Prompt
How do I tune a WAF to reduce false positives?
Latest observation
To reduce false positives in a WAF, the goal is usually “tighten detection where it matters, relax it where normal traffic is being flagged, and keep visibility so you don’t accidentally create blind spots.” A practical tuning approach looks like this:
1) Start with good visibility
Before changing rules, make sure you can see:
- Which rule triggered
- Which URI/endpoint
- Which parameter or header matched
- Request method, user agent, and source IP
- Whether the request was blocked or only logged
If your WAF supports it, run in monitor/log-only mode first for new rules.
2) Baseline normal traffic
Collect a few days of real traffic and identify:
- Top endpoints
- Common request patterns
- Frequent user agents / clients
- Legitimate payloads that contain “suspicious” strings
- APIs or forms that submit JSON, XML, file uploads, or encoded data
False positives often come from endpoints that naturally carry:
- Search terms
- Rich text / HTML
- Base64
- JSON blobs
- File names
- Long query strings
- Special characters in names, addresses, or comments
3) Tune by scope, not globally
Avoid disabling a rule everywhere if it only causes issues on one path.
Prefer:
- Per-URI exclusions
- Per-parameter exclusions
- Per-method exclusions
- Per-tenant/app exclusions
- Per-rule exceptions for known-safe patterns
Example:
- Allow SQLi rule exceptions on
/searchparameterqif it is repeatedly safe - Exempt file upload endpoints from some XSS-style inspections on multipart data if appropriate
4) Reduce sensitivity carefully
If your WAF uses thresholds or anomaly scoring:
- Raise the score required to block
- Keep detection enabled, but change some rules from “block” to “log”
- Tune individual rule thresholds instead of turning off the whole category
This is often better than disabling entire protections.
5) Exclude known-safe inputs
If a specific field is expected to contain characters that trigger signatures, add narrow exceptions:
- Allow HTML only in a
commentfield, but sanitize upstream - Allow long encoded strings in a
tokenfield - Allow special characters in a
filenameparameter if the application expects them
Be careful: exclusions should be as specific as possible.
6) Use positive security where possible
For application-specific endpoints, define what is expected:
- Allowed methods:
GET,POST, etc. - Allowed content types:
application/json,multipart/form-data - Allowed parameter names
- Expected parameter length/format
- IP allowlists for admin endpoints
This reduces dependence on generic signatures.
7) Validate against real false positives
For every rule you change, confirm:
- Why it triggered
- Whether the payload was truly safe
- Whether the exclusion is narrow enough
- Whether the endpoint might later accept malicious variants
Document each exception with:
- Reason
- Owner
- Date added
- Expiration/review date if possible
8) Review common false-positive sources
Common causes include:
- SQLi patterns matching legitimate text
- XSS patterns matching HTML snippets or product descriptions
- Command injection signatures matching shell-like strings in logs or commands
- XML/JSON parsers flagging nested structures
- Bot rules blocking legitimate crawlers or monitoring tools
- Geo/IP reputation rules blocking VPNs, CDNs, or corporate egress
9) Use staged rollout
When changing rules:
- Log-only
- Limited scope
- Partial block
- Full enforcement
This helps catch regressions before they affect users.
10) Keep a feedback loop with app owners
WAF tuning is easiest when developers or app owners can tell you:
- Which inputs are supposed to be flexible
- Which endpoints are sensitive
- Which clients are legitimate but unusual
- Which releases changed request formats
A new frontend or API release can suddenly create new false positives.
11) Don’t over-exempt
A common mistake is creating broad exclusions like:
- “Disable XSS for this whole site”
- “Skip all inspection for POST requests”
- “Bypass WAF for all traffic from this IP range”
These can create security gaps. Aim for the smallest safe exception.
12) Re-test after changes
After tuning:
- Re-run blocked samples
- Test normal user flows
- Check whether attack traffic is still detected
- Monitor alert volume for a few days
Simple tuning checklist
- Identify top false-positive rules
- Confirm affected endpoints/parameters
- Make narrow exceptions
- Prefer log-only before blocking
- Keep anomaly scoring where possible
- Document all changes
- Re-test and monitor
If you want, I can also give you:
- a vendor-neutral WAF tuning playbook,
- ModSecurity/OWASP CRS-specific tuning examples, or
- a checklist for reducing false positives in AWS WAF / Cloudflare / Akamai.