added fail2ban config
This commit is contained in:
4
etc/fail2ban/filter.d/caddy-custom.conf
Normal file
4
etc/fail2ban/filter.d/caddy-custom.conf
Normal 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
28
etc/fail2ban/jail.local
Normal 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
|
||||
Reference in New Issue
Block a user