-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
tls: modularize trusted CA providers #5784
Conversation
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.
Oh this is actually awesome -- thank you for contributing this!
It's pretty close to what I'd do.
- Exported types and their fields will need godocs.
- It's a slight bummer we can't combine the PKI*CAPool types. (Unless we can? I wonder what that would look like. It's just a matter of what the admin wants to sign the certs with, right?)
I have little in the way of criticism of this change. Nice work 😃
I'll come back to it when I'm in a better head-space. One more thing, I did consider |
Implemented for consideration. I realized last week that this can be generalized to be the |
The certs are used differently than the CA pool flow
Apply suggestions from code review Co-authored-by: Francis Lavoie <[email protected]>
fc8455b
to
27b5030
Compare
Wow, I really appreciate all the work that went into these tests. Can't wait to review!! |
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 is a big improvement. 7 client auth provider modules built-in, that's pretty awesome! Thanks for working on this. LGTM.
"Matt, how can you approve a 2,500 line change without any review comments?" -- because Mohammed writes good code and nothing obvious stuck out to me. This is a bigger PR than I usually review, so yes I'm sure some details got overlooked. But I'd rather get this merged in and tested before a release than try to find all the problems with my tired eyes right now. 🙂
Nice work on this :) |
Correct me if i am wrong but It seems you accidently broke #6022 caddy/modules/caddytls/connpolicy.go Line 437 in a6d9f9b
|
It shouldn't break. I was aware of it and tried my best to avoid breakage. The certificates are still parsed when the directive has the |
No you got it wrong, i try to explain it better: in the referenced pull request there was support added to load client certificate verifier modules via caddyfile. Which was previously only possible via json config. This has nothing to do with leaf certificates. It is used to do additional checks on client certificates. For example revocation checks via my plugin https://github.com/Gr33nbl00d/caddy-revocation-validator In line 437 this seems to be missing:
|
You can see it here in the old builtins.go line 221 the verifier section was there: |
Correction i forgot 2 lines to copy :) Last 2 lines were missing in my previous comment
|
Yeah I see what you mean @Gr33nbl00d. It got lost in translation somewhere. I think this happened because ultimately, we don't have any actual implementation of that module interface in Caddy itself, so it's not possible to write a test using anything built-in. We should probably make a mock cert verifier module in a PRs welcome! |
Yes you are right i had the same idea ;) It would definitly help to harden the code. It was maybe because a merge conflict in the builtin.go file because 2 different prs affected the same file. |
Aaah I see your point, @Gr33nbl00d. Sorry 😔 I'll definitely review a PR to add it back (with a test 🙂). If you don't beat me, I'll add it back but it might take me a while. |
No problem, this can always happen. We are humans not machines and we make mistakes. I am still in the process of implementing the caddy file support. This is not yet released :) So take your time |
The current implementation of client authentication requires the CA to be either known in DER format or available on disk as PEM files. This prevents the advanced usage of client authentication by standing on the shoulders of the PKI app or to fetch the certs from shared Caddy storage. The current implementation makes it hard to share the same trusted client CAs across a cluster of Caddy servers without having to produce the root certs first then plugging them. This is a long way of saying, the trusted root CA is very rigid and not extensible.
This implementation allows for the trust CA to be any Caddy module that satisfies an interface. It also provides 4 basic providers:
TODO: