Safeguard
Developer Tools•

How do you sign release files with cosign sign-blob?

Sign tarballs, installers and other non-container files with cosign sign-blob and a bundle, then verify with identity checks. Steps, flags and pitfalls.

Safeguard Security Team
3 min read

Use cosign sign-blob with a bundle output to sign any file, such as a tarball or installer. Publish the bundle next to the file. Consumers then run verify-blob with the bundle and the signer identity they expect, which checks both the signature and who made it.

Sign a file

Keyless signing is the documented recommendation:

cosign sign-blob <file> --bundle bundle.sigstore.json

With your own key:

cosign sign-blob --key cosign.key --bundle bundle.sigstore.json README.md

The docs say the bundle is the recommended way to sign a blob, because users pass one bundle instead of separate signature and certificate files. In CI, a yes flag skips confirmation prompts.

Verify a file

cosign verify-blob <file> --bundle artifact.sigstore.json \
  --certificate-identity=name@example.com \
  --certificate-oidc-issuer=https://accounts.example.com

The identity and issuer are the point. Without them you only learn that someone signed, which anyone can do.

For key based signing, verify with the public key. If the key lives in a KMS, the docs suggest exporting the public key once, so verification does not need a KMS call.

Checksum, signature or bundle

MethodProves integrityProves who signedNotes
Checksum file aloneOnly if the checksum came from a trusted channelNoAttacker who swaps the file can swap the sum
Signature with a keyYesYes, by keyYou manage keys
Bundle with keyless signingYesYes, by identityNeeds trust roots and the bundle

A release routine

  1. Build the file in CI and compute its digest.
  2. Sign with the CI workload identity, writing a bundle.
  3. Upload the file, the bundle and the checksum to the release page.
  4. In your install docs, show the exact verify command with your real identity and issuer filled in.
  5. Test the instructions on a clean machine.

Pitfalls

  • Losing the bundle. The docs say to keep it, since it holds verification metadata.
  • Publishing the verify command without the identity flags.
  • Signing on a developer laptop with a personal identity, which makes the identity hard to explain to users.
  • One doc example passes an image reference to sign-blob, which looks like a mistake, so check your target is a file path.

What signing does not cover

A signed file can still be malicious if the pipeline or source was compromised. Signing says who published it, not that it is safe.

Where Safeguard fits

Safeguard's SBOM and dependency scanning and policy gates help check what goes into a release before you sign it.

Quick check

Do I need the bundle to verify later?

Yes, or the separate signature and certificate. The bundle keeps them together with log evidence.

Is a published SHA-256 enough?

Only if the sum is delivered over a channel an attacker cannot change. A signature verified against an identity is stronger.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.