Skip to content

preserving the client IP address #2252

@tmsnan

Description

@tmsnan

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.

  1. 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

  2. x-forwarded-for
    x-forwarded-for is 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.
    client_ip drawio

[optional Relevant Links:]

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions