diff --git a/config/filter.d/couriersmtp.conf b/config/filter.d/couriersmtp.conf index dfb50b4a..ea556338 100644 --- a/config/filter.d/couriersmtp.conf +++ b/config/filter.d/couriersmtp.conf @@ -5,6 +5,12 @@ # $Revision: 728 $ # +[INCLUDES] + +# Read common prefixes. If any customizations available -- read them from +# common.local +before = common.conf + [Definition] # Option: failregex @@ -14,7 +20,9 @@ # (?:::f{4,6}:)?(?P[\w\-.^_]+) # Values: TEXT # -failregex = error,relay=,.*550 User unknown +_daemon = courieresmtpd + +failregex = ^%(__prefix_line)serror,relay=,.*: 550 User unknown\.$ # Option: ignoreregex # Notes.: regex to ignore. If this regex matches, the line is ignored. diff --git a/config/filter.d/cyrus-imap.conf b/config/filter.d/cyrus-imap.conf index a39c8112..b5c8e386 100644 --- a/config/filter.d/cyrus-imap.conf +++ b/config/filter.d/cyrus-imap.conf @@ -4,6 +4,11 @@ # # $Revision: 728 $ # +[INCLUDES] + +# Read common prefixes. If any customizations available -- read them from +# common.local +before = common.conf [Definition] @@ -14,10 +19,9 @@ # (?:::f{4,6}:)?(?P[\w\-.^_]+) # Values: TEXT # -failregex = : badlogin: .*\[\] plaintext .*SASL\(-13\): authentication failure: checkpass failed$ - : badlogin: .*\[\] LOGIN \[SASL\(-13\): authentication failure: checkpass failed\]$ - : badlogin: .*\[\] (?:CRAM-MD5|NTLM) \[SASL\(-13\): authentication failure: incorrect (?:digest|NTLM) response\]$ - : badlogin: .*\[\] DIGEST-MD5 \[SASL\(-13\): authentication failure: client response doesn't match what we generated\]$ +_daemon = (?:cyrus/)?(?:imap(d|s)?|pop3(d|s)?) + +failregex = ^%(__prefix_line)sbadlogin: \S+ ?\[\] \S+ .*?\[?SASL\(-13\): (authentication failure|user not found): .*\]? # Option: ignoreregex # Notes.: regex to ignore. If this regex matches, the line is ignored. diff --git a/config/filter.d/exim.conf b/config/filter.d/exim.conf index 9cc2daa1..d72bb7e3 100644 --- a/config/filter.d/exim.conf +++ b/config/filter.d/exim.conf @@ -14,7 +14,14 @@ # (?:::f{4,6}:)?(?P[\w\-.^_]+) # Values: TEXT # -failregex = \[\] .*(?:rejected by local_scan|Unrouteable address) + +# In versions >= 0.8.11 below strings defined in exim-common.conf + +host_info = H=([\w.-]+ )?(\(\S+\) )?\[\](:\d+)? (I=\[\S+\]:\d+ )?(U=\S+ )?(P=e?smtp )? +pid = ( \[\d+\])? + +failregex = ^%(pid)s %(host_info)ssender verify fail for <\S+>: Unrouteable address\s*$ + ^%(pid)s \S+ F=(<>|\S+@\S+) %(host_info)srejected by local_scan\(\): .{0,256}$ # Option: ignoreregex # Notes.: regex to ignore. If this regex matches, the line is ignored. diff --git a/config/filter.d/lighttpd-fastcgi.conf b/config/filter.d/lighttpd-fastcgi.conf index 1c6e3fce..6e694f7c 100644 --- a/config/filter.d/lighttpd-fastcgi.conf +++ b/config/filter.d/lighttpd-fastcgi.conf @@ -3,13 +3,23 @@ # Author: Arturo 'Buanzo' Busleiman # +[INCLUDES] + +# Read common prefixes. If any customizations available -- read them from +# common.local +before = common.conf + [Definition] # Option: failregex # Notes.: regex to match ALERTS as notified by lighttpd's FastCGI Module # Values: TEXT # -failregex = .*ALERT\ -\ .*attacker\ \'\' +_daemon = (?:lighttpd|suhosin) + +_lighttpd_prefix = (?:\(mod_fastcgi\.c\.\d+\) FastCGI-stderr:\s) + +failregex = ^%(__prefix_line)s%(_lighttpd_prefix)s?ALERT - .* \(attacker '', file '.*'(?:, line \d+)?\)$ # Option: ignoreregex # Notes.: regex to ignore. If this regex matches, the line is ignored. diff --git a/config/filter.d/postfix.conf b/config/filter.d/postfix.conf index d909a92f..fbff8caa 100644 --- a/config/filter.d/postfix.conf +++ b/config/filter.d/postfix.conf @@ -5,6 +5,12 @@ # $Revision: 728 $ # +[INCLUDES] + +# Read common prefixes. If any customizations available -- read them from +# common.local +before = common.conf + [Definition] # Option: failregex @@ -14,7 +20,9 @@ # (?:::f{4,6}:)?(?P[\w\-.^_]+) # Values: TEXT # -failregex = reject: RCPT from (.*)\[\]: 554 +_daemon = postfix/smtpd + +failregex = ^%(__prefix_line)sNOQUEUE: reject: RCPT from \S+\[\]: 554 5\.7\.1 .*$ # Option: ignoreregex # Notes.: regex to ignore. If this regex matches, the line is ignored. diff --git a/debian/changelog b/debian/changelog index 9b9a3c6f..84d2b156 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,24 @@ +fail2ban (0.8.4-3+squeeze3) squeeze-lts; urgency=high + + * Use anchored failregex for filters to avoid possible DoS. Manually + picked up from the current status of 0.8 branch (as of + 0.8.13-29-g09b2016): + - CVE-2013-7176: postfix.conf - anchored on the front, expects + "postfix/smtpd" prefix in the log line + - CVE-2013-7177: cyrus-imap.conf - anchored on the front, and + refactored to have a single failregex + - couriersmtp.conf - anchored on both sides + - exim.conf - front-anchored versions picked up from exim.conf + and exim-spam.conf + - lighttpd-fastcgi.conf - front-anchored picked up from suhosin.conf + (copied from the Wheezy version) + * Catch also failed logins via secured (imaps/pop3s) for cyrus-imap. + Regression was introduced while strengthening failregex in 0.8.11 (bd175f) + Debian bug #755173 + * cyrus-imap: catch "user not found" attempts + + -- Thorsten Alteholz Sat, 26 Jul 2014 10:00:00 +0200 + fail2ban (0.8.4-3+squeeze2) squeeze-security; urgency=high * Anchor apache- filters failregexes to avoid possible DoS on servers