Blacklist
Documentation and help for SK2’s Blacklist Plugin.
Filename: sk2_blacklist_plugin.php
Found in: sk2/sk2_plugins/
In typical usage, SK2 automatically enters blacklist and or whitelist values or scores dependent upon simple user classification of past comments, trackbacks, and pingbacks as spam or ham, then applies these rules on future submissions. SK2 also maintains a list of domains and IPs which have produced or been mentioned in spams it has captured. These are ’scored’, so that if they crop up again in a spam wave the trackback or comment will automatically attract that score - meaning it will have to be a very virtuous comment, trackback, or pingback to reach the state where it is approved (and so appears on your blog).
General Settings
- Blacklist - Strength: Drop down dialog where you may change the amount of karma applied when triggered, or disable.
Advanced Options
Found on the General Settings page when Show Advanced Options button is toggled on. These values may be changed from their default values to fine tune your SK2 installation.
- Automatically blacklist URLs and IP when karma under (enter value)
- Automatically whitelist URLs and IP when karma over (enter value)
Blacklist
A brief description of each type of entry under the Blacklist tab or page. These scores may be hand-edited by pressing the Switch to edit mode button:
- IP Blacklist: These are entered in the IP format, or xxx.xxx.xxx.xxx where x is any single digit. This means to deny future comments from the IP.
- IP Whitelist: Allow comments from the IP.
- Domain Blacklist: Only use: domain.com or domain.co.uk (do not include subdomains). This means to deny future comments from the domain.
- Domain Whitelist: Allow comments from the domain.
- Domain Graylist: Any graylist entry tells SK2 to ignore that domain completely.
- Regex: Regex is short for “regular expressions”, which explains capitalizing it as regEx. There are four regex entries: Regex Blacklist, Regex Whitelist, Regex Content Blacklist, and Regex Content Whitelist. Blacklist means disallowed, while Whitelist means allowed.
Regex is dangerous for newbies, so play with this at your own risk, and only if you really know what you’re doing. While advanced levels of regex can seem quite cryptic, beginning levels can be quite straightforward.
From DrDave:
First and foremost: if you use RegEx’s, be extra careful! and do some extensive testing (with the “approve logged-in users” filter disabled), as it is super-easy to kill all your comments with a bad move.
Now, for the format: it is the regular RegEx format, with *delimiters*… the way PHP requires them. PHP doc has some info on delimiters, Google will have tons of stuff on regex in general….
To make it very short, all your regex’s must be between a unique character that acts as a delimiter, for example, you should input your example above as: #gregg|matt|jimmy|karren# or /gregg|matt|jimmy|karren/ etc. (I recommend using ‘#’)
You need to escape special characters (e.g. ‘.’ becomes ‘\.’), but do not escape twice, as you may be inclined to if you have experience using RegEx in PHP (SK2 does the second escaping for you).
In DrDave’s example the “|” character between the names means “or”, so, “gregg”, or “matt”, or “jimmy”, or “karren”.
If you wish to explore regex in further detail, there are many online resources and tutorials. Here are a few to get you started:
A Tao of Regular Expressions (PDF)
A Whirlwind Guide to Regular Expressions
What are Delimiters?
-
- Regex Blacklist: Applies to the URL field, and can be thought of as text snippets that are not wanted on your blog. It’s important to remember that SK2 uses a weighting scheme, so while an undesired word may result in a karma score spanking (points subtracted), other tests and SK2 plugins could add points when aggregated by Anubis.
-
- Regex Whitelist: This field also applies to the URL. An identical entry in both Regex Whitelist and Blacklist do not cancel each other, the Blacklist entry is persistent and the comment’s score is still spanked. However, if the Regex Whitelist entry is a different snippet or portion of the URL that also contains a Blacklist snippet, then a few points are added to the karma score because of the Whitelist match. Remember to thoroughly test your ideas.
-
- Regex Content Blacklist:
-
- Regex Content Whitelist:
- RBL Server (IP): Real time IP blacklist server. SK2 places one of these, by default, in the initial installation.
- RBL Server (URI): Real time domain blacklist server. SK2 also places one of these in the initial installation.
- Kumo Seed: Not currently used … possible future development.
wkirkland said,
April 18, 2008 at 12:31 pm
Been using SK2 for a while. Great. Thanks.
I am looking for a way to monitor/approve some but not all commenters. Is there a way to list ip address, or e-mail address so that I get notified and have to approve the comment before it goes live?
Thx
WK