Skip to content

Commit

Permalink
[fail2ban/nginxplus] Change format of fail2ban match
Browse files Browse the repository at this point in the history
Previously, we were trying to match CLF formatted logs in access.log.  But our access log
is in a JSON format, so we needed to adjust the fail2ban failregex accordingl[fail2ban/nginxplus] Change format of fail2ban match

Previously, we were trying to match CLF formatted logs in access.log.  But our access log
is in a JSON format, so we needed to adjust the fail2ban failregex accordingly

Co-authored-by: Alicia Cozine <[email protected]>
Co-authored-by: Christina Chortaria <[email protected]>
Co-authored-by: Francis Kayiwa <[email protected]>
Co-authored-by: James R. Griffin III <[email protected]>
Co-authored-by: Kevin Reiss <[email protected]>
  • Loading branch information
6 people committed Dec 23, 2024
1 parent 0aeb5d3 commit 4382fd1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion roles/nginxplus/files/fail2ban/nginx-badbots-filter.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

badbots = 360Spider|claudebot|OAI-SearchBot|GPTBot

failregex = (?i)<HOST> -.*"(GET|POST|HEAD).*HTTP.*(?:%(badbots)s).*"$
failregex = (?i)\{\"remote_ip\"\: \"<HOST>\".*?\"user_agent\"\:.*?(?:%(badbots)s).*$

ignoreregex =

0 comments on commit 4382fd1

Please sign in to comment.