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

Support directory models (SavedModel) #49

Open
mihaimaruseac opened this issue Oct 25, 2023 · 5 comments
Open

Support directory models (SavedModel) #49

mihaimaruseac opened this issue Oct 25, 2023 · 5 comments

Comments

@mihaimaruseac
Copy link
Collaborator

mihaimaruseac commented Oct 25, 2023

Models that are saved as a directory (e.g., TF's SavedModel) require SLSA changes to record the hash. This is different that what we use for signing, where we can compute a directory hash.

Until we standardize this for SLSA, we won't be able to support these directory models for now. We need to converge on a single scheme for both signing and SLSA.

@MarkLodato
Copy link

Could you explain what's wrong with the current approach, where each file is listed individually in the subject?

@mihaimaruseac
Copy link
Collaborator Author

Models beyond a certain size (SavedModel or not) split the weights into multiple files. Each will be listed individually in the subject, but the verification only looks at the hashes, not at the file names. So someone could swap the names of two files (model-0001.pth and model-0042.pth for example), the model will still load but will misbehave (unclear how possible this is and what would be an upper bound on impact). SLSA verification will still pass though, so that's why we need something else.

@mihaimaruseac
Copy link
Collaborator Author

Another issue here is that you can remove a file from the directory, SLSA verification will still pass, but most models will no longer work

@laurentsimon
Copy link
Collaborator

laurentsimon commented Jan 9, 2024

Let's implement a Go library (or just create a Go reference implementation) of the existing serialize_v1 https://github.com/google/model-transparency/blob/main/model_signing/serialize.py#L325. slsa-framework/slsa-verifier#730 and slsa-framework/slsa-github-generator#3070 can make use of it. It will avoid duplicating implementations. Overtime we can create ref implementations for other languages in this repo. Wdut?

@mihaimaruseac
Copy link
Collaborator Author

This sounds great! Let's chat about this and plan it

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