-
Notifications
You must be signed in to change notification settings - Fork 137
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 intermediate CA implementation with in-memory signer #494
Conversation
cc @bobcallaway Not in love with the amount of reader locks. The goroutine communication seems to be in line with the recommended style. |
Signed-off-by: Hayden Blauzvern <hblauzvern@google.com>
d9fbd8c
to
b38b0db
Compare
Codecov Report
@@ Coverage Diff @@
## main #494 +/- ##
==========================================
+ Coverage 47.97% 48.25% +0.28%
==========================================
Files 14 14
Lines 1063 1063
==========================================
+ Hits 510 513 +3
+ Misses 480 478 -2
+ Partials 73 72 -1
Continue to review full report at Codecov.
|
@@ -53,7 +54,7 @@ func newServeCmd() *cobra.Command { | |||
|
|||
cmd.Flags().StringVarP(&serveCmdConfigFilePath, "config", "c", "", "config file containing all settings") | |||
cmd.Flags().String("log_type", "dev", "logger type to use (dev/prod)") | |||
cmd.Flags().String("ca", "", "googleca | pkcs11ca | fileca | ephemeralca (for testing)") | |||
cmd.Flags().String("ca", "", "googleca | pkcs11ca | fileca | intermediateca | ephemeralca (for testing)") |
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.
given the dependency on google CA service for intermediateca
, does it make sense to have the name reflect that somehow?
If scaled horizontally, this would result in several different in memory signers and different responses on |
Yep, it would. Intermediates would change, but the root would be the same. |
Brace for noob question 😆 : I don't understand how verification would work if that was the case. Only the leaf code signing certificate is uploaded to Rekor. With the binary I want to verify in hand, I can hash and look it up in the Rekor log. That gives me a signature and leaf cert. To verify the leaf certificate chains to the Fulcio root I need the full chain of CA certificates back the the Fulcio root right? How does a verifier obtain the ephemeral intermediate certificate that are part of that chain in this case? If it has been rotated since the issuing event there is no way I can grab it from |
Question away! The certificate chain doesn't/shouldn't get verified based on what's returned by Rekor. (Separately, I am actually working on support for adding the cert chain, but there's a larger question around how to search when you don't know if an entry contains just the cert chain or the cert). The verification key/cert/chain comes from either CLI input or the OCI object (expect in one case for verify-blob, discussed below). The ephemeral intermediate CA certificate needs to be persisted alongside the leaf certificate. This is done currently in the OCI signature. For other use-cases, it's up to the client to figure out how to store the cert. Rekor shouldn't be used as storage for certificates. For example, the way that verify-blob fetches a certificate given an artifact isn't ideal. Rekor is meant as a witness to an event, and to find that proof, you need to know the contents of the Rekor entry (the signature, artifact hash, and verification key). Searching means you will accept someone else's proof and verification key. As for the comment about |
High level comment: Intermediate CA certs are meant to be untrusted and just used for chain building from a leaf to a root. It's always up to the client to store these in the same way they store leaf certificates. |
Ahhhh ok I think I understand whats up here. Limme check my understanding:
Verifiers can then check that this chains back to Fulcio root cert because they have the intermediates in hand already and then can also check the signature because they have the leaf in hand. I think this makes sense, but I can foresee some modifications to the API and perhaps clients to make it function as expected. I recall then when I did the |
Cosign will not need any updates besides figuring out Thanks for pointing out replicas, this is something I'll need to consider. I do quite like the idea of an ephemeral key, but without coordination between the replicas, this might not be feasible. |
Thanks for the comments y'all. I want to unblock this work and I don't see a clear path forward to having replicas share the same ephemeral cert and key. I'll be opening a new PR that adds a CA backed by KMS with an on-disk certificate chain. |
Signed-off-by: Hayden Blauzvern hblauzvern@google.com
Summary
Ticket Link
Ref #489
Release Note