Blocking Malicious IPs with AWS WAF and CloudFront
Short answer
B Modify the configuration of AWS WAF to add an IP match condition to block the malicious IP address.
Question
Key Takeaways
The core concept tested is the granularity of deny rules in AWS security services, specifically that Security Groups only support allow rules while WAF supports explicit denies.
This question tests the correct configuration of AWS WAF to block specific IP addresses at the edge. The correct action is modifying the Web ACL associated with the CloudFront distribution.
Common mistake: Candidates often select Network ACLs or CloudFront settings because they are also entry points, failing to recognize that NACLs operate at the subnet/VPC level and do not inspect HTTP traffic headers like source IP in the same way WAF does for web apps.
Expert Analysis
Why the Answer Is Correct
AWS WAF (Web Application Firewall) is designed to filter web requests based on conditions such as IP addresses, HTTP headers, and body content. By creating an IP match condition in a Web ACL and associating it with the CloudFront distribution, you can explicitly block the malicious IP before it reaches the origin. This is the most effective and appropriate layer for blocking known bad actors targeting a web application.
Why the Other Options Are Wrong
Option A is incorrect because CloudFront distributions do not have Network ACLs; NACLs are associated with subnets in VPCs. Option C is incorrect because Network ACLs are stateless and operate at the subnet level, but more importantly, they are not the primary defense for web applications protected by WAF, and updating them requires knowing the specific subnet IDs. Option D is incorrect because Security Groups are stateful firewalls that only support allow rules; they cannot be used to create deny rules for specific IPs.
Community Comment Notes
Community consensus strongly favors option B. As noted by user 'FlyingHawk', "Security group for EC2 only supports allow rule, not deny rul" which immediately eliminates option D. User 'bujuman' confirmed that the direct blocking feature in the CloudFront console has been deprecated in favor of managing blocks via the Web ACL in WAFv2, reinforcing that B is the current operational standard.
Official Reference
https://docs.aws.amazon.com/waf/latest/developerguide/waf-rule-statement-type-ipset-match.html
This link opens the official vendor documentation in a new tab.
Exam Strategy
Always check if a security service supports 'deny' rules. If it's a Security Group, remember it's allow-only. For web application protection involving CloudFront or ALB, AWS WAF is the standard tool for IP-based blocking.
Frequently Asked Questions
Why can't I use Security Groups to block the IP?
Is WAF better than NACLs for this scenario?
Community Votes
100% of anonymous learners picked answer B. Votes are pick records left by other test-takers — they are not the verified answer.
Discussion 7 contributions
Compiled from public community threads and reader submissions, lightly edited for clarity. Handles and vote tallies are shown as recorded, and comments reflect the views of individual contributors.
From public community threads 7
-
mohammadthainat 👍 5 Answered Bin WAF you can define Web ACL (Web Access Control List) Rule: IP Set: up to 10,000 IP addresses – use multiple Rules for more IPs
-
bujuman 👍 4 Answered BThere was option from disttribution Security Tab ==> Request logs for the specified time range where someone could target an IP address and block it - which action won't do more than creating a block rule under the associated Web ACL- but function has vanished, i don't ask me why. So the only feasable option in WEBACLv2 is to go for an Ipset and ad a WebACL ip match block condition. I really liked the option A the first time i experimented it.
-
Sivaeas 👍 4 Answered BThe AWS WAF IP set match statement inspects the IP address of a web request against a set of IP addresses and address ranges. Use this to allow or block web requests based on the IP addresses that the requests originate from
-
xBUGx 👍 3 Answered AYou only need to block an IP. And Cloudfront is the first layer
-
FlyingHawk 👍 1 Answered BNetwork ACL is with VPC at subnet level, A and C are incorrect. security group for EC2 only supports allow rule, not deny rul, D is out. B is correct: https://docs.aws.amazon.com/waf/latest/developerguide/waf-rule-statement-type-ipset-match.html
Show 2 more comments
-
Salilgen 👍 1 Answered Bhttps://aws.amazon.com/blogs/security/how-to-enhance-amazon-cloudfront-origin-security-with-aws-waf-and-aws-secrets-manager/
-
Andy_09 👍 12Option B
Reader comments & corrections
No reader corrections yet — spotted an error or have a note? Share it below.
Related Analysis
Practice All SAA-C03 Questions
Access 120 questions with complete answers and detailed explanations.
View Full SAA-C03 Practice Test →