gateway icon indicating copy to clipboard operation
gateway copied to clipboard

Allow setting of trusted CIDR blocks for X-Forwarded-For

Open robd003 opened this issue 1 year ago • 1 comments

Description: Last week Envoy just released support for trusted CIDR blocks when processing X-Forwarded-For headers.

It would be really useful to have a default configuration mode called "cloudflare" which would automatically load the IP ranges from these two dynamically updated lists:

Cloudflare IPv4 CIDR blocks: https://www.cloudflare.com/ips-v4/ Cloudflare IPv6 CIDR blocks: https://www.cloudflare.com/ips-v6/

[optional Relevant Links:] https://github.com/envoyproxy/envoy/pull/31831 https://github.com/envoyproxy/envoy/releases/tag/v1.32.0

robd003 avatar Oct 21 '24 05:10 robd003

A knob for configuring CIDR can be added to the ClientTrafficPolicySpec.ClientIPDetection.XForwardedForSettings,

NumTrustedHops: 2
TrustedCIDRs:
  - 173.245.48.0/20
  - 103.21.244.0/22

Given that the IP lists are updated only once a year, I believe it’s reasonable to just manually update the CTP whenever Cloudflare makes changes. cc @envoyproxy/gateway-maintainers

zhaohuabing avatar Oct 21 '24 06:10 zhaohuabing

+1 to a generic trustedCIDRs

arkodg avatar Oct 21 '24 17:10 arkodg

@arkodg I would like to contribute to this, please assign if help wanted. Thanks!

rudrakhp avatar Oct 23 '24 03:10 rudrakhp

This issue has been automatically marked as stale because it has not had activity in the last 30 days.

github-actions[bot] avatar Dec 22 '24 04:12 github-actions[bot]

Can we keep this open until the code is actually released (1.3.0?) with documentation?

robd003 avatar Dec 22 '24 05:12 robd003

This issue has been automatically marked as stale because it has not had activity in the last 30 days.

github-actions[bot] avatar Feb 07 '25 04:02 github-actions[bot]

@arkodg do we have anything pending in this issue?

rudrakhp avatar May 17 '25 13:05 rudrakhp

@rudrakhp are we tracking the regression associated with losing out on X-Envoy-Internal-Address anywhere ?

arkodg avatar May 19 '25 22:05 arkodg