-
Notifications
You must be signed in to change notification settings - Fork 1
ROX-31430: delegate TLS to host implementation #168
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
base: main
Are you sure you want to change the base?
Conversation
|
I would recommend using native_tls and leaving FIPS compliance to the host operating system. |
I've changed the approach but haven't pushed out the commit yet, I'm getting a weird error when connecting to sensor with native_tls. I will update the PR once I get everything working correctly. Thanks for the suggestion @neverpanic! |
9e479d3 to
9152bb4
Compare
9152bb4 to
0d718b7
Compare
With this patch, we move away from using the tonic provided TLS implementation to injecting a manually built native-tls configuration, then using that to create a hyper HttpsConnector and finally telling tonic to use that connector for handling the underlying HTTPs connections needed for gRPC. In case no TLS certificates are provided, plain HTTP is used.
0d718b7 to
9f1b0d8
Compare
| let certs = { | ||
| let config = self.config.borrow(); | ||
| let Some(certs) = config.certs() else { | ||
| return Ok(None); |
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.
This part I don't follow, certs could just be None and passed further?
| }; | ||
| certs.to_owned() | ||
| }; | ||
| let (ca, cert, key) = tokio::try_join!( |
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.
Do I see it correctly, that try_join! macro joins concurrent activity? If yes, why is it needed here?
| Ok(Some(connector.into())) | ||
| } | ||
|
|
||
| fn get_https_connector( |
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.
This sounds like a very lightweight function, can't it be a part of get_tls_connector?
| let channel = Channel::from_shared(url)?; | ||
| let channel = match connector { | ||
| Some(connector) => channel.connect_with_connector(connector).await?, | ||
| None => channel.connect().await?, |
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.
I assume this would be an attempt to talk over an unencrypted channel, right? If that's the case, worth adding a warning log message.
Description
With this patch, we move away from using the tonic provided TLS implementation to injecting a manually built native-tls connector, then using that to create a hyper HttpsConnector and finally telling tonic to use that connector for handling the underlying HTTPs connections needed for gRPC. In case no TLS certificates are provided, plain HTTP is used.
With native-tls TLS will be handled by the OS implementation, which in linux will default to openssl. This is important for FIPS compliance, since having a FIPS compliant openssl implementation will automatically allow us to be FIPS compliant by proxy.
Checklist
Automated testing
If any of these don't apply, please comment below.
Testing Performed
Run fact on a stackrox deployment and validated it connected to sensor correctly.