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

cosign digest subcommand to resolve tag to digest #3034

Closed
seankhliao opened this issue Jun 3, 2023 · 1 comment · Fixed by #3255
Closed

cosign digest subcommand to resolve tag to digest #3034

seankhliao opened this issue Jun 3, 2023 · 1 comment · Fixed by #3255
Labels
enhancement New feature or request

Comments

@seankhliao
Copy link

Description

A cosign digest $artifact-reference subcommand that can resolve an image tag to the digest.

Why

Signing (or any other operation) by tag is generally discouraged (ref #2047), as tags can be mutable and change between two different steps in a workflow (eg publish and sign).

In most cases, users should try and get an image digest from a previous step, eg directly from the output of their build tool.

However, there are situations where there is no previous stage that can produce an image digest, and we'd like to resolve a tag to a digest, and only use the digest going forward in a workflow.
Example: check if there's a signed copy of in image in a private mirror. If not, run processes to generate trust on the image (scanners), and push the signed result into the private mirror for use.

There are other tools that can do this, eg crane digest, but installing an extra tool that isn't otherwise needed seems wasteful.
cosign already partially does this with cosign triangulate (the digest is used as the tag for the signature) and some massaging of the output can turn it into the digest, but it would be nice to to have to do that:

$ cosign triangulate $image | tr ':-' '@:' | sed 's/\.sig$//'

Slack thread

@seankhliao seankhliao added the enhancement New feature or request label Jun 3, 2023
@VenutNSA
Copy link

VenutNSA commented Aug 3, 2023

Hello!
We and a few other teams have come across the need to use this function

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants
@seankhliao @VenutNSA and others