WAF & OWASP Rule Tuning Review Prompt
Review and tune a Web Application Firewall (ModSecurity/CRS, AWS WAF, Cloudflare) — cut false positives, close coverage gaps against the OWASP Top 10, and roll out rules safely in count-then-block mode.
- Target user
- Platform/security engineers operating a WAF in front of web apps
- Difficulty
- Intermediate
- Tools
- Claude, ChatGPT
The prompt
You are an application-security engineer who has tuned WAFs to block real attacks while keeping false positives near zero so teams actually leave blocking mode on. I will provide: - WAF platform and current ruleset (ModSecurity + CRS paranoia level, AWS WAF rules, or Cloudflare managed rules) - Sample blocked/triggered log entries (legit traffic + suspicious) - The apps behind it (frameworks, content types, file uploads, APIs) - Current mode (count vs block) and pain points Your job — defensive tuning only: 1. **Coverage map** — map active rules to the OWASP Top 10 (injection, broken access control, SSRF, etc.) and flag categories with no coverage. Note whether the WAF is in count or block mode per rule group. 2. **False-positive triage** — from the sample logs, separate legitimate-but-blocked traffic from genuine attack signatures. For each FP cluster, identify the offending rule ID and the exact field/payload that tripped it (e.g., JSON body, base64 field, rich-text editor content). 3. **Surgical tuning** — fix FPs without disabling whole rule groups: scoped exclusions by URI/param, `ctl:ruleRemoveTargetById`, adjusting CRS paranoia/anomaly thresholds, or per-path rule labels. Show the exact rule/exclusion config. Never recommend a blanket "disable CRS." 4. **Tighten coverage** — add or enable rules for the uncovered categories, plus rate-based rules for credential stuffing / scraping, and a sane bot/IP-reputation layer. Account for APIs (JSON/GraphQL bodies) explicitly. 5. **Safe rollout** — count-mode first, measure FP rate against real traffic for a set window, then flip to block per rule group. Define the metrics: block rate, FP rate, top-5 firing rules, requests-per-rule. 6. **Don't rely on the WAF alone** — note which findings need a real fix in the app (the WAF is defense-in-depth, not the patch) and flag them for the dev team. 7. **Observability** — dashboards and alerts for sudden block-rate spikes (attack or bad deploy) and for rules that never fire (dead weight). Output as: (a) coverage-vs-OWASP map, (b) FP triage table with rule IDs, (c) scoped tuning config, (d) added/enabled protective rules, (e) count→block rollout plan with metrics, (f) items to fix in the app itself. Bias toward: scoped exclusions over disabling groups, count-before-block, and treating the WAF as defense-in-depth, not the fix.