Bantracker Specification



Ban parsing


Bantracker should parse channel MODE +b/+q/-b/-q messages and add/modify entries in the database accordingly.


The Bantracker should understand simple nick!user@host style bans, as well as CIDR and "Extban" style bans.


The way to identify an Extban is that it begins with a '$', optionally followed by an '~' to invert its meaning, optionally a ':' to indicate some data follows it.

  • "$" ( "~" | ) ( "a" | "r" | "x" ) [ ":" [ data... ] ]

On [ freenode] these extbans are as follows: {| style="width: 100%; text-align: left" ! Type character ! Data is required ! Type of data ! notes |- | a | false | <nowiki>NickServ</nowiki> account | Match any user logged into the <nowiki>NickServ</nowiki> account account. account is optional, "$a" would be equivalent to "$a:*" and matches any identified user, and the inverse ("$~a" and "$~a:*") matches any unidentified user. |- | r || true || real name (<nowiki>GECOS</nowiki>) || Match any user with the real name (or <nowiki>GECOS</nowiki>) that matches the data. |- | x || true || full nick!user@host#gecos match || This will match any user whos prefix (nick!user@host) and <nowiki>GECOS</nowiki>, joined with a "#" symbol, matches the mask in the data. |}


<nowiki>CIDR</nowiki> masks are also accepted, for instance: {| style="width: 100%; text-align: left;" ! <nowiki>CIDR</nowiki> mask ! Start of range ! End of range |- | || || |- | || || |- | || || |} Those are only the most simple forms. See the [ this CIDR calculator] for some more complex forms.



Bantracker should log all channel activity in a channel, including MODEs, JOINs, NICKs, PRIVMSGs, NOTICEs, and CTCPs. It should recognise MODEs adding or removing mode "b" and mode "q". When Bantracker sees a KICK, or detects a /remove (special kind of forced PART message), it should log that action in the database appropriately.


Bantracker currently keeps an in-memory 200 line log for each channel it's in where Bantracker is enabled. It then inserts a copy of that log into the database for <u>every</u> +b/+q/kick/remove action taken.

Ban Scoring


Scoring bans would help to maintaining large list of bans, where bans with low scores are candidates for removal and bans with high scores are worth keeping. Operators can review and raise a ban's score, while it decreases as the ban grows older.


(Ban scoring implementation) TODO

Ban grouping


If someone has been banned more than once, the BT should be able to group that ban with others of matching criteria.


If someone has been banned more than once, the BT should be able to group that ban with others of matching criteria. This criteria could be IP, ident, nick, provider etc.

UbuntuBots/Spec/Bantracker (last edited 2012-01-20 19:47:22 by alanbell)