Sub topic 12
Signing charts and verifying provenance
This chapter assumes you can package and push a chart with helm package and helm push, and that you know what an OCI digest is. You also need GnuPG installed and a key pair. Helm's built-in signing uses PGP.
What provenance gives you
A digest tells you that the bytes you pulled match the bytes you pinned. It doesn't tell you who published them. Provenance adds that. A provenance file (.prov) is a text file that contains:
- the chart's
Chart.yamlmetadata, - the SHA-256 hash of the packaged
.tgz, - a PGP signature over both.
Anyone holding your public key can check that the archive is unchanged and that your private key signed it.
Preparing the keyring
Helm reads keyrings in the legacy GnuPG format. Newer GnuPG versions (2.1 and later) store keys differently, so export them first:
gpg --list-secret-keys
gpg --export-secret-keys > ~/.gnupg/secring.gpg
gpg --export > ~/.gnupg/pubring.gpgThe first command shows the key name (the user ID) that you pass to Helm in the next step.
Signing at package time
Add --sign to helm package. You also give it the key name and the secret keyring:
helm package ./myapp --sign \
--key 'Alice Example' \
--keyring ~/.gnupg/secring.gpgHelm prompts for the key passphrase. It then writes two files next to each other:
myapp-0.1.0.tgz
myapp-0.1.0.tgz.provPushing the signed chart
Push the .tgz as usual:
helm push myapp-0.1.0.tgz oci://registry.example.com/chartsHelm looks for myapp-0.1.0.tgz.prov in the same directory. If it finds the file, it uploads it to the registry with the chart. It isn't a separate artifact and it isn't a separate tag. If the .prov file is missing, the push succeeds and the chart is unsigned, with no warning.
Verifying on the consumer side
The consumer needs your public key in a keyring. They pull with --verify:
helm pull oci://registry.example.com/charts/myapp \
--version 0.1.0 \
--verify \
--keyring ~/.gnupg/pubring.gpgHelm downloads the chart and its .prov file. It then checks the signature against the keyring and compares the recorded hash with the archive. If either check fails, the command exits with an error.
You can also verify files you already have on disk:
helm verify myapp-0.1.0.tgz --keyring ~/.gnupg/pubring.gpgLimits to know about
- The signature covers the chart archive. It doesn't cover the registry's manifest digest or the tag. A tag can still be moved to a different chart, and a moved tag only fails verification if the new chart's
.provdoesn't match. - Verification is opt-in. Plain
helm pullandhelm installdon't check signatures unless you pass--verify. - Trust depends on how consumers obtain your public key. Distribute it over a channel separate from the registry.
- Teams that already sign container images often use Sigstore's
cosigninstead. It signs the OCI artifact by digest and fits the same tooling as image signing. Helm's.provfiles andcosignsignatures are separate mechanisms, and you can use one or both.
Common errors
| Symptom | Likely cause |
|---|---|
| `failed to load keyring` | The keyring is missing or is in the newer GnuPG format. Re-export it with `gpg --export`. |
| `unable to find a signing key` | The `--key` value doesn't match a user ID in the secret keyring. |
| Verification fails after a successful push | The `.tgz` was rebuilt after signing, so its hash no longer matches the `.prov` file. Package and sign in one step. |
| Chart pushed without a signature | The `.prov` file wasn't in the same directory as the `.tgz` at push time. |
Exercise
You run helm package ./myapp --sign ... and then helm push dist/myapp-0.1.0.tgz oci://registry.example.com/charts. Consumers report that helm pull --verify can't find provenance. The .prov file was written to the current directory. What went wrong, and how do you fix it?
Show answer
Helm looks for the .prov file next to the .tgz that you push. The archive was in dist/, but the .prov file was in the current directory, so it wasn't uploaded. Package with --destination dist so both files land in the same directory. Then push again, or bump the version if your registry doesn't allow overwriting tags.