Add NGINX 404 and DOS filters

This commit is contained in:
blackc2004 2016-05-04 15:58:38 -07:00
parent 82ecab168b
commit 59516f7708
4 changed files with 59 additions and 0 deletions

View File

@ -55,3 +55,24 @@ action = iptables-allports[name=fusionpbx, protocol=all]
maxretry = 5
findtime = 600
bantime = 600
[nginx-404]
enabled = true
port = http,https
filter = nginx-404
logpath = /var/log/nginx/access*.log
bantime = 600
findtime = 600
maxretry = 10
[nginx-dos]
# Based on apache-badbots but a simple IP check (any IP requesting more than
# 240 pages in 60 seconds, or 4p/s average, is suspicious)
# Block for two full days.
enabled = true
port = http
filter = nginx-dos
logpath = /var/log/nginx/access*.log
findtime = 60
bantime = 172800
maxretry = 240

View File

@ -55,3 +55,22 @@ action = iptables-allports[name=fusionpbx, protocol=all]
maxretry = 5
findtime = 600
bantime = 600
[nginx-404]
enabled = true
port = http,https
filter = nginx-404
logpath = /var/log/nginx/access*.log
bantime = 600
findtime = 600
maxretry = 10
[nginx-dos]
# Based on apache-badbots
enabled = true
port = http
filter = nginx-dos
logpath = /var/log/nginx/access*.log
findtime = 60
bantime = 172800
maxretry = 240

View File

@ -0,0 +1,5 @@
# Fail2Ban configuration file
#
[Definition]
failregex = <HOST> - - \[.*\] "(GET|POST).*HTTP.* 404
ignoreregex =

View File

@ -0,0 +1,14 @@
# Fail2Ban configuration file
[Definition]
# Option: failregex
# Notes.: Regexp to catch a generic call from an IP address.
# Values: TEXT
#
failregex = ^<HOST> -.*"(GET|POST).*HTTP.*"$
# Option: ignoreregex
# Notes.: regex to ignore. If this regex matches, the line is ignored.
# Values: TEXT
#
ignoreregex =