FAIL2BAN - Filter.d - http-404

From IT-Arts.net


Return to Wiki Index


! Should be customized to your needs !

Filter.d

# /etc/fail2ban/filter.d/http-404.conf

[Definition]
failregex = ^<HOST> -.*"(GET|POST|HEAD|PUT|DELETE|OPTIONS|PATCH|TRACE).*HTTP.*" 404
            ^<HOST> -.*"[^"]*" 404
ignoreregex =

Jail.conf

enabled = true
banaction = %(banaction_allports)s
logpath = /var/log/nginx/*error*.log
          /var/log/nginx/*access*.log
maxretry = 21
findtime = 3d
bantime = 1d
backend = polling