AWS API Gateway with AWS WAF

I want to use the AWS Web Application Firewall service with the AWS API Gateway. AWS WAF only works with AWS CloudFront distributions.

According to this post https://forums.aws.amazon.com/message.jspa?messageID=677382, the Gateway API creates a CloudFront distribution behind the scenes. Although I do not see this distribution either in the CloudFront console or in the WAF console.

Can I use the CloudFront distribution created by the Gateway API for WAF?

+5
amazon-web-services amazon-cloudfront aws-api-gateway
source share
2 answers

Unfortunately no, the Gateway API does not provide access to the CloudFront distribution. To use WAF, you will have to create a second distribution that is inefficient, but must function.

+2
source share

Ok guys, I had a similar problem, what is the best thing you can do at this point,

there is an api gateway that completes SSL - make a call from Api Gateway to your alb, elb or nlb (it is better if it matches your architecture) - have alb protected by WAF with two sets of rules 1. a white list of all api ip gateways 2. have a header http accepted only by api gateway

in this way you keep your infrared to the limit.

if you have nlb, then you can have a direct link to NLB directly, keep in mind that NLB does not support route-based routing and application fault tolerance in the cross-zone

I asked AWS to raise a feature request for the same

+1
source share

All Articles