-
-
Save xros/56260c67125ff4d2a3a9 to your computer and use it in GitHub Desktop.
Adds Nginx DOS detection to Fail2ban
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /etc/fail2ban/jail.local | |
# [...] | |
[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. | |
# @author xros | |
enabled = true | |
port = http,https | |
filter = nginx-dos | |
logpath = /srv/data-srv1/logs/nginx/*/*access.log | |
findtime = 60 | |
bantime = 172800 | |
maxretry = 240 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /etc/fail2ban/filter.d/nginx-dos.conf | |
# Fail2Ban configuration file | |
# | |
# Generated on Fri Jun 08 12:09:15 EST 2012 by BeezNest | |
# | |
# Author: Yannick Warnir | |
# | |
# $Revision: 1 $ | |
# | |
[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 = |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment