-
Notifications
You must be signed in to change notification settings - Fork 141
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
Attach SBOMs to built images. #149
Conversation
if len(sbomFormats) > 0 { | ||
var mt ggcrtypes.MediaType | ||
var path string | ||
switch sbomFormats[0] { |
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.
Currently cosign's method for associating SBOMs supports a single type of SBOM, so I simply pick the first when multiple are emitted. This can be controlled by restricting or reordering the sbom formats.
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.
Is there an issue we can reference here (and in ko-build/ko#661) so we can switch to publishing both/all when the API supports it?
switch sbomFormats[0] { | ||
case "spdx": | ||
mt = ctypes.SPDXMediaType | ||
path = filepath.Join(sbomPath, fmt.Sprintf("sbom-%s.spdx.json", arch.ToAPK())) |
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 wish the SBOM metadata were surfaced in a way we could plumb through to here, but the file list is effectively discarded today. We should consider ways to improve the way this is plumbed through.
87b15ba
to
2feee5f
Compare
This change attaches SBOMs to the `oci.SignedImage`s we build up, and these are published thanks to the previous commit in this series. I have added validation that for each of the examples we have that we scan download its SBOM with cosign. Fixes: chainguard-dev#145
Looks fine to me, given that we can't just fix cosign immediately. |
This change attaches SBOMs to the
oci.SignedImage
s we build up, and these are published thanks to the previous commit in this series.I have added validation that for each of the examples we have that we scan download its SBOM with cosign.
Fixes: #145
Based on #147