mirror of
https://github.com/fabriziosalmi/patterns.git
synced 2025-12-17 17:55:48 +00:00
29 lines
579 B
Plaintext
29 lines
579 B
Plaintext
# Nginx WAF rules for CORRELATION
|
|
location / {
|
|
set $attack_detected 0;
|
|
|
|
if ($request_uri ~* "@ge 5") {
|
|
set $attack_detected 1;
|
|
}
|
|
|
|
if ($request_uri ~* "@ge %{tx.inbound_anomaly_score_threshold}") {
|
|
set $attack_detected 1;
|
|
}
|
|
|
|
if ($request_uri ~* "@eq 0") {
|
|
set $attack_detected 1;
|
|
}
|
|
|
|
if ($request_uri ~* "@gt 0") {
|
|
set $attack_detected 1;
|
|
}
|
|
|
|
if ($request_uri ~* "@ge %{tx.outbound_anomaly_score_threshold}") {
|
|
set $attack_detected 1;
|
|
}
|
|
|
|
if ($attack_detected = 1) {
|
|
return 403;
|
|
}
|
|
}
|