-
Notifications
You must be signed in to change notification settings - Fork 607
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
generate SBOM both SPDX and Cyclone DX formats based for container images and attach em by using cosign attach #669
Comments
How will the CLI look like? |
IMHO, an $ nerdctl image push -t <foo> --sbom <spdx|cyclonedx> .
Syft can generate an SBOM file for both formats. |
We don't have to use syft as an executable way, I've recently asked @wagoodman to give us an example of how to use syft as a Go module, thanks to him, he created a gist for it. 👉 https://gist.github.com/wagoodman/57ed59a6d57600c23913071b8470175b |
kinly ping @AkihiroSuda @Dentrax |
Probably the CLI and the output format should be compatible with https://github.com/docker/sbom-cli-plugin |
it will be because they use Syft too under the hood |
There are two ways of developing this feature. The first is executing the Syft binary as we did while implementing the signing feature by performing the cosign binary. The latter depends on Syft packages by adding it to the go.mod file. Syft binary is about 60MB in size, btw. |
Kindly ping @AkihiroSuda |
Executing a separate syft binary is preferable |
If we maintain separate syft executable internally, I think it would be better to start related flags with $ nerdctl image push -t <IMAGE> --sbom-format <SPDX|CYCLONEDX> --sbom-attach --sbom-output /path/to/file User may want to either attach SBOM directly to upstream or export the local disk. All flags are optional. Cross ref: anchore/syft#592 |
kindly ping sir @AkihiroSuda |
|
Looks like there's been some progress in this aspect with pluggable SBOM generators: https://github.com/docker/buildkit-syft-scanner/tree/master . Docker CLI relies on a flag to attach the SBOM. |
👍 |
The current docker command is this, so a flag: |
SGTM |
We (w/@Dentrax) thought that Syft is a popular tool to allows us to generate SBOMs easily and quickly. Even GoReleaser project using syft under the hood to generate an SBOM. We have recently added cosign support to sign and verify container images while building/pushing and pulling in nerdctl. So, cosign has SBOM spec defined to let people attach SBOM (both SPDX and Cyclone DX formats) files to container images by using cosign attach command.
So, let's add that support to the nerdctl CLI too. We can generate an SBOM file while pushing the container image, then attach the SBOM file to it.
WDYT?
cc: @dlorenc @AkihiroSuda @luhring @wagoodman
The text was updated successfully, but these errors were encountered: