How to Set Up AWS WAF for Web Application Protection
Complete guide to AWS WAF configuration including managed rules, rate limiting, bot protection, custom rules, and integration with CloudFront, ALB, and API Gateway for comprehensive web application security.
10 min readUpdated 2026-01-13
AWS WAF (Web Application Firewall) protects your web applications from common web exploits, bots, and DDoS attacks. It filters malicious traffic before it reaches your application, providing protection against SQL injection, cross-site scripting (XSS), and other OWASP Top 10 vulnerabilities.
This article is part of our comprehensive Cloud Security Tips for 2026 guide covering essential practices for protecting your cloud environment.
AWS WAF pricing has three components. Web ACL costs $5 per month per Web ACL. Each rule costs $1 per month per rule. Request charges are $0.60 per million requests evaluated. Managed rule groups from AWS or Marketplace have additional subscription fees, typically $1-20 per month depending on the rule set. Bot Control adds $10 per month plus $1 per million requests. For most applications, expect $20-50 per month for basic protection with managed rules.
AWS WAF v2 is the current version with significant improvements. It supports WAF capacity units (WCUs) for rule limits instead of rule counts. You can use managed rule groups from AWS or Marketplace. It has better console experience and easier rule creation. WAF v2 also adds features like rate-based rules, regex pattern sets, and IP sets. AWS WAF Classic is legacy and should be migrated to v2. New deployments should always use AWS WAF v2.
AWS WAF is best for native AWS integration, pay-as-you-go pricing, and when you have security expertise to configure rules. Third-party WAFs like Cloudflare, Imperva, or F5 offer more advanced threat intelligence, specialized security teams managing rules, and features like bot detection or API security that go beyond AWS WAF capabilities. Consider third-party WAFs for high-security applications, when you lack WAF expertise, or need features like advanced bot management.
Use the Count action instead of Block when first deploying rules. Count mode logs matching requests without blocking them. Monitor CloudWatch metrics and WAF logs to understand what traffic would be blocked. Analyze false positives by reviewing sampled requests in the console. Once confident in the rule behavior, switch from Count to Block. This testing period typically takes 1-2 weeks for new rules.
Start with AWS Managed Rules Core Rule Set (AWSManagedRulesCommonRuleSet) which covers OWASP Top 10 vulnerabilities. Add the Known Bad Inputs rule set for blocking known exploit patterns. Enable SQL database protection if you use databases. Add Admin Protection if you have admin panels. For bot traffic, start with Bot Control which identifies and categorizes bot traffic. Enable IP reputation rules to block known malicious IP addresses. These provide baseline protection for most applications.
Need Professional Help?
Our team of experts can help you implement and configure these solutions for your organization.