Skip to content

Add TLS to signer #357

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

Draft
wants to merge 17 commits into
base: add-payload-hash-to-jwt
Choose a base branch
from
Draft

Add TLS to signer #357

wants to merge 17 commits into from

Conversation

jclapis
Copy link
Collaborator

@jclapis jclapis commented Aug 13, 2025

This is a cherry-pick of the TLS support that @ManuelBilbao added in #297. It builds on top of #354 / #353 / #356 which obviate the nonce in the jti, but it's important to keep TLS support in as part of the audit finding as well.

Note that PR hasn't been updated in a bit, so it's a good idea to get some eyes on this one to ensure it got ported over properly and doesn't need any modernization changes.

While this is in draft review I'll look at adding an --insecure variant to the configuration that lets the user run without TLS if they want to (better for unit testing, anyway).

@jclapis jclapis self-assigned this Aug 13, 2025
@jclapis jclapis added the signer Signer module label Aug 13, 2025
Copy link
Collaborator

@ltitanb ltitanb left a comment

Choose a reason for hiding this comment

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

i would also add a link or short guide on how to generate the certs files?

@@ -78,7 +81,7 @@ pub async fn handle_docker_init(config_path: PathBuf, output_dir: PathBuf) -> Re
if let Some(SignerConfig { inner: SignerType::Remote { url }, .. }) = &cb_config.signer {
url.to_string()
} else {
format!("http://cb_signer:{signer_port}")
format!("https://cb_signer:{signer_port}")
Copy link
Collaborator

Choose a reason for hiding this comment

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

shouldn't this be http if the TslMode is insecure?

.signer
.as_ref()
.map(|config| match &config.tls_mode {
TlsMode::Insecure => None,
Copy link
Collaborator

Choose a reason for hiding this comment

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

let's a warning when this is the case, like we have already below

Comment on lines +179 to +185
module_volumes.push(Volumes::Simple(format!(
"{}:{}/{}:ro",
certs_path.join(SIGNER_TLS_CERTIFICATE_NAME).display(),
SIGNER_TLS_CERTIFICATES_PATH_DEFAULT,
SIGNER_TLS_CERTIFICATE_NAME
)));
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit this is duplicated below, let's refactor to a get_certs_volume?

Comment on lines +126 to +129
get_env_val(
SIGNER_TLS_CERTIFICATES_PATH_ENV,
SIGNER_TLS_CERTIFICATES_PATH_DEFAULT,
),
Copy link
Collaborator

Choose a reason for hiding this comment

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

assume it's fine that we insert this even if the TslMode may be None?

Copy link
Collaborator

Choose a reason for hiding this comment

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

i see we're simply not loading them after, i would still avoid adding them if not needed for clarity

Comment on lines +127 to +129
fn default_tls_mode() -> TlsMode {
TlsMode::Certificate(PathBuf::from("./certs"))
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

should the default be None instead? as this won't work out of the box

)
.await
} else {
info!("NOTE: Running in insecure HTTP mode, no TLS certificates provided");
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
info!("NOTE: Running in insecure HTTP mode, no TLS certificates provided");
warn!("Running in insecure HTTP mode, no TLS certificates provided");

@sambacha
Copy link

should explicitly state what TLS version is supported no?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
signer Signer module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants