release/sbom/oci-artifact
Releases publish an SBOM
Implements release/sbom for the oci-artifact artifact: it runs when the release publishes one (see artifacts).
| Severity | warning |
| Tiers | 1 |
| Artifact | oci-artifact |
| Scope | root |
| Kind | outcome |
| Source | library v0.4.0 |
| Selected by | fleetlint-recommended@v0.4.0 |
Requirement
An SBOM of what went into the artifact is attached to its digest: cosign attest --type spdx|cyclonedx or cosign attach sbom, or oras attach --artifact-type with an SPDX or CycloneDX media type. An artifact built from a repository tree has the repository’s dependency SBOM (syft dir:.); one built from nothing but data states that in its annotations.
Why
Consumers and scanners need to know what is inside an artifact; generating the SBOM in the pipeline ties it to the exact build.
Capability applies when
release.exists || repo.artifacts.size() > 0Fix
Generate the SBOM with syft (syft dir:. -o spdx-json > sbom.spdx.json) and attach it: cosign attest --yes --type spdxjson --predicate sbom.spdx.json <repository>@<digest>.
Agent instruction: Add anchore/sbom-action (or syft dir:.) before the push step and cosign attest --yes --type spdxjson --predicate <sbom> <repository>@${{ steps.<id>.outputs.digest }} after it.
Sources
- https://csrc.nist.gov/pubs/sp/800/218/final (standard, PS.3.2: Collect, safeguard, maintain, and share provenance data for all components of each software release)
- https://github.com/ossf/scorecard/blob/main/docs/checks.md (standard, SBOM)
- https://spdx.github.io/spdx-spec/v2.3/ (spec)
- https://cyclonedx.org/specification/overview/ (spec)
- https://fleetlint.org/baseline/#releases
- https://oras.land/docs/how_to_guides/manifest_config/ (spec)
- https://docs.sigstore.dev/cosign/verifying/attestation/ (spec)
- https://github.com/anchore/syft (spec)
Generated by fleetlint docs from catalog v0.4.0.