Created
October 16, 2023 11:06
-
-
Save kkroesch/f73b6f8dfb8073776a966cab187807b0 to your computer and use it in GitHub Desktop.
Fail2ban filter 404-requests (unsolicited pentests) for Nginx
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
# in /etc/fail2ban/jail.conf | |
# ... | |
[nginx-4xx] | |
enabled = true | |
port = http,https | |
filter = nginx-4xx | |
logpath = /var/log/nginx/access.log | |
bantime = 3600 | |
findtime = 10 | |
maxretry = 10 | |
# ... |
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-4xx.conf | |
[Definition] | |
failregex = ^<HOST>.*"(GET|POST).*" (404|444|403|400) .*$ | |
ignoreregex = |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment