
Here is the official Documentation for AWS WAF and API Gateway.

We hope this article has been informative and helpful in getting started with AWS WAF and API Gateway. With a wide range of pre-configured rules and the ability to create custom rules, AWS WAF provides a powerful and flexible solution for protecting web applications. Use AWS WAF to control how an Amazon CloudFront distribution, an Amazon API Gateway REST API, an Application Load Balancer, or an AWS AppSync GraphQL API. Finally, we integrated AWS WAF with API Gateway and tested the setup by simulating an attack.īy using AWS WAF with API Gateway, you can add an additional layer of security to your API and protect it from various web attacks. We started by creating an HTTP API on API Gateway, followed by creating an AWS WAF Web ACL to define our rules for protecting the API. In this article, we explored how to use AWS WAF to protect an HTTP API on API Gateway from web attacks. If the setup is working correctly, you should see an error message indicating that the request has been blocked by AWS WAF.In the URL, append the following code snippet to simulate an SQL injection attack:.This is sufficient to repel basic DOS attacks where all the requests originate from a handful of IP addresses.

With AWS WAF, you can create rate-based rules that rate limits at the IP level. You can do this in the API Gateway stage settings.
