A successfully built container image doesn’t guarantee it came from a proper build process or a trusted publisher. Tags like latest can also point to different images over time. To reduce the risk of supply chain compromise, teams need to verify not just the image contents, but also the identity of the signer. Sigstore and Cosign provide an open approach to signing and verifying artifacts, including container images stored in OCI registries.
What Are Sigstore and Cosign?
Sigstore is a project that simplifies software artifact signing and verification. Cosign is one of its primary tools, with support for container images and other OCI artifacts. In keyless signing mode—without long-term key management—Cosign can use identities from OpenID Connect (OIDC) providers. Fulcio issues short-lived signing certificates, while Rekor provides a transparency log that helps others trace signing evidence.
This workflow reduces the need to store permanent private keys across many CI runners. However, keyless mode isn’t risk-free: the identity used for signing must still be restricted, the authentication flow must be secured, and verification policies must specify trusted identities and issuers.
What Does a Signature Actually Prove?
A signature connects a specific artifact to a signer identity and cryptographic proof. If an image changes, its digest changes too, so a signature referencing the old digest won’t automatically apply to the new image. Therefore, reference images using digests like registry.example/app@sha256:..., not just mutable tags.
That said, a valid signature doesn’t automatically prove the code is safe, vulnerability-free, or built from the correct source. A signature only answers part of the question: does the examined artifact match the signing proof, and does the signer identity match expected policy? Vulnerability scanning, build provenance checks, and change review are still required.
Recommended Workflow
- Build images from reviewed commits through a trusted CI pipeline.
- Capture the image digest after build and push to registry completes.
- Sign the digest-based reference using a pipeline identity or securely managed key.
- Verify the signature before the image enters staging or production environments.
- Preserve build logs, source commits, scan results, and deployment decisions for incident tracing.
Separating build, signing, and deployment reduces the chance that one leaked credential can perform all actions. In mature systems, signing rights are granted only to specific pipelines, not to every developer or local machine.
Example: Signing and Verifying Images
With Cosign installed and keyless authentication available, the following commands illustrate the basic workflow. Replace the image name with your own and use the correct build digest.
# Example: sign an image already pushed to registry
cosign sign registry.example.com/team/application@sha256:IMAGE_DIGEST
# Verify with expected identity and certificate issuer
cosign verify registry.example.com/team/application@sha256:IMAGE_DIGEST
--certificate-identity="[email protected]"
--certificate-oidc-issuer="https://accounts.example.com"The identity and issuer values above are examples. Adjust them to match the actual certificate identities produced by your CI environment. Don’t remove identity checks just to make verification succeed—this could allow signatures from unexpected parties to be accepted. For key-based configuration, distribute public keys through trusted channels and protect private keys with adequate access controls.
Make Verification Part of Deployment Policy
Running verification manually on occasion isn’t sufficient for production services. Add verification steps to your release pipeline, then use admission policies on your orchestration platform where available. Such policies can reject images lacking valid signatures or signed by identities outside an approved list.
Start with test environments and audit mode so teams know which images don’t yet meet rules. Once build and signing processes are consistent, apply rejection gradually. Ensure emergency paths are documented, restricted, and audited—not permanent exceptions that bypass all checks.
Mistakes to Avoid
- Verifying tags only: tags can change. Use digests to bind verification to specific artifacts.
- Accepting any identity: a valid signature from the wrong account still violates organizational policy.
- Treating signatures as security scans: combine with vulnerability scanning, dependency checks, and build provenance.
- Ignoring transparency logs: establish how to preserve verification evidence and who may sign.
- Sharing CI credentials: limit token permissions, separate duties, and rotate exposed credentials.
Pre-Deployment Checklist
Ensure your registry stores signature artifacts correctly, pipeline OIDC identities are restricted, verification rules are tested against both valid and invalid images, and result logs are accessible for audit. Document who approves policy changes and how recovery works if signing fails. Teams should also review Cosign version changes and official documentation before updating pipelines.
Conclusion
Sigstore and Cosign help build verifiable trust in container images, especially when signatures are bound to digests and checked against specified identities. They don’t replace security scanning or access controls, but serve as an important layer in the software supply chain. Implement signing in trusted pipelines, verify automatically before deployment, and preserve evidence needed for audit.
Official references: Cosign Signing Documentation and Sigstore Cosign Repository.

Leave a comment