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

Add in-toto format as hash of shard hashes #265

Merged

Conversation

mihaimaruseac
Copy link
Collaborator

@mihaimaruseac mihaimaruseac commented Jul 27, 2024

Summary

Note: This is an experiment serialization, one of the 4 in a series of PRs (#264, #265, #266, #267). Before a stable release of the library, we would standardize on an ergonomic format, with as little corner cases / dangerous corners as possible.

This converts model serialization manifests that record every model file hash into an in-toto payload that can then be passed to Sigstore's sign_intoto for signing to generate a Sigstore Bundle (if using Sigstore).

To identify the models, we compute a hash of all hashes of the files and use that as the subject. The individual file hashes are used as the payload and we would have the verifier check them as part of the verification process.

CC @susperius for converting manifest to in-toto. This should cover #111, #224, and #248 (first part of the machinery). CC @laurentsimon and (optionally) @TomHennen to make sure I did not mishandle in-toto.

Note: This is the equivalent of #264, but for file shard hashes instead of file hashes.

Note: This builds on #264. I decided to split every feature into its own PR to make it easier to review what changes (should be only the last commit) and to be able to merge partial work and continue from there.

Release Note

NONE

Documentation

NONE

laurentsimon
laurentsimon previously approved these changes Jul 31, 2024
}
}
],
"predicateType": "https://model_signing/DigestOfShardDigests/v0.1",
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm curious if the non-sharded version can be represented as a special case of this one, with the shard=0.
Not sure it's worth it to try to optimize it. Thinking more about it, I like that it's separate to avoid implementation problems :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hmm, we can try that in the future.

@mihaimaruseac mihaimaruseac force-pushed the in-toto-digests-of-shard-digests branch 2 times, most recently from 16feae4 to 7646d4f Compare July 31, 2024 22:02
This converts model serialization manifests that record every model file
shard hash into an in-toto payload that can then be passed to Sigstore's
`sign_intoto` for signing to generate a Sigstore `Bundle` (if using
Sigstore).

To identify the models, we compute a hash of all hashes of the file
shards and use that as the subject. The individual file hashes are used
as the payload and we would have the verifier check them as part of the
verification process.

Signed-off-by: Mihai Maruseac <[email protected]>
@mihaimaruseac mihaimaruseac force-pushed the in-toto-digests-of-shard-digests branch from 7646d4f to fa08711 Compare August 1, 2024 17:28
Copy link
Contributor

@spencerschrock spencerschrock left a comment

Choose a reason for hiding this comment

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

Deferring to Laurent's review, I did confirm Mihai's latest force-push was a rebase on top of main.

@mihaimaruseac mihaimaruseac merged commit 313af3a into sigstore:main Aug 1, 2024
20 checks passed
@mihaimaruseac mihaimaruseac deleted the in-toto-digests-of-shard-digests branch August 1, 2024 17:43
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.

3 participants