Skip to content

Add interface for certificate validation #298

Open
@kommendorkapten

Description

Description

Originally discussed here: #253 (comment)

The original implementation was made against the operational mode of PGI using ephemeral certificates and the trust root delivered via TUF. This mode of operation allows us to make the following simplifications:

  • End entity (leaf) certificates expires after only ten minutes, so no method for revocation is implemented
  • The Sigstore bundle only contains the end entity certificate
  • All intermediates are provided via the trust root
  • Long lived certificates (root and intermediates) are distributed via TUF, which allows us to perform instant revocation by removing the certificate from the trust root, so no method for verifying certificate revocation is needed

However, for private deployments these preconditions may not always be met, and certain users may want to rely on a more traditional PKI, where untrusted certificates are provided in the Sigstore bundle, and CLRs or OCSP is used to verify validity of the certificate.

To achieve required security using Certificates in Sigstore-go the client has to perform certificate verification themselves, by parsing the Sigstore bundle and then verify the certificate, which is not great UX.

Proposed is to add the support for a callback function:

func ValidateCertificate(c *x509.Certifiicate) (bool, error) {
        // validate certificate
}

That would then called for each certificate found in the bundle, including the end entity certificate.

To not complicate the logic for the default policy (using PGI), if the callback function is not set, it would set it to the a function that always returns true.

Trust root

Should the callback method be called for the certificates found in the trust root? My take is no. The trust root is created and provide by the client, and so the client could perform the certificate verification prior to composing the trust root.

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions