-
Notifications
You must be signed in to change notification settings - Fork 76
Improve our internal key management #927
Copy link
Copy link
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
sigstore-python's internal key management is currently a bit of a mess. The following parties are at play:
- TUF/the trust root/bundle: this is the ultimate source of all of our "a priori" key material.
- Fulcio: the trust root distributes one or more Fulcio CAs as chains of X.509 certificates. Internally, we mash these into a single pool and return certificates with expired timeranges at the trustroot level (which is probably incorrect).
- Certificate Transparency ("CTFE"): the trust root distributes one or more CTFE keys, which we load so long as they are valid or expired (but not from the future).
- Rekor: the trust root distributes one or more Rekor keys, which we load similarly to CTFE keys.
Now, the status quo:
- Our internal
RekorClienthas_ct_keyringand_rekor_keyringmembers, representing the CTFE and Rekor keyrings respectively as loaded from the trust root. The latter makes a little sense; the former makes no sense (since CTFE has nothing to do with Rekor). - Our internal
FulcioClienthas no keyrings or certificate pools internally. - We currently make no distinction in loaded keys/certs between signing and verifying, which is almost certainly incorrect.
Now, a solution:
-
We should keep key management entirely within the
TrustedRootand its APIs. In practice, that means thatTrustedRootshould have APIs roughly like the following:TrustedRoot.rekor_keyring(disposition="sign") # a suitable set of Rekor keys for use in the signing process TrustedRoot.ctfe_keyring(disposition="verify") # a suitable set of CTFE keys for use during verification
...and so forth. The
dispositionkwarg is pretty ugly; we just need some way to differentiate between the set of keys that are valid in each context. -
SigningContextandVerifiershould probably take aTrustedRootdirectly. -
RekorClientshould have no key material within it at all.
CC @jku for thoughts.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request