Package Signing and Verification
Introduction
In this tutorial, create and sign a package, verify its signature, and deploy it.
Package signing lets consumers verify a package’s contents, and that it was signed by an expected identity before deployment. Trust the signer by verifying with its public key or a pinned OIDC issuer and identity.
Prerequisites
Complete these prerequisites:
- Install the Zarf binary (Installing Zarf).
- Clone the Zarf source repository to create the WordPress example package.
Step 1: Clone the Zarf repository
git clone https://github.com/zarf-dev/zarf.gitStay outside the cloned repository for the remaining steps so the generated keys and package are written to your current directory.
Step 2: Generate a Signing Key Pair
Generate a private and public key pair:
zarf tools gen-keyEnter a strong password when prompted to encrypt the private key.
This creates two files:
cosign.key: private signing keycosign.pub: public verification key
Step 3: Create a Package
Create a WordPress package for amd64 from the Zarf examples directory:
zarf package create ./zarf/examples/wordpress --architecture amd64The log shows the path to the created package:
INF writing package to disk path=zarf-package-wordpress-amd64-26.0.0.tar.zstStep 4: Sign the Package
Sign the package with the private key:
zarf package sign zarf-package-wordpress-amd64-26.0.0.tar.zst --signing-key cosign.key --signing-key-pass <password>The package now contains a signature.
Step 5: Verify the Package Signature
Verify the signature with the public key:
zarf package verify zarf-package-wordpress-amd64-26.0.0.tar.zst --key cosign.pubSuccessful verification includes the following output:
2026-01-15 14:17:13 INF checksum verification status=PASSEDVerified OK2026-01-15 14:17:16 INF signature verification status=PASSED2026-01-15 14:17:16 INF verification complete status=SUCCESSVerification checks the signature and package checksums. This confirms the package came from the expected signer and has not been modified.
Step 6: Deploy with Signature Verification
Deploy with signature verification enabled. If you have an initialized Kubernetes cluster, see Initializing a K8s Cluster, then run:
zarf package deploy zarf-package-wordpress-amd64-26.0.0.tar.zst --key cosign.pub --verify --confirmThe --verify flag enforces signature verification. If the signature is invalid or the public key doesn’t match, Zarf will abort the deployment.
Before deployment begins, the output includes:
Verifying package signature...✔ Package signature verified successfullyDeploying package...Keyless Signing
Use keyless signing in CI/CD or when you want to sign with an OIDC identity instead of managing a private key. Sigstore’s Fulcio certificate authority issues a short-lived certificate for that identity.
Sign Keylessly
Run this command interactively to open a browser for OIDC login:
zarf package sign zarf-package-wordpress-amd64-26.0.0.tar.zst --keyless --confirmIn GitHub Actions, Zarf detects the job’s OIDC environment. Grant the job id-token: write permission and use the same command; no --identity-token flag is needed:
permissions: id-token: write contents: readVerify a Keyless-Signed Package
Verify the expected OIDC identity instead of providing a public key:
zarf package verify zarf-package-wordpress-amd64-26.0.0.tar.zst \ --certificate-identity "your-email@example.com" \ --certificate-oidc-issuer "https://accounts.google.com"For packages signed in GitHub Actions, use --certificate-identity-regexp to match the workflow path:
zarf package verify zarf-package-wordpress-amd64-26.0.0.tar.zst \ --certificate-identity-regexp "https://github.com/my-org/my-repo/.github/workflows/release.yml@refs/tags/" \ --certificate-oidc-issuer "https://token.actions.githubusercontent.com"For packages signed with the default keyless options, verification works offline. Zarf embeds the Sigstore TrustedRoot in the binary, and the package bundle includes the Rekor inclusion proof. See the Package Signing Reference for keyless-signing, custom TrustedRoot, and TSA timestamp details.
Next Steps
Next, you can:
- Learn about signing existing packages with
zarf package signin the Package Signing Reference - Explore cloud KMS options for production signing in the Package Signing Reference
- Integrate signature verification into your CI/CD pipelines
- Establish key management and rotation procedures for your organization
Additional Resources
- Package Signing Reference - Comprehensive signing and verification documentation
- zarf package sign command - Command reference
- zarf package verify command - Command reference