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

Plan for Reference Types Work! #1397

Open
dlorenc opened this issue Feb 4, 2022 · 10 comments
Open

Plan for Reference Types Work! #1397

dlorenc opened this issue Feb 4, 2022 · 10 comments
Labels
enhancement New feature or request

Comments

@dlorenc
Copy link
Member

dlorenc commented Feb 4, 2022

Description

The reference types work is off and running now in OCI, and we should start to think through how we'll adopt it here in cosign.

Assuming the work completes, gets adopted by registries, and meets all the use cases required by cosign, we still have a few choices to make!

  • When do we add support, and how? Do we need to wait for all registries to support it, or can we do a transition with a fallback option?
  • How would a fallback work? Could we always check the new location and fall back to the old one? Should we always check both?
  • How about writes? Always push to the new location first, then fallback to the old one?
  • Should we just make it a config option?

I think as soon as there's a workable draft spec merged in https://github.com/opencontainers/wg-reference-types, we should create a dev branch here in cosign to let people try it out, without us needing to answer the fallback questions right away. Maybe a "cosign-oci-ref" build or something that only works with the new APIs.

We could also publish and run a ttl.sh-like ephemeral registry that supports the new API as it gets developed, to let people try it out against a real endpoint without requiring them to run something locally.

@dlorenc dlorenc added the enhancement New feature or request label Feb 4, 2022
@mattmoor
Copy link
Member

mattmoor commented Feb 4, 2022

We should track the reference type work in GGCR's pkg/registry to test against. If we can flag this on/off then we can also test fallback.

@jdolitsky
Copy link
Contributor

Perhaps this is something to cross-post in GGCR repo, but yesterday the extensions proposal was merged:
https://github.com/opencontainers/distribution-spec/tree/main/extensions

Regarding fallback options, etc., this is how clients will be able to determine if experimental APIs defined in the working group are exposed by a given registry

@znewman01
Copy link
Contributor

Just want to bump this now that the working group for reference types has concluded:

https://github.com/opencontainers/wg-reference-types

@imjasonh
Copy link
Member

imjasonh commented Oct 7, 2022

There's some work ongoing in ggcr now: google/go-containerregistry#1455

When that gets closer to landing I will try to see how cosign should use it, to make sure it's a good fit, and so sigstore-go gets a good go API for discovering attached things by type.

We'll probably also need cosign to maintain a compat mode for some time (forever?) so signatures etc that were attached using cosign's scheme remain discoverable. That code should only live in sigstore-go.

If folks have opinions or ideas about how they'd like this to look and feel please share!

@jdolitsky
Copy link
Contributor

See #2684

@developer-guy
Copy link
Member

I'm super excited about this!

@ChristianCiach
Copy link
Contributor

#2684 "only" handles signatures and SBOMs, which is great! Is the same thing eventually planned for attestations, too?

I still cannot decide if I should publish my SBOMs as sbom- or att-artifacts.

@znewman01
Copy link
Contributor

#2684 "only" handles signatures and SBOMs, which is great! Is the same thing eventually planned for attestations, too?

Yes! We just wanted to get something out so people could play with it, then fine-tune the support before we drop the "experimental" tag.

@ChristianCiach
Copy link
Contributor

ChristianCiach commented Sep 29, 2023

Now that the sbom-type attachments have been deprecated in #3256, I am trying to convert to attestations.

Unfortunately #2684 only added (experimental) support for signatures and sbom-attachments (which are now deprecated), but not for attestations. This is unfortunate, because the zot registry does not support docker-specific media types:

$ cosign attest --tlog-upload=false --predicate cdx.sbom.json --type cyclonedx --key cosign.key  localhost:5000/some-project/my-image:sha256:856f88f0c75ab14cc6e4f31776d41de7fe02971d146cf5118b840a662dc5ff00

Enter password for private key: 
Using payload from: cdx.sbom.json
Error: signing localhost:5000/some-project/my-image:1.0.0: PUT http://localhost:5000/v2/some-project/my-image/manifests/sha256-856f88f0c75ab14cc6e4f31776d41de7fe02971d146cf5118b840a662dc5ff00.att: MANIFEST_INVALID: manifest invalid; [map[mediaType:application/vnd.docker.distribution.manifest.v2+json]]
main.go:74: error during command execution: signing localhost:5000/some-project/my-image:1.0.0: PUT http://localhost:5000/v2/some-project/my-image/manifests/sha256-856f88f0c75ab14cc6e4f31776d41de7fe02971d146cf5118b840a662dc5ff00.att: MANIFEST_INVALID: manifest invalid; [map[mediaType:application/vnd.docker.distribution.manifest.v2+json]]

Signatures and sbom-attachments work fine with Zot (when using the experimental oci-1-1 mode), but not attestations.

@ChristianCiach
Copy link
Contributor

ChristianCiach commented Feb 22, 2024

Sorry to bump this, but is there a roadmap for this? There hasn't been any activity in this issue for a year now. Is there even any interest in supporting to store signatures and attestations as true OCI artifacts?

The deprecation of SBOM attachments makes it impossible for us to publish SBOMs as attestations to a registry that doesn't support proprietary docker image types.

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

No branches or pull requests

7 participants