How to set up container signing with cosign
This guide shows you how to set up Sigstore container signing for a BlueBuild custom image repository. This guide is useful when manually setting up a new repository, or regenerating keys for a pre-existing one. Setting up container signing is important for security and verifiability. This guide requires either cosign
or skopeo
, so make sure one of those is installed before proceeding. If you don’t already have either one of those installed, it is recommended you install cosign.
- Inside your repository, generate a new key pair. Do NOT put in a password when it asks you to, just press enter. The signing key will be used in GitHub Actions and will not work if it is encrypted.
- with cosign:
- with skopeo:
- Add the private key to your GitHub repository secrets
- This can be done manually on GitHub:
- Open your repository’s settings.
- From the sidebar, pick “Secrets and Variables” and “Actions”.
- Create a new repository secret called
SIGNING_SECRET
and for its value copy the contents of yourcosign.key
/cosign.private
file.
- This can also be done manually with the GitHub CLI, if that is installed:
- This can be done manually on GitHub:
- Commit the
cosign.pub
file into your git repository, so that it can be used for verification. The file should always be in the root of your repository.