A company has a VPC with an Application Load Balancer (ALB) that distributes traffic to EC2 instances in private subnets. The ALB needs to be accessible from the internet. The security team requires that all traffic to the ALB be inspected by AWS WAF. Which configuration meets these requirements?
ALB supports AWS WAF integration for web traffic inspection.
Why this answer
AWS WAF can be directly associated with an Application Load Balancer (ALB) to inspect HTTP/HTTPS traffic before it reaches the ALB. Making the ALB internet-facing allows it to receive traffic directly from the internet while WAF provides the required traffic inspection. This combination meets both the accessibility and security requirements without additional components.
Exam trap
The trap here is that candidates may think CloudFront is always required for WAF integration, but AWS WAF can be directly associated with an internet-facing ALB without needing CloudFront.
How to eliminate wrong answers
Option B is wrong because AWS WAF cannot be directly attached to a Network Load Balancer (NLB); WAF only supports ALBs, API Gateway, CloudFront, and AppSync. Option C is wrong because a Security Group acts as a stateful firewall filtering traffic based on IP addresses and ports, but it does not perform application-layer inspection like WAF (e.g., SQL injection or XSS detection). Option D is wrong because while CloudFront with WAF can inspect traffic, it introduces an additional CDN layer that is not required by the question; the ALB itself can be directly associated with WAF without CloudFront.