File: //etc/fail2ban/action.d/iptables-captcha-bloqueia.conf
# Fail2Ban configuration file
#
# Author: Fabiano Candiotto @ Locaweb 2024
#
[Definition]
# Option: actionstart
#actionstart = iptables -t nat -N fail2ban-<name>
# iptables -t nat -A fail2ban-<name> -j RETURN
# iptables -t nat -I PREROUTING -p tcp -j fail2ban-<name>
# Option: actionstop
#actionstop = iptables -t nat -D PREROUTING -p tcp -j fail2ban-<name>
# iptables -t nat -F fail2ban-<name>
# iptables -t nat -X fail2ban-<name>
# Option: actioncheck
#actioncheck = iptables -n -t nat -L PREROUTING | grep -q fail2ban-captcha-ok
#actioncheck =
# Option: actionban
#actionban = iptables -I fail2ban-<name> 1 -s <ip> -j DROP
#actionban = iptables -t nat -D fail2ban-lw-captcha -p tcp --source <ip> --dport 80 -j REDIRECT --to-port 8000
# iptables -t nat -D fail2ban-lw-captcha -p tcp --source <ip> --dport 443 -j REDIRECT --to-port 8043
# /usr/bin/fail2ban-client unban <ip>
#actionban = /usr/bin/firewall-cmd --ipset=security-captcha --remove-entry=<ip>
actionban = /usr/sbin/ipset add wplogin-captcha <ip>
/usr/bin/fail2ban-client unban <ip>
# Option: actionunban
#actionunban = iptables -D fail2ban-<name> -s <ip> -j DROP
actionunban =
[Init]
# Defaut name of the chain
name = default
# Option: port
#port = 80
#toport = 8000
# Option: protocol
#protocol = tcp