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

Independent container updates #1080

Open
wants to merge 26 commits into
base: main
Choose a base branch
from
Open

Conversation

almet
Copy link
Member

@almet almet commented Feb 11, 2025

This pull request introduces independent container updates.

Signatures are meant to be done with an hardware key (yubikey), for which the public key will be packaged alongside the code.

container signatures are stored locally and checked against a known public key just before doing the conversion of the documents. Behind the curtain, it uses cosign so that the signatures are publicly auditable.

It adds a dangerzone-image CLI providing tooling to check for remote new images, verification of the attestations and signatures, also with the ability to create and use archives, for air-gapped environments.

$ dangerzone-image --help

  attest-provenance  Look up the image attestation to see if the image...
  get-manifest       Retrieves a remote manifest for a given image and...
  list-remote-tags   List the tags available for a given image.
  load-archive       Upgrade the local image to the one in the archive.
  prepare-archive    Prepare an archive to upgrade the dangerzone image...
  upgrade            Upgrade the image to the latest signed version.
  verify-local       Verify the local image signature against a public...

It is fixing the following issues:

The last commit here introduces a way to use the code, but is not meant to be shipped "as is". We still need to get the full story for this, especially in terms of UX.

Before being ready to be shipped, we still miss a few key components:

almet and others added 6 commits February 11, 2025 18:13
It contains utilities to interact with OCI registries, like getting the list of
published tags and getting the content of a manifest. It does so
via the use of the Docker Registry API v2 [0].

The script has been added to the `dev_scripts`, and is also installed on
the system under `dangerzone-image`.

[0]  https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry
Signatures are stored in the OCI Manifest v2 registry [0], and are
expected to follow the Cosign Signature Specification [0]

The following CLI utilities are provided with `dangerzone-image`:

For checking new container images, upgrading them and downloading them:

- `upgrade` allows to upgrade the current installed image to the
  last one available on the OCI registry, downloading and storing the
  signatures in the process.
- `verify-local` allows the verify the currently installed image against
  downloaded signatures and public key.

To prepare and install archives on air-gapped environments:

- `prepare-archive` helps to prepare an archive to install on another
  machine
- `load-archive` helps upgrade the local image to the archive given
  in argument.

Signatures are stored locally using the format provided by `cosign
download signature`, and the Rekor log index is used to ensure the
requested-to-install container image is fresher than the one already
present on the system.

[0] https://github.com/sigstore/cosign/blob/main/specs/SIGNATURE_SPEC.md
The hash list provided on the Github releases page is now bundled in the
`reproduce-image.py` script, and the proper hashes are checked after
download.
A new `dangerzone-image attest-provenance` script is now available,
making it possible to verify the attestations of an image published on
the github container registry.

Container images are now build nightly and uploaded to the container
registry.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

2 participants