Skip to content
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 sha256:... as alternative way to specify a blob #4016

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

wolfv
Copy link

@wolfv wolfv commented Jan 17, 2025

Hey, looking for some early feedback on this change to make validation of blobs without providing the actual blob easier.

Summary

With this change, one can validate blobs without the blob - just by sha256:<hash>.

Release Note

  • Allow passing a hash instead of an actual blob / file by using sha256:<hash>.

@haydentherapper
Copy link
Contributor

@woodruffw, @kommendorkapten and I had a discussion in sigstore/protobuf-specs#444. There was some concern that providing only the hash of an attestation would lead to a lack of verification of the document itself.

@wolfv
Copy link
Author

wolfv commented Jan 17, 2025

Sure, but in our case the server application already checks the hash and we don't want to send the file around to the microservice to validate the signature :)

Also sigstore-python already supports this.

But also fine with me if it isn't accepted!

@woodruffw
Copy link
Member

Hey @wolfv! Good to see you 🙂

Per sigstore/protobuf-specs#444, I think there are two subtly different cases here: when doing a "bare" verification (cosign verify-blob) having a hash instead of an artifact is OK, since the signature is over a "bare" payload and the hash is equivalently binding to it.

However, in the attestation verification context, just a hash is insufficient (since it binds to the subject's digest, but not the subject's name.

So, I think cosign could support sha256:... in the "bare" case, but forbid it for the attestation case. OTOH, I could see that being confusing for users -- I'm curious what @haydentherapper thinks.

(In sigstore-python we allow sha256:... in both cases, which was arguably a mistake 😅 -- I'm going to investigate removing or augmenting it in the next stable release. In particular, if we decide to keep it, I'll likely add some kind of required --subject flag to complement the digest.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants