Skip to content

Instantly share code, notes, and snippets.

@alexalouit
Created June 30, 2017 14:51
Show Gist options
  • Save alexalouit/5c1501f9fc95a91947ed8410e7d9eb93 to your computer and use it in GitHub Desktop.
Save alexalouit/5c1501f9fc95a91947ed8410e7d9eb93 to your computer and use it in GitHub Desktop.
Fail2ban: http ddos (apache/nginx/varnish)
# Fail2Ban filter to catch all http request
#
# Author: Alex Alouit <alexandre.alouit@gmail.com>
[Definition]
failregex = ^<HOST> -.*"(GET|HEAD|POST|PUT|DELETE|TRACE|CONNECT).*
ignoreregex =
[http-get-ddos]
enabled = true
port = http,https
filter = http-ddos
logpath = /var/log/apache2/access.log
#logpath = /var/log/nginx/access.log
maxretry = 60
findtime = 60
bantime = 6000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment