Skip to content

Implement SCT verification #22

Closed

Description

@tetsuo-cpp

This doesn't seem to exist in pyca/cryptography. We should check whether there's another library that includes this functionality. If not, we might need to hand-roll it ourselves.

Activity

  1. self-assigned this
    on Apr 7, 2022
  2. added
    enhancement
    on Apr 7, 2022
  3. tetsuo-cpp commented on Apr 7, 2022

    @tetsuo-cpp
    ContributorAuthor

    I've had a look for some potential libraries that include functionality to verify signed certificate timestamps. Here are the two main candidates:

    • google/certificate-transparency: This library looks good and there is SCT validation functionality here. Downsides are that it isn't available on PyPI so distribution is an issue and it uses its own custom types to represent certificates, timestamps, etc and does not integrate well with cryptography. cosign is actually using the Go version of this library to implement SCT verification.
    • theno/ctutlz: This library looks good too. It is available on PyPI and appears to be using the cryptography types that we're using. The downsides are that it doesn't seem as battle tested or actively maintained (although that might be because the library is "done"). With that in mind, I'm cautious about bringing this in as a dependency.

    At the moment, I'm leaning towards just hand-rolling the SCT verification ourselves. There doesn't seem to be an obvious choice and from what I can see, it shouldn't be all that difficult to implement ourselves.

    Thoughts @di and @woodruffw?

  4. di commented on Apr 7, 2022

    @di
    Member

    It looks like google/certificate-transparency is not really maintained anymore. Additionally, it seems to be mostly implemented in C++, which might be a dealbreaker for us here.

    There is also an example at https://github.com/pierky/sct-verify/blob/master/sct-verify.py that might be helpful for us here, which calls out to openssl for some things.

  5. tetsuo-cpp commented on Apr 8, 2022

    @tetsuo-cpp
    ContributorAuthor

    Ok, there seems to be some issues preventing us from using python-tuf to read the root key (described in sigstore/root-signing#103).

    The way it should really work and how cosign does it is that we bundle a root.json in our repo. Using that, we should be able to download the public key to verify the SCT. We should let the user supply their own root.json in the case that the one we package with this tool expires and the user wishes to remain on the same version.

    I think at this point I'm going to just check the public key into our repo and leave the TUF part for further down the track.

  6. di commented on Apr 8, 2022

    @di
    Member

    I think at this point I'm going to just check the public key into our repo and leave the TUF part for further down the track.

    I think this is fine for now, but let's make sure we create an issue to capture getting the root via TUF for the future.

  7. di commented on Apr 8, 2022

    @di
    Member

    Here's a draft branch of the Java client's implementation of SCT verification, for reference: https://github.com/sigstore/sigstore-java/compare/add-sct-verification

  8. tetsuo-cpp commented on Apr 10, 2022

    @tetsuo-cpp
    ContributorAuthor

    I think this is fine for now, but let's make sure we create an issue to capture getting the root via TUF for the future.

    Captured in #25.

  9. di commented on Apr 19, 2022

    @di
    Member

    Here's the finished implementation for the Java client: sigstore/sigstore-java#1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions