updated fail2ban definitions to match new nginx log format
This commit is contained in:
parent
c54bc33b6b
commit
1e378032b0
1 changed files with 3 additions and 3 deletions
|
@ -11,19 +11,19 @@ echo "Setting up fail2ban for Nginx errors with strict, moderate, and lenient ja
|
||||||
# Create the filter files
|
# Create the filter files
|
||||||
cat > /etc/fail2ban/filter.d/nginx-4xx-strict.conf << EOL
|
cat > /etc/fail2ban/filter.d/nginx-4xx-strict.conf << EOL
|
||||||
[Definition]
|
[Definition]
|
||||||
failregex = ^<HOST> .* "(GET|POST|HEAD|PUT|DELETE|CONNECT|OPTIONS|TRACE|PATCH).*" (401|403) .*$
|
failregex = ^[^ ]+ <HOST> .* "(GET|POST|HEAD|PUT|DELETE|CONNECT|OPTIONS|TRACE|PATCH).*" (401|403) .*$
|
||||||
ignoreregex =
|
ignoreregex =
|
||||||
EOL
|
EOL
|
||||||
|
|
||||||
cat > /etc/fail2ban/filter.d/nginx-4xx-moderate.conf << EOL
|
cat > /etc/fail2ban/filter.d/nginx-4xx-moderate.conf << EOL
|
||||||
[Definition]
|
[Definition]
|
||||||
failregex = ^<HOST> .* "(GET|POST|HEAD|PUT|DELETE|CONNECT|OPTIONS|TRACE|PATCH).*" (400|405|406|408|413|444) .*$
|
failregex = ^[^ ]+ <HOST> .* "(GET|POST|HEAD|PUT|DELETE|CONNECT|OPTIONS|TRACE|PATCH).*" (400|405|406|408|413|444) .*$
|
||||||
ignoreregex =
|
ignoreregex =
|
||||||
EOL
|
EOL
|
||||||
|
|
||||||
cat > /etc/fail2ban/filter.d/nginx-4xx-lenient.conf << EOL
|
cat > /etc/fail2ban/filter.d/nginx-4xx-lenient.conf << EOL
|
||||||
[Definition]
|
[Definition]
|
||||||
failregex = ^<HOST> .* "(GET|POST|HEAD|PUT|DELETE|CONNECT|OPTIONS|TRACE|PATCH).*" (404|429) .*$
|
failregex = ^[^ ]+ <HOST> .* "(GET|POST|HEAD|PUT|DELETE|CONNECT|OPTIONS|TRACE|PATCH).*" (404|429) .*$
|
||||||
ignoreregex =
|
ignoreregex =
|
||||||
EOL
|
EOL
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue