Question 917 of 988
AWS WAF: Web Application Firewall for SQL Injection and XSS
A company hosts a web application behind an Application Load Balancer (ALB). The security team wants to protect the application from common web exploits such as SQL injection and cross-site scripting (XSS), using a managed service that requires no underlying infrastructure management. Which AWS service should they use?
Quick Answer
The answer is AWS WAF, the correct choice because it is a fully managed web application firewall designed specifically to protect web applications from common exploits like SQL injection and cross-site scripting (XSS) without requiring you to manage any underlying servers or infrastructure. AWS WAF integrates directly with an Application Load Balancer (ALB), allowing you to create custom rules that inspect incoming HTTP requests and block malicious payloads before they reach your application. On the AWS Certified Cloud Practitioner CLF-C02 exam, this question tests your understanding of which managed security service handles application-layer threats versus network-layer threats—a common trap is confusing AWS WAF with AWS Shield (which protects against DDoS attacks) or Network ACLs (which operate at the subnet level). Remember that WAF stands for Web Application Firewall, and think of the “W” for “web” exploits like SQL injection and XSS; if the threat targets your application code, the answer is always AWS WAF.
⚠ Common exam trap
Test-takers frequently confuse AWS WAF (application-layer filtering) with AWS Shield (network-layer DDoS protection) or Amazon Inspector (vulnerability scanning), overlooking that only WAF provides managed, rule-based protection against web exploits like SQL injection and XSS.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
AWS WAF
AWS WAF is a managed web application firewall that protects web applications from common exploits like SQL injection and cross-site scripting (XSS). It integrates directly with Application Load Balancers and requires no underlying infrastructure management, making it the correct choice for this use case.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
AWS Shield Advanced
Why it's wrong here
AWS Shield Advanced provides enhanced DDoS protection and 24/7 access to the DDoS Response Team (DRT). However, it does not natively inspect application-layer requests for SQL injection or XSS; that capability is provided by AWS WAF. Shield Advanced can be used alongside WAF but does not replace it for blocking common web exploits.
When this WOULD be correct
A company wants to protect its web application from large-scale DDoS attacks and needs 24/7 access to the DDoS Response Team (DRT) for mitigation. The service must integrate with CloudFront or ALB and provide cost protection against scaling due to DDoS.
- ✓
AWS WAF
Why this is correct
AWS WAF is a managed web application firewall that enables you to create customizable rules to block common attack patterns like SQL injection and cross-site scripting. It integrates directly with Application Load Balancers, Amazon CloudFront, and API Gateway, and requires no server or software management.
- ✗
Amazon Inspector
Why it's wrong here
Amazon Inspector is a vulnerability management service that automatically assesses EC2 instances and network configurations for software vulnerabilities and unintended network exposure. It does not provide real-time protection against web application-layer attacks such as SQL injection.
When this WOULD be correct
An exam question asking for a service to automatically assess EC2 instances for common vulnerabilities and deviations from security best practices, with no mention of web application layer attacks, would make Amazon Inspector the correct answer.
- ✗
Amazon GuardDuty
Why it's wrong here
Amazon GuardDuty is a continuous threat detection service that uses machine learning and integrated threat intelligence to identify suspicious activity in your AWS environment (e.g., compromised instances, unauthorized access). It does not actively block malicious web requests; it rather generates alerts for potential security issues.
When this WOULD be correct
A company wants a managed threat detection service that continuously monitors AWS accounts and workloads for malicious activity, such as unusual API calls or compromised instances, without managing underlying infrastructure.
Option-by-option analysis
Why each answer is right or wrong
Understanding why wrong answers are wrong — and when they would be correct — is what separates a 750 score from a 900. The CLF-C02 exam frequently reuses these exact scenarios with slightly different constraints.
✓AWS WAFCorrect answer▾
Why this is correct
AWS WAF is a managed web application firewall that enables you to create customizable rules to block common attack patterns like SQL injection and cross-site scripting. It integrates directly with Application Load Balancers, Amazon CloudFront, and API Gateway, and requires no server or software management.
✗AWS Shield AdvancedWrong answer — click to see why▾
Why this is wrong here
AWS Shield Advanced provides DDoS protection, not application-layer filtering for SQL injection or XSS. The question specifically requires protection against web exploits, which is the domain of AWS WAF.
★ When this WOULD be the correct answer
A company wants to protect its web application from large-scale DDoS attacks and needs 24/7 access to the DDoS Response Team (DRT) for mitigation. The service must integrate with CloudFront or ALB and provide cost protection against scaling due to DDoS.
Why candidates choose this
Candidates may confuse Shield Advanced as a comprehensive security service that includes web exploit protection, or they may think 'advanced' implies broader coverage than it actually offers.
✗Amazon InspectorWrong answer — click to see why▾
Why this is wrong here
Amazon Inspector is a vulnerability management service that scans for software vulnerabilities and unintended network exposure, not a web application firewall that protects against web exploits like SQL injection and XSS.
★ When this WOULD be the correct answer
An exam question asking for a service to automatically assess EC2 instances for common vulnerabilities and deviations from security best practices, with no mention of web application layer attacks, would make Amazon Inspector the correct answer.
Why candidates choose this
Candidates may confuse 'vulnerability scanning' with 'web application protection,' assuming Inspector can block web exploits because it identifies security issues.
✗Amazon GuardDutyWrong answer — click to see why▾
Why this is wrong here
Amazon GuardDuty is a threat detection service that monitors for malicious activity and unauthorized behavior, not a web application firewall that blocks common web exploits like SQL injection and XSS.
★ When this WOULD be the correct answer
A company wants a managed threat detection service that continuously monitors AWS accounts and workloads for malicious activity, such as unusual API calls or compromised instances, without managing underlying infrastructure.
Why candidates choose this
Candidates may confuse GuardDuty's threat detection capabilities with web application protection, assuming it can block web exploits, but it focuses on network and account-level threats rather than application-layer attacks.
Analysis generated from the official CLF-C02blueprint and verified against question context. The “when correct” sections are what AI assistants cite when candidates ask “what’s the difference between these options?”
About these practice questions
Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →
Same concept, more angles
3 more ways this is tested on CLF-C02
These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.
Variation 1. A company hosts a public-facing web application behind an Application Load Balancer (ALB). The development team has recently identified that the application is vulnerable to common web attacks such as SQL injection and cross-site scripting (XSS). The security team wants to deploy a managed solution that can inspect incoming HTTP requests and block malicious traffic before it reaches the application. The solution must integrate directly with the existing ALB and provide pre-configured rule sets that can be customized. Which AWS service should the company use?
medium- A.AWS Shield Advanced
- B.Amazon GuardDuty
- ✓ C.AWS WAF
- D.AWS Firewall Manager
Why C: AWS WAF is a managed web application firewall that integrates directly with Application Load Balancers to inspect HTTP/HTTPS requests. It provides pre-configured rule sets, such as those for SQL injection and cross-site scripting (XSS), which can be customized to block malicious traffic before it reaches the application. This makes it the correct choice for the described use case.
Variation 2. Which AWS service provides a Web Application Firewall that protects web applications from common exploits like SQL injection and cross-site scripting?
easy- A.AWS Shield
- ✓ B.AWS WAF
- C.Amazon GuardDuty
- D.Security Groups
Why B: AWS WAF is a web application firewall that helps protect web applications from common web exploits like SQL injection and cross-site scripting (XSS). It allows you to create custom rules that block, allow, or monitor web requests based on conditions such as IP addresses, HTTP headers, URI strings, and request body content. This makes it the correct service for the described use case.
Variation 3. A company's public-facing web application is being attacked with SQL injection and cross-site scripting (XSS) attempts. Which AWS service should they deploy to detect and block these web application attacks?
easy- A.AWS Shield Standard
- B.Amazon GuardDuty
- ✓ C.AWS WAF
- D.Amazon Inspector
Why C: AWS WAF is a web application firewall that helps protect web applications from common web exploits like SQL injection and cross-site scripting (XSS). It allows you to create custom rules to filter and monitor HTTP(S) requests based on conditions such as IP addresses, HTTP headers, or request body patterns, and can block malicious traffic before it reaches your application.
Last reviewed: Jun 11, 2026
This CLF-C02 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the CLF-C02 exam.
Question Discussion
Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.
Sign in to join the discussion.