docker / docker/cli

[Feature Request] add cosign for verifying signature while pulling image

Open
#3,283 5 comments 31 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area/trust
Dominant language
Go
Stars
6.1k
Forks
2.2k
Avg merge
1d 15h
Merged PRs (30d)
43

Description

Abstract
What we propose is that we can support custom content trust verifiers into Docker besides Notary such as cosign. Actually, the idea is coming from a discussion on sigstore slack channel by @developer-guy.

Motivation

cosign, is a lightweight, container signing, verification, and storage in an OCI registry. We should avoid unnecessary image pulling before checking whether the image is signed.

Proposal

Docker has support for Notary in its own CLI, the trust command and there is a special variable called

$ export DOCKER_CONTENT_TRUST=1

...which helps users to ensure that the image that they pull has a valid signature on the Notary server. Would it makes sense if we add the same functionality to the docker daemon for cosign? That said, this way we can avoid verifying the image after downloading it, we would have done it while downloading the image, do we have a plan for that.

$ docker image pull developer-guy/alpine:3.12
$ cosign verify -key cosign.pub developer-guy/alpine:3.12  # check if signed

Instead of this one, we would do these several ways:

Solution 1: cosign specific

$ export DOCKER_CONTENT_TRUST_COSIGN_ENABLED=1
$ docker image pull developer-guy/alpine:3.12  # check if signed
  • How will Docker decide to which content trust verifier be used?

Solution 2: support interchangeable container signers: users decide the trust verifier

$ export DOCKER_CONTENT_TRUST_VERIFIER=notary
$ export DOCKER_CONTENT_TRUST_VERIFIER=cosign
$ export DOCKER_CONTENT_TRUST_VERIFIER=my-custom-signer

Caveats:

By implementing this way, we may have to determine a custom trust verifier interface API. An interface that enables Docker to use a wide variety of container signers & verifiers.

cc: @dlorenc @lukehinds

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing Docker CLI's existing trust command and DOCKER_CONTENT_TRUST behavior, then compare the proposed cosign and interchangeable-verifier approaches. Done would require an agreed verifier interface and pull-time signature verification, but the issue does not identify files or tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, go
Domain
cli, security
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.