Skip to content
Snippets Groups Projects
Commit 85f75aec authored by Elian Loraux's avatar Elian Loraux
Browse files

add banaction config

parent 577f27d6
Branches
No related tags found
1 merge request!19ajout du services bannisement
...@@ -7,6 +7,7 @@ logpath = /home/dockerweb/traefik/log/access.log ...@@ -7,6 +7,7 @@ logpath = /home/dockerweb/traefik/log/access.log
chain = DOCKER-USER chain = DOCKER-USER
mode = aggressive mode = aggressive
findtime = 4h findtime = 4h
banaction = docker-page
EOF EOF
cat <<EOF > /etc/fail2ban/jail.d/nocloud_base.conf cat <<EOF > /etc/fail2ban/jail.d/nocloud_base.conf
[sshd] [sshd]
...@@ -21,5 +22,17 @@ banaction = %(banaction_allports)s ...@@ -21,5 +22,17 @@ banaction = %(banaction_allports)s
bantime = 1w bantime = 1w
findtime = 1d findtime = 1d
EOF 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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment