Why WAF Matters
A Web Application Firewall inspects HTTP traffic before it reaches your application. It blocks malicious requests at the edge — SQL injection, XSS, DDoS floods — before they ever hit your EC2/EKS workloads.
Core Rule Groups I Applied
1. AWS Managed Rules
resource "aws_wafv2_web_acl" "main" {
name = "prod-waf"
scope = "REGIONAL"
rule {
name = "AWSManagedRulesCommonRuleSet"
priority = 1
override_action { none {} }
statement {
managed_rule_group_statement {
name = "AWSManagedRulesCommonRuleSet"
vendor_name = "AWS"
}
}
}
}
2. Rate Limiting
We capped requests at 2000 per 5 minutes per IP to neutralize brute force and credential stuffing.
3. Geo-blocking
Blocked traffic from regions we don't operate in, reducing noise by ~40%.