-
Notifications
You must be signed in to change notification settings - Fork 182
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
Publish image attestations #1017
base: main
Are you sure you want to change the base?
Conversation
87a65ce
to
178364e
Compare
ℹ️ One of the things that isn't clear yet is why the attestations show up as It seems related to the Reference Types effort effort which might not be implemented by the GHCR. |
In order to get the attestation from the container registry, one need to do a few HTTP requests. We found these do be hard to put together, so here is a summary of the calls we had to do (testing on my personal user in order to have the container be public):
Variable definitions:
Authentication:
These calls have been put together in a small script I wrote to download the attestations from a container registry for a specific tag. |
While trying to build our own attestations (without using the GHA), we've been puzzled by how the container registry was populated in different ways. It turns out that attestations are different from plain signatures:
What's been complex to understand is that cosign, in their documentation, points us to use (the attest-build-provenance this PR has been using uses the Cosign Bundle Specification) |
178364e
to
93b95db
Compare
b2760ce
to
e0e1458
Compare
59a93c6
to
cbd4795
Compare
Placing these inside the `dangerzone` python package enables an inclusion with the software itself, and also makes it possible for end-users to attest the image.
- Verify the archive against the known public signature - Prepare a new archive format (with signature removed) - Load the new image and retag it with the expected tag During this process, the signatures are lost and should instead be converted to a known format. Additionally, the name fo the repository should ideally come from the signatures rather than from the command line.
On air-gapped environements, it's now possible to load signatures generated by `cosign save` commands. The signatures embedded in this format will be converted to the one used by `cosign download signature`.
12aafa2
to
9c2d7a7
Compare
This allows to be sure that the image name is verified by a known public key, rather than relying on an input by the user, which can lead to issues.
Also, check for new container images when starting the application. This replaces the usage of `share/image-id.txt` to ensure the image is trusted.
This pull request introduces a new workflow to automate the release of container images. Each night, the worflow builds a container image and uploads it to the container registry.
Note
Please note that, while signatures are involved in this workflow, the produced images are not signed by our release key. So, this is not to be confused with
cosign sign
commands, which are also used for independent container updates, but is different that the signatures involved when producing attestations.Here is a list of the produced assets:
Verifying the validity of the attestation can be done with the following commands:
We should be able to also do it using sigstore-python and raw HTTP calls, but because the main goal here is to see how it works, I stopped there.
Related to #745