Skip to content

Utilities to publish signatures on ghcr.io when Github PAT (Personal Access Tokens) tokens are disabled

Notifications You must be signed in to change notification settings

freedomofpress/ghcr-signer

Repository files navigation

GHCR Signature Publisher

This repository allows to publish container signatures to the Github Container Registry (ghcr.io) when Github Personal Access Tokens (PATs) are disabled.

Disabling PATs is considered a good security practice: these tokens aren't fine-grained and as such can give more privileges than intended to the bearer. Unfortunately, the Github Container Registry doesn't provide any other mechanism of authentication.

Traditionally, container signatures are generated and published in one step using cosign --sign, but in situations where Github PAT tokens are disabled, this is impractical.

Usage

The flow is as follows:

  1. Prepare the signatures locally
  2. Create a pull request, with the signatures
  3. The CI ensures signatures are valid
  4. The pull request is merged in the main branch
  5. A workflow is triggered, publishing the signatures to the registry.

Preparing the signatures

Generate signatures locally, without publishing it. Make sure to pass the image name and its hash, without labels:

export IMAGE="ghcr.io/freedomofpress/dangerzone/dangerzone@sha256:<hash>"
uv run ./ghcr-signer.py prepare "$IMAGE"

You should pass a key via --key or --sk (in case of a hardware key).

Publishing Signatures

When the main branch is updated with new content inside the SIGNATURES folder, a workflow will:

  • Detect the latest folder, based on its date
  • Attach signatures to the container registry using Github credentials

About

Utilities to publish signatures on ghcr.io when Github PAT (Personal Access Tokens) tokens are disabled

Resources

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages