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

nginx-based ssl passthrough support with SNI #2539

Closed
r7vme opened this issue May 18, 2018 · 16 comments
Closed

nginx-based ssl passthrough support with SNI #2539

r7vme opened this issue May 18, 2018 · 16 comments
Labels
lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.

Comments

@r7vme
Copy link

r7vme commented May 18, 2018

Is this a BUG REPORT or FEATURE REQUEST? (choose one): FEATURE REQUEST

At the moment ingress controller implements own proxy for ssl passthrough cases. It runs in own go routine that does three things:

  1. extracts SNI
  2. adds PROXY protocol header
  3. does piping between two TCP connections directly to backend (Kubernetes service)

It would be great to have 1 and 3 done by nginx. 2 is only needed, when your clients going directly to ingress-controller w/o load-balancer and support proxy protocol. Not needed if external load balancer already does PROXY protocol (e.g. AWS ELB and HAProxy).

@aledbf
Copy link
Member

aledbf commented May 18, 2018

It would be great to have 1 and 3 done by nginx.

Agree. The issue with that approach is that you lose the source IP address (client).

@aledbf
Copy link
Member

aledbf commented May 18, 2018

@r7vme the problem is that using the sni preread feature implies the use of an upstream so you receive a connection from nginx itself

Please check https://github.com/kubernetes/ingress-nginx/pull/614/files#diff-b7803798d356c6c17a90d93cc58bdbaaL480

@r7vme
Copy link
Author

r7vme commented May 18, 2018

@r7vme the problem is that using the sni preread feature implies the use of an upstream so you receive a connection from nginx itself

I think with "piping" you also receive connection from ingress-controller? That's why PROXY protocol is in place, to keep initial client IP.

@r7vme
Copy link
Author

r7vme commented May 18, 2018

In our case, we don't need PROXY support in ingress as we use either ELB or Nginx. Are there are many people using ingress-controller w/o load-balancers in front?

Not top priority, but having ability to skip additional layer (Go based proxy) in data path would be great. Unfortunately we still need ssl-passthru, so we can not disable it completely.

@aledbf
Copy link
Member

aledbf commented May 18, 2018

Not top priority, but having ability to skip additional layer (Go based proxy)

I want to change that but losing the source IP address is a deal breaker.

@r7vme
Copy link
Author

r7vme commented May 18, 2018

I want to change that but losing the source IP address is a deal breaker.

Definitely, but i think it's possible to make Go proxy optional for cases, when PROXY protocol enabled on load balancer (ELB, HAProxy). In general, do you think will it work? I can work on PR based on initial implmentation here

@kfox1111
Copy link

I use nginx-ingress without a lb in front.

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Aug 16, 2018
@nrobert13
Copy link

Not top priority, but having ability to skip additional layer (Go based proxy)

I want to change that but losing the source IP address is a deal breaker.

@aledbf , but in case of passthrough, you do not touch the original package, so it still contains the HOST header. Isn't this the source of the client IP?

@aledbf
Copy link
Member

aledbf commented Sep 3, 2018

Isn't this the source of the client IP?

No, because once we read the TLS sni hello in the stream section we need to send the connection to a nginx upstream and that means NGINX opens a new connection to the upstream server. That's the reason why we lose the source IP address. There is no option to "just" pipe the connection.

@nrobert13
Copy link

I see, I guess the main reason for ssl-passthrough is ssl-client authn. is it that important to keep the client ip?

@aledbf
Copy link
Member

aledbf commented Sep 3, 2018

is it that important to keep the client ip?

Most of the users want this information

@nrobert13
Copy link

I guess then, the only way is proxy protocol. This seems to be a solution .. https://stackoverflow.com/questions/48211083/proxy-protocol-and-ssl

@fejta-bot
Copy link

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Oct 4, 2018
@fejta-bot
Copy link

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

@k8s-ci-robot
Copy link
Contributor

@fejta-bot: Closing this issue.

In response to this:

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.
Projects
None yet
Development

No branches or pull requests

6 participants