Skip to main content
In this tutorial, you’ll install Sigstore’s Cosign binary, verify your setup, generate a key pair for signing OCI artifacts, and configure Flux CD to use the Cosign public key. By following these steps, you’ll enable secure supply chain workflows for container images.

Verify Cosign Is Not Installed

First, confirm Cosign isn’t already available:
Seeing command not found means Cosign isn’t installed. Continue to the installation methods below.

Installation Options

Cosign is part of the Sigstore project. Choose the method that best fits your environment:

1. Standalone Binary

2. RPM Package

3. DEB Package

Verify Installation

After installation, check your Cosign version:
Ensure you install v2.0.0 or later for full compatibility with Flux CD’s image verification features.

Generate a Cosign Key Pair

Create an asymmetric key pair to sign your OCI artifacts:
Verify the files:
Keep your private key (cosign.key) secure and never commit it to version control. Remember your password—it’s required for signing and verification.

Configure Flux CD with the Public Key

To enable Flux CD to verify image signatures, store the public key as a Kubernetes Secret in the flux-system namespace:
Flux will automatically fetch this key and validate any signed OCI artifacts during reconciliation.

Next Steps

  1. Build and push an OCI artifact (e.g., container image).
  2. Sign the image using Cosign.
  3. Observe Flux CD verifying the signature in your cluster.

References

Watch Video