fail2ban: split dsa-exim into strict and not-so-strict checks
authorAdam D. Barratt <adam@adam-barratt.org.uk>
Fri, 27 Sep 2019 13:36:41 +0000 (14:36 +0100)
committerAdam D. Barratt <adam@adam-barratt.org.uk>
Fri, 27 Sep 2019 13:36:41 +0000 (14:36 +0100)
The not-so-strict checks need more provocation to add a ban

Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
modules/fail2ban/files/filter/dsa-exim-strict.conf [new file with mode: 0644]
modules/fail2ban/files/filter/dsa-exim.conf
modules/fail2ban/files/jail/dsa-exim-strict.conf [new file with mode: 0644]
modules/fail2ban/files/jail/dsa-exim.conf

diff --git a/modules/fail2ban/files/filter/dsa-exim-strict.conf b/modules/fail2ban/files/filter/dsa-exim-strict.conf
new file mode 100644 (file)
index 0000000..33310ab
--- /dev/null
@@ -0,0 +1,7 @@
+#
+
+[INCLUDES]
+before = exim-common.conf
+
+[Definition]
+failregex = ^%(pid)s SMTP protocol error in "(?i:AUTH LOGIN)" .* \[<HOST>\] AUTH command used when not advertised$
index 64c8c1e..84f921e 100644 (file)
@@ -4,8 +4,7 @@
 before = exim-common.conf
 
 [Definition]
 before = exim-common.conf
 
 [Definition]
-failregex = ^%(pid)s SMTP protocol error in "(?i:AUTH LOGIN)" .* \[<HOST>\] AUTH command used when not advertised$
-            ^%(pid)s %(host_info)ssender verify fail for <\S+>: (?:Unknown user|Unrouteable address|all relevant MX records point to non-existent hosts)\s*$
+failregex = ^%(pid)s %(host_info)ssender verify fail for <\S+>: (?:Unknown user|Unrouteable address|all relevant MX records point to non-existent hosts)\s*$
             ^%(pid)s \w+ authenticator failed for (\S+ )?\(\S+\) \[<HOST>\](:\d+)?( I=\[\S+\](:\d+)?)?: 535 Incorrect authentication data( \(set_id=.*\)|: \d+ Time\(s\))?\s*$
             ^%(pid)s %(host_info)sF=(<>|[^@]+@\S+) rejected RCPT [^@]+@\S+: (relay not permitted|Sender verify failed|Unknown user|Unrouteable address|Invalid local part)\s*$
             ^%(pid)s SMTP protocol synchronization error \([^)]*\): rejected (connection from|"\S+") %(host_info)s(next )?input=".*"\s*$
             ^%(pid)s \w+ authenticator failed for (\S+ )?\(\S+\) \[<HOST>\](:\d+)?( I=\[\S+\](:\d+)?)?: 535 Incorrect authentication data( \(set_id=.*\)|: \d+ Time\(s\))?\s*$
             ^%(pid)s %(host_info)sF=(<>|[^@]+@\S+) rejected RCPT [^@]+@\S+: (relay not permitted|Sender verify failed|Unknown user|Unrouteable address|Invalid local part)\s*$
             ^%(pid)s SMTP protocol synchronization error \([^)]*\): rejected (connection from|"\S+") %(host_info)s(next )?input=".*"\s*$
diff --git a/modules/fail2ban/files/jail/dsa-exim-strict.conf b/modules/fail2ban/files/jail/dsa-exim-strict.conf
new file mode 100644 (file)
index 0000000..3030e49
--- /dev/null
@@ -0,0 +1,8 @@
+[dsa-exim-strict]
+enabled = true
+filter = dsa-exim-strict
+port = smtp,ssmtp,submission
+logpath = /var/log/exim4/mainlog
+maxretry = 1
+findtime = 3600
+bantime = 10800
index fcf9a5e..412c028 100644 (file)
@@ -3,6 +3,6 @@ enabled = true
 filter = dsa-exim
 port = smtp,ssmtp,submission
 logpath = /var/log/exim4/mainlog
 filter = dsa-exim
 port = smtp,ssmtp,submission
 logpath = /var/log/exim4/mainlog
-maxretry = 1
-findtime = 3600
+maxretry = 6
+findtime = 900
 bantime = 10800
 bantime = 10800