sbom: add initial CycloneDX format support for attestation layer#6877
Open
echeng3805 wants to merge 1 commit into
Open
sbom: add initial CycloneDX format support for attestation layer#6877echeng3805 wants to merge 1 commit into
echeng3805 wants to merge 1 commit into
Conversation
faf4e39 to
55a1d6d
Compare
Signed-off-by: Ev Cheng <ev_cheng@apple.com>
55a1d6d to
6f82ce6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Initial PR for issue #6665: "BuildKit + CycloneDX SBOM Integration"
This PR extends the SBOM scanner protocol to support CycloneDX JSON alongside SPDX. Previously,
HasSBOMandCreateSBOMScannerhardcodedintoto.PredicateSPDX, which meant CycloneDX output from a scanner would result in an error:"ERROR: failed to build: failed to solve: bundle entry https://cyclonedx.org/bom does not match required predicate type https://spdx.dev/Document"The
PredicateTypeinCreateSBOMScanneris now left empty so the unbundler can detect the format from thepredicateTypefield in the scanner's JSON output and attach the attestation with the correct predicate type (https://spdx.dev/Document orhttps://cyclonedx.org/bom).
HasSBOMis updated via a newIsSBOMPredicateTypehelper to recognize both formats.Scanners may write
.cdx.jsonfiles to$BUILDKIT_SCAN_DESTINATION; the existing.spdx.jsonconvention is unchanged.Note: This PR doesn't create parity with SPDX within BuildKit, since there's additional actions BuildKit performs to enhance the SPDX SBOM. However, this PR is meant to be a first "pass-through" step to integrating CycloneDX SBOMs.
Example
imagetoolscurlNote:
in-toto.io/predicate-typeishttps://cyclonedx.org/bom, nothttps://spdx.dev/Documentcurlon an image that has a SPDX SBOM attestation layer looks like this