Synopsis
The SBOM file is given with the
--sbom-file flag. CycloneDX (JSON and XML) and
SPDX (JSON and tag-value) are supported.
The file is uploaded as it is, so the recorded checksum is the checksum of the
file you supplied and you can verify it by hand. It must be a single file: it is
not compressed, and a gzipped file is rejected, because the format and the
summary below are read from it.
Kosli reads the format, the creation time, the tools that produced it, the
subject it describes and how many packages it lists. A plain SBOM file is not
checked against the artifact; it is recorded as reported.
The SBOM may also arrive inside an in-toto attestation, as a Sigstore bundle or
a DSSE envelope. The SPDX or CycloneDX document is then read from it, and the
bundle or envelope is what is uploaded and checksummed. When the artifactâs
fingerprint is known, because it is calculated from the artifact or given with
--fingerprint, the attestation must list that artifact as its subject, signed
or not. When the attestation is bound by the artifactâs template name and commit
instead, or to the trail alone, there is no fingerprint to check the subject
against, so it is not checked. To verify its signature, pass
--certificate-identity (or --certificate-identity-regexp) with
--certificate-oidc-issuer, or --key. Without them the signature is not
checked, and even a signed bundle is recorded with verified set to false. The
record is annotated with verified and the verification details, as
kosli attest in-toto annotates it. To pick the SBOM from a file holding
several attestations, or to record provenance, use kosli attest in-toto.
Verifying a certificate-signed attestation needs the trust root of the Sigstore instance
that signed it: Sigstoreâs public-good instance, or GitHubâs own, which signs attestations
for private repositories. It is fetched over TUF on every run that verifies one, from
https://tuf-repo-cdn.sigstore.dev or https://tuf-repo.github.com respectively, and
cached under ~/.sigstore, so the runner needs outbound HTTPS to that host and a writable
~/.sigstore directory. A key-signed attestation needs neither, unless it carries a
transparency log entry or a signed timestamp, which are checked against Sigstoreâs
public-good trust root. An unsigned attestation needs neither.
The SBOM file is the only attachment: this command does not accept additional
attachments, because two or more would be compressed together.
The format and the file checksum are also added as the sbom_format and
sbom_sha256 annotations.
The attestation can be bound to a trail using the trail name.
The attestation can be bound to an artifact in two ways:
- using the artifactâs SHA256 fingerprint which is calculated (based on the
--artifact-typeflag and the artifact name/path argument) or can be provided directly (with the--fingerprintflag). - using the artifactâs name in the flow yaml template and the git commit from which the artifact is/will be created. Useful when reporting an attestation before creating/reporting the artifact.
.kosli_ignore file to the root of the artifact.
Each line should specify a relative path or path glob to be ignored. You can include comments in this file, using #.
The .kosli_ignore file is always treated as part of the artifact: its own entries cannot exclude it, so the exclusion list cannot be changed without changing the fingerprint.
Paths the list already matches stay excluded whatever is later added there, so keep its entries as narrow as possible.
Excluding the file with --exclude keeps it out of the fingerprint but still applies the paths it lists, which lets a writable directory change the list again.
To drop the file from the fingerprint safely, move its entries to --exclude and delete it.
You can optionally associate the attestation to a git commit using --commit.
The commit is read from the git repository at --repo-root, which must be the repositoryâs top-level directory. Without --commit, no git repository is needed.
If --commit is only defaulted from CI and --repo-root is left at ., a missing repository or commit
prints a warning and the attestation is sent without commit info.
Note that when the attestation is reported for an artifact that does not yet exist in Kosli, --commit is required to facilitate
binding the attestation to the right artifact.
You can optionally redact some of the git commit data sent to Kosli using --redact-commit-info.
To record repository information, all three of --repo-id, --repo-url, and --repository must be set together.
These are automatically set in GitHub Actions, GitLab CI, Bitbucket Pipelines, and Azure DevOps.
In other CI systems, set them explicitly to capture repository metadata.
Flags
Flags inherited from parent commands
Examples Use Cases
These examples all assume that the flags--api-token, --org, --host, (and --flow, --trail when required), are set/provided.
report an SBOM about a pre-built docker artifact (kosli finds the fingerprint)
report an SBOM about a pre-built docker artifact (kosli finds the fingerprint)
report an SBOM signed into a Sigstore bundle, verifying who signed it
report an SBOM signed into a Sigstore bundle, verifying who signed it
report an SBOM about a trail
report an SBOM about a trail