You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, Pubgrade uses Kaniko to build container images, which are then stored in a temporary container registry. These images are signed using DCT (Docker Content Trust) keys, which are stored in GitHub Actions secrets. Finally, the signed images from github-actions (triggered from pubgrade) are pushed to the final container registry. The current approach requires storing and managing DCT keys for each container registry repository manually.
This poses several challenges:
We need to upload separate DCT keys for each repository.
Managing secrets across multiple repositories increases exposure risk.
Manually updating or rotating keys is cumbersome.
We need a centralized and secure approach to store and access DCT keys for signing images.
Modify the Pubgrade CI/CD payload to include the Docker trust keys, id and passphrase allowing them to be securely passed to GitHub Actions for signing Docker images. The keys will be included in the JSON payload of the curl command and stored securely by Pubgrade before being forwarded to the GitHub Actions workflow.
Proposed curl Command Update
Update the curl command to include a docker_trust object in the payload:
docker_trust.private_key: The Docker private key content.
docker_trust.key_id: The ID of the private key.
docker_trust.passphrase: The passphrase for the private key.
Steps to Manually Verify DCT signed image
Inspect Trust Metadata:
Retrieve the image’s trust data (digest, signers, signatures).
Example Command:docker trust inspect <repository>:<tag>
Check for signed tags, digest, and signer key IDs.
Verify Signer’s Key:
Confirm the signer’s key ID matches the expected trusted key.
Example Command (with notary):notary -s https://notary.docker.io -d ~/.docker/trust key list
Check Trust Metadata:
Validate the tag’s digest and signer in the trust store.
Example Command:notary -s https://notary.docker.io -d ~/.docker/trust list docker.io/<repository>
Notes
No private keys are needed; verification uses public metadata.
Use notary for deeper checks if needed, pointing to the registry’s notary server.
A mismatched digest suggests tampering; do not use the image.
@akash2237778: Thanks a lot for raising this important issue regarding the management of DCT keys for image signing within Pubgrade and for taking the time to propose a detailed solution. Improving how we handle artifact signing and key management is definitely something we need to address.
However, after reviewing the proposal and thinking through the implications for the overall trust chain, I have some concerns about the suggested approach and would like to propose an alternative direction.
Concerns with the Proposed Solution
While centralizing key management (if/where necesseary) is a valid goal, there are, I believe, a few challenges with the proposed method of passing DCT keys via the API payload:
Limited Scope & Misleading Trust Assertion: Your proposal focuses on enabling signing using keys provided by the code repository. However, this implies an assertion that "Project X signed off on this build," which can be misleading:
It doesn't inherently verify the code's origin, its approval status, or whether required source control policies (like code reviews) were met before the build was triggered.
The entity providing the key (the code owner/repo context) doesn't actually control the Pubgrade build environment or process. Therefore, they can't truly attest to the integrity of the final built artifact.
Standard DCT keys lack a strong, verifiable link back to a specific project identity, making it difficult for deployers to confirm the correct, authorized key was actually used for signing.
Security Risks: Sending sensitive private keys and passphrases directly in an API request body, even over HTTPS, poses significant security risks. The primary concerns are accidental exposure through potential server-side request logging or the compromise of the API endpoint itself. Best practices generally advise against transmitting such secrets directly.
For these reasons, particularly the potentially misleading trust implications and the security concerns, I feel this approach may not be the best path forward.
Pubgrade could sign the images using its own identity for a more honest/narrowly scoped attestion ("The image was built and signed by Pubgrade using its processes.")
If we don't want to generate and manage DCT keys within Pubgrade itself, perhaps a cleaner way to implement this might be using Sigstore. Pubgrade's build process could use an OIDC identity to obtain short-lived signing certificates dynamically. If my understanding is correct, this might eliminate the need for managing static DCT keys entirely.
Deployers could then verify that the image signature originates from Pubgrade's official identity (via Sigstore OIDC).
Beyond that, we could plan for mechanisms to provide verifiable provenance back to the source code:
Improving End-to-End Trust (Provenance):
To link the Pubgrade-signed image back to the original source code, Pubgrade's build process could maybe generate and sign SLSA Provenance Attestations. These could creates verifiable links between the final image digest and the specific source repository, commit hashes etc. used in the build.
Deployers could check whether the SLSA attestations confirm that the image was built from the expected source code commit/repository.
This approach provides a clearer trust model: Pubgrade attests to the build process it controls, and provides verifiable evidence (the SLSA attestation) linking the artifact back to its source. It doesn't assert secure code review policies and branch protection rules, and it doesn't verify that the commiters are trusted and that the dependencies (including the base image) used in the code are safe - but I think it would put us on the right track to do what we can to establish an end to end trust chain (and we could still try to address the missing pieces in the future).
Added GitHub Actions workflow that automates the process of pulling, tagging, pushing, and signing a container image. Triggered by a repository_dispatch event (sign-image) or manual workflow_dispatch, it runs on an ubuntu-latest environment with the following steps:
Checkout Code: Clones the repository using actions/checkout@v4.
Docker Hub Login: Authenticates with Docker Hub using provided credentials from repository_dispatch API call.
Pull Image: Pulls the specified container image using the pull_tag input.
Extract Image Name: Derives the image name from the push_tag input and stores it in the environment.
Get Image Digest: Retrieves the image digest for verification.
Install Cosign: Installs Cosign (v2.2.1) for signing the image.
Tag and Push Image: Tags the pulled image with push_tag and pushes it to Docker Hub.
Sign Image: Signs the pushed image using Cosign with experimental features enabled.
Output Digest: Logs the signed image's digest for verification.
The workflow uses OIDC token permissions for secure operations and outputs the digest for post-signing verification. It ensures a streamlined process for pulling, tagging, pushing, and cryptographically signing container images.
Awesome, thanks a lot @akash2237778! I'm wondering: Do you think this would also work seamlessly with a privately hosted container registry, e.g., Harbor? We are planning to deprecate Docker Hub so that we have better control and are not relying on Docker's open source program (which is a bit unreliable).
We would probably also want to deploy HashiCorp Vault for secret management, if that helps you in any way.
For both I'm just not sure when we would have the resources to work on this. Possibly during BioHackathons in September and November. Or do you wanna have a stab at it? For Harbor, you could talk to @JaeAeich - he has a Helm chart for that. We would just need integration with LS AAI.
Closing as not planned: Pubgrade's direction has changed. Images are now built and signed in each repository's CI (keyless Sigstore signatures and attestations in the release workflows), and Pubgrade only orchestrates the rollout of released images. Pubgrade no longer signs anything, so it has no DCT keys to manage, and Docker Content Trust is being retired upstream in favour of Sigstore/Notation anyway. If Pubgrade ever needs to check signatures before a rollout, that would be a new issue about verifying Sigstore signatures, not about storing keys.
Activity
akash2237778 commentedon Apr 13, 2025
Add Docker Trust Keys to Pubgrade /build Payload
Proposed Solution
Modify the Pubgrade CI/CD payload to include the Docker trust keys, id and passphrase allowing them to be securely passed to GitHub Actions for signing Docker images. The keys will be included in the JSON payload of the
curlcommand and stored securely by Pubgrade before being forwarded to the GitHub Actions workflow.Proposed
curlCommand UpdateUpdate the
curlcommand to include adocker_trustobject in the payload:Steps to Manually Verify DCT signed image
Inspect Trust Metadata:
Retrieve the image’s trust data (digest, signers, signatures).
Example Command:
docker trust inspect <repository>:<tag>Check for signed tags, digest, and signer key IDs.
Verify Signer’s Key:
Confirm the signer’s key ID matches the expected trusted key.
Example Command (with notary):
notary -s https://notary.docker.io -d ~/.docker/trust key listCheck Trust Metadata:
Validate the tag’s digest and signer in the trust store.
Example Command:
notary -s https://notary.docker.io -d ~/.docker/trust list docker.io/<repository>Notes
uniqueg commentedon May 2, 2025
@akash2237778: Thanks a lot for raising this important issue regarding the management of DCT keys for image signing within Pubgrade and for taking the time to propose a detailed solution. Improving how we handle artifact signing and key management is definitely something we need to address.
However, after reviewing the proposal and thinking through the implications for the overall trust chain, I have some concerns about the suggested approach and would like to propose an alternative direction.
Concerns with the Proposed Solution
While centralizing key management (if/where necesseary) is a valid goal, there are, I believe, a few challenges with the proposed method of passing DCT keys via the API payload:
Limited Scope & Misleading Trust Assertion: Your proposal focuses on enabling signing using keys provided by the code repository. However, this implies an assertion that "Project X signed off on this build," which can be misleading:
Security Risks: Sending sensitive private keys and passphrases directly in an API request body, even over HTTPS, poses significant security risks. The primary concerns are accidental exposure through potential server-side request logging or the compromise of the API endpoint itself. Best practices generally advise against transmitting such secrets directly.
For these reasons, particularly the potentially misleading trust implications and the security concerns, I feel this approach may not be the best path forward.
Proposed Alternative: Pubgrade Signing + Provenance Tracking
Beyond that, we could plan for mechanisms to provide verifiable provenance back to the source code:
This approach provides a clearer trust model: Pubgrade attests to the build process it controls, and provides verifiable evidence (the SLSA attestation) linking the artifact back to its source. It doesn't assert secure code review policies and branch protection rules, and it doesn't verify that the commiters are trusted and that the dependencies (including the base image) used in the code are safe - but I think it would put us on the right track to do what we can to establish an end to end trust chain (and we could still try to address the missing pieces in the future).
What do you think? Happy to discuss this further!
akash2237778 commentedon Jun 3, 2025
Added GitHub Actions workflow that automates the process of pulling, tagging, pushing, and signing a container image. Triggered by a repository_dispatch event (sign-image) or manual workflow_dispatch, it runs on an ubuntu-latest environment with the following steps:
Checkout Code: Clones the repository using actions/checkout@v4.
Docker Hub Login: Authenticates with Docker Hub using provided credentials from repository_dispatch API call.
Pull Image: Pulls the specified container image using the pull_tag input.
Extract Image Name: Derives the image name from the push_tag input and stores it in the environment.
Get Image Digest: Retrieves the image digest for verification.
Install Cosign: Installs Cosign (v2.2.1) for signing the image.
Tag and Push Image: Tags the pulled image with push_tag and pushes it to Docker Hub.
Sign Image: Signs the pushed image using Cosign with experimental features enabled.
Output Digest: Logs the signed image's digest for verification.
The workflow uses OIDC token permissions for secure operations and outputs the digest for post-signing verification. It ensures a streamlined process for pulling, tagging, pushing, and cryptographically signing container images.
PR: #26
uniqueg commentedon Jul 7, 2025
Awesome, thanks a lot @akash2237778! I'm wondering: Do you think this would also work seamlessly with a privately hosted container registry, e.g., Harbor? We are planning to deprecate Docker Hub so that we have better control and are not relying on Docker's open source program (which is a bit unreliable).
We would probably also want to deploy HashiCorp Vault for secret management, if that helps you in any way.
For both I'm just not sure when we would have the resources to work on this. Possibly during BioHackathons in September and November. Or do you wanna have a stab at it? For Harbor, you could talk to @JaeAeich - he has a Helm chart for that. We would just need integration with LS AAI.
akash2237778 commentedon Jul 11, 2025
Thanks! I'll try to setup Harbor. And see if pubgrade is compatible otherwise I'll make it. Created #27 for tracking this one
uniqueg commentedon Nov 12, 2026
Closing as not planned: Pubgrade's direction has changed. Images are now built and signed in each repository's CI (keyless Sigstore signatures and attestations in the release workflows), and Pubgrade only orchestrates the rollout of released images. Pubgrade no longer signs anything, so it has no DCT keys to manage, and Docker Content Trust is being retired upstream in favour of Sigstore/Notation anyway. If Pubgrade ever needs to check signatures before a rollout, that would be a new issue about verifying Sigstore signatures, not about storing keys.