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

Consider adding a SystemContext override for use-sigstore-attachments #1575

Open
dmesser opened this issue Jun 11, 2022 · 6 comments
Open

Consider adding a SystemContext override for use-sigstore-attachments #1575

dmesser opened this issue Jun 11, 2022 · 6 comments
Labels
kind/feature A request for, or a PR adding, new functionality

Comments

@dmesser
Copy link

dmesser commented Jun 11, 2022

As a user of skopeo I would like an additional flag for skopeo to automatically pick up cosign-style signatures artifacts when copying a single image or a series of images using skopeo copy and skopeo sync so I can copy the signature artifacts over automatically with the image(s) that are getting copied.

While the larger background is the missing specification of OCI references types which is currently discussed here, cosign adopted a fairly straight forward and portable approach to associate images and their signatures stored as OCI artifacts (sort of) with a naming convention. For a given image the signature is expected in the same repository in a manifest tag named like this:

sha256-<sha256_checksum_of_image>.sig

Upon providing a the flag, skopeo should be able to probe during the copying process if such a tag exist and simply copy it over as well, retaining the name.

This is sort of a pre-cursor to let skopeo verify signed images during manifests getting copied / sync'd around (#1533). The use case for simple signature copy is to allow mirroring of signed images for the benefit of being able to verify those images in the target registry. Sometimes the environment of the target registry is even disconnected by a physical air-gap.

Background: Quay is a heavy user of skopeo and would like to rely on it natively to capture potential signature artifacts during repository mirror configurations.

@mtrmac
Copy link
Collaborator

mtrmac commented Jun 11, 2022

Thanks for your report.

Conceptually this is a c/image feature, where c/image should treat mostly the attachments as part of the primary image (for purposes of format conversion and non-registry transport support), so moving there.

I’m currently tentatively thinking that this would be a per-registry/per-repo option in registries.d whether to look for the signature / attachment images when copying other data (to avoid extra round-trips on every image access, especially Docker Hub users tend to be antsy about those); the default might start opt-in but could change over time.

It’s a bit more complicated in the skopeo sync case, because skopeo sync listing all tags would naively trigger copying the signatures twice — once as a part of the primary image, once as an individual artifact. Short—term that doesn’t hurt other than the extra time/duplication of effort, eventually we might want to filter those duplicates out (while still copying stray attachments?).

@mtrmac mtrmac transferred this issue from containers/skopeo Jun 11, 2022
@dmesser
Copy link
Author

dmesser commented Jun 13, 2022

I'd propose to still have a CLI option for skopeo sync|copy as well as a YAML spec for skopeo sync to ease opt-in.

@mtrmac
Copy link
Collaborator

mtrmac commented Jun 13, 2022

An option to do what?

I’d much prefer not to add a special-case code, and an option, to skopeo copy, only for that to be obsoleted/made redundant by a c/image feature a few weeks afterwards.

(Also note that a full repo sync with skopeo sync will copy the tagged signatures just as well without having to understand them at all — apart from #1574 being necessary, but that’s necessary either way.)

@dmesser
Copy link
Author

dmesser commented Jun 13, 2022

An option to enable/disable copy of cosign-style signature artifacts. skopeo copy copies a single manifest (list) and as a user I may not want to have to fiddle with an extra config file only in order to express a common preference to copy the signature with it. skopeo sync depending on the tag filter expression may not capture the tagged signatures.

@mtrmac
Copy link
Collaborator

mtrmac commented Jun 13, 2022

Ah, an option as an alternative to the registries.d per-registry configuration? That makes sense.

@mtrmac
Copy link
Collaborator

mtrmac commented Jul 19, 2022

The functionality now exists, as of #1595 (although there wasn’t a c/image release since).

It is configured via use-sigstore-attachments in registries.d, there isn’t a Go-level override yet.

@mtrmac mtrmac changed the title Support for cosign-style signatures for copy and sync Consider adding a SystemContext override for use-sigstore-attachments Dec 9, 2022
@mtrmac mtrmac added the kind/feature A request for, or a PR adding, new functionality label Dec 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature A request for, or a PR adding, new functionality
Projects
None yet
Development

No branches or pull requests

2 participants