如何保护AWS API网关终端节点免受DDos攻击?

时间:2018-07-19 06:49:31

标签: amazon-web-services aws-api-gateway

最近,我一直在使用AWS API网关来创建API,并使用API​​密钥和Cognito(OAuth)保护它。

有一天,我发现我的API被访问了1万次,因为攻击者无法访问它而失败。

我的问题是:亚马逊是否会对未经授权的此类api调用收费?如果他们收费,那么如何保护它。据我了解,即使我将WAF放在前面,我的API网址也仍然会公开....

感谢您的帮助...

2 个答案:

答案 0 :(得分:4)

如果您使用以下授权类型保护终端节点:AWS_IAM,CUSTOM和COGNITO_USER_POOLS,则对于失败的请求,将不向API网关收费。请参考Pricing Documentation。另请参考Secure AWS API Gateway with Lambda Integration

答案 1 :(得分:3)

您所描述的是一种java.io.IOException: Failed to connect to /172.x.x.x:33898攻击。

这是您需要采取的措施,以保护DDoS免受API Gateway Endpoint的攻击。<​​/ p>

DDoS

您仍然需要使用1) Create your API 2) Setup CloudFront distribution to your API 3) Front your CloudFront distribution with AWS WAF. 4) Create ACL rule and set requester limit to what you deem appropriate. 5) Test. AWS_IAM来执行授权部分。

这是详细说明步骤的文档:

https://aws.amazon.com/blogs/compute/protecting-your-api-using-amazon-api-gateway-and-aws-waf-part-i/