Skip to content

sbom: deterministic CycloneDX SBOMs, and attestgate's RequireSBOM - #32

Merged
aledbf merged 1 commit into
mainfrom
sbom
Oct 13, 2026
Merged

aledbf merged 1 commit into
mainfrom
sbom

Conversation

@aledbf

@aledbf aledbf commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

S2 of the supply-chain plan (PR 8 in the table): the deterministic CycloneDX 1.6 library and command the three repositories write their SBOMs with.

  • sbom (importable) on cyclonedx-go v0.12.0:
    • Kinds: Go (build info: the main module at the release's version, its modules with their go.sum hash, replacements as compiled, and stdlib), Apko, Dpkg, Apk (-only is what ships; the rest is formulation), Pnpm (runtime dependencies only, never dev), Pins (versions.yaml), and File.
    • Combining and checking: Merge nests BOMs under a subject; Check refuses an empty version, (devel), or a component with neither a purl nor a hash.
    • Determinism: components are sorted, the serial is a UUIDv8 of the subject, and the timestamp comes only from SOURCE_DATE_EPOCH.
  • cmd/sbom: one subcommand per kind, plus merge and check.
  • attestgate.Gate.RequireSBOM: an upload also needs an earlier cosign attest-blob --type cyclonedx. It is off, so bumping go-tools turns no repository red.
  • Run on real inputs (spin's pnpm lock, spin-ami's apko lock, a Go binary): each BOM passes check, and pnpm gives the same bytes on a second run.

mutate: 135 refused, 0 survived.

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

S2 of the supply-chain plan. Package sbom and cmd/sbom write CycloneDX
1.6 from what a build read - Go build info, an apko lock, a dpkg
listing, an apk database split into shipped and formulation, a pnpm
lock's runtime dependencies, versions.yaml pins, a file by its hash -
merge BOMs under the file they describe, and check that every component
has a version a scanner can match and a package URL or a hash. The same
inputs are the same bytes: sorted components, a serial derived from the
subject, SOURCE_DATE_EPOCH's time or none.

attestgate's RequireSBOM holds an upload to a cyclonedx attestation
before it too; it is off until a repository writes its SBOMs.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@aledbf
aledbf merged commit 621f429 into main Oct 13, 2026
1 check passed
@aledbf
aledbf deleted the sbom branch October 13, 2026 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant