cosign
cosign copied to clipboard
`cosign copy` should have an option to create a "copy attestation"
A user in Slack has a use case that looks like the following:
- There's an upstream image we depend on (
alpine:latest
) with no signatures. - We want to verify the images we use. Obviously if there's no upstream signatures, we can't use those.
- So we want to sign the images when copying to a private repo to note "hey, I got this from hub.docker.com/alpine:latest at time T"
This used to be possible via:
cosign copy upstream:latest private-repo
cosign sign private-repo:latest
But now that we don't allow signing by tag (#2047) it's trickier, you need to:
DIGEST=$(crane resolve upstream:latest)
cosign copy upstream@$DIGEST private-repo
cosign sign private-repo@$DIGEST
This is a little safer in case "private-repo" is malicious.
But it's annoying to do. Also, semantically, the signature here means "I copied this." We could have the user cosign attach attestation
instead that basically says "I copied this from cosign copy
!
(This hints at a general need for "common attestation patterns" with sugar support in Cosign.)