-
Notifications
You must be signed in to change notification settings - Fork 26
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
Proposal: TrustedMaterial Interface Refinement #293
Comments
I'm +1 to all of these changes, thanks for putting this together!
This also will come up with sigstore/protobuf-specs#249, which I'd really like to do before we have a 1.0 release of the protobuf spec. |
I have some clarifying questions, one general and the other more specific. First the general question, with a disclaimer that I haven't thought much about certificate pools until this week. Let's say in our trusted root there's 3 different Assuming we get that ironed out : ) today in sigstore-go the TrustedMaterials interface mirrors the private members of TrustedRoot and the various function signatures in trusted_root.go. Would we update those all to match? Or are these changes just scoped to TrustedMaterials? |
It shouldn't allow any malicious behavior. x509 libraries implement path finding, using the subject key IDs and authority key IDs in each certificate to determine the path from a leaf certificate down to a CA certificate from the root pool. There is no meaningful difference between the two when it comes to certificate validation.
Yea, I think that would be reasonable. With the current logic, we would lose the validity window check however if we merge all CA certs together, so we'd need a mapping from CA cert to trust root entry to check the validity window after the x509 library verifies the certificate and finds the certificate chain (which is returned here, we currently ignore this). |
My fear if we put all certificates into a single cert pool is that it would complicate the logic a bit, and so increase the risk of a bug causing validation to succeed when it shouldn't. As Hayden mention, we need to verify the chain after a successful verification, to see if that chain was valid during time by comparing this against the trusted certificate chains. I feel like this is a possibly complicated operation. Keeping each ca as a single struct and then iterating over them seems less error prone to me, as the only comparison to be done is the first initial comparison of the time stamp, then verification can go forth and creating the cert pool. If we group all certs together, my understanding is that we would then need to (perfectly) match the the returned chains against the chains in the trusted root, which is a bit more complicated. (This is a |
Description
The
TrustedMaterial
interface currently includes these methods:The
CertificateAuthority
interface is defined as:There are a couple of issues with this interface:
verify/certificate.go
andverify/tsa.go
are tightly coupled to theCertificateAuthority
struct. In some instances, we may want to allow a client to provide a*x509.CertPool
(for example, to cleanly migrate cosign to the newTrustedMaterial
interface), to provide a custom certificate verifier function, or to provide multiple root certificates.I propose the following changes:
TimestampingAuthority
interface.CertificateAuthority
interface.FulcioCertificateAuthority
andSigstoreTimestampingAuthority
that implement the new interfaces.pkg/verify
package and into thepkg/root
package.These would be defined as follows:
The TrustedMaterial interface would then be updated to look like this:
One of the benefits of this approach is a smoother transition for cosign. This would allow cosign's
CheckOpts
to implement theTrustedMaterial
interface, as it currently is impossible due to the use ofx509.CertPool
in cosign, which is not compatible with the currentTrustedMaterial
interface.The text was updated successfully, but these errors were encountered: