Mon serveur YunoHost
Matériel: PC
Version de YunoHost: 3.6.4.3
J’ai accès à mon serveur : En SSH & En direct avec un clavier/écran
Êtes-vous dans un contexte particulier ou avez-vous effectué des modificiations particulières sur votre instance ? : non
Je pence que le problème fait suite a une mise a jour mais, je ne peux pas l’affirmer.
Description du problème
J’ai des erreurs du service fail2ban. J’essaie d’en trouver la cause.
Voici le genre d’erreur que je trouve dans les logs :
2019-08-01 14:33:43,600 fail2ban.actions [1251]: NOTICE [postfix-sasl] Ban 37.221.213.146
2019-08-01 14:33:43,603 fail2ban.filter [1251]: INFO [recidive] Found 37.221.213.146
2019-08-01 14:33:43,712 fail2ban.action [1251]: ERROR iptables -w -n -L INPUT | grep -q 'f2b-postfix-sasl[ \t]' -- stdout: b''
2019-08-01 14:33:43,713 fail2ban.action [1251]: ERROR iptables -w -n -L INPUT | grep -q 'f2b-postfix-sasl[ \t]' -- stderr: b''
2019-08-01 14:33:43,714 fail2ban.action [1251]: ERROR iptables -w -n -L INPUT | grep -q 'f2b-postfix-sasl[ \t]' -- returned 1
2019-08-01 14:33:43,714 fail2ban.CommandAction [1251]: ERROR Invariant check failed. Trying to restore a sane environment
2019-08-01 14:33:43,939 fail2ban.action [1251]: ERROR iptables -w -N f2b-postfix-sasl
iptables -w -A f2b-postfix-sasl -j RETURN
iptables -w -I INPUT -p tcp -m multiport --dports smtp,465,submission,imap3,imaps,pop3,pop3s -j f2b-postfix-sasl -- stdout: b''
2019-08-01 14:33:43,941 fail2ban.action [1251]: ERROR iptables -w -N f2b-postfix-sasl
iptables -w -A f2b-postfix-sasl -j RETURN
iptables -w -I INPUT -p tcp -m multiport --dports smtp,465,submission,imap3,imaps,pop3,pop3s -j f2b-postfix-sasl -- stderr: b"iptables v1.6.0: invalid port/service `imap3' specified\nTry `iptables -h' or 'iptables --help' for more information.\n"
2019-08-01 14:33:43,946 fail2ban.action [1251]: ERROR iptables -w -N f2b-postfix-sasl
iptables -w -A f2b-postfix-sasl -j RETURN
iptables -w -I INPUT -p tcp -m multiport --dports smtp,465,submission,imap3,imaps,pop3,pop3s -j f2b-postfix-sasl -- returned 2
2019-08-01 14:33:43,946 fail2ban.actions [1251]: ERROR Failed to execute ban jail 'postfix-sasl' action 'iptables-multiport' info 'CallingMap({'ipjailmatches': <function Actions.__checkBan.<locals>.<lambda> at 0x7f6378f348c8>, 'ipfailures': <function Actions.__checkBan.<locals>.<lambda> at 0x7f6378f34840>, 'failures': 3, 'matches': 'Aug 1 14:33:28 atlas postfix/submission/smtpd[14555]: warning: unknown[37.221.213.146]: SASL PLAIN authentication failed:\nAug 1 14:33:39 atlas postfix/submission/smtpd[14555]: warning: unknown[37.221.213.146]: SASL PLAIN authentication failed:\nAug 1 14:33:42 atlas postfix/submission/smtpd[14566]: warning: unknown[37.221.213.146]: SASL PLAIN authentication failed:', 'ipjailfailures': <function Actions.__checkBan.<locals>.<lambda> at 0x7f6378f34ae8>, 'time': 1564662823.6000311, 'ip': '37.221.213.146', 'ipmatches': <function Actions.__checkBan.<locals>.<lambda> at 0x7f6378f34730>})': Error starting action
je ne connais pas suffisamment bien fail2ban et iptable pour comprendre la nature du problème à partir des logs. (sauf que, dans l’exemple,cela concerne l’application des règles de postfix mais, j’ai des erreurs pour d’autre services ou plutot pour les autres règles comme: dovecot, rainloop, sshd, etc )
J’ai regardé l’état du service fail2ban :
# service fail2ban status
● fail2ban.service - Fail2Ban Service
Loaded: loaded (/lib/systemd/system/fail2ban.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2019-08-01 08:06:20 CEST; 23h ago
Docs: man:fail2ban(1)
Process: 564 ExecStart=/usr/bin/fail2ban-client -x start (code=exited, status=0/SUCCESS)
Main PID: 1251 (fail2ban-server)
Tasks: 25 (limit: 4915)
CGroup: /system.slice/fail2ban.service
└─1251 /usr/bin/python3 /usr/bin/fail2ban-server -s /var/run/fail2ban/fail2ban.sock -p /var/run/fail2ban/fail2ban.pid -x -b
août 01 08:06:02 atlas systemd[1]: Starting Fail2Ban Service...
août 01 08:06:15 atlas fail2ban-client[564]: 2019-08-01 08:06:15,580 fail2ban.server [1124]: INFO Starting Fail2ban v0.9.6
août 01 08:06:15 atlas fail2ban-client[564]: 2019-08-01 08:06:15,581 fail2ban.server [1124]: INFO Starting in daemon mode
août 01 08:06:18 atlas systemd[1]: fail2ban.service: Unit cannot be reloaded because it is inactive.
et rien ne semble étrange à part peut-être:
août 01 08:06:18 atlas systemd[1]: fail2ban.service: Unit cannot be reloaded because it is inactive.
semble vouloir dire que le service ne peut être rechargé car inactif (traduction hasardeuse).
Je ne sais pas comment m’y prendre pour continuer l’investigation ! Je suis à l’écoute de vos suggestions afin de trouver la cause du problème !
Cordialement