anchorectl sbom

Sign, verify and attest local SBOM files using cosign.

These commands run the cosign binary (v3.0.4 or later) found on your PATH, or the one named by the ANCHORECTL_COSIGN_PATH environment variable when that is set. ANCHORECTL_COSIGN_PATH takes the full path of the cosign binary; it is an environment variable only, with no configuration-file setting or flag. If it is set but does not point at an executable cosign, the command fails rather than falling back to PATH. They work on files on disk only: they do not contact Anchore Enterprise and do not push anything to a registry. For a walkthrough, see Sign and Attest SBOMs.

Every command on this page also accepts the global flags. Signing settings can also come from the cosign section of the configuration file; a flag on the command line takes precedence.

Supported SBOM formats: CycloneDX JSON, SPDX JSON and Syft JSON.

Subcommands

  • sbom sign — Sign an SBOM file with cosign
  • sbom verify — Verify an SBOM file’s signature or attestation with cosign
  • sbom attest — Attest that an SBOM describes a file, signed with cosign

sbom sign

Sign an SBOM file on disk with cosign and write a Sigstore signature bundle next to it (SBOM.sigstore.json, or --bundle). The SBOM file itself is not modified.

anchorectl sbom sign SBOM [flags]

Arguments

ArgumentDescription
SBOMPath to the SBOM file to sign.

Flags

FlagTypeEnvironment variableDefaultRequiredDescription
--keystringANCHORECTL_COSIGN_KEY""One of --key / --keylessPrivate key: a file path or a KMS URI (awskms://, gcpkms://, azurekms://, hashivault://).
--keylessboolANCHORECTL_COSIGN_KEYLESSfalseOne of --key / --keylessSign with a short-lived certificate from an OIDC login instead of a key. Needs --tlog-upload=true.
--bundlestringSBOM.sigstore.jsonNoFile to write the Sigstore bundle to.
--overwriteboolfalseNoOverwrite the bundle file if it already exists.
--tlog-uploadboolANCHORECTL_COSIGN_TLOG_UPLOADtrueNoRecord the signature in the Rekor transparency log. Set false to sign fully offline.

The key password is read from cosign.password in the configuration file, ANCHORECTL_COSIGN_PASSWORD or COSIGN_PASSWORD. There is no password flag. If none is set, cosign prompts for it.

sbom verify

Check the Sigstore bundle for an SBOM file with cosign and print one line: the signature (or, with --attestation, the attestation) is valid, or it is not. The exit code is 0 only when the check passes.

anchorectl sbom verify SBOM [flags]

Arguments

ArgumentDescription
SBOMPath to the SBOM file to verify.

Flags

FlagTypeEnvironment variableDefaultRequiredDescription
--keystringANCHORECTL_COSIGN_PUBLIC_KEY""One of --key / --certificate-*Public key: a file path or a KMS URI. Read from cosign.public-key in the configuration file.
--certificate-identitystringANCHORECTL_COSIGN_CERTIFICATE_IDENTITY""With keylessIdentity a keyless signature must carry.
--certificate-oidc-issuerstringANCHORECTL_COSIGN_CERTIFICATE_OIDC_ISSUER""With keylessOIDC issuer a keyless signature must carry.
--bundlestringSBOM.sigstore.json; with --attestation, SBOM.att.sigstore.jsonNoSigstore bundle to check.
--attestationboolfalseNoVerify an attestation about the SBOM instead of a signature of the SBOM itself.
--subjectstring""With --attestationThe file the SBOM describes, which the attestation is bound to.
--typestringdetectedNoWith --attestation: the attestation type (cyclonedx, spdxjson, custom or an absolute URI). Detected from the SBOM file when omitted.
--tlog-uploadboolANCHORECTL_COSIGN_TLOG_UPLOADtrueNoCheck the Rekor transparency log entry. Set false to verify a bundle that was signed offline.

With --attestation, anchorectl also checks that the SBOM stored in the attestation is the SBOM file you passed. If the attestation is valid but describes a different SBOM, verification fails.

sbom attest

Create a signed cosign attestation that a file (the subject, named with --subject) is described by the given SBOM, and write a Sigstore attestation bundle next to the SBOM (SBOM.att.sigstore.json, or --bundle). Neither the SBOM nor the subject file is modified.

anchorectl sbom attest SBOM --subject FILE [flags]

Arguments

ArgumentDescription
SBOMPath to the SBOM file to use as the attestation predicate.

Flags

FlagTypeEnvironment variableDefaultRequiredDescription
--subjectstring""YesThe file the SBOM describes, which the attestation is bound to.
--keystringANCHORECTL_COSIGN_KEY""One of --key / --keylessPrivate key: a file path or a KMS URI.
--keylessboolANCHORECTL_COSIGN_KEYLESSfalseOne of --key / --keylessSign with a short-lived certificate from an OIDC login instead of a key. Needs --tlog-upload=true.
--typestringdetectedNoThe attestation type (cyclonedx, spdxjson, custom or an absolute URI). Detected from the SBOM file when omitted: CycloneDX → cyclonedx, SPDX → spdxjson, Syft → https://syft.dev/bom.
--bundlestringSBOM.att.sigstore.jsonNoFile to write the Sigstore bundle to.
--overwriteboolfalseNoOverwrite the bundle file if it already exists.
--tlog-uploadboolANCHORECTL_COSIGN_TLOG_UPLOADtrueNoRecord the attestation in the Rekor transparency log. Set false to attest fully offline.
Last modified November 24, 2026