Cosign Sign and verify artifacts
Light · Postcard
102 × 152 mm · PDF
Dark · Postcard
102 × 152 mm · PDF
Ink saver · Postcard
102 × 152 mm · PDF
Light · A4 landscape
297 × 210 mm · PDF
Dark · A4 landscape
297 × 210 mm · PDF
Ink saver · A4 landscape
297 × 210 mm · PDF
Light · A3 landscape
420 × 297 mm · PDF
Dark · A3 landscape
420 × 297 mm · PDF
Ink saver · A3 landscape
420 × 297 mm · PDF
Start here
cosign generate-key-pair
cosign sign --key cosign.key
<image>@<digest>
cosign verify --key cosign.pub <image>
cosign sign <image>@<digest>
cosign sign-blob --bundle <b> <file>
cosign verify-blob --bundle <b> <file>
cosign attest --predicate <f> <image>
cosign tree <image>
Concepts
- OIDC login Google, GitHub, ...
- Fulcio short-lived cert
- Signature stored in registry
- Rekor transparency log
Keys
cosign generate-key-pair
cosign generate-key-pair --output-key-prefix
<name>
cosign generate-key-pair --kms <kms-uri>
cosign public-key --key <kms-uri>
--key awskms:// / gcpkms:// / azurekms:// /
hashivault://
Sign
cosign sign --key cosign.key
<image>@<digest>
cosign sign <image>@<digest>
cosign sign --yes <image>@<digest>
cosign sign -a <key>=<value>
<image>@<digest>
cosign sign --recursive <image>@<digest>
cosign sign --identity-token <token>
<image>@<digest>
cosign sign --key <kms-uri>
<image>@<digest>
cosign sign --signing-config <file>
<image>@<digest>
Verify
cosign verify --key cosign.pub <image>
cosign verify --certificate-identity <id>
--certificate-oidc-issuer <url> <image>
cosign verify --certificate-identity-regexp <re>
--certificate-oidc-issuer-regexp <re>
<image>
cosign verify -a <key>=<value> --key cosign.pub
<image>
cosign verify --certificate-github-workflow-repository
<owner/repo> ... <image>
cosign verify --key cosign.pub <image> | jq
cosign verify --key cosign.pub --local-image
<dir>
cosign verify --insecure-ignore-tlog --key cosign.pub
<image>
Attestations
cosign attest --key cosign.key --predicate <file>
<image>@<digest>
cosign attest --type <type> --predicate <file>
<image>@<digest>
cosign verify-attestation --key cosign.pub
<image>
cosign verify-attestation --type <type> --policy
<file> --key cosign.pub <image>
cosign attest --predicate -
<image>@<digest>
cosign verify-attestation ... <image> | jq -r
.payload | base64 -d
Blobs
cosign sign-blob --bundle <bundle> <file>
cosign verify-blob --bundle <bundle>
--certificate-identity <id> --certificate-oidc-issuer
<url> <file>
cosign sign-blob --key cosign.key <file>
cosign verify-blob --key cosign.pub --bundle <bundle>
<file>
cosign sign-blob --yes --bundle <bundle>
<file>
cosign attest-blob --predicate <file> --bundle
<bundle> <file>
Inspect and manage
cosign tree <image>
cosign save --dir <dir> <image>
cosign load --dir <dir> <image>
cosign clean <image>
cosign initialize
cosign login <registry>
cosign versionEnvironment
COSIGN_PASSWORD=<pw>
SIGSTORE_ID_TOKEN=<token>
SIGSTORE_ROOT_FILE=<pem>
cosign env --show-descriptions
Recipes
cosign generate-key-paircosign sign --key cosign.key ghcr.io/me/app@sha256:<digest>cosign verify --key cosign.pub ghcr.io/me/app@sha256:<digest>
cosign sign --yes ghcr.io/me/app@sha256:<digest>cosign verify ghcr.io/me/app@sha256:<digest> \ --certificate-identity-regexp 'https://github.com/me/app/.*' \ --certificate-oidc-issuer https://token.actions.githubusercontent.com
cosign sign-blob --yes --bundle app.tgz.sigstore.json app.tgzcosign verify-blob --bundle app.tgz.sigstore.json \ --certificate-identity <id> --certificate-oidc-issuer <url> app.tgz
cosign attest --key cosign.key --type spdxjson --predicate sbom.spdx.json <image>@<digest>cosign verify-attestation --key cosign.pub --type spdxjson <image>@<digest>



