2024-12-21 00:30:30 +00:00
|
|
|
# Nginx WAF rules for INITIALIZATION
|
|
|
|
|
location / {
|
|
|
|
|
set $attack_detected 0;
|
|
|
|
|
|
2025-01-15 00:26:17 +00:00
|
|
|
if ($request_uri ~* "!@rx (?:URLENCODED|MULTIPART|XML|JSON)") {
|
2024-12-21 00:30:30 +00:00
|
|
|
set $attack_detected 1;
|
|
|
|
|
}
|
|
|
|
|
|
2025-01-15 00:26:17 +00:00
|
|
|
if ($request_uri ~* "^[a-f]*([0-9])[a-f]*([0-9])") {
|
2024-12-21 00:30:30 +00:00
|
|
|
set $attack_detected 1;
|
|
|
|
|
}
|
|
|
|
|
|
2025-01-15 00:26:17 +00:00
|
|
|
if ($request_uri ~* "^.*$") {
|
2024-12-21 00:30:30 +00:00
|
|
|
set $attack_detected 1;
|
|
|
|
|
}
|
|
|
|
|
|
2025-01-15 00:26:17 +00:00
|
|
|
if ($request_uri ~* "@eq 0") {
|
2024-12-21 00:30:30 +00:00
|
|
|
set $attack_detected 1;
|
|
|
|
|
}
|
|
|
|
|
|
2025-01-15 00:26:17 +00:00
|
|
|
if ($request_uri ~* "@eq 1") {
|
2024-12-21 00:30:30 +00:00
|
|
|
set $attack_detected 1;
|
|
|
|
|
}
|
|
|
|
|
|
2025-01-15 00:26:17 +00:00
|
|
|
if ($request_uri ~* "@eq 100") {
|
2025-01-09 00:26:35 +00:00
|
|
|
set $attack_detected 1;
|
|
|
|
|
}
|
|
|
|
|
|
2024-12-21 00:30:30 +00:00
|
|
|
if ($attack_detected = 1) {
|
|
|
|
|
return 403;
|
|
|
|
|
}
|
|
|
|
|
}
|