Web Application Firewall (WAF)
WAF protects your web application by monitoring HTTP and HTTPS traffic at Layer 7. It defends against common threats such as SQL injection and cross-site scripting by inspecting incoming traffic and ensuring that only legitimate requests reach your application.

Use Cases and Integrations
WAF actively protects exposed endpoints operating over HTTP or HTTPS. It integrates seamlessly with services including:- Amazon CloudFront (via a simple checkbox)
- API Gateway
- Application Load Balancer
- AWS AppSync
- AWS Cognito
- AWS App Runner
- AWS Verified Access

Components of WAF
WAF is composed of several key components managed via a centralized dashboard:- Web ACLs: Define rules to either allow, block, or count a request.
- Rule Groups: Collections of rules that can be custom-defined or sourced from managed rule groups available through AWS or the AWS Marketplace.
Each AWS resource can associate with only one Web ACL at a time, although a single ACL can protect multiple resources.

- IP address
- HTTP header information
- HTTP body content
- Size constraints
- Geo-match (to block or allow traffic from specific regions)
- Rate limits (e.g., requests per hour)




- IP reputation: Blocks traffic from known malicious sources.
- Fraud control: Prevents bot and malicious activity with CAPTCHA challenges.


AWS Shield
Transitioning to network-layer security, AWS Shield helps protect against Distributed Denial-of-Service (DDoS) attacks. DDoS attacks involve multiple compromised systems used by attackers to overwhelm services, often causing upset scaling costs. AWS Shield is available in two variants:- Shield Standard: A free service offered to all AWS accounts.
- Shield Advanced: A premium service that offers enhanced protection, access to the AWS security team, and automatic rule updates.

- UDP reflection attacks: Exploit the stateless nature of UDP by spoofing requests.
- TCP SYN floods: Create incomplete connections that drain system resources.
- DNS query floods: Overwhelm DNS servers, disrupting service.
- Layer 7 attacks: Overload web servers with traffic, even when auto-scaling is active.






Conclusion
WAF and AWS Shield together deliver comprehensive security for your infrastructure. Here is a summary of their roles:
By integrating WAF and Shield with AWS components like CloudFront, API Gateway, and various load balancers, you ensure robust security and maintain high availability under attack conditions. This layered defense strategy is essential for sustaining service uptime and controlling costs.
Thank you for reading this article.