solution to throttle the Traffic On ALB

0

I am looking for a solution to throttle the Traffic On ALB if it reaches some number I have WAF integrated with ALB but WAF can throttle traffic from single IP.

asked 3 years ago822 views
1 Answer
0
Accepted Answer

This solution is specific to traffic which is consuming the CloudFront distribution and ALB configured as origin which is integrated with WAF seems that's the case in your design.
In CloudFront configuration you need to add the custom header for example X-Forwarded-For header with value (IP address) 1.1.1.1, this configuration will inject X-Forwarded-For = 1.1.1.1 in all the packets traversing over CF towards origin.
Now you can configure rate-based policy on the WAF. Set a rate threshold to inspect the Client IP Address in the "X-Forwarded-For" HTTP header in the request forwarded from CloudFront to Origin ALB. The Rate Based Rule will use the first IP address in the header "X-Forwarded-For" to decide the Rate Threshold breach per Client IP Address.

For more information on configuring Rate Limiting based on XFF header please refer the documentation:
https://docs.aws.amazon.com/waf/latest/developerguide/waf-rule-statement-type-rate-based.html

For e.g:
Rate Threshold: 10000 Requests/5 mins
Aggregate Key: IP address in header
Header field name: X-Forwarded-For
Fallback for missing IP address: MATCH
Action: BLOCK

Thanks

AWS
abhdey
answered 3 years ago
profile picture
EXPERT
reviewed 10 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions