-
Notifications
You must be signed in to change notification settings - Fork 3.4k
envoy: Never use x-forwarded-for header, add for Cilium Ingress #25674
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
envoy: Never use x-forwarded-for header, add for Cilium Ingress #25674
Conversation
17e1d5c
to
541509c
Compare
541509c
to
8e05023
Compare
/test |
Envoy by default gets the source address from the `x-forwarded-for` header, if present. Always add an explicit `use_remote_address: true` for Envoy HTTP Connection Manager configuration to disable the default behavior. Also set the `skip_xff_append: true` option to retain the old behavior of not adding `x-forwarded-for` headers on cilium envoy proxy. Setting these options is not really needed for admin and metrics listeners, or most of the tests, but we add them there too in case anyone uses them as a source of inspiration for a real proxy configuration. This fixes incorrect hubble flow data when HTTP requests contain an `x-forwarded-for` header. This change has no effect on Cilium policy enforcement where the source security identity is always resolved before HTTP headers are parsed. Fixes: cilium#25630 Signed-off-by: Jarno Rajahalme <jarno@isovalent.com>
Do not skip adding `x-forwarded-for` in Cilium Ingress. Signed-off-by: Jarno Rajahalme <jarno@isovalent.com>
df3c23c
to
868dbe5
Compare
/test Job 'Cilium-PR-K8s-1.26-kernel-net-next' failed: Click to show.Test Name
Failure Output
Jenkins URL: https://jenkins.cilium.io/job/Cilium-PR-K8s-1.26-kernel-net-next/184/ If it is a flake and a GitHub issue doesn't already exist to track it, comment Then please upload the Jenkins artifacts to that issue. |
net-next hit known flake #24514 |
/test-1.26-net-next |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM ✅
Envoy by default gets the source address from the x-forwarded-for header, if present. Always add an explicit
use_remote_address: true
for Envoy HTTP Connection Manager configuration to disable the default behavior.Also add
skip_xff_append: true
config to keep the existing behavior of not addingx-forwarded-for
headers, except for Cilium Ingress, where we now useskip_xff_append: false
to explicitly append the source IP tox-forwarded-for
header so that Hubble flow records have a trace for the original source of the traffic traversing Cilium Ingress.Fixes: #25630