Salut,
Je tourne et retourne un problème depuis un moment, et je viens de trouver la solution…
fail2ban me retournait d’une façon aléatoire des erreurs de ce type:
2011-08-08 12:22:52,286 fail2ban.actions.action: ERROR iptables -N fail2ban-pam-generic
iptables -A fail2ban-pam-generic -j RETURN
iptables -I INPUT -p tcp -j fail2ban-pam-generic returned 400
2011-08-08 15:06:04,467 fail2ban.actions.action: ERROR iptables -D INPUT -p tcp -m multiport --dports 10122 -j fail2ban-ssh-ddos
iptables -F fail2ban-ssh-ddos
iptables -X fail2ban-ssh-ddos returned 100
2011-08-08 15:06:10,027 fail2ban.actions.action: ERROR iptables -N fail2ban-apache-overflows
iptables -A fail2ban-apache-overflows -j RETURN
iptables -I INPUT -p tcp -m multiport --dports http,https -j fail2ban-apache-overflows returned 200
2011-08-08 15:06:10,224 fail2ban.actions.action: ERROR iptables -N fail2ban-postfix
iptables -A fail2ban-postfix -j RETURN
iptables -I INPUT -p tcp -m multiport --dports smtp,ssmtp -j fail2ban-postfix returned 400
2011-08-08 15:06:10,283 fail2ban.actions.action: ERROR iptables -N fail2ban-sasl
iptables -A fail2ban-sasl -j RETURN
iptables -I INPUT -p tcp -m multiport --dports smtp,ssmtp,imap2,imap3,imaps,pop3,pop3s -j fail2ban-sasl returned 200
2011-08-08 15:14:26,002 fail2ban.actions.action: ERROR iptables -D INPUT -p tcp -m multiport --dports http,https -j fail2ban-apache-overflows
iptables -F fail2ban-apache-overflows
iptables -X fail2ban-apache-overflows returned 100
2011-08-08 15:14:28,374 fail2ban.actions.action: ERROR iptables -D INPUT -p tcp -m multiport --dports smtp,ssmtp,imap2,imap3,imaps,pop3,pop3s -j fail2ban-sasl
iptables -F fail2ban-sasl
iptables -X fail2ban-sasl returned 100
2011-08-08 15:14:45,382 fail2ban.actions.action: ERROR iptables -N fail2ban-apache-noscript
iptables -A fail2ban-apache-noscript -j RETURN
iptables -I INPUT -p tcp -m multiport --dports http,https -j fail2ban-apache-noscript returned 400
Je suis tombé sur un blog qui donne un “hack” permettant d’éviter ces erreurs. C’est pas très beau comme solution, mais ça fonctionne…
[quote]Edit /usr/bin/fail2ban-client and adding a time.sleep(0.1):
def __processCmd(self, cmd, showRet = True):
beautifier = Beautifier()
for c in cmd:
time.sleep(0.1)
beautifier.setInputCmd©[/quote]
La durée de pause était insuffisante chez moi, je suis passé à 0.2, plus d’erreur…
2011-08-08 15:15:52,887 fail2ban.jail : INFO Jail 'apache-noscript' started
2011-08-08 15:15:53,133 fail2ban.jail : INFO Jail 'pam-generic' started
2011-08-08 15:15:53,376 fail2ban.jail : INFO Jail 'ssh-ddos' started
2011-08-08 15:15:53,600 fail2ban.jail : INFO Jail 'apache-overflows' started
2011-08-08 15:15:53,852 fail2ban.jail : INFO Jail 'ssh' started
2011-08-08 15:15:54,076 fail2ban.jail : INFO Jail 'postfix' started
2011-08-08 15:15:54,334 fail2ban.jail : INFO Jail 'sasl' started
2011-08-08 15:15:54,556 fail2ban.jail : INFO Jail 'apache' started