You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rate limit one specific IP that is constantly hammering one specific target domain (target_per_ip).
Rate limit one specific IP that is constantly hammering any target domain (per_ip)
Rate limit one specific target domain whois is constantly hammered by any source IP (per_target)
When doing some tests for exemple with ab from a remote host and some agressive parameters, the first rate limit to trigger is target_per_ip which is correct.
My question is; as soon as the request hits one of the limit, in this example per_ip and is returned with a 429, the other zones counters seems to increase even if the request is denied with a 429.
In the end the "attacker" blocked with 429 in previous zones is able to trigger a 429 returnet to anyone else trying to visit the target domain even it's own request are 429'ed.
Is there some kind of zone ordering, or some way to define that a request already returned with a 429 because it exceed a zone doesn't increase the other zones counters ?
I'm not sure if my question is correctly asked :)
Side question:
I'm using {client_ip} in the placeholder because it should be populated by real client IP from trusted proxies (for example Cloudflare IP ranges). Is this a right way to do it ? Will the trusted proxies replace client_ip with the real IP before rate limit is checked ?
We define them this way (with modules to automatically get cloudflare IP ranges)
Yes, it's what I am experiencing. I was not expecting a request being blocked by one of the zone still being counted as a hit in the other zones.
It's probably by design and I am doing it wrong to achieve what I try to do.
It seems to me that an attacker being rate limited by the per_ip zone and getting returned with a 429 http code still increases the other per_target zone even if the request is not served.
Hmm, that is odd if that's really what's happening. While iterating the zones, we return immediately at the first one that is exceeded. They are sorted by order of how restrictive they are (in terms of events per window).
Hello,
First, I would like to thank you for this amazing module !
I recently did some tests with it and I have some questions about multi zone handling. I've this configuration:
What I'm trying to achieve is:
When doing some tests for exemple with
ab
from a remote host and some agressive parameters, the first rate limit to trigger istarget_per_ip
which is correct.Then after a few seconds it triggers the second
per_ip
limit which is a bit more tolerantAnd finally it triggers the third limit
per_target
which is even more tolerantMy question is; as soon as the request hits one of the limit, in this example
per_ip
and is returned with a 429, the other zones counters seems to increase even if the request is denied with a 429.In the end the "attacker" blocked with 429 in previous zones is able to trigger a 429 returnet to anyone else trying to visit the target domain even it's own request are 429'ed.
Is there some kind of zone ordering, or some way to define that a request already returned with a 429 because it exceed a zone doesn't increase the other zones counters ?
I'm not sure if my question is correctly asked :)
Side question:
I'm using {client_ip} in the placeholder because it should be populated by real client IP from trusted proxies (for example Cloudflare IP ranges). Is this a right way to do it ? Will the trusted proxies replace client_ip with the real IP before rate limit is checked ?
We define them this way (with modules to automatically get cloudflare IP ranges)
Thanks a lot for your time reading and the feedback !
Kind regards
The text was updated successfully, but these errors were encountered: