Description
First of all, thank you for the great project and everyone involved in it. I'm a maintainer of an OSS project using cosign to sign release binaries. Our project uses GoReleaser for signing, and we run the following commands on the checksum:
COSIGN_EXPERIMENTAL=1 cosign sign-blob --output-certificate=checksum.txt.pem --output-signature=checksum.txt.keyless.sig checksum.txt
To verify this, we provide a verification example as follows:
cosign verify-blob --cert checksums.txt.pem --signature checksums.txt.keyless.sig --certificate-github-workflow-repository=terraform-linters/tflint checksums.txt
However, I understand that this way does not verify the checksum.txt.pem
's certificate chain against the Fulcio root trust, so it is not sufficient:
https://github.com/sigstore/cosign/blob/v1.10.1/cmd/cosign/cli/verify/verify_blob.go#L122-L129
To avoid this, I understand that I need to pass the Fulcio root certificate with the --certificate-chain
option:
https://github.com/sigstore/cosign/blob/v1.10.1/cmd/cosign/cli/verify/verify_blob.go#L131-L139
Now the question is, how can I get this root certificate securely?
I have confirmed that I can get certificates locally using TUF by cosign initialize
. I can use this to build a certificate chain like this:
cosign initialize
cat ~/.sigstore/root/targets/fulcio_intermediate_v1.crt.pem > fulcio_chained.crt.pem
echo >> fulcio_chained.crt.pem
cat ~/.sigstore/root/targets/fulcio.crt.pem >> fulcio_chained.crt.pem
echo >> fulcio_chained.crt.pem
cat ~/.sigstore/root/targets/fulcio_v1.crt.pem >> fulcio_chained.crt.pem
cosign verify-blob --cert checksums.txt.pem --cert-chain fulcio_chained.crt.pem --signature checksums.txt.keyless.sig --certificate-github-workflow-repository=terraform-linters/tflint checksums.txt
Verified OK
But I'm not sure I can trust this local cache. In my opinion, it's safest to also get this root certificate by the TUF client, like COSIGN_EXPERIMENTAL=1 cosign verify-blob
:
https://github.com/sigstore/cosign/blob/v1.10.1/cmd/cosign/cli/verify/verify_blob.go#L220-L227
What do you think about this? Is there a better way?
Activity