Fail2Ban O filtro SASL falha logins falhados

3

Estou usando o fail2ban no meu servidor de e-mail. Eu descobri esta manhã que houve cerca de 5000 tentativas de login (via 1 hora) via SMTP que não foram apanhadas pelo meu filtro sasl. Aqui está um exemplo de uma entrada em /var/log/mail.log

Jan 25 04:39:56 ***** postfix/smtpd[23828]: warning: 114-32-231-17.HINET-IP.hinet.net[114.32.231.17]: SASL LOGIN authentication failed: authentication failure

Aqui está minha definição de filtro sasl (não modificada) para o fail2ban:

# Fail2Ban configuration file
#
# Author: Yaroslav Halchenko
#
# $Revision: 728 $
#

[Definition]

# Option: failregex
# Notes.: regex to match the password failures messages in the logfile. The
#          host must be matched by a group named "host". The tag "<HOST>" can
#          be used for standard IP/hostname matching and is only an alias for
#          (?:::f{4,6}:)?(?P<host>[\w\-.^_]+)
# Values: TEXT
#
failregex = (?i): warning: [-._\w]+\[<HOST>\]: SASL (?:LOGIN|PLAIN|(?:CRAM|DIGEST)-MD5) authentication failed(: [A-Za-z0-9+/]*={0,2})?$

# Option:  ignoreregex
# Notes.:  regex to ignore. If this regex matches, the line is ignored.
# Values:  TEXT
#
ignoreregex =

Alguém pode recomendar uma melhoria na regex que também teria detectado esse registro?

    
por AJ. 25.01.2012 / 13:25

1 resposta

6

Definir outro failregex

(?i): warning: [-._\w]+\[<HOST>\]: SASL (?:LOGIN|PLAIN|(?:CRAM|DIGEST)-MD5) authentication failed(:.*)$

Eu testei este regex com o fail2ban-regex e está funcionando.

    
por 25.01.2012 / 13:40