A global e-commerce company hosts its web application on Amazon EC2 instances behind an Application Load Balancer (ALB), utilizing Amazon CloudFront for content delivery. During a promotional event, the security team identifies a massive spike in HTTP POST requests targeting the `/login` endpoint from a distributed botnet. This Layer 7 traffic is bypassing cache and exhausting the compute capacity of the origin EC2 instances. The company needs to detect and block this application-layer attack at the edge before it reaches the backend infrastructure. Which solution should a solutions architect recommend?
- AConfigure stateless Network Access Control Lists (NACLs) on the ALB subnets to deny inbound traffic from the source IP addresses generating the HTTP POST requests
- Deploy AWS WAF on the Amazon CloudFront distribution and configure a rate-based rule targeting the `/login` pathAnswer
- CEnable AWS Shield Standard on the Amazon CloudFront distribution to automatically filter the Layer 7 HTTP POST requests
- DCreate an inbound rule in the Application Load Balancer's security group that denies traffic from the offending IP addresses on port 443
Answer
Deploy AWS WAF on the Amazon CloudFront distribution and configure a rate-based rule targeting the `/login` path
The correct solution is to deploy AWS WAF on the Amazon CloudFront distribution and create a rate-based rule for the `/login` path. AWS WAF operates at Layer 7 and is integrated with CloudFront at the AWS edge, allowing it to inspect HTTP/HTTPS request details like the request method (POST) and URI path. A rate-based rule tracks the number of requests originating from each IP address and blocks them once they exceed a defined threshold, effectively neutralizing the distributed botnet flood before the traffic reaches the backend ALB or EC2 origin.
Step-by-Step Solution
Key Concept
Edge protection against Layer 7 application DDoS attacks using AWS WAF and Amazon CloudFront
Estimated Time:1m 30s