Re:Application-Layer DDoS Attack Protection with HAProxy
by idealhavoc on Friday November 09, 2018 @05:38PM
(#18418643)
In our maps blog post we have a section where we talk about applying different rate limits for different paths (https://www.haproxy.com/blog/introduction-to-haproxy-maps/#r...). For this I'd change the path fetch to a req.hdr(authorization) (or however you send API keys) to limit per API key. You could also add a 20/second with another stick table using the methods in this DDoS post (just with a string key to store API key rather than ip/src to store the IP address).
You can put HAProxy directly on a box running another service to provide protection/reporting if you don't want to replace or add HAProxy to your ELB's (though sometimes that just adds too much complexity), we also talk about using HAProxy and ELB in our AWS blog post (https://www.haproxy.com/blog/haproxy-amazon-aws-best-practic...).
Re:Application-Layer DDoS Attack Protection with HAProxy
by rogerdonut on Friday November 09, 2018 @09:55PM
(#18419666)
You might want to check out this post on using HAProxy as an API Gateway:
https://www.haproxy.com/blog/using-haproxy-as-an-api-gateway...
It has a section on rate limiting. Specifically check out the section which starts with the sentence: "Optionally, instead of a daily limit as used above, you can also do it based on the rate of the requests."
At the moment, I'm using AWS and Elastic Load Balancer so, I'm just thinking HAProxy just doesn't fit well within the existing network layout.
Additionally, i'm not sure if I should just be solving this with a simple nginx/redis lua script. If you have any recommendations I'd love to hear how other people solve this rate limiting/throttling problem.
Even if HAproxy isn't suitable, I'd like to hear the "HAProxy" solution for it...