2024-12-21 00:30:30 +00:00
|
|
|
# Nginx WAF rules for EXCEPTIONS
|
|
|
|
|
location / {
|
|
|
|
|
set $attack_detected 0;
|
|
|
|
|
|
2025-01-11 00:26:37 +00:00
|
|
|
if ($request_uri ~* "@endsWith (internal dummy connection)") {
|
2024-12-21 00:30:30 +00:00
|
|
|
set $attack_detected 1;
|
|
|
|
|
}
|
|
|
|
|
|
2025-01-11 00:26:37 +00:00
|
|
|
if ($request_uri ~* "^(?:GET /|OPTIONS *) HTTP/[12].[01]$") {
|
2024-12-21 00:30:30 +00:00
|
|
|
set $attack_detected 1;
|
|
|
|
|
}
|
|
|
|
|
|
2025-01-11 00:26:37 +00:00
|
|
|
if ($request_uri ~* "@streq GET /") {
|
2024-12-21 00:30:30 +00:00
|
|
|
set $attack_detected 1;
|
|
|
|
|
}
|
|
|
|
|
|
2025-01-11 00:26:37 +00:00
|
|
|
if ($request_uri ~* "@ipMatch 127.0.0.1,::1") {
|
2024-12-21 00:30:30 +00:00
|
|
|
set $attack_detected 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ($attack_detected = 1) {
|
|
|
|
|
return 403;
|
|
|
|
|
}
|
|
|
|
|
}
|