diff --git a/ChangeLog b/ChangeLog index 0e433e90..8174993a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -56,6 +56,8 @@ configuration before relying on it. according to the XARF standard (v0.2). Close gh-105 * Support PyPy * Add filter for apache-botsearch + * Add filter for kerio. Thanks Tony Lawrence for blog of regexs and + providing samples. Close gh-120 * Filter for stunnel * Filter for Counter Strike 1.6. Thanks to onorua for logs. Close gh-347 diff --git a/MANIFEST b/MANIFEST index 675cd662..a2103e59 100644 --- a/MANIFEST +++ b/MANIFEST @@ -122,6 +122,7 @@ fail2ban/tests/files/logs/freeswitch fail2ban/tests/files/logs/groupoffice fail2ban/tests/files/logs/gssftpd fail2ban/tests/files/logs/guacamole +fail2ban/tests/files/logs/kerio fail2ban/tests/files/logs/lighttpd-auth fail2ban/tests/files/logs/mysqld-auth fail2ban/tests/files/logs/nsd @@ -182,6 +183,7 @@ config/filter.d/courier-smtp.conf config/filter.d/cyrus-imap.conf config/filter.d/exim.conf config/filter.d/gssftpd.conf +config/filter.d/kerio.conf config/filter.d/suhosin.conf config/filter.d/named-refused.conf config/filter.d/openwebmail.conf diff --git a/THANKS b/THANKS index 3bd2e411..46dcd4c1 100644 --- a/THANKS +++ b/THANKS @@ -84,6 +84,7 @@ Steven Hiscocks TESTOVIK Tom Pike Tomas Pihl +Tony Lawrence Tyler Vaclav Misek Vincent Deffontaines diff --git a/config/filter.d/kerio.conf b/config/filter.d/kerio.conf new file mode 100644 index 00000000..e7ca0a01 --- /dev/null +++ b/config/filter.d/kerio.conf @@ -0,0 +1,17 @@ +# Fail2ban filter for kerio + +[Definition] + +failregex = ^ SMTP Spam attack detected from , + ^ IP address found in DNS blacklist \S+, mail from \S+ to \S+$ + ^ Relay attempt from IP address + ^ Attempt to deliver to unknown recipient \S+, from \S+, IP address $ +[Init] + +datepattern = ^[%%d/%%b/%%Y %%H:%%M:%%S] + +# DEV NOTES: +# +# Author: A.P. Lawrence +# +# Based off: http://aplawrence.com/Kerio/fail2ban.html diff --git a/config/jail.conf b/config/jail.conf index 8f049e74..03ac242d 100644 --- a/config/jail.conf +++ b/config/jail.conf @@ -614,6 +614,11 @@ port = smtp,465,submission logpath = /var/log/exim/mainlog +[kerio] +port = imap,smtp,imaps,465 +logpath = /opt/kerio/mailserver/store/logs/security.log + + # # Mail servers authenticators: might be used for smtp,ftp,imap servers, so # all relevant ports get banned diff --git a/fail2ban/tests/files/logs/kerio b/fail2ban/tests/files/logs/kerio new file mode 100644 index 00000000..c9368c22 --- /dev/null +++ b/fail2ban/tests/files/logs/kerio @@ -0,0 +1,29 @@ +# failJSON: { "time": "2011-06-17T17:00:45", "match": true, "host": "200.90.149.178" } +[17/Jun/2011 17:00:45] Attempt to deliver to unknown recipient , from , IP address 200.90.149.178 + +# failJSON: { "time": "2014-01-18T06:41:25", "match": true, "host": "202.169.236.195" } +[18/Jan/2014 06:41:25] SMTP Spam attack detected from 202.169.236.195, client closed connection before SMTP greeting + +# failJSON: { "time": "2014-01-18T06:42:12", "match": true, "host": "115.147.104.13" } +[18/Jan/2014 06:42:12] SMTP Spam attack detected from 115.147.104.13, client sent data before SMTP greeting + +# failJSON: { "time": "2014-01-18T05:47:17", "match": true, "host": "112.140.49.130" } +[18/Jan/2014 05:47:17] IP address 112.140.49.130 found in DNS blacklist UCEProtect1, mail from to + +# failJSON: { "time": "2014-01-18T06:39:44", "match": true, "host": "91.232.105.66" } +[18/Jan/2014 06:39:44] IP address 91.232.105.66 found in DNS blacklist BarracudaCentral, mail from to + +# failJSON: { "time": "2013-12-30T05:27:59", "match": true, "host": "64.31.59.75" } +[30/Dec/2013 05:27:59] Relay attempt from IP address 64.31.59.75, mail from to rejected + +# failJSON: { "time": "2013-12-30T19:24:28", "match": true, "host": "74.63.193.116" } +[30/Dec/2013 19:24:28] Relay attempt from IP address 74.63.193.116, mail from to rejected + +# failJSON: { "time": "2013-12-13T00:22:45", "match": true, "host": "23.108.148.156" } +[13/Dec/2013 00:22:45] Attempt to deliver to unknown recipient , from , IP address 23.108.148.156 + +# failJSON: { "time": "2013-12-13T01:11:04", "match": true, "host": "218.85.253.185" } +[13/Dec/2013 01:11:04] Attempt to deliver to unknown recipient , from , IP address 218.85.253.185 + + +