diff --git a/upgrade/traefik_fail2ban.sh b/upgrade/traefik_fail2ban.sh index 028741ae3566d6fb6539e98e95991cc1e67055e9..5c7af03518ff3c6c5d082ce34ac27772022b0522 100644 --- a/upgrade/traefik_fail2ban.sh +++ b/upgrade/traefik_fail2ban.sh @@ -7,6 +7,7 @@ logpath = /home/dockerweb/traefik/log/access.log chain = DOCKER-USER mode = aggressive findtime = 4h +banaction = docker-page EOF cat <<EOF > /etc/fail2ban/jail.d/nocloud_base.conf [sshd] @@ -21,5 +22,17 @@ banaction = %(banaction_allports)s bantime = 1w findtime = 1d EOF -fail2ban-client reload +cat <<EOF > /etc/fail2ban/action.d/docker-page.conf +[Definition] + +actionstart = + +actionstop = + +actioncheck = +actionban = cd /home/dockerweb/ban; bash ban.sh <ip> + +actionunban = cd /home/dockerweb/ban; bash unban.sh <ip> +EOF +fail2ban-client reload