Prompt
Azure Web Application Firewall keeps causing false positives
Latest observation
Azure Web Application Firewall (WAF) false positives are usually caused by a rule set being too strict for your app’s traffic patterns, especially with things like JSON payloads, APIs, file uploads, encoded input, or query strings that look “suspicious” but are legitimate.
Here’s a practical way to reduce them without weakening security too much:
1) Identify exactly which rules are firing
In Azure Monitor / WAF logs, find:
- Rule ID
- Rule group
- Request path / parameter
- Match details
This tells you whether the issue is:
- a specific managed rule,
- a custom rule,
- or an overly broad exclusion problem.
2) Put WAF in Detection mode first
If you’re currently in prevention mode and not sure what’s being blocked:
- switch temporarily to Detection
- observe logs
- confirm which requests are legitimate
This helps avoid blindly disabling protections.
3) Add targeted exclusions
Instead of disabling an entire rule group, exclude only the specific:
- parameter name
- request header
- cookie
- request body field
Example: if a rule is triggered by a search parameter or a JSON field containing special characters, exclude only that field.
4) Disable only the specific false-positive rules
If one managed rule repeatedly hits valid traffic:
- disable that rule ID only
- keep the rest of the rule set active
This is often better than turning off the whole OWASP set.
5) Tune for your app type
Certain workloads often need extra tuning:
- APIs / JSON: managed rules may interpret structured payloads as attacks
- File uploads: encoded content can trigger inspections
- Single-page apps: unusual query strings or route parameters can look suspicious
- GraphQL: complex nested payloads often trigger rules
6) Review encoding and request formatting
False positives often happen when requests contain:
- double-encoded characters
- SQL-like text in search fields
- HTML/script-like text in user-generated content
- large JSON blobs
If possible, normalize requests and avoid sending unnecessary special characters.
7) Use custom allow rules carefully
If traffic comes from trusted sources:
- internal IPs
- partner systems
- known service principals you can create a custom rule to allow them, but keep it narrow and specific.
8) Keep WAF and rule sets updated
Sometimes false positives are caused by older managed rule behavior. Make sure you’re using:
- the latest supported managed rule set
- current Azure WAF features for your gateway/app gateway/CDN/front door
9) Test changes incrementally
After each adjustment:
- test the exact failing request
- verify the request is allowed
- confirm no new bypass is introduced
Recommended process
- Capture a blocked request from logs
- Identify the exact rule ID
- Confirm it’s a legitimate request
- Add the smallest possible exclusion or rule exception
- Retest in Detection, then Prevention
If you want, I can help you troubleshoot a specific WAF log entry or suggest the exact exclusion format for Application Gateway, Front Door, or Azure CDN.