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

Providing Trusted Leaf Certificates to the Leaf Certificate Verifier #6046

Closed
mohammed90 opened this issue Jan 17, 2024 · 4 comments · Fixed by #6050
Closed

Providing Trusted Leaf Certificates to the Leaf Certificate Verifier #6046

mohammed90 opened this issue Jan 17, 2024 · 4 comments · Fixed by #6050
Labels
bug 🐞 Something isn't working good first issue 🐤 Good for newcomers

Comments

@mohammed90
Copy link
Member

The leaf-certificate verifier in client authentication does not have a way to provide the trusted leaf certificate material without relying no the deprecated field trusted_leaf_certs, which was not meant to be the proxy forever and only left around as a bridge for existing users and not to be used after the introduction of the feature in #4389. At the moment, there's no way to configure the "verifier": "leaf"directly with new behavior only.

We should provide a way to provide the trusted certificates to the tls.client_auth.leaf module.

@mohammed90 mohammed90 added bug 🐞 Something isn't working good first issue 🐤 Good for newcomers labels Jan 17, 2024
@armadi1809
Copy link
Contributor

@mohammed90 I can take a look at this, unless you want to leave it for someone doing their first contribution.

@mohammed90
Copy link
Member Author

Go for it!

@armadi1809
Copy link
Contributor

Cool. I have a couple of questions though to make sure I understand this right.

  1. Currently, what happens when we include the { "verifier" : "leaf"} in our config without using the deprecated trusted_leaf_certs field? I am assuming it doesn't do anything?

  2. How do you envision this being implemented? Should it be a sub-directive of the verifier directive?

@mohammed90
Copy link
Member Author

  • Currently, what happens when we include the { "verifier" : "leaf"} in our config without using the deprecated trusted_leaf_certs field? I am assuming it doesn't do anything?

Per the code here:

for _, trustedLeafCert := range l.TrustedLeafCerts {
if remoteLeafCert.Equal(trustedLeafCert) {
return nil
}
}
return fmt.Errorf("client leaf certificate failed validation")

It'll return an error in the last line

  • How do you envision this being implemented? Should it be a sub-directive of the verifier directive?

Start by figuring out the JSON first, not the Caddyfile. Consider that the source of the certificates can be from various sources, so it should be pluggable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐞 Something isn't working good first issue 🐤 Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants