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

Proxy protocol support #10645

Closed
strainovic opened this issue May 30, 2019 · 5 comments
Closed

Proxy protocol support #10645

strainovic opened this issue May 30, 2019 · 5 comments
Labels
area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions

Comments

@strainovic
Copy link

Is your feature request related to a problem? Please describe.

I have Kubernetes Cluster with NginX Reverse proxy in a front of worker nodes. Some of my services require Mutual TLS and I setup SSL Pass-trough on NginX Reverse proxy and on Kubernetes Ingress Controller (also NginX). When request hits my services (Kestrel web server), remote (source) IP is IP address of Kubernetes Ingress Controller but not original client IP. It creates me a problem as I need to check ACL based on client IP address. Enabling proxy protocol on both of NginX services I'm able to deliver original client IP to Kestrel but Kestrel at the moment doesn't know to speak proxy protocol in order to get original client IP.

Describe the solution you'd like

I would like to see proxy protocol support for Kestrel web server.

Describe alternatives you've considered

As service itself needs to to Mutual TLS, I see no alternatives for this problem.

Additional context

https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt

Thanks!

@analogrelay
Copy link
Contributor

We don't have plans to add something like this to the server. Our current recommendation is to use the X-Forwarded-For headers as described in our documentation on Hosting ASP.NET Core on Linux with Nginx. Does that not work in your scenario?

@Tratcher
Copy link
Member

Note for 3.0 we're adding support for client certificates forwarded in headers (and then using them for authentication). #9756

@strainovic
Copy link
Author

@anurse XFF header cannot be injected into encrypted traffic. If we terminate SSL earlier, service will not be able to performe Mutual TLS as SSL is already offloaded.

@Tratcher That is nice but it requires to have some other services in a front of our service who can get client certificate and put it in defined http header.

Is there any other solution?

@Tratcher
Copy link
Member

Terminating SSL on NGinx and forwarding the client cert and IP is your best option.

https://serverfault.com/questions/622855/nginx-proxy-to-back-end-with-ssl-client-certificate-authentication

@strainovic
Copy link
Author

Thanks @Tratcher!

@ghost ghost locked as resolved and limited conversation to collaborators Dec 3, 2019
@amcasey amcasey added area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions and removed area-runtime labels Aug 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions
Projects
None yet
Development

No branches or pull requests

5 participants