Generate Web Application Firewall rules for AWS WAF, Azure WAF, or Cloudflare to protect against OWASP Top 10.
Act as a web security engineer. Generate WAF rule configurations to protect a web application against common attacks. ## Input Parameters - **WAF Provider**: [PROVIDER] (AWS WAF v2 / Azure Front Door WAF / Cloudflare WAF) - **Application Type**: [APP_TYPE] (REST API / GraphQL / Web App / E-commerce) - **Threat Model**: [THREATS] (OWASP Top 10 / bot protection / DDoS / all) - **IaC Format**: [IAC] (Terraform / CloudFormation / Bicep / API calls) - **Sensitivity**: [SENSITIVITY] (high / medium / low false-positive tolerance) ## Generate Rules For 1. **SQL Injection**: Pattern matching for union-based, blind, and error-based SQLi. 2. **XSS**: Script tag detection, event handler attributes, encoded payloads. 3. **Path Traversal**: Directory traversal patterns, null bytes. 4. **SSRF**: Internal IP range blocking, metadata endpoint protection (169.254.169.254). 5. **Rate Limiting**: Per-IP, per-endpoint, and login-specific rate limits. 6. **Bot Management**: Good bot allowlist (Googlebot, etc.), bad bot signatures, CAPTCHA challenge. 7. **Geo-blocking**: Country-based rules (if applicable). 8. **Request Size Limits**: Body size, header count, query string length. 9. **IP Reputation**: Integration with threat intelligence feeds. 10. **Custom Rules**: Application-specific patterns (e.g., API key format validation). ## Configuration - Rule priority ordering for correct evaluation. - Logging configuration for blocked requests. - Count mode rules for monitoring before blocking. - Exceptions/allowlists for known false positives. - Metric publishing for dashboard integration. ## Output Format Return WAF rules in the chosen IaC format with inline comments. Include a rule evaluation order diagram and a testing guide with sample malicious payloads.
Free to copy and use. Compatible with Claude 4 Opus, GPT-5, Gemini 2.5 Pro.
Choose your WAF provider, application type, and threat model. Start in count mode to identify false positives before switching to block mode.
Initial release
Sign in and download this prompt to leave a review.