Using a WAF
AWS WAF (short for Web Application Firewall) is a firewall service for monitoring our web traffic. Unlike security groups and network ACLs (NACLs), which only check for ports and IP addresses, AWS WAF can find content matched against predefined signatures that can help detect common attacks, such as SQL injection and cross-site scripting. Currently, we can only use WAF with API Gateway, CloudFront, and ALBs. It cannot be used directly with services such as EC2 or Route 53.
AWS WAF can be used with CloudFront distributions, ALBs, and API Gateway, each having unique characteristics affecting WAF usage. CloudFront is global, meaning WAF rules apply uniformly across all Regions, providing consistent protection for global applications. In contrast, ALBs and API Gateway are regional, so WAF rules must be configured for each region separately, allowing for tailored security policies but increasing management overhead. Using CloudFront with WAF is simpler and can reduce latency...