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

VSA: should policy digest be mandatory #803

Closed
Tracked by #900
laurentsimon opened this issue Apr 5, 2023 · 5 comments · Fixed by #979
Closed
Tracked by #900

VSA: should policy digest be mandatory #803

laurentsimon opened this issue Apr 5, 2023 · 5 comments · Fixed by #979
Assignees
Labels
vsa Applies to SLSA VSA spec

Comments

@laurentsimon
Copy link
Contributor

Only the uri field is mandatory. Why is the digest not? Do we expect the uri to not be hashable in some scenarios?

I also wonder whether we should allow a version field. I would expect that policies will evolve over time. Or maybe we expect the policy to be renamed to reflect changes?

@laurentsimon
Copy link
Contributor Author

If resourceDescriptor has a version field, we could use it for the policy too.

@MarkLodato
Copy link
Member

I don't think we should make it required because it is not necessary for correct use of the VSA. It might not be straightforward to hash it. For example, if the policy is a combination of a per-package config plus some global config, you need to define a canonical serialization of both to represent it.

@laurentsimon
Copy link
Contributor Author

laurentsimon commented Apr 6, 2023

I was suspecting the policy may not be hash-able, thanks for confirming. Fwiw, in your example, the base policy could be part of the final policy, like a base image is part of a final image in a dockerfile. In this case the serialization is kinda free. But not everyone may use this model.

@MarkLodato MarkLodato added the vsa Applies to SLSA VSA spec label Apr 7, 2023
@MarkLodato
Copy link
Member

Here's a concrete example: the "policy" is that the new version must have provenance matching the previous version. There is no recorded policy anywhere; it's just a comparison to the previous version. Technically this creates a policy on the fly based on the previous version's provenance, but it is never serialized anywhere. One could define a canonical serialization and hash it, and perhaps that's a good idea, but it's not necessary for correct operation. Thus making it REQUIRED in the spec seems like an overstep.

I think a good compromise is to change from:

The entry MUST contain a uri.

to:

The entry MUST contain a uri identifying which policy was applied and SHOULD contain a digest to indicate the exact version of that policy.

@laurentsimon
Copy link
Contributor Author

SGTM

@kpk47 kpk47 moved this to 🆕 New in Issue triage May 25, 2023
@kpk47 kpk47 moved this from 🆕 New Issues to 📋 Backlog in Issue triage May 25, 2023
@kpk47 kpk47 moved this from 📋 Backlog to Untriaged in Issue triage Jun 26, 2023
@joshuagl joshuagl self-assigned this Oct 10, 2023
@joshuagl joshuagl moved this from Untriaged to 🏗 In progress in Issue triage Oct 10, 2023
joshuagl added a commit that referenced this issue Nov 13, 2023
Recommended that the `digest` field of `ResourceDescriptor` is set in a
Verification Summary Attestation's (VSA) `policy` object.

Fixes: #803

Signed-off-by: Joshua Lock <[email protected]>
@github-project-automation github-project-automation bot moved this from 🏗 In progress to ✅ Done in Issue triage Nov 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
vsa Applies to SLSA VSA spec
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants