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

CLI Design: Uploading Other Things #368

Closed
dlorenc opened this issue Jun 13, 2021 · 5 comments
Closed

CLI Design: Uploading Other Things #368

dlorenc opened this issue Jun 13, 2021 · 5 comments

Comments

@dlorenc
Copy link
Member

dlorenc commented Jun 13, 2021

Description

Right now we have:

cosign upload which uploads a "thing" but treats it as a signature. This is designed for usage in workflows that require signing with strategies unsupported by cosign (HSMs, other scripts), but still wish to use the rest of the cosign signature spec.

We also have cosign upload-blob which uploads a generic binary blob as an OCI Artifact, with nothing to do with the rest of the cosign spec. This is designed as something that would be signed after it is uploaded.

We also have a WIP CLI for uploading WASM, which follows a separate WASM specification for how to layout WASM blobs in an OCI registry, defined here.

I can think of a few other things we might want to upload as well (SBOMs, In-Toto Attestations, etc.), which complicates the CLI design a bit.

Description

There are two basic classes of things we're uploading (new things and references to existing things). Let's split these out into two sub-trees.

Upload

cosign upload blob <blob>
cosign upload wasm <wasm>

Attach

cosign attach attestation -f <attestation> <image>
cosign attach sbom -f <sbom> <image>
cosign attach signature -f <sig> <image>

For storing in the registry, signatures will use the cosign signature spec. We'll define new ones for attestations and SBOMs, but a rough idea for now is that we can use the suffix to locate and differentiate. .sig for signatures, .sbom (or maybe .spdx?) for SBOMs, etc.

Questions

Should SBOMs be a type of attestation, or their own suffix? We can use mediaTypes on each layer within the overall wrapper object to differentiate between formats. My initial hunch is no. An attestation is typically signed itself, so if someone did have a signed SBOM they could upload it using an attestation.

@dlorenc
Copy link
Member Author

dlorenc commented Jun 13, 2021

Note: all of these commands would be able to work with the current "naming convention" based discovery mechanism, but I think they also would work fine with the either of the two References proposals in the OCI specification as well.

@dlorenc
Copy link
Member Author

dlorenc commented Jun 13, 2021

@jonjohnsonjr I made this for you:
image

Gist

@nishakm
Copy link

nishakm commented Jun 13, 2021

Can cosign return the reference to the SBOM/Signature manifest so some other tool can use it to manage things like tracking original images and blobs? What about signed content, for example, signing an SBOM and producing a detached signature?

@dlorenc
Copy link
Member Author

dlorenc commented Jun 13, 2021

Yup! I'll try to show how that would work in the diagram. It's actually the nice thing about treating the SBOMs as "first class" images, you can sign them just like normal ones. The only difference is they have a funny name.

@dlorenc
Copy link
Member Author

dlorenc commented Jun 13, 2021

Getting more crowded, but hopefully this helps!
image

dlorenc referenced this issue in dlorenc/cosign Jun 19, 2021
This is in preparation for #368.

Signed-off-by: Dan Lorenc <[email protected]>
dlorenc referenced this issue in dlorenc/cosign Jun 19, 2021
This is in preparation for #368.

Signed-off-by: Dan Lorenc <[email protected]>
dlorenc pushed a commit that referenced this issue Jun 21, 2021
This is in preparation for #368.

Signed-off-by: Dan Lorenc <[email protected]>
@dlorenc dlorenc closed this as completed Dec 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants