简体   繁体   English

如何设置 AWS ELB 阻止来自给定 IP 的过多查询?

[英]How can I set AWS ELB block too many queries from a given IP?

We have had issues where one IP makes hundreds of requests to our servers, resulting in an overloaded RDS database.我们遇到过一个问题,即一个 IP 向我们的服务器发出数百个请求,从而导致 RDS 数据库过载。 Is there a way to set our AWS ELB to block in the case of this DOS-like behavior?在这种类似 DOS 的行为的情况下,有没有办法将我们的 AWS ELB 设置为阻止?

Well, this is a very old post but you can do it with AWS WAF, you just need to attach an ACL to your ELB and set a rate limit rule like in the image:嗯,这是一篇很老的帖子,但您可以使用 AWS WAF 来完成,您只需要将 ACL 附加到您的 ELB 并设置速率限制规则,如图所示: 在此处输入图片说明

I hope this helps someone in the future, I had a really big problem an this solved it for me.我希望这对将来的某人有所帮助,我遇到了一个非常大的问题,这为我解决了。

You could block the IP with an ACL rule on the VPC.您可以在 VPC 上使用 ACL 规则阻止 IP。

http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_ACLs.html http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_ACLs.html

What you are asking for is rate limit at ELB.您要求的是 ELB 的速率限制。 Unfortunately AWS does not provide rate limit for ELB.不幸的是,AWS 没有为 ELB 提供速率限制。

ELB Rate Limiting and IP Rules ELB 限速和 IP 规则

ELB does not support that, as mentioned by helloV.正如 helloV 所提到的,ELB 不支持这一点。 You can do that on the NGINX level: https://www.nginx.com/blog/rate-limiting-nginx/ .您可以在 NGINX 级别执行此操作: https ://www.nginx.com/blog/rate-limiting-nginx/。

If you have any piece of code as a lambda, API Gateway supports rate limiting (or throttling): https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-request-throttling.html如果您有任何一段代码作为 lambda,API Gateway 支持速率限制(或节流): https : //docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-request-throttling.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM