Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
robd003 opened this issue Oct 21, 2024 · 3 comments
Open

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

robd003 opened this issue Oct 21, 2024 · 3 comments
Assignees
Labels
kind/feature new feature

Comments

@robd003
Copy link

robd003 commented Oct 21, 2024

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:]
envoyproxy/envoy#31831
https://github.com/envoyproxy/envoy/releases/tag/v1.32.0

@robd003 robd003 added the triage label Oct 21, 2024
@zhaohuabing
Copy link
Member

zhaohuabing commented Oct 21, 2024

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 zhaohuabing added kind/feature new feature help wanted Extra attention is needed and removed triage labels Oct 21, 2024
@arkodg
Copy link
Contributor

arkodg commented Oct 21, 2024

+1 to a generic trustedCIDRs

@rudrakhp
Copy link
Contributor

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

@zirain zirain added kind/feature new feature and removed kind/feature new feature help wanted Extra attention is needed labels Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature new feature
Projects
None yet
Development

No branches or pull requests

5 participants