Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cosign integration. Docker images signature and validation in github actions #492

Merged

Conversation

groldan
Copy link
Member

@groldan groldan commented Jul 2, 2024

Backport #491 to 1.8.x

Required to create these secrets in github actions setup:

image

Cosign_key is the private key
Cosign_pub_key the public one (for use in validation process)
Cosign_password is the password for the private key
Docker token and username for dockerhub repo.

You should create your keys with cosign generate-key-pair
You will be challenged for setting a password for the private key (that is going to be the value of your cosign_password secret)
Then you will get 2 files, cosign.key and cosign.pub.

Assign those values to the secrets, and make public the cosign.pub (adding to your repo in git, so people can access it for own validation).

Since cosign advices to avoid signing based on tags, then we are signing images based on digest.
Once pulled in repo, signing procedure is executed and cosign adds a .sig file into the dockerhub repo, which is used for validation. If the sig file for a digest is removed, then image wont be recognized as signed.

You can validate images in this way:
cosign verify --key cosign.pub jemacchi/geoserver-cloud-wms:1.9-SNAPSHOT

IMPORTANT Note: do not confuse use of Cosign with Docker Content Trust (reference: https://snyk.io/blog/signing-container-images/ ).

@groldan groldan added build Issues related to the build and/or CI docker Issues related to docker images or docker composition labels Jul 2, 2024
@groldan groldan merged commit eab2601 into geoserver:release/1.8.x Jul 2, 2024
2 checks passed
@groldan groldan deleted the release/signed-images_1.8.x branch July 2, 2024 03:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Issues related to the build and/or CI docker Issues related to docker images or docker composition
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants