WAF : forward client IP and port by http header

0

Hi ,

I want to use WAF to protect my application but I need to get client's IP and port for my application to work. I know that I can use X-Forwarded-For (XFF) header to get the client's IP but for port, I don't see any options for that. Would advice if there is any way for me to get the client Port data ? Many many thanks.

2 個答案
1
已接受的答案

yes it is related with which WAF are you using for example

In AWS WAF, when used with an Application Load Balancer, there is an attribute called routing.http.xff_client_port.enabled. When set to true, this attribute allows the X-Forwarded-For header to preserve the source port that the client used to connect to the load balancer. By default, this attribute is set to false​0\n\nIndicates whether the X-Forwarded-For header should preserve the source port that the client used to connect to the load balancer. The possible values are true and false. The default is false","pub_date":null}}​.

If you need to forward the client port to your application, you should set this attribute to true. This will cause the Application Load Balancer to include the client's source port in the X-Forwarded-For header, which can then be read by your application.

profile picture
專家
已回答 1 年前
0

This would depend on the underlying service calling WAF, rather than WAF itself. For example, for CloudFront, you could use the CloudFront-Viewer-Address header

AWS
專家
Paul_L
已回答 1 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南