notaryproject / specifications

Cross tooling and interoperability specifications
https://notaryproject.dev/
Apache License 2.0
158 stars 44 forks source link

As a user of Notation, I want to sign and verify images using distribution-spec 1.0 registries #112

Open sudo-bmitch opened 2 years ago

sudo-bmitch commented 2 years ago

I think most of our work has focused on the ORAS artifact-spec work. It would be useful if there's a backwards compatible solution that can sign images on registries without the newer ORAS artifact-spec APIs. Possible options I'm thinking of:

  1. Use well known tags, similar to other projects that push a tag with the digest of the artifact being signed and some extension.
  2. Push a new Index that contains both the image being signed and any associated artifacts, changing the tag pointer.

For the first option, to push multiple signatures, we may need to wrap the signature artifacts with an OCI Index and the Index replaces the list of artifacts we'd see from the new API query. To handle race conditions, that may have to be a best-effort / user problem, unless we can get ETag and Precondition Semantics supported in the registry.

For the second option, there may be users that want that to tightly control what is associated with their image, who want this ability rather than the API anyway. The challenge is that this requires the existing runtimes to recursively descend through Index to find the image to run, and I'm not sure they do that if they don't see the platform field or if there's an Index within an Index, which may result in breaking changes to existing image runtimes that aren't checking the signatures. This would need a lot of testing if we went that way.

Are there other options than these, and is there interest in adding any of these backwards compatibility features to Notary v2?

sajayantony commented 2 years ago

I think digest pinned deployments will never see an updated scan report if we use the index to constantly append and recompose the images. This was my reason for supporting the first solution here

Ok thinking more through that even in the tag based model you need to lookup other tags. I think updating the tag pointing to an index has a few interesting areas to discuss. Like will pushing an patched image to the same tag cause lookup of previous images to fail?

It didn't cross my mind that distribution spec didn't explicitly call out preconditions and it seems like clarifying that will avoid a lot of issues.

sudo-bmitch commented 2 years ago

If the tag points to an index with signatures included in the index, then pushing a new tag with just your image would be an unsigned image. You'd need to go through the same process used to push the previous image of attaching signatures in an index and pushing everything.

sudo-bmitch commented 2 years ago

First pass at comparing the options: https://hackmd.io/FIa5U4xcSV6ccftwCPAZjA

sudo-bmitch commented 2 years ago

I'm not sure what 1.1 refers to. Distribution-spec is only at 1.0.1, and the .1 patch I believe is focused on a client side vulnerability.

yizha1 commented 2 years ago

This issue is related to distribution-spec for OCI Artifact update.