Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to protect AWS API gateway endpoint from DDos attack?

Recently I have been working with AWS API gateway where I created an API and protected it with API key and Cognito (OAuth).

One day I found that my API has been accessed 10K times which failed because of attacker didn't had the access to it.

My question is : Does Amazon charge for such api calls which are unauthorized? If they charge then how to protect it. As I understand even if I put WAF in front it my API url will still be exposed ....

Any help is appreciated...

like image 815
Lalit Kumar Avatar asked Jul 19 '18 06:07

Lalit Kumar


People also ask

How do I protect my gateway API endpoint?

You can protect your API using strategies like generating SSL certificates, configuring a web application firewall, setting throttling targets, and only allowing access to your API from a Virtual Private Cloud (VPC).

How do I protect my API from DDoS?

Using an access control framework, such as OAuth, you control the list of APIs that each specific API key can access. To prevent a massive amount of API requests that can cause a DDoS attack or other misuse of the API service, apply a limit to the number of requests in a given time interval for each API.

What type of firewall can be used in conjunction with API gateway to help prevent DDoS attacks?

AWS Shield and AWS Shield Advanced.


1 Answers

If you protect your endpoint with the following authorization types: AWS_IAM, CUSTOM, and COGNITO_USER_POOLS, API Gateway will not be charged for failed requests. Please reference the Pricing Documentation. Also reference Secure AWS API Gateway with Lambda Integration

like image 54
KiteCoder Avatar answered Oct 19 '22 05:10

KiteCoder