Skip to content

Encourage signing OCI artifacts that *you* produced, not that the registry gives you #2516

Open
@znewman01

Description

A common workflow is:

$ ko build --image-refs /tmp/refs
$ cat /tmp/refs | xargs cosign sign

This is almost good: it avoids signing tags (#2047). But unfortunately those image refs are computed after a roundtrip to the registry, meaning that you (1) built something, (2) sent it to a third party, and (3) signed something that the third party sent back to you. (Same is true for docker build.)

Ideally, you'd sign something that you built directly. But OCI makes this hard! You don't know the hash of the thing you're signing until you upload it (unless you use layouts).

We need to do a few things here:

  • Docs and education: make sure folks understand that, mostly for the OCI use case.
  • Try to get upstream tools to not have this problem, by producing OCI layouts: track bugs against ko (Signing built images ko-build/ko#357) etc.
  • cosign payloads contain a "docker-reference" field which has something like gcr.io/foo:latest; this payload changes when moving an image from localhost to gcr.io. We should allow users to set this as the ultimate target? Or maybe not have the docker-reference at all, I'm not sure.
  • Making cosign sign of layouts idiomatic (I don't know all the details here)

CC @datosh @sudo-bmitch

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions