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

Add TLS support to the pinniped-proxy directly. #4951

Merged
merged 3 commits into from
Jun 28, 2022
Merged

Conversation

absoludity
Copy link
Contributor

Signed-off-by: Michael Nelson minelson@vmware.com

Description of the change

After playing around with different options, this appears to be the simplest way to add tls support to pinniped-proxy without breaking the existing non-tls setup.

I'm leaving this as a draft until I figure out how TLS on the related service will interact with this. After that, it should just be updating the api server to be able to trust the cert, then the related chart changes.

Benefits

Possible drawbacks

Applicable issues

  • fixes #

Additional information

Signed-off-by: Michael Nelson <minelson@vmware.com>
@netlify
Copy link

netlify bot commented Jun 24, 2022

Deploy Preview for kubeapps-dev canceled.

Name Link
🔨 Latest commit 359b476
🔍 Latest deploy log https://app.netlify.com/sites/kubeapps-dev/deploys/62ba41a8160f8a00095c2a4c

Signed-off-by: Michael Nelson <minelson@vmware.com>
@absoludity absoludity marked this pull request as ready for review June 27, 2022 05:52
Copy link
Contributor

@antgamdia antgamdia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! Thank for the explanation!

Comment on lines 1 to 3
// Copyright 2020-2022 the Kubeapps contributors.
// SPDX-License-Identifier: Apache-2.0
use tokio_native_tls::native_tls::{Identity, TlsAcceptor};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Copyright 2020-2022 the Kubeapps contributors.
// SPDX-License-Identifier: Apache-2.0
use tokio_native_tls::native_tls::{Identity, TlsAcceptor};
// Copyright 2022 the Kubeapps contributors.
// SPDX-License-Identifier: Apache-2.0
use tokio_native_tls::native_tls::{Identity, TlsAcceptor};

let server = Server::bind(&addr).serve(make_svc);

info!("Listening on http://{}", addr);
let with_tls = opt.proxy_tls_cert != "" && opt.proxy_tls_cert_key != "";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe worth adding a warning if just one of them is set ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even erroring and stopping - we can't run with just one.


// Run the server for ever. If it returns with an error, return the
// result, otherwise, if it completes, we return Ok.
server.await?;
if with_tls {
info!("Configuring with TLS cert {} and key {}", opt.proxy_tls_cert, opt.proxy_tls_cert_key);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this is logging the secret name but not the content, isn't it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, they're just file paths. Not so clear from the option names...

Signed-off-by: Michael Nelson <minelson@vmware.com>
@absoludity absoludity merged commit 1aa45e4 into main Jun 28, 2022
@absoludity absoludity deleted the 2268-pinniped-tls branch June 28, 2022 07:13
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.

3 participants