-
Notifications
You must be signed in to change notification settings - Fork 715
preserving the client IP address #2252
Description
Description:
Currently, the gateway supports two methods for obtaining the client IP address (proxy protocol in the four-layer and x-forwarded-for in the seven-layer). But, I think some additional details need to be added.
-
proxy protocol
The Proxy protocol to enable Layer 4 listeners to retrieve client IP addresses. But currently gateway only supports http listener, we need to expand to support non-http/https scenarios.
feat: proxy protocol in ClientTrafficPolicy #2203 -
x-forwarded-for
x-forwarded-foris a layer-7 protocol method for saving client IP addresses. The current gateway also utilizes it for current limiting based on the source IP. But, source IP-based rate limiting in the gateway only supports direct connections to the gateway. To accommodate scenarios involving indirect connections to the gateway and obtain the correct client IP address, it may be necessary to introduce the xff_num_trusted_hops field. In multi-hop scenarios, it is important to note that the XFF header may be susceptible to forgery.

[optional Relevant Links:]
#946
https://github.com/envoyproxy/gateway/blob/0add22b8c58111606243e688611c63b96784cb75/api/v1alpha1/clienttrafficpolicy_types.go#L55C1-L58C15
#1328