A company is deploying a web application on Amazon EC2 instances behind an Application Load Balancer (ALB). The ALB is internet-facing and receives traffic from clients. The company wants to improve security by adding an additional layer of protection against common web exploits like SQL injection and cross-site scripting. Which AWS service should they use?
Web application firewall that filters SQL injection and XSS.
Why this answer
AWS WAF (Web Application Firewall) is the correct service because it is specifically designed to protect web applications from common exploits such as SQL injection and cross-site scripting (XSS). It integrates directly with an Application Load Balancer (ALB) to inspect HTTP/HTTPS requests and apply customizable rules to block malicious traffic before it reaches the EC2 instances.
Exam trap
The trap here is that candidates often confuse AWS WAF with AWS Shield Advanced, mistakenly thinking Shield Advanced covers application-layer exploits, when in fact Shield Advanced focuses on volumetric DDoS protection and WAF handles Layer 7 threats like SQL injection and XSS.
How to eliminate wrong answers
Option A is wrong because AWS Firewall Manager is a centralized policy management service that helps manage AWS WAF, AWS Shield Advanced, and VPC security groups across accounts, but it does not itself inspect web traffic or block application-layer attacks. Option C is wrong because AWS Shield Advanced provides protection against Distributed Denial of Service (DDoS) attacks at the network and transport layers, not against application-layer exploits like SQL injection or XSS. Option D is wrong because Network ACLs are stateless packet filters that operate at the subnet level (Layer 3/4) and cannot inspect application-layer payloads or block specific HTTP request patterns.