added fail2ban config

This commit is contained in:
dado
2025-11-01 17:20:14 +01:00
parent ef14cdb753
commit c842aeea3c
2 changed files with 32 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
[Definition]
failregex = ^.*"remote_ip":"<HOST>",.*?"status":(?:4\d{2}|5\d{2}),.*$
ignoreregex =
datepattern = LongEpoch

28
etc/fail2ban/jail.local Normal file
View File

@@ -0,0 +1,28 @@
[DEFAULT]
destemail =
sendername = Fail2Ban
[sshd]
enabled = true
port = 1222
mode = aggressive
filter = sshd
maxretry = 3
findtime = 5m
bantime = 120m
logpath = %(sshd_log)s
sshd_backend = systemd
[caddy]
backend = auto
enabled = true
chain = FORWARD
protocol = tcp
port = http,https
filter = caddy-custom
maxretry = 3
# 24h
bantime = 86400
# 12h
findtime = 43200 #12h
logpath = /var/log/caddy/access.log