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.

posta 3 anni fa839 visualizzazioni
1 Risposta
0
Risposta accettata

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
con risposta 3 anni fa
profile picture
ESPERTO
verificato 10 mesi fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande