Skip to content

Instantly share code, notes, and snippets.

@arantius
Created March 7, 2011 01:42
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arantius/857951 to your computer and use it in GitHub Desktop.
Save arantius/857951 to your computer and use it in GitHub Desktop.
The default rules for a Karma Blocker installation.
# This is a ruleset configuration for Karma Blocker. For more information, see:
# http://trac.arantius.com/wiki/Extensions/KarmaBlocker
# This default ruleset is intended to be demonstrative: making productive
# use of all the features that the Karma Blocker rule syntax provides. It
# should generally work, but it has intentionally not been tweaked to deal
# with the particulars of any given site. All rules here are intended to
# explain what can be done, and how it can be done, while remaining as
# generic as possible, with limited exceptions. You the user are expected
# to tweak and customize these rules.
[Settings]
threshold=12
cutoff=12
collapse=false
[Inject]
function='DM_tag'
function='OA_show'
function='_gat._getTracker'
function='quantserve'
function='s.t'
function='setOmniturePageName'
function='urchinTracker'
# If any request that a Flash movie makes is blocked, the entire Flash
# movie will remove itself from the page. So if we let the movie
# through, we let all requests it makes go through, with this rule.
[Group]
name="Whitelist: flash sub-request"
score=-13
rule=$type==object_subrequest
# eBay uses third-party iframes for auction descriptions now, to
# prevent the XSS hole they left open for a long time.
[Group]
name="Whitelist: eBay"
match=any
score=-13
rule=$url.host=='cgi.ebay.com'
rule=$url.host=='vi.ebaydesc.com'
rule=$url.host=='srx.main.ebayrtm.com'
[Group]
name="Whitelist: HTTPS"
score=-4
rule=$url.scheme=='https'
[Group]
name="Whitelist: CDNs"
score=-4
match=any
rule=$url.host$='.akamai.com'
rule=$url.host$='.asset-cache.com'
rule=$url.host$='.cachefly.com'
rule=$url.host$='.fsdn.com'
rule=$url.host$='.ggpht.com'
rule=$url.host$='.gstatic.com'
rule=$url.host=~'cdn'
[Group]
name="Whitelist: Keywords"
score=-4
match=any
rule=$url=~'(\b|_)(downlo|uplo)ads?\d*(\b|_)'
[Group]
name="(I)FRAMEs and Scripts"
score=6
match=any
rule=$type==script
rule=$type==subdocument
[Group]
name="Feed Trackers"
score=4
match=any
rule=$url.path=~'^/~.{1,2}/'
rule=$url^='http://feeds.wordpress.com/1.0/'
[Group]
name="Size: 0x0 & 1x1"
score=4
match=any
rule=$origin.tag.size=='0x0'
rule=$origin.tag.size=='1x1'
# See: http://www.iab.net/iab_products_and_industry_services/1421/1443/1452
[Group]
name="Size: Standard Banner"
score=4
match=any
rule=$origin.tag.size=='300x250'
rule=$origin.tag.size=='468x60'
rule=$origin.tag.size=='234x60'
rule=$origin.tag.size=='88x31'
rule=$origin.tag.size=='120x90'
rule=$origin.tag.size=='120x60'
rule=$origin.tag.size=='120x240'
rule=$origin.tag.size=='125x125'
rule=$origin.tag.size=='728x90'
rule=$origin.tag.size=='160x600'
rule=$origin.tag.size=='120x600'
rule=$origin.tag.size=='300x600'
[Group]
name="Third-party"
score=4
rule=$thirdParty==true
[Group]
name="Unsavory hosts"
score=4
match=any
rule=$url.host$='.addtoany.com'
rule=$url.host$='.blogads.com'
rule=$url.host$='.imrworldwide.com'
rule=$url.host$='.kontera.com'
rule=$url.host$='.scorecardresearch.com'
rule=$url.host$='.statcounter.com'
[Group]
name="Images"
score=3
rule=$type==image
[Group]
name="Extra-long URLs"
score=2
rule=$url.path=~'.{175}'
[Group]
name="Keywords (Full)"
score=2
rule=$url=~'(\b|_)ad(frame|sense|server?|sonar)?s?\d*(\b|_)'
rule=$url=~'(\b|_)banners?\d*(\b|_)'
rule=$url=~'(\b|_)(analytic|quant|s_code|track|urchin|webtrend)(s|er|ing)?\d*(\b|_)'
rule=$url.host=~'metrics'
[Group]
name="Keywords (Partial)"
score=2
rule=$url=~'(\b|_)ads?\d*|ads?\d*(\b|_)'
rule=$url=~'(\b|_)track(s|er|ing)?\d*|track(s|er|ing)?\d*(\b|_)'
[Group]
name="Long Querystring"
score=2
match=all
rule=$url.path=~'\?(.*&){6,}'
[Group]
name="Objects (Flash)"
score=2
rule=$type==object
[Group]
name="Querystring"
score=1
rule=$url.path=~'\?'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment