xff: add support for configuring a list of trusted CIDRs (#31831)
Commit Message: xff: add support for configuring a list of trusted CIDRs The original client IP address can be determined from the x-forwarded-for header either by a fixed number of trusted hops, or by evaluating the client IP address against a list of trusted addresses. This adds support for configuring a list of CIDRs in the xff original IP detection extension. The remote IP address is evaluated against these, and optionally recurses through XFF to find the last non-trusted address. Additional Description: This feature is generally used by people with a CDN in front of their edge proxy to ensure that XFF is only parsed when the remote connection comes from a CDN server. The behaviour of the new functionality should be the same as Nginx's `realip` module. Disclaimer: This is my first time writing C++ so I'm not certain my changes are completely idiomatic, but I've tried to stick with existing style in the codebase. Feedback very welcome! Risk Level: Medium Testing: Unit tests, manual tests Docs Changes: Updates to HTTP Connection Manager header manipulation docs, and proto docs. Release Notes: Added to changelogs/current.yaml Platform Specific Features: None Fixes #21639 Relates to #31296 --------- Signed-off-by: James O'Gorman <james@netinertia.co.uk> Mirrored from https://github.com/envoyproxy/envoy @ fbc6ee2ed5b858c842999c688504fd133008868amain
parent
97eaaf4b9b
commit
21d8442732
2 changed files with 48 additions and 1 deletions
Loading…
Reference in new issue