Skip to content

Allow clientIPGeoLocations without clientIPDetection.xForwardedFor #8955

@sboulkour

Description

@sboulkour

What would you like to be added?

Relax the clientIPGeoLocations validator so that ClientTrafficPolicy.spec.clientIPDetection is no longer mandatory. When omitted, EG should emit the geoip filter without xff_config / custom_header_config, letting Envoy fall back to its native default: the downstream connection source address (TCP peer).

No new CRD fields needed — only relaxing the check in validateAuthorizationGeoIP:

if clientIPDetection == nil {
    return nil, errors.New("authorization clientIPGeoLocations requires ClientTrafficPolicy.spec.clientIPDetection to be configured")
}

Why is this needed?

Envoy's HTTP geoip filter (proto) supports three IP-source modes:

  1. xff_config set → use XFF
  2. custom_header_config set → use a named header
  3. Neither set → use the downstream connection source address

EG today only exposes modes 1 and 2. Mode 3 — Envoy's own default and the correct behavior for L4-transparent topologies — is unreachable through any EG configuration.

This matters for setups behind L4-transparent load balancers that preserve the client source IP at TCP level and don't touch HTTP headers, e.g.:

  • AWS NLB with target-type: instance + externalTrafficPolicy: Local
  • Azure Standard Load Balancer (default behavior)

In these topologies the TCP peer is the real client IP. The current workaround — setting numTrustedHops: 1 purely to satisfy the validator — also opens an XFF spoofing window, since EG then asks Envoy to trust whatever the client puts in XFF.

Proposed solution

In validateAuthorizationGeoIP: accept nil clientIPDetection, and emit the geoip filter without xff_config / custom_header_config in that case. Operator intent is expressed by omission, mirroring raw Envoy config.

Environment

  • Envoy Gateway: v1.8.0-rc.1+
  • Topology: Client → AWS NLB / Azure Standard LB → Envoy Gateway → Backend

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions