-
Notifications
You must be signed in to change notification settings - Fork 587
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
Ability to sign or attest the generated SBOM #510
Comments
@luhring I like this new feature of signing reports and I find it useful. But I believe an attestation would give more value and metadata than a signature. So I'd vote for supporting attestations :). |
I've started taking a look at this. First, I'll say I'm excited about the work described in sigstore/cosign#844 — I can tell that's going to help make this implementation MUCH cleaner. Here's my latest thinking on what would make sense for a first iteration of this functionality (answering the "Open Questions" above):
It probably makes sense to introduce a new subcommand here: So, something like this could work well:
I agree with the above comment — let's target attestation only at first.
The automatic pushing that Cosign does provides a very nice user experience. Let's have Syft do that, too, but have configuration available for turning this off. Also, note: registry write access will be new to Syft, and more thought is needed around how this should work.
With the choice to introduce a new command, there's no longer an obligation to write the raw SBOM to stdout. It might make sense to write the attestation envelope to stdout. Users can redirect this somewhere (including
Not sure about longer term, but for the short term, I think it makes sense to apply this constraint.
There's no technical need to restrict the SBOM formats to support, but some of Syft's formats just don't make sense here since they aren't designed to be machine-readable (e.g.
Yes, this is very nice workflow from Cosign, and it'd be great to show it off to Syft users.
To start with, let's just support Cosign's basic key files (e.g.
We're not sure yet. We think it could be a nice user experience for existing Cosign users to start using Syft and not have to re-configure attestation-related things just because they introduced a new tool. On the other hand, if Cosign's config is meant to be internal and/or unstable, we'd probably be better off creating a wholly independent config for attestation within Syft's existing app config. This would be a good discussion topic with the Sigstore folks!
Yes, by default. And this can be disabled via configuration. Curious for others' thoughts! 😃 |
Wow, missed this! Thanks for opening it! The cosign/pkg work is flying by thanks to @mattmoor. Adding him in here for FYI. |
The OCI package is looking pretty good @dekkagaijin is tackling the signing and verification bits now 🎉 |
We recently made a similar effort on projects like nerdctl, conftest. But, instead of using cosign as Go module to avoid extra dependencies, we've used cosign executable file under the hood to sign and verify container image. Here is the summary of what we have done so far: |
Thanks @developer-guy, I'll check those out! On my side, this issue has been on the back burner for a few weeks, but hopefully it gets more attention here shortly. It's absolutely the direction we want to take Syft. |
UpdateWe're about to land the first PR for this issue and I wanted to update the scope a bit here to give people a quick summary of where we are and where we are going RE: Attestations.
The format from the initial comment is what we have adopted. We've also taken into account using multiple formats for the predicate.
See the final PR here for a summary of the SBOM formats supported
For the initial implementation, we have settled on producing a signed attestation that can be attached to an image using the SBOM as the predicate.
The automatic pushing that Cosign does provides a very nice user experience. Because we are not attaching the attestation as part of the syft command pushing/attaching will not be scoped under the
With the choice to introduce a new command, there's no longer an obligation to write the raw SBOM to stdout. We have chosen to write the attestation envelope to stdout so users can proceed with that artifact in their respective workloads.
We have chosen to keep with the above so make sure we are still using the manifest and digests as part of the attestation inputs.
We have chosen to support all input formats that syft currently supports, specifically:
If we need to size these down, make additions, or update this list in the future PRs will be added.
This feature will be added in a follow-up PR along with Rekor integration for uploading signatures.
To start with, let's just support Cosign's basic key files (e.g.
Currently, syft will support the |
See this comment re BINARY size increase: |
Background
Syft can already generate SBOMs in a variety formats (SPDX, CycloneDX, lossless Syft JSON, etc.). These SBOMs can be saved and used in a number of downstream tasks, such as vulnerability scanning w/ Grype.
We recently looked at a supply chain security workflow that leverages Cosign to sign the SBOM from Syft before it's used downstream. This workflow was published as a blog post: https://anchore.com/blog/drop-an-sbom-how-to-secure-your-software-supply-chain-using-open-source-tools/
Ideally, there would be no opportunity for the SBOM to be tampered with before it's signed.
The new feature
Syft could have an option to sign (or even attest) the SBOM immediately as it's produced, using an identity provided by the user, to avoid any chance of tampering with the SBOM.
Implementation
This could be implemented by integrating Cosign into Syft. By doing so, this could allow Syft users to pass Cosign-related keys and/or configuration to Syft.
A simple case would be to use Cosign's
sign-blob
functionality to sign the SBOM:Syft could even leverage Cosign's Keyless Signatures workflow (creating keys via OIDC auth and publishing the signature to Rekor), to avoid the need for users to specify any keys:
Alternatively (or in addition), Syft could create an in-toto attestation for the SBOM (as the "predicate") with respect to the image (as the "subject"), akin to Cosign's
attest
command:Open questions
predicateType
value?The text was updated successfully, but these errors were encountered: