fleetlint Policy for a fleet of repositories
v0.7
Getting started

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).

Severitywarning
Tiers1
Artifactoci-artifact
Scoperoot
Kindoutcome
Sourcelibrary v0.4.0
Selected byfleetlint-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() > 0

Fix

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


Generated by fleetlint docs from catalog v0.4.0.