Add fail2ban to stop these malicious ips ;-;
Some checks failed
Deploy with Docker Compose / deploy (push) Has been cancelled

This commit is contained in:
2026-03-09 14:18:01 +00:00
parent 8e50537333
commit 61366e4039
9 changed files with 59 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
[Definition]
# Matches excessive 4xx responses (scanners probing for common paths)
# Log format: $remote_addr "$request" $status rt=$request_time
failregex = ^<HOST> ".*" 4\d\d rt=
ignoreregex = "GET /favicon\.ico HTTP
"GET /robots\.txt HTTP

View File

@@ -0,0 +1,5 @@
[Definition]
# Matches failed login attempts (401/403) on POST to /auth/login
# Log format: $remote_addr "$request" $status rt=$request_time
failregex = ^<HOST> "POST .*/auth/login HTTP/.*" (401|403) rt=
ignoreregex =

View File

@@ -0,0 +1,4 @@
[DEFAULT]
# Ignore localhost; add your home IP after the comma
ignoreip = 127.0.0.1/8 ::1
banaction = iptables-multiport

View File

@@ -0,0 +1,7 @@
[nginx-4xx]
enabled = true
filter = nginx-4xx
logpath = /var/log/nginx/access.log
maxretry = 20
findtime = 300
bantime = 3600

View File

@@ -0,0 +1,7 @@
[nginx-login]
enabled = true
filter = nginx-login
logpath = /var/log/nginx/access.log
maxretry = 5
findtime = 600
bantime = 3600

View File

@@ -0,0 +1,7 @@
[sshd]
enabled = true
filter = sshd
logpath = /var/log/auth.log
maxretry = 5
findtime = 600
bantime = 3600