From d60f470096eb1482caddc7ecc93716004983ea68 Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Wed, 9 Oct 2013 10:09:06 +1100 Subject: [PATCH 1/3] ENH: added to dovecot filter. closes gh-325 --- config/filter.d/dovecot.conf | 4 +--- testcases/files/logs/dovecot | 3 +++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/config/filter.d/dovecot.conf b/config/filter.d/dovecot.conf index c7ef080c..a46c3fa9 100644 --- a/config/filter.d/dovecot.conf +++ b/config/filter.d/dovecot.conf @@ -9,8 +9,6 @@ before = common.conf [Definition] -_daemon = dovecot(-auth)? - # Option: failregex # Notes.: regex to match the password failures messages in the logfile. # first regex is essentially a copy of pam-generic.conf @@ -18,7 +16,7 @@ _daemon = dovecot(-auth)? # failregex = ^%(__prefix_line)s(pam_unix(\(\S+\))?:)?\s+authentication failure; logname=\S* uid=\S* euid=\S* tty=dovecot ruser=\S* rhost=(\s+user=\S*)?\s*$ ^%(__prefix_line)s(pop3|imap)-login: (Info: )?(Aborted login|Disconnected)(: Inactivity)? \(((no auth attempts|auth failed, \d+ attempts)( in \d+ secs)?|tried to use disabled \S+ auth)\):( user=<\S*>,)?( method=\S+,)? rip=, lip=(\d{1,3}\.){3}\d{1,3}(, session=<\w+>)?(, TLS( handshaking)?(: Disconnected)?)?\s*$ - ^%(__prefix_line)sdovecot: auth\(\S+\): pam\(\S+,\): pam_authenticate\(\) failed: User not known to the underlying authentication module: \d+ Time\(s\)\s*$ + ^%(__prefix_line)s(dovecot: )?auth(-worker)?\(\S+\): (Info: )?pam\(\S+,\): pam_authenticate\(\) failed: (User not known to the underlying authentication module: \d+ Time\(s\)|Authentication failure \(password mismatch\?\))\s*$ # Option: ignoreregex # Notes.: regex to ignore. If this regex matches, the line is ignored. diff --git a/testcases/files/logs/dovecot b/testcases/files/logs/dovecot index 508f39be..733552df 100644 --- a/testcases/files/logs/dovecot +++ b/testcases/files/logs/dovecot @@ -32,3 +32,6 @@ Jul 02 13:49:32 hostname dovecot[442]: pop3-login: Disconnected (no auth attempt # failJSON: { "time": "2005-07-02T13:49:32", "match": true , "host": "200.76.17.206" } Jul 02 13:49:32 hostname dovecot[442]: dovecot: auth(default): pam(account@MYSERVERNAME.com,200.76.17.206): pam_authenticate() failed: User not known to the underlying authentication module: 2 Time(s) + +# failJSON: { "time": "2013-08-11T03:56:40", "match": true , "host": "1.2.3.4" } +2013-08-11 03:56:40 auth-worker(default): Info: pam(username,1.2.3.4): pam_authenticate() failed: Authentication failure (password mismatch?) From 864d2f41b9913f0691ecc070a9e7d69a834822e5 Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Wed, 9 Oct 2013 14:52:17 +1100 Subject: [PATCH 2/3] ENH: auth-worker as per of _daemon definition for dovecot --- config/filter.d/dovecot.conf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config/filter.d/dovecot.conf b/config/filter.d/dovecot.conf index a46c3fa9..d337e6bd 100644 --- a/config/filter.d/dovecot.conf +++ b/config/filter.d/dovecot.conf @@ -9,6 +9,7 @@ before = common.conf [Definition] +_daemon = (dovecot(-auth)?|auth-worker) # Option: failregex # Notes.: regex to match the password failures messages in the logfile. # first regex is essentially a copy of pam-generic.conf @@ -16,7 +17,7 @@ before = common.conf # failregex = ^%(__prefix_line)s(pam_unix(\(\S+\))?:)?\s+authentication failure; logname=\S* uid=\S* euid=\S* tty=dovecot ruser=\S* rhost=(\s+user=\S*)?\s*$ ^%(__prefix_line)s(pop3|imap)-login: (Info: )?(Aborted login|Disconnected)(: Inactivity)? \(((no auth attempts|auth failed, \d+ attempts)( in \d+ secs)?|tried to use disabled \S+ auth)\):( user=<\S*>,)?( method=\S+,)? rip=, lip=(\d{1,3}\.){3}\d{1,3}(, session=<\w+>)?(, TLS( handshaking)?(: Disconnected)?)?\s*$ - ^%(__prefix_line)s(dovecot: )?auth(-worker)?\(\S+\): (Info: )?pam\(\S+,\): pam_authenticate\(\) failed: (User not known to the underlying authentication module: \d+ Time\(s\)|Authentication failure \(password mismatch\?\))\s*$ + ^%(__prefix_line)s(Info|dovecot: auth\(default\)): pam\(\S+,\): pam_authenticate\(\) failed: (User not known to the underlying authentication module: \d+ Time\(s\)|Authentication failure \(password mismatch\?\))\s*$ # Option: ignoreregex # Notes.: regex to ignore. If this regex matches, the line is ignored. From eb59a57b7f7ad22ca2af10298156680467bc050d Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Wed, 9 Oct 2013 14:54:36 +1100 Subject: [PATCH 3/3] ENH: tighten pam_unix expression for dovecot --- config/filter.d/dovecot.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/filter.d/dovecot.conf b/config/filter.d/dovecot.conf index d337e6bd..51c28af4 100644 --- a/config/filter.d/dovecot.conf +++ b/config/filter.d/dovecot.conf @@ -15,7 +15,7 @@ _daemon = (dovecot(-auth)?|auth-worker) # first regex is essentially a copy of pam-generic.conf # Values: TEXT # -failregex = ^%(__prefix_line)s(pam_unix(\(\S+\))?:)?\s+authentication failure; logname=\S* uid=\S* euid=\S* tty=dovecot ruser=\S* rhost=(\s+user=\S*)?\s*$ +failregex = ^%(__prefix_line)s(pam_unix(\(dovecot:auth\))?:)?\s+authentication failure; logname=\S* uid=\S* euid=\S* tty=dovecot ruser=\S* rhost=(\s+user=\S*)?\s*$ ^%(__prefix_line)s(pop3|imap)-login: (Info: )?(Aborted login|Disconnected)(: Inactivity)? \(((no auth attempts|auth failed, \d+ attempts)( in \d+ secs)?|tried to use disabled \S+ auth)\):( user=<\S*>,)?( method=\S+,)? rip=, lip=(\d{1,3}\.){3}\d{1,3}(, session=<\w+>)?(, TLS( handshaking)?(: Disconnected)?)?\s*$ ^%(__prefix_line)s(Info|dovecot: auth\(default\)): pam\(\S+,\): pam_authenticate\(\) failed: (User not known to the underlying authentication module: \d+ Time\(s\)|Authentication failure \(password mismatch\?\))\s*$