1 Answer
- Newest
- Most votes
- Most comments
4
For mixed networks (Corporate + Public), relying solely on Source IP is no longer a best practice. Instead, use a multi-layered rate-limiting strategy using the following AWS WAF features:
1. Implement Composite Keys (IP + Header)
To distinguish between users behind a single corporate NAT/Proxy, configure your Rate-based Rules to use Custom Keys.
- Recommendation: Combine
IPwith a unique identifier like aSession-IDcookie,User-Agent, or anAuthorizationheader. - Result: AWS WAF tracks requests per unique user/browser session rather than per shared IP.
- -> https://aws.amazon.com/blogs/security/discover-the-benefits-of-aws-waf-advanced-rate-based-rules/
2. Path-Specific Granularity
A global limit is rarely sufficient. Apply different thresholds based on the URI:
- Public/Static Content: High threshold (e.g., 2,000 requests / 5 min).
- Sensitive Endpoints (Login/API): Low threshold (e.g., 100 requests / 5 min) using Scope-down statements.
3. Leverage AWS WAF Intelligent Threat Mitigation
If user identity isn't available via headers:
- WAF Tokens: Use the AWS WAF JavaScript SDK. This issues a unique cryptographic token to each legitimate client.
- Rate Limit by Token: Set rules based on the
TokenID. This effectively isolates individual devices, regardless of whether they share a corporate ASN or a mobile carrier IP. - -> https://docs.aws.amazon.com/waf/latest/developerguide/waf-tokens.html
4. Implementation Best Practice: "Count" Mode
Before enforcing any rule, deploy it in Count mode. Monitor your CloudWatch metrics to identify if legitimate corporate traffic spikes exceed your thresholds. Only switch to Block once you have verified the "Top 10 IP" report against your known user patterns.
see also:
Relevant content
- asked 10 months ago
- asked a year ago
- asked a year ago
