-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
docs(sbom): improve SBOM docs by adding a description for scanning SBOM attestation #2690
Conversation
In the following example, Cosign can get an attestation and trivy scan it. | ||
|
||
```bash | ||
$ cosign verify-attestation --key /path/to/cosign.pub --type cyclonedx <IMAGE> > sbom.cdx.intoto.jsonl |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it includes several attestations, Trivy fails to scan, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The --type cyclonedx
option of Cosign will take only cyclonedx attestation if the image has multiple attestations.
Depending on the number of cyclonedx attestations, the behavior will be as follows.
- If there is no cycnlonedx attestation, the cosign command will fail.
- If there is one cycnlonedx attestation, Trivy will successfully scan. This situation is assumed in the text of the description.
- (rare case) If there is more than one cycnlonedx attestation, it will also successfully scan because json.NewReader parses only the first line if there are multiple lines in input data(ref). This is unintended behavior but it is not bad because they may be the same content.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added a note that before trying the example, you create CycloneDX-type attestation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there is more than one cycnlonedx attestation, it will also successfully scan because json.NewReader parses only the first line if there are multiple lines in input data(ref).
I didn't know that. Cool. Thanks for your explanation.
Since CycloneDX is more advanced supported than SPDX, I've used CycloneDX in the example. |
Description
I've improved SBOM docs by adding a description for scanning SBOM attestation.
Related issues
Checklist