docker: sign container images pushed to GHCR with GitHub OIDC tokens#4999
Conversation
2fab85a to
da729bd
Compare
|
@MichaelEischer need some more time to test. facing some issue during the slsa verification. |
|
@MichaelEischer the changes w.r.t the SLSA provenance is complete. I will update the documentation shortly. |
376fe34 to
877a10e
Compare
* the id-token of the GitHub Actions workflow will be used for image signing * replace branch-based tagging with SHA-based tagging since, branch names are mutable, SLSA provenance requires immutable tagging * use official SLSA framework Github Reusable workflow docker: fix incorrect registry name in image output step * use REGISTRY environment variable instead of IMAGE_REGISTRY docker: revert change to remove branch tag
docs: update the documentation
877a10e to
4fb9aa4
Compare
|
@MichaelEischer I guess you can do a final review and merge this. As for
I will pick it up in a separate issue. |
MichaelEischer
left a comment
There was a problem hiding this comment.
LGTM. Thanks!
I am not sure how the build-and-push steps work to upload to Dockerhub. Let me see if I can make this a generic solution which would work for any repository, not limited to Dockerhub and GHCR.
Currently the Dockerhub images are built locally, see https://github.com/restic/restic/blob/master/helpers/prepare-release/main.go for the corresponding script.
To get SLSA provenance for the DockerHub images, we have to allow the CI pipeline to push images to DockerHub. Then either the signature for the GHCR image can be reused, or the pipeline just duplicates the provenance generation step.
What does this PR change? What problem does it solve?
Refer:
https://github.com/sigstore/cosign-installer[Edit]
Changes made to the GitHub Workflow:
installing cosign v2.4.0add new step to sign all the images generated during the build and push step[\Edit]
Was the change previously discussed in an issue or on the forum?
Closes #4983
Checklist
changelog/unreleased/that describes the changes for our users (see template).gofmton the code in all commits.