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

fix(xforwarder): Set the remote proxy's IP to the HTTP request context when PROXY Protocol is enabled #10492

Open
wants to merge 1 commit into
base: v2.11
Choose a base branch
from

Conversation

andsarr
Copy link
Contributor

@andsarr andsarr commented Mar 3, 2024

What does this PR do?

When the PROXY Protocol is enabled, and the PROXY Header is sent, the XForwarded only sees the remote address contained on the PROXY Header since the go-proxyproto.Listener has already modified the connection (technically it just wraps it) in the TCP layer.
This means, that the XForwarded cannot determined if the remote proxy (the server connection to Traefik) is allowed to forward headers.

This PR makes the XForwarded aware of the PROXY Protocol. When a new HTTP connection is established, the IP of the proxy is added to the request context.

Motivation

Fixes 9757

More

  • Added/updated tests
  • Added/updated documentation

Additional Notes

@traefiker traefiker added this to the 2.11 milestone Mar 3, 2024
@andsarr andsarr changed the title fix(xforwarder): Set remote proxy IP to HTTP request context when PROXY Protocol is enabled fix(xforwarder): Set the remote proxy's IP to the HTTP request context when PROXY Protocol is enabled Mar 3, 2024
@juliens juliens self-assigned this Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants