[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Configurar fail2ban



Estimados. debido a un reciente ataque de varias IP desde china a mi servidor postfix he investigado un poco y encontre Fail2ban, según veo es un software interesante que permite bloquear IP que hacen muchos login fallidos y desde diferentes IP

el problema es que no puedo configurar el failregex de este.

he intentado con algunos como estos.

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

unos me dan error y otros no enuentra coincidencia.

las lineas del log que me dan cuenta del error de login son las siguientes

Aug  1 01:27:38 nao postfix/smtpd[31212]: connect from unknown[183.160.126.122]
Aug  1 01:27:39 nao postfix/smtpd[31212]: warning: unknown[183.160.126.122]: SASL LOGIN authentication failed: authentication failure
Aug  1 01:27:40 nao postfix/smtpd[31212]: lost connection after AUTH from unknown[183.160.126.122]
Aug  1 01:27:40 nao postfix/smtpd[31212]: disconnect from unknown[183.160.126.122]
Aug  1 01:28:24 nao postfix/smtpd[31212]: connect from unknown[60.173.9.227]
Aug  1 01:28:25 nao postfix/smtpd[31212]: warning: unknown[60.173.9.227]: SASL LOGIN authentication failed: authentication failure
Aug  1 01:28:26 nao postfix/smtpd[31212]: lost connection after AUTH from unknown[60.173.9.227]
Aug  1 01:28:26 nao postfix/smtpd[31212]: disconnect from unknown[60.173.9.227]
Aug  1 01:28:27 nao postfix/smtpd[31212]: connect from unknown[60.173.9.227]
Aug  1 01:28:28 nao postfix/smtpd[31212]: warning: unknown[60.173.9.227]: SASL LOGIN authentication failed: authentication failure
Aug  1 01:28:29 nao postfix/smtpd[31212]: lost connection after AUTH from unknown[60.173.9.227]
Aug  1 01:28:29 nao postfix/smtpd[31212]: disconnect from unknown[60.173.9.227]

y realmente he buscado pero no encuentro que poner para que me funcione el fail2ban.

espero me puedan ayudar.

Saludos.

Reply to: