Prompt
Microsoft Azure Web Application Firewall keeps causing false positives, how do I reduce them?
Latest observation
Azure Web Application Firewall (WAF) false positives are usually reduced by tuning the policy, not by turning protection off globally. The best approach depends on whether you’re using Application Gateway WAF or Front Door WAF, but the general steps are similar.
1) Find the exact rule causing the block
Use WAF logs in Azure Monitor / Log Analytics to identify:
- Rule ID
- Rule group
- Request URL
- Matched parameter / payload
- Whether it’s a managed rule or a custom rule
This tells you what to adjust instead of weakening everything.
2) Put the WAF policy in Detection mode first
If you’re actively tuning:
- Change policy mode from Prevention to Detection
- Let it run for a bit
- Review logs for legitimate traffic being flagged
- Then re-enable Prevention after tuning
This avoids blocking real users while you investigate.
3) Exclude specific request parts
If a managed rule is triggering on known-safe input, use exclusions rather than disabling the whole rule.
Common exclusions include:
- Request header names
- Request cookie names
- Query string parameter names
- Request body parameter names
- Request URI / path values
Example use cases:
- A JSON field like
descriptionorcommentcontains HTML-like text - A search box accepts characters that look like injection payloads
- A cookie or header carries encoded data that trips a rule
4) Disable only the offending rule, not the whole set
If a specific managed rule is consistently false-positive and you’re sure it’s safe:
- Disable that individual rule ID
- Or disable the smaller rule group if necessary
Be conservative here; don’t disable broad categories unless you’ve confirmed the impact.
5) Add custom allow rules for known-safe traffic
If certain requests are always legitimate, create a custom rule to allow them based on:
- IP address ranges
- Geo location
- Request headers
- Hostname
- Specific paths or URI patterns
- HTTP method
This is especially useful for internal tools, partner integrations, or health probes.
6) Check for encoding and payload shape issues
False positives often happen when applications send:
- Double-encoded characters
- Unexpected JSON structures
- Base64 blobs
- XML content
- Large form values
- Rich text/HTML in fields
If possible, adjust the app to send cleaner input or store rich content in a way that doesn’t resemble attack payloads.
7) Use the latest managed rule set
Make sure you’re on the latest supported managed ruleset version:
- Newer versions often reduce false positives
- They also improve detection accuracy
8) Create path-specific policies
If only one app section is noisy:
- Apply different WAF policies to different listeners, routes, or paths
- Use stricter rules where needed and lighter tuning only for the problematic app
9) Review rule tuning after app changes
False positives can reappear after:
- Application updates
- New features
- New request formats
- API changes
Keep a process to review WAF logs after deployments.
Practical recommendation
Start with this sequence:
- Enable logging
- Identify the exact rule ID
- Add the narrowest exclusion possible
- If needed, disable only that rule
- Re-test in Detection mode
- Return to Prevention
Important caution
Avoid these unless absolutely necessary:
- Disabling all managed rules
- Running the WAF permanently in Detection mode
- Adding overly broad exclusions like entire request bodies or all parameters
Those reduce security significantly.
If you want, I can also give you:
- a step-by-step guide for Azure Portal
- KQL queries to find false positives in WAF logs
- or examples for Application Gateway vs Front Door tuning.