Prompt
How do I fix false positives in AWS WAF?
Latest observation
Oct 29, 2026
OpenAI APIWeb search: off
False positives in AWS WAF usually mean a rule is matching traffic that should be allowed. The fix is typically to identify which rule is too broad, then scope it down or exempt the legitimate traffic.
1) Find the exact rule causing the block
Check WAF logs in:
- Amazon Kinesis Data Firehose destinations
- CloudWatch Logs if you enabled them
- WAF metrics in CloudWatch
- AWS WAF sampled requests
Look for:
terminatingRuleIdruleGroupId- matched statement details
- request headers, URI, query string, body pattern
This tells you whether the false positive comes from:
- a managed rule group
- a custom rule
- a rate-based rule
- a regex/string match rule
2) Adjust the rule instead of disabling WAF entirely
Common options:
For custom rules
- Make the match condition more specific
- Add an AND condition so it only matches the intended path/parameter
- Change from broad
CONTAINSto a more preciseEXACTLYor stricter regex - Exclude safe fields from inspection if appropriate
For managed rule groups
Use one of these:
- Rule action override to set the offending sub-rule to
COUNT - Exclude specific rules from the group
- Add a scope-down statement so the managed group only applies to certain paths
3) Create exceptions for legitimate traffic
If a specific endpoint or partner traffic is being blocked:
- Add a lower-priority allow rule
- Use label-based exceptions
- Exempt known IPs, headers, or paths
- Whitelist trusted bots or integrations
Example use cases:
- API endpoint with unusual payloads
- file upload path
- webhook sender
- health check URL
- admin or internal app traffic
4) Use COUNT mode to test safely
Before fully changing enforcement:
- Change the rule to COUNT
- Monitor logs and metrics
- Confirm the false positives are gone
- Then re-enable blocking if appropriate
This is especially useful for managed rule groups.
5) Tune rate-based rules carefully
False positives here often happen because:
- many users share one IP
- NAT gateways or proxies collapse traffic
- mobile carriers rotate through shared IPs
Fixes:
- Increase the threshold
- Use a custom aggregation key if available
- Exclude known internal IPs
- Apply rate limits only to sensitive paths
6) Inspect body and header inspection settings
Sometimes WAF matches harmless content in:
- request body
- cookies
- headers
- JSON fields
Possible fixes:
- Reduce inspected size if body inspection is too broad
- Use JSON body parsing correctly
- Add oversize handling options
- Scope rules to specific headers/paths
7) Use labels and rule priority to allow known-good traffic first
If a request should bypass later blocking rules:
- Add an early allow rule
- Or label trusted traffic and have later rules skip it
Be careful: allow rules are strong, so scope them tightly.
8) Re-test after every change
Validate with:
- replayed requests
- application test cases
- real logs from blocked legitimate users
- CloudWatch metrics for blocked/allowed counts
Recommended workflow
- Identify the exact offending rule in logs.
- Put that rule in COUNT mode.
- Narrow the rule or add a scoped exception.
- Test legitimate traffic.
- Re-enable blocking if safe.
If you want, I can also give you:
- a step-by-step AWS console guide
- Terraform/CloudFormation examples
- help diagnosing a specific WAF log entry if you paste one here.