2024-12-21 00:30:30 +00:00
|
|
|
# Nginx WAF rules for CORRELATION
|
|
|
|
|
location / {
|
|
|
|
|
set $attack_detected 0;
|
|
|
|
|
|
2025-01-10 00:27:14 +00:00
|
|
|
if ($request_uri ~* "@ge 5") {
|
2024-12-21 00:30:30 +00:00
|
|
|
set $attack_detected 1;
|
|
|
|
|
}
|
|
|
|
|
|
2025-01-10 00:27:14 +00:00
|
|
|
if ($request_uri ~* "@gt 0") {
|
2024-12-21 00:30:30 +00:00
|
|
|
set $attack_detected 1;
|
|
|
|
|
}
|
|
|
|
|
|
2025-01-10 00:27:14 +00:00
|
|
|
if ($request_uri ~* "@ge %{tx.outbound_anomaly_score_threshold}") {
|
2024-12-21 00:30:30 +00:00
|
|
|
set $attack_detected 1;
|
|
|
|
|
}
|
|
|
|
|
|
2025-01-10 00:27:14 +00:00
|
|
|
if ($request_uri ~* "@ge %{tx.inbound_anomaly_score_threshold}") {
|
2024-12-21 00:30:30 +00:00
|
|
|
set $attack_detected 1;
|
|
|
|
|
}
|
|
|
|
|
|
2025-01-10 00:27:14 +00:00
|
|
|
if ($request_uri ~* "@eq 0") {
|
2024-12-21 00:30:30 +00:00
|
|
|
set $attack_detected 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ($attack_detected = 1) {
|
|
|
|
|
return 403;
|
|
|
|
|
}
|
|
|
|
|
}
|