feat: native SBOM support (SBoM/v1 input, sbom linking, orchestrating SBOM) - #3177
Draft
a-thaler wants to merge 12 commits into
Draft
feat: native SBOM support (SBoM/v1 input, sbom linking, orchestrating SBOM)#3177a-thaler wants to merge 12 commits into
a-thaler wants to merge 12 commits into
Conversation
Signed-off-by: Andreas Thaler <andreas.thaler01@sap.com>
Signed-off-by: Andreas Thaler <andreas.thaler01@sap.com>
Signed-off-by: Andreas Thaler <andreas.thaler01@sap.com>
Signed-off-by: Andreas Thaler <andreas.thaler01@sap.com>
Signed-off-by: Andreas Thaler <andreas.thaler01@sap.com>
Signed-off-by: Andreas Thaler <andreas.thaler01@sap.com>
✅ Deploy Preview for ocm-website ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Signed-off-by: Andreas Thaler <andreas.thaler01@sap.com>
Signed-off-by: Andreas Thaler <andreas.thaler01@sap.com>
Signed-off-by: Andreas Thaler <andreas.thaler01@sap.com>
Signed-off-by: Andreas Thaler <andreas.thaler01@sap.com>
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.
What
Adds native SBOM support to OCM: attach SBOMs to component resources, discover them from OCI images at build time, and assemble an orchestrating SBOM for a whole component version.
This PR is an outcome from a hackathon and outlines a potential solution for open-component-model/ocm-project#1225
Why
A component is only as trustworthy as your ability to say what is inside it. This makes SBOMs first-class OCM resources — transported with the component, accessed uniformly whether the component lives in a CTF archive or an OCI registry, and aggregatable into one document a scanner (Trivy, Dependency-Track, …) can consume.
Design background:
docs/adr/0026_native_sbom_support.md.What's included
type: sbomlinked to its subject via theocm.software/artefactReferencelabel, whose value is a flatidentitySelector(name/version of the described resource). Follows the ocm-spec artefact-reference convention. Discovery:descriptor.FindSBOMResources.SBoM/v1input type (bindings/go/input/sbom) — discovers the SBOM attached to a referenced resource's OCI image (buildx attestation + OCI Referrers API, in-toto unwrapped) at construction time and bakes it as a local blob in its original format (e.g. SPDX). References the subject by{name, version, extraIdentity}; resolved to the subject's access by a pre-construction pass (no constructor-core change). For a multi-arch image it attaches every platform's SBOM (one resource per platform, arch-tagged via the resource's ownextraIdentity), or a single platform when the reference setsextraIdentity.architecture. The auto-added label carries name/version only (no architecture), so it stays a subset of the subject image's identity; per-arch disambiguation is via the SBOM resource'sextraIdentity.bindings/go/oci) —FetchImageSBOMs,ListImagePlatforms,ImageSBOMDownloader/ImagePlatformLister, per-platform resolution. Only SBOM predicates (SPDX/CycloneDX) are extracted; SLSA provenance layers are intentionally ignored.ocm get sbom <cv> [--recursive]— assembles a single flat CycloneDX 1.6 document (hierarchy in thedependenciesgraph, so scanners actually read it); SPDX/CycloneDX-XML normalized to CycloneDX;-o json|yaml; host-arch selection for per-arch SBOMs.ocm download resource --identity name=<sbom-resource>.SBoM/v1reference entry, and an end-to-end tutorial.Verification
bindings/go/sbom,bindings/go/input/sbom, and the CLI pre-pass /get sbom.ghcr.io/stefanprodan/podinfo:6.9.1:add cvbakes per-arch SPDX SBOMs, each carrying theocm.software/artefactReferencelabel;get sbom --recursiveproduces a flat CycloneDX doc that Trivy scans successfully.Notes
bindings/go/sbom,bindings/go/input/sbom) isolate the CycloneDX/protobom dependencies;go.sumshould be re-verified against the sumdb in CI.SBoM/v1input reads the image index atadd cvtime to enumerate platforms (needs registry credentials).ocm.software/artefactReferencelabel follows the still-in-review ocm-spec convention (docs(conventions): define artefact-linking label convention ocm-spec#146); the value shape may change if that lands differently.