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

Allow uploading detached signatures over in-toto statements with --type=intoto #865

Open
rbehjati opened this issue Jun 7, 2022 · 6 comments
Labels
enhancement New feature or request

Comments

@rbehjati
Copy link

rbehjati commented Jun 7, 2022

Currently when uploading artefacts to Rekor using rekor-cli upload --type intoto only in-toto attestations in the form of DSSE Envelopes can be uploaded. (This is based on my current understanding. I was not able to upload anything else, but also I am not an expert in in-toto).

It would be nice to be able to upload in-toto statements with detached signatures. For instance, currently one could upload an in-toto statement (for instance a SLSA provenance file), with a detached signature with the following command:
rekor-cli upload --type rekord --artifact provenance.json --signature provenance.sig --pki-format=x509 --public-key=pub.pem
However, since the type in this case is not intoto the subject and the materials in the provenance files are not indexed.

Alternatively, is it possible to implement indexing similar to #792 for artefacts that, as in the example above, are in-toto statements, but are not DSSE Envelopes with an attached signature (and therefore are not uploaded with --type intoto)?

@rbehjati rbehjati added the enhancement New feature or request label Jun 7, 2022
@asraa
Copy link
Contributor

asraa commented Jun 14, 2022

@lumjjb @SantiagoTorres For your opinions:
Is it better to consider that a rekord/hashedrekord type can be a (SLSA) provenance, or loosen the --type intoto to allow for signatures on intoto attestations but may not be DSSE envelopes?

@SantiagoTorres
Copy link
Contributor

Hmm, I think there are a couple of separate problems in there. You can still use x509 sigs/keyids on DSSE as far as I'm aware. Either way, if we wanted to separate the envelope from the type on in-toto we could do that, but that will become a problem later when we actually want to index things no?

@bobcallaway bobcallaway added the ga_candidate Proposed blocking issue for GA release label Jul 20, 2022
@dlorenc
Copy link
Member

dlorenc commented Aug 1, 2022

This is important but not sure it should block GA.

@dlorenc
Copy link
Member

dlorenc commented Aug 18, 2022

Will #973 fix this one?

@trixor trixor added ga_blocker and removed ga_candidate Proposed blocking issue for GA release ga_blocker labels Aug 18, 2022
@asraa
Copy link
Contributor

asraa commented Aug 24, 2022

Will #973 fix this one?

@rbehjati took a review on this PR:
This PR would allow you to upload the following proposed entry to Rekor in code:

re := V002Entry{
		IntotoObj: models.IntotoV002Schema{
			Content: &models.IntotoV002SchemaContent{
				Envelope: &models.IntotoV002SchemaContentEnvelope{
            Payload: {YOUR_B64_ENCODED_PROVENANCE.JSON},
            PayloadType: {YOUR_PAYLOAD_TYPE},
           Signatures: {YOUR_KEY_IDs, SIG, PUBLICKEY},
},
			},
		}}

That PR's implementation of artifact creation via CLI flags assumes that artifact is a JSON envelope. If would be a little complicated logic to modify, but could be done. @pxp928 You would need to do the following in CreateFromArtifactProperties:

  1. If signature is present, assume that this is the re.IntotoObj.ContentEnvelope.Signatures and that artifact in this case is not the whole envelope but just the re.IntotoObj.Content.Envelope.Payload.
  2. The function verifyEnvelope currently works on an entire envelope. Parth would need to modify verify to work on, let's say, the common re.IntotoObj.

@rbehjati how would you communicate the payloadType in your CLI invocation?

@rbehjati
Copy link
Author

@rbehjati how would you communicate the payloadType in your CLI invocation?

We use rekor-cli upload with --type rekord. If you are referring to the payload type in the envelope, it should be "application/vnd.in-toto+json" I think. But we don't directly use or generate DSSE envelopes. Does that answer the question?

Do you recommend using the upload functionality programatically instead of using the CLI?

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

6 participants