rateBasedStatement property
A rate-based rule tracks the rate of requests for each originating IP address, and triggers the rule action when the rate exceeds a limit that you specify on the number of requests in any 5-minute time span. You can use this to put a temporary block on requests from an IP address that is sending excessive requests.
When the rule action triggers, AWS WAF blocks additional requests from the IP address until the request rate falls below the limit.
You can optionally nest another statement inside the rate-based statement, to narrow the scope of the rule so that it only counts requests that match the nested statement. For example, based on recent requests that you have seen from an attacker, you might create a rate-based rule with a nested AND rule statement that contains the following nested statements:
- An IP match statement with an IP set that specified the address 192.0.2.44.
- A string match statement that searches in the User-Agent header for the string BadBot.
You cannot nest a RateBasedStatement
, for example for use
inside a NotStatement
or OrStatement
. It can only
be referenced as a top-level statement within a rule.
Implementation
final RateBasedStatement? rateBasedStatement;