AWS WAF is a firewall service for monitoring our web traffic. Unlike security groups and NACLs, which only check for ports and IP addresses, AWS WAF can find malicious content that can lead to common attacks such as SQL injection and cross-site scripting. Currently, we can only use WAF with API Gateway, CloudFront, and application load balancers. This cannot be used directly with services such as EC2 or Route 53.
Configuring and using the AWS web application firewall (WAF)
Getting ready
To create a WAF with a CloudFront distribution, we need to create a CloudFront distribution over an S3 bucket by following the Securing S3 using CloudFront and TLS recipe of this chapter.
We can use WAF with CloudFront distributions, application...