Open xmlking opened 2 years ago
Maybe a silly question, but are you sure there is an SBOM for that image? Did you push one using cosign?
Yes you can check here https://github.com/xmlking/grpc-starter-kit/pkgs/container/grpc-starter-kit%2Fgreeter
Just an FYI, looks like maybe there's just not an sbom for that tag. Looks like when you fetch the sbom using a sha that does exist, it works (using one for the images from link you sent):
vaikas@villes-mbp eventing % cosign download sbom ghcr.io/xmlking/grpc-starter-kit/greeter@sha256:eaef37a8b9422d50dbf5c5b6366ea4a3e1cce2b0d4b5632998cf1ed842aad578
--output-file=/tmp/sbom.spdx
Found SBOM of media type: text/spdx
vaikas@villes-mbp eventing % ls -l /tmp/sbom.spdx
-rw-r--r-- 1 vaikas wheel 50921 Mar 11 09:50 /tmp/sbom.spdx
Can confirm the same.
Downloading the signature ✅
$ cosign download signature ghcr.io/philips-labs/slsa-provenance:v0.7.2
{"Base64Signature":"MEUCIQCXfQeeQE77CdZkKVaBZa474eTIZR4uUQHoQ+W/2+uatgIgXKty8HA9NYzK40rYoQ1ebs1yrECUnp/BmLNsp9oMUPw=","Payload":"eyJjcml0aWNhbCI6eyJpZGVudGl0eSI6eyJkb2NrZXItcmVmZXJlbmNlIjoiZ2hjci5pby9waGlsaXBzLWxhYnMvc2xzYS1wcm92ZW5hbmNlIn0sImltYWdlIjp7ImRvY2tlci1tYW5pZmVzdC1kaWdlc3QiOiJzaGEyNTY6ZTMzNzhhZWYyMzgyMWZkNmUyMTAyMjllNWI5OGI1YmVhZDI4NTg1ODFiMmQ1OTBkOWUzYjQ5ZDUzYzNmNzFlNyJ9LCJ0eXBlIjoiY29zaWduIGNvbnRhaW5lciBpbWFnZSBzaWduYXR1cmUifSwib3B0aW9uYWwiOm51bGx9","Cert":null,"Chain":null,"Bundle":null}
Downloading the attestations ✅ both the sbom and build provenance are here as an attestation…
$ cosign download attestation ghcr.io/philips-labs/slsa-provenance:v0.7.2
{"payloadType":"application/vnd.in-toto+json","payload":"eyJfdHlwZSI6Imh0dHBzOi8vaW4tdG90by5pby9TdGF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wiU0VDVVJJVFlcIixcbiAgICAgXCJyZWZlcmVuY2VMb2NhdG9yXCI6IFwiY3BlOjIuMzphOmJhc2UtZmlsZXM6YmFzZV9maWxlczoxMS4xK2RlYjExdTI6KjoqOio6KjoqOio6KlwiLFxuICAgICBcInJlZmVyZW5jZVR5cGVcIjogXCJjcGUyM1R5cGVcIlxuICAgIH0sXG4gICAge1xuICAgICBcInJlZmVyZW5jZUNhdGVnb3J5XCI6IFwiU0VDVVJJVFlcIixcbiAgICAgXCJyZWZlcmVuY2VMb2NhdG9yXCI6IFwiY3BlOjIuMzphOmJhc2VfZmlsZXM6YmFzZS1maWxlczoxMS4xK2RlYjExdTI6KjoqOio6KjoqOio6KlwiLFxuICAgICBcInJlZmVyZW5jZVR5cGVcIjogXCJjcGUyM1R5cGV
…
$ cosign download sbom ghcr.io/philips-labs/slsa-provenance:v0.7.2
Error: image not found in registry
main.go:46: error during command execution: image not found in registry
We are using cosign v1.6.0
.
The SBOM and provenance are attached like this.
cosign attest --predicate sbom-spdx.json --type spdx --key cosign.key ghcr.io/philips-labs/slsa-provenance:v0.7.2
cosign attest --predicate provenance-predicate.att --type slsaprovenance --key cosign.key ghcr.io/philips-labs/slsa-provenance:v0.7.2
@marcofranssen Have you tried with cosign attach sbom --type cyclonedx --sbom file.json ghcr.io/philips-labs/slsa-provenance:v0.7.2
? It looks like you simply attached the attestations (one with a SBOM), you didn't add a sbom based on your comments.
@hectorj2f you are right. Using the cosign attach sbom
command I can download the sbom.
Now just a bit confused on when to use cosign attest
vs cosign attach
when it comes to SBOMs. Maybe that needs some documentation/writeup to clarify the usecases for the community.
+1 on clarifying that.
@marcofranssen Yes, you're right.
Getting
MANIFEST_UNKNOWN: manifest unknown
errorError