bonjour ,
J’ai pris un serveur VPS (Debian 9 64bits) y a quelques jours , préinstaller avec Ispconfig3 , Apache2, amavis , clamav, etc… (installed ISPConfig-Version: 3.1.15p2)
J’ai configurer le serveur de mail , et tout fonctionne parfaitement sauf fail2ban, qui ne bannie presque pas , le bannissement ce font dans les logs de Apache2 , mais rien a faire dans les logs mail ( /var/log/mail.log)
J’utilise Fail2ban depuis quelques années mais la je sèche , premier serveur préconfigurer avec Ispconfig3, je me demande si c pas le faite d’ajouter des règles de bannissement a la configuration existante?
J’ai plusieurs fois vérifier si les règles fonctionne :
exemple:
#fail2ban-regex /var/log/mail.log /etc/fail2ban/filter.d/postfix-auth.conf /etc/fail2ban/filter.d/postfix-auth.conf:
Running tests
=============
Use failregex filter file : postfix-auth, basedir: /etc/fail2ban
Use ignoreregex filter file : postfix-auth, basedir: /etc/fail2ban
Use log file : /var/log/mail.log
Use encoding : UTF-8
Results
=======
Failregex: 20 total
|- #) [# of hits] regular expression
| 1) [20] lost connection after (AUTH|UNKNOWN|EHLO|STARTTLS) from (.*)\[<HOST>\]
`-
Ignoreregex: 0 total
mais pourtant aucun bannisement?
Mon Iptables-save:
# Generated by iptables-save v1.6.0 on Fri Dec 13 19:57:22 2019
*raw
:PREROUTING ACCEPT [154061:15739237]
:OUTPUT ACCEPT [122879:36250246]
COMMIT
# Completed on Fri Dec 13 19:57:22 2019
# Generated by iptables-save v1.6.0 on Fri Dec 13 19:57:22 2019
*nat
:PREROUTING ACCEPT [61496:2323032]
:INPUT ACCEPT [61155:2306652]
:OUTPUT ACCEPT [12979:901594]
:POSTROUTING ACCEPT [8763:648634]
COMMIT
# Completed on Fri Dec 13 19:57:22 2019
# Generated by iptables-save v1.6.0 on Fri Dec 13 19:57:22 2019
*mangle
:PREROUTING ACCEPT [154061:15739237]
:INPUT ACCEPT [154061:15739237]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [122879:36250246]
:POSTROUTING ACCEPT [118524:35991702]
COMMIT
# Completed on Fri Dec 13 19:57:22 2019
# Generated by iptables-save v1.6.0 on Fri Dec 13 19:57:22 2019
*filter
:INPUT ACCEPT [2311:136333]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [2794:648292]
:f2b-apache-admin - [0:0]
:f2b-apache-badbots - [0:0]
:f2b-apache-botsearch - [0:0]
:f2b-apache-fakegooglebot - [0:0]
:f2b-apache-modsecurity - [0:0]
:f2b-apache-nohome - [0:0]
:f2b-apache-noscript - [0:0]
:f2b-apache-overflows - [0:0]
:f2b-apache-shellshock - [0:0]
:f2b-attack-x00 - [0:0]
:f2b-decode - [0:0]
:f2b-dovecot - [0:0]
:f2b-forbidden - [0:0]
:f2b-ip-scann - [0:0]
:f2b-nullmulti - [0:0]
:f2b-postfix - [0:0]
:f2b-postfix-auth - [0:0]
:f2b-postfix-sasl - [0:0]
:f2b-pure-ftpd - [0:0]
:f2b-scanner-key - [0:0]
:f2b-scanner-script - [0:0]
:f2b-scanner-url - [0:0]
:f2b-smtp-secu - [0:0]
:f2b-sshd - [0:0]
-A INPUT -p tcp -m multiport --dports 25,465,465,587,587 -j f2b-smtp-secu
-A INPUT -p tcp -m multiport --dports 25 -j f2b-postfix-auth
-A INPUT -p tcp -m multiport --dports 80,443 -j f2b-attack-x00
-A INPUT -p tcp -j f2b-nullmulti
-A INPUT -p tcp -m multiport --dports 80,443 -j f2b-forbidden
-A INPUT -p tcp -m multiport --dports 80,443 -j f2b-scanner-script
-A INPUT -p tcp -m multiport --dports 80,443 -j f2b-scanner-url
-A INPUT -p tcp -m multiport --dports 80,443 -j f2b-scanner-key
-A INPUT -p tcp -m multiport --dports 80,443 -j f2b-ip-scann
-A INPUT -p tcp -m multiport --dports 80,443 -j f2b-decode
-A INPUT -p tcp -m multiport --dports 80,443 -j f2b-apache-admin
-A INPUT -p tcp -m multiport --dports 25 -j f2b-postfix-sasl
-A INPUT -p tcp -m multiport --dports 110,995,143,993,587,465,4190 -j f2b-dovecot
-A INPUT -p tcp -m multiport --dports 25 -j f2b-postfix
-A INPUT -p tcp -m multiport --dports 21 -j f2b-pure-ftpd
-A INPUT -p tcp -m multiport --dports 80,443 -j f2b-apache-shellshock
-A INPUT -p tcp -m multiport --dports 80,443 -j f2b-apache-modsecurity
-A INPUT -p tcp -m multiport --dports 80,443 -j f2b-apache-fakegooglebot
-A INPUT -p tcp -m multiport --dports 80,443 -j f2b-apache-botsearch
-A INPUT -p tcp -m multiport --dports 80,443 -j f2b-apache-nohome
-A INPUT -p tcp -m multiport --dports 80,443 -j f2b-apache-overflows
-A INPUT -p tcp -m multiport --dports 80,443 -j f2b-apache-noscript
-A INPUT -p tcp -m multiport --dports 80,443 -j f2b-apache-badbots
-A INPUT -p tcp -m multiport --dports 22 -j f2b-sshd
-A INPUT -s xx.xx.xx.xx/32 -p tcp -j ACCEPT
-A INPUT -p tcp -m tcp --dport 8080 -j DROP
-A INPUT -p udp -m udp --dport 8080 -j DROP
-A INPUT -p tcp -m tcp --dport 8081 -j DROP
-A INPUT -p udp -m udp --dport 8081 -j DROP
-A INPUT -p tcp -m tcp --dport 7722 -j DROP
-A INPUT -p tcp -m tcp --dport 21 -j DROP
-A INPUT -p tcp -m tcp --dport 110 -j DROP
-A INPUT -p tcp -m tcp --dport 143 -j DROP
-A INPUT -p tcp -m tcp --dport 8082 -j DROP
-A INPUT -p udp -m udp --dport 8082 -j DROP
-A INPUT -p tcp -m tcp --dport 80 -j DROP
-A OUTPUT -p tcp -m tcp --dport 8080 -j DROP
-A OUTPUT -p udp -m udp --dport 8080 -j DROP
-A OUTPUT -p tcp -m tcp --dport 8081 -j DROP
-A OUTPUT -p udp -m udp --dport 8081 -j DROP
-A OUTPUT -p tcp -m tcp --dport 7722 -j DROP
-A OUTPUT -p tcp -m tcp --dport 21 -j DROP
-A OUTPUT -p tcp -m tcp --dport 110 -j DROP
-A OUTPUT -p tcp -m tcp --dport 143 -j DROP
-A OUTPUT -p tcp -m tcp --dport 8082 -j DROP
-A OUTPUT -p udp -m udp --dport 8082 -j DROP
-A OUTPUT -p tcp -m tcp --dport 80 -j DROP
-A f2b-apache-admin -j RETURN
-A f2b-apache-badbots -j RETURN
-A f2b-apache-botsearch -j RETURN
-A f2b-apache-fakegooglebot -j RETURN
-A f2b-apache-modsecurity -j RETURN
-A f2b-apache-nohome -j RETURN
-A f2b-apache-noscript -j RETURN
-A f2b-apache-overflows -j RETURN
-A f2b-apache-shellshock -j RETURN
-A f2b-attack-x00 -j RETURN
-A f2b-decode -j RETURN
-A f2b-dovecot -j RETURN
-A f2b-forbidden -j RETURN
-A f2b-ip-scann -j RETURN
-A f2b-nullmulti -j RETURN
-A f2b-postfix -j RETURN
-A f2b-postfix-auth -j RETURN
-A f2b-postfix-sasl -j RETURN
-A f2b-pure-ftpd -j RETURN
-A f2b-scanner-key -j RETURN
-A f2b-scanner-script -j RETURN
-A f2b-scanner-url -j RETURN
-A f2b-smtp-secu -j RETURN
-A f2b-sshd -j RETURN
COMMIT
# Completed on Fri Dec 13 19:57:22 2019
J’ai volontairement bloquer les ports de phpmyadmin et ispconfig, pour que juste mon IP est accès.
Une Idée? une aide?