Closed danbev closed 1 year ago
I think having the current intoto::verify-envelope
covers the attestations and that my initial motivation for creating this issue is invalid. As long as there is a way to retrieve the DSSE Envelope we can verify the contents.
Currently we have support for verifying in-toto envelopes using
intoto::verify-envelope
. This issue suggests adding a function named something likeintoto::verify-attestation
, similar to cosign_verify-blob-attestation.The use case here is that we want to verify an attestation, and the example here will be the sigstore-js npm package (but this will hopefully be the same for all npm packages that use npm publish provenance).
We can start by accessing the attestation url:
With that url we can find the DSSE envelope using:
TODO: ~double check the spec regarding the requirement of cert/public_key/keyid~. They are all optional.
We can inspect the payload using:
With this envelope we can then use it in a seedwing policy and use
intoto::verify-envelope
to verify it. For example:Pattern:
The blob in this case can be downloaded using the following command:
And the file
sigstore-1.3.0.tgz
needs to be in a one of the data directories specified to the policy server:This will be used to check the subject.
Input:
Output:
For this we needed to add sha512 digest algorithm support as only sha256 is currently supported in the main branch.