patterns/waf_patterns/nginx/correlation.conf

29 lines
579 B
Plaintext
Raw Normal View History

# Nginx WAF rules for CORRELATION
location / {
set $attack_detected 0;
2025-01-11 00:26:37 +00:00
if ($request_uri ~* "@ge %{tx.outbound_anomaly_score_threshold}") {
set $attack_detected 1;
}
2025-01-11 00:26:37 +00:00
if ($request_uri ~* "@ge 5") {
set $attack_detected 1;
}
2025-01-11 00:26:37 +00:00
if ($request_uri ~* "@ge %{tx.inbound_anomaly_score_threshold}") {
set $attack_detected 1;
}
2025-01-11 00:26:37 +00:00
if ($request_uri ~* "@eq 0") {
set $attack_detected 1;
}
2025-01-11 00:26:37 +00:00
if ($request_uri ~* "@gt 0") {
set $attack_detected 1;
}
if ($attack_detected = 1) {
return 403;
}
}