Skip to content
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

generating SBOMs for both cosign and cosigned projects and sign them #959

Closed
developer-guy opened this issue Oct 28, 2021 · 14 comments · Fixed by #1236 or #1237
Closed

generating SBOMs for both cosign and cosigned projects and sign them #959

developer-guy opened this issue Oct 28, 2021 · 14 comments · Fixed by #1236 or #1237
Labels
enhancement New feature or request

Comments

@developer-guy
Copy link
Member

developer-guy commented Oct 28, 2021

Description

we (w/@Dentrax) thought that there are no SBOMs files generated and signed for both cosign and cosigned projects, so we're proposing to generate, sign them right after generating them via cosign's private key, and attach them to the proper registry. I'd like to list the tools that can help us to do that:

as an example the Kyverno project is already doing this:

👀 github.com/kyverno/kyverno/pull/2438/

cc: @luhring @puerco @cpanato @nishakm

@developer-guy developer-guy added the enhancement New feature or request label Oct 28, 2021
@luhring
Copy link
Contributor

luhring commented Oct 28, 2021

The syft "sbom-action" might be a way to get started with almost no effort, even if this workflow step is later replaced in a future iteration.

Also, I just pulled in anchore/syft#510, which would simplify the SBOM generation + attestation workflow here.

@VinodAnandan
Copy link

We have helped with the SBOM generation for Kyverno, Trivy, gosec, Buildpack, etc. The following Github action is utilised to generate the SBOM, https://github.com/CycloneDX/gh-gomod-generate-sbom . It is simple and straightforward and generates an accurate SBOM with a dependency graph. @nscuro has already addressed @dlorenc's concern ( CycloneDX/cyclonedx-gomod#20 ) related to the accuracy of SBOM. The team is happy to address any further concerns and provide any help with the SBOM generation.

Cc: @nscuro, @stevespringett, @coderpatros, @DarthHater, @tricky42, @knqyf263, @masahiro331, @samj1912, @natalieparellano, @ShubhamPalriwala, @JimBugwadia, @ccojocar, @mmorel-35

@nscuro
Copy link

nscuro commented Nov 1, 2021

As cosign uses goreleaser, goreleaser/goreleaser#2597 (and consequently goreleaser/goreleaser#2618) may be relevant.

@developer-guy
Copy link
Member Author

kindly reminder @dlorenc

@mattmoor
Copy link
Member

mattmoor commented Dec 6, 2021

For cosigned we added support for producing sboms with ko, so once we cut a new ko release we should get that for free (same with the cosign images we build with ko).

@developer-guy
Copy link
Member Author

oh, that's so nice, would you mind sharing the PR on the ko side?

@mattmoor
Copy link
Member

mattmoor commented Dec 6, 2021

There were a few, but this connects a few of the dots: ko-build/ko#511

It's merged at HEAD. Please try it out and report any issues!

@developer-guy
Copy link
Member Author

We (w/@Dentrax) would like to add CycloneDX support as well. May we do this? Because the CycloneDX community provides great go modules that we can use for this.

@developer-guy
Copy link
Member Author

works like a charm @mattmoor 🤩
Screen Shot 2021-12-06 at 20 02 20

@developer-guy
Copy link
Member Author

developer-guy commented Dec 6, 2021

Also, cosign supports text/spdx+json mediaType for SBOMs based on SPDX format. Maybe we can add this support too, WDYT @mattmoor? Is it worth it?

@mattmoor
Copy link
Member

mattmoor commented Dec 6, 2021

@developer-guy works for me! cc @imjasonh

@imjasonh
Copy link
Member

imjasonh commented Dec 6, 2021

works like a charm @mattmoor 🤩

Just a nit: ko build --sbom builds and pushes with an SBOM, and ko deps --sbom=spdx generates one on-demand from the binary in the image.

You should try ko build --sbom=spdx and cosign download sbom ... on the pushed image to verify that the SBOM was built and pushed and attached how cosign expects to find it.

@developer-guy
Copy link
Member Author

what about making ko compliant with CycloneDX format, and also supporting text/spdx+json mediaType, I'd love to do that btw, I can create separate issues for that.

@mattmoor
Copy link
Member

mattmoor commented Dec 6, 2021

SPDX was always just a starting point. I think we'd love to have CycloneDX support as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
6 participants