A web application firewall is in place to protect public-facing web applications from outside threats.
WAF should be appropriately deployed and configured to appropriately block malicious traffic.
There should be a single Global WAF ACL set.
Recommended Solution:
Enable a Web Application Firewall (WAF) for all public-facing web applications. Configure it with standard security rulesets (e.g., OWASP Core Rule Set) to detect and block common attacks such as SQL injection, XSS, and request smuggling. Regularly update and tune the rules to minimize false positives.
Risks and Side Effects:
Implementing or tightening WAF rules may initially block legitimate traffic or cause application performance degradation if not tuned properly. Continuous monitoring and rule adjustments are required to balance security and usability.
How to Check if Affected Resources Handle Customer Data:
Review application documentation and data flow diagrams to determine which web applications process or serve customer data. Check whether endpoints behind the affected web servers are used for customer authentication, data input forms, or APIs that exchange customer information. If logs or configuration files reference customer databases or CRM integrations, those applications are considered to handle customer data.
In AWS, any internet-facing resource that serves web traffic or APIs should ideally be protected by a Web Application Firewall (WAF). Here’s a breakdown of the main AWS resources that should be behind WAF, depending on how your architecture is set up:
1. Amazon CloudFront Distributions
Why: CloudFront is often the first entry point for global web traffic. Applying WAF at this layer helps block malicious requests before they reach your origin servers.
Use case: Static websites, dynamic web applications, APIs, or content delivery networks (CDNs).
2. Application Load Balancers (ALB)
Why: ALBs route traffic to backend EC2 instances, containers, or Lambda functions. WAF at this level protects internal applications or microservices exposed to the internet.
Use case: Web apps, REST APIs, or services behind an ALB.
3. Amazon API Gateway
Why: API Gateway endpoints are public by default and can expose critical business logic. WAF helps prevent attacks like injection, scraping, and DoS attempts.
Use case: Public or partner-facing APIs.
4. AWS AppSync (GraphQL APIs)
Why: GraphQL APIs are vulnerable to overly complex queries and enumeration attacks. WAF can enforce query depth limits and request validation.
Use case: Mobile or web applications using GraphQL.
5. Amazon Cognito Hosted UI (optional)
Why: If you expose Cognito’s hosted UI for user sign-up or login, WAF can help protect against brute-force or injection attacks.
Use case: Authentication portals for customers or employees.
6. AWS Elastic Beanstalk Environments
Why: Beanstalk apps typically use an ALB or CloudFront. Apply WAF at the load balancer or CloudFront layer to protect the Beanstalk environment.
Use case: Managed web applications deployed through Elastic Beanstalk.
7. Public-Facing EC2 Instances (if not behind ALB)
Why: Directly exposed EC2 web servers are vulnerable entry points. A WAF can protect HTTP/HTTPS traffic through an AWS WAF-enabled CloudFront distribution or ALB placed in front.
Use case: Legacy applications or custom web servers.
Rule of Thumb
If the AWS resource:
- Accepts HTTP/HTTPS requests directly from the internet, and
- Handles customer data or serves data to customers
...then it should be behind AWS WAF (via CloudFront, ALB, or API Gateway integration).
AWS WAF Coverage Checklist
Here’s a short, practical checklist you can use to verify that all applicable AWS resources are protected by a WAF — either for internal compliance tracking (e.g., Drata) or automated auditing (e.g., AWS Config, Security Hub).
1. Identify Public-Facing Entry Points
List all CloudFront distributions, ALBs, API Gateways, and AppSync APIs.
Use the AWS CLI or console:
aws cloudfront list-distributions
aws elbv2 describe-load-balancers
aws apigateway get-rest-apis
aws appsync list-graphql-apis
Confirm which ones have a public DNS name or public IP (internet-facing).
2. Check for WAF Associations
For each CloudFront distribution, confirm it has an associated WAF WebACL:
aws wafv2 list-web-acls --scope CLOUDFRONT
For each Application Load Balancer:
aws wafv2 list-web-acls --scope REGIONAL
For each API Gateway or AppSync API:
aws wafv2 list-web-acls --scope REGIONAL
Verify that the WebACLs are actively associated with the resources above.
3. Review WAF Configuration
Ensure WAF WebACLs use AWS Managed Rules (e.g., AWSManagedRulesCommonRuleSet, SQLiRuleSet).
Check for custom rules or rate-based rules to block brute force or scraping.
Verify logging is enabled to CloudWatch Logs or S3 for auditability.
4. Confirm Coverage for Customer-Data Applications
Identify which web apps/APIs process customer data or serve data to customers (e.g., sign-in pages, dashboards, APIs).
Ensure those endpoints are behind a CloudFront or ALB with WAF enabled.
For internal-only services, document why WAF protection is not required (for audit traceability).
5. Ongoing Monitoring
Enable AWS Config rule: wafv2-webacl-resource-association-check
→ Automatically detects if CloudFront, ALB, or API Gateway resources lack WAF association.
Integrate findings into AWS Security Hub or Drata evidence collection for continuous compliance.