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

WIP: add new version of intoto type #1279

Closed
wants to merge 7 commits into from

Conversation

bobcallaway
Copy link
Member

  • move tests out of e2e dir and into pkg-specific version
  • add test coverage

Summary

This adds v0.0.3 of the intoto type, aiming to address a few issues in v0.0.2:

Release Note

Adds new default version of intoto type

FYI @pxp928 @bdehamer

Signed-off-by: Bob Callaway <bcallaway@google.com>
Signed-off-by: Bob Callaway <bcallaway@google.com>
Signed-off-by: Bob Callaway <bcallaway@google.com>
Signed-off-by: Bob Callaway <bcallaway@google.com>
@asraa
Copy link
Contributor

asraa commented Jan 13, 2023

sorry, quick comment before I dive in: wdyt about renaming to a dsse type? i was talking with @laurentsimon and had a huge amount of confusion myself about what content/payloadHash referred to, and if it's a dsse type it could be better named as predicate/envelopeHash

I think this came up in an issue before but I can't find a reference.

@bobcallaway
Copy link
Member Author

sorry, quick comment before I dive in: wdyt about renaming to a dsse type? i was talking with @laurentsimon and had a huge amount of confusion myself about what content/payloadHash referred to, and if it's a dsse type it could be better named as predicate/envelopeHash

I think this came up in an issue before but I can't find a reference.

In

"description": "DSSE envelope specified as a stringified JSON object; payloadType in the envelope MUST be set to 'application/vnd.in-toto+json'",
I tried to make this clear that this would only accept DSSE envelopes that are signed intoto attestations.

I would presume that a more generically named dsse type could refer to any payload, but this type has been specific to intoto attestations?

Signed-off-by: Bob Callaway <bcallaway@google.com>
@kommendorkapten
Copy link
Member

My two cents:

I think it would be a bit cleaner to have the type referring to the outer envelope, e.g. dsse. Then after the envelope is parsed, we can extract certain fields based on a set of payload types Rekor recognizes, such as in-toto statements (and the predicate type for build provenances like it is today). This is e.g. how cose does it:

if ok && contentType == in_toto.PayloadType {
.

The risk with this is of course that there can be a combinatorial explosion of "subtypes" in the dsse type, but with proper structure of the code I think it should be fine.
I guess with this way, it would be easier for a consumer to use.

To start with we may only recognize in-toto statements, but any dsse enevelope could be uploaded.

Copy link
Contributor

@asraa asraa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some very minor comments, but overall this is so nicely organized, multiple signatures are covered, and so on.

return errors.New("either proposed content or envelope hash, payload hash, and signatures must be present")
}
v.IntotoObj = *intotoObj
return nil
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because this is incoming proposed content with canonicalized fields, shouldn't verifyEnvelope still apply here for robustness?

What if a user proposed a ProposedEntry with pre-canonicalized fields, let's say, because it wants to hide the Envelope content? It should still be verifiable, assuming verification over a hash.

But if it's clear that users MUST be publishing full envelope content to the log, fine with me.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only hesitation here is that I am wondering if it's possible for a client to be setting the EnvelopeHash, PayloadHash, and Signatures of a bogus signed envelope and bypassing validation (not through the CLI, but through setting a proposed entry in the createentry handler)

@bobcallaway bobcallaway closed this May 8, 2023
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

Successfully merging this pull request may close these issues.

None yet

3 participants