ich habe unter Debian Jessie einen Mailserver bestehend aus Dovecot 2.2.13 und Postfix 2.11.3 installiert und möchte diesen zusätzlich mit Fail2ban 0.8.13 absichern. Das Problem ist nun, dass Dovecot folgende Log-Einträge in der /var/log/mail.log erzeugt.
Code: Alles auswählen
Aug 29 09:44:09 v1234567890 dovecot: imap-login: Disconnected: Inactivity (auth failed, 9 attempts in 176 secs): user=<test@mydomain.com>, method=PLAIN, rip=x.x.x.x, lip=x.x.x.x, TLS, session=<6RYbU24eRABPzsG1>
Aug 29 09:59:49 v1234567890 dovecot: imap-login: Disconnected: Inactivity (auth failed, 9 attempts in 180 secs): user=<test@mydomain.com>, method=PLAIN, rip=x.x.x.x, lip=x.x.x.x, TLS, session=<jbHwim4eFABPzsG1>
Aug 29 10:10:51 v1234567890 dovecot: imap-login: Disconnected: Inactivity (auth failed, 33 attempts in 180 secs): user=<test@mydomain.com>, method=PLAIN, rip=x.x.x.x, lip=x.x.x.x, TLS, session=<J/Zfsm4eAgBPzsG1>
Aug 29 10:13:57 v1234567890 dovecot: imap-login: Disconnected: Inactivity during authentication (auth failed, 14 attempts in 180 secs): user=<test@mydomain.com>, method=LOGIN, rip=x.x.x.x, lip=x.x.x.x, TLS, session=<WB56vW4ebgBPzsG1>
Gruß
Jochen
Hier noch meine Fail2ban-Konfiguration:
/etc/fail2ban/filter.d/dovecot.conf
Code: Alles auswählen
[Definition]
failregex = (?: pop3-login|imap-login): .*(?:Authentication failure|Aborted login \(auth failed|Aborted login \(tried to use disabled|Disconnected \(auth failed|Aborted login \(\d+ authentication attempts).*rip=(?P<host>\S*),.*
ignoreregex = imap-login: Disconnected.*\(no auth attempts\).*
Code: Alles auswählen
[DEFAULT]
ignoreip = 127.0.0.1/8
bantime = 3600
maxretry = 3
backend = auto
destemail = root
banaction = iptables-multiport
mta = sendmail
protocol = tcp
chain = INPUT
action_ = %(banaction)s[name=%(__name__)s, port="%(port)s", protocol="%(protocol)s", chain="%(chain)s"]
action_mw = %(banaction)s[name=%(__name__)s, port="%(port)s", protocol="%(protocol)s", chain="%(chain)s"]
%(mta)s-whois[name=%(__name__)s, dest="%(destemail)s", protocol="%(protocol)s", chain="%(chain)s"]
action_mwl = %(banaction)s[name=%(__name__)s, port="%(port)s", protocol="%(protocol)s", chain="%(chain)s"]
%(mta)s-whois-lines[name=%(__name__)s, dest="%(destemail)s", logpath=%(logpath)s, chain="%(chain)s"]
action = %(action_mwl)s
[...]
[dovecot]
enabled = true
port = smtp,ssmtp,submission,imap2,imap3,imaps,pop3,pop3s
filter = dovecot
logpath = /var/log/mail.log
maxretry = 3
[...]