[RISOLTO] Regola fail2ban disattesa da iptables
Inviato: mer 9 nov 2022, 16:28
Ho un jail di fail2ban (versione 0.11.2) che scrive una regola su iptables. Il mio problema è che l'IP dell'intruso non viene bannato.
La regola iptables è questa:
Naturalmente le porte che sto chiamando sono le 80 e 443.
La regola in questione viene generata da una action di fail2ban. Questo è il mio jail
La "action" di fail2ban non l'ho nemmeno toccata e come si vede anche sopra è la "iptables-multiport" che sta dentro la directory action.d:
Qualche dritta? Grazie in anticipo.
La regola iptables è questa:
Codice: Seleziona tutto
# iptables -n -L --line-numbers
Chain INPUT (policy ACCEPT)
num target prot opt source destination
1 f2b-SQL tcp -- 0.0.0.0/0 0.0.0.0/0 multiport dports 80,443
Chain f2b-SQL (1 references)
num target prot opt source destination
1 REJECT all -- 1.2.3.4 0.0.0.0/0 reject-with icmp-port-unreachable
2 RETURN all -- 0.0.0.0/0 0.0.0.0/0
La regola in questione viene generata da una action di fail2ban. Questo è il mio jail
Codice: Seleziona tutto
[SQLinjection]
enabled = true
filter = SQLinjection
action = iptables-multiport[name=SQL, port="80,443"]
sendmail-whois-lines[name=SQL, logpath="%(logpath)s"]
logpath = /path/to/file.log
maxretry = 1
bantime = 30d
Codice: Seleziona tutto
[Definition]
# Option: actionstart
# Notes.: command executed on demand at the first ban (or at the start of Fail2Ban if actionstart_on_demand is set to false).
# Values: CMD
#
actionstart = <iptables> -N f2b-<name>
<iptables> -A f2b-<name> -j <returntype>
<iptables> -I <chain> -p <protocol> -m multiport --dports <port> -j f2b-<name>