Sign an image by digest
Sign the immutable digest, not a tag; a tag can move between push and signing, so signing it is unsafe.
cosign sign --key cosign.key <host>/<name>@sha256:<id>
- tool
- cosign5 commands
More cosign commands
-
COSIGN_EXPERIMENTAL=1 cosign sign <host>/<name>@sha256:<id>Sign with Fulcio and Rekor using your OIDC identity; in cosign v2 this is the default.
-
cosign verify --certificate-identity=<id> --certificate-oidc-issuer=<host> <host>/<name> | jq .Verify a keyless signature; always set both the signer identity and the OIDC issuer.
-
cosign attest --key cosign.key --predicate sbom.json --type cyclonedx <host>/<name>@sha256:<id>Attach a signed CycloneDX SBOM attestation to an image digest.
-
cosign verify-attestation --key cosign.pub --type cyclonedx <host>/<name> | jq -r '.payload' | base64 -d | jq .Verify the attestation, then decode the in-toto payload to read the predicate.