-
Notifications
You must be signed in to change notification settings - Fork 49
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
feat: Verification of VSA #542
Comments
Note: we may need to differentiate between containers and non-containers, maybe via |
What if it were |
May work. You're right the my proposal deviates from the current convention that our commands follow One limitation is that it mangles verify different verification routines into one command line option, so we'd lose namespaces? Eg: ... verify-artifact --vsa-path ... Maybe |
Ah true - yes, I only say this because I worry that for each command we'll have a (artifact/image) pathway like cosign. Hmmm Yeah, VSAs definitely seem like a different pathway altogether. I've usually liked detecting the resource type depending on |
I'm also worried about implicit detection. |
Another option could be to create another sub-namespace: $ slsa-verifier verify-artifact --with-provenance \ # that's a new namespace
--provenance-path <provenance-specific-args>
$ slsa-verifier verify-artifact --with-vsa \ # that's a new namespace
--vsa-path <vsa-specific-args> This would allow us to keep the existing namespaces. |
I think it's ok to have flags that are mutually exclusive. Though, maybe |
there are also corner cases, e.g. for containers where provenance and vsa may be stored on the registry. For Sigstore, users need not provide it to us, we infer this based on builderID. |
Right, those options can vary by the type of artifact (e.g. the command, |
I think so. |
I may have found a better way: spf13/cobra#1327
The link above has a bunch of code example to implement it. |
Grouping is nice, but is only for documentation. From my experiments, if you want to enforce only flags from a single group, you need to write code to validate that. |
+1, I'm planning to have a manual validation to ensure no flags overlap with different groups. Besides this downside, that seems like a good direction? |
Yes, I like it! Was looking over that during the last end of year break when updating the verifier flags but didn't get a chance to do something. I think doing it as part of the VSA verification work is great |
So the above was for verification of artifacts with a VSA. To support custom digests in-toto/attestation#338, I think we need a dedicated API Eventually, I think all this can be backed by a set of APIs #756:
For the CLI, we don't need this level of re-factoring, zo. |
First step towards supporting VSA verification is to add e2e tests in https://github.com/laurentsimon/slsa-verifier/tree/feat/vsa and merge. |
Fixes #542 Adds support for VSAs. ## Testing process - added some unit an end-to-end tests - manually invoking ``` go run ./cli/slsa-verifier/ verify-vsa \ --subject-digest gce_image_id:8970095005306000053 \ --attestation-path ./cli/slsa-verifier/testdata/vsa/gce/v1/gke-gce-pre.bcid-vsa.jsonl \ --verifier-id https://bcid.corp.google.com/verifier/bcid_package_enforcer/v0.1 \ --resource-uri gce_image://gke-node-images:gke-12615-gke1418000-cos-101-17162-463-29-c-cgpv1-pre \ --verified-level BCID_L1 \ --verified-level SLSA_BUILD_LEVEL_2 \ --public-key-path ./cli/slsa-verifier/testdata/vsa/gce/v1/vsa_signing_public_key.pem \ --public-key-id keystore://76574:prod:vsa_signing_public_key \ --print-attestation {"_type":"https://in-toto.io/Statement/v1","predicateType":"https://slsa.dev/verification_summary/v1","predicate":{"timeVerified":"2024-06-12T07:24:34.351608Z","verifier":{"id":"https://bcid.corp.google.com/verifier/bcid_package_enforcer/v0.1"},"verificationResult":"PASSED","verifiedLevels":["BCID_L1","SLSA_BUILD_LEVEL_2"],"resourceUri":"gce_image://gke-node-images:gke-12615-gke1418000-cos-101-17162-463-29-c-cgpv1-pre","policy":{"uri":"googlefile:/google_src/files/642513192/depot/google3/production/security/bcid/software/gce_image/gke/vm_images.sw_policy.textproto"}},"subject":[{"name":"_","digest":{"gce_image_id":"8970095005306000053"}}]} Verifying VSA: PASSED PASSED: SLSA verification passed ``` TODOS: - open issue on the in_toto attestations repo about the incorrect json [fields](https://github.com/in-toto/attestation/blob/36c11295429a997d5bb520b4e80a1d0c16845f9c/go/predicates/vsa/v1/vsa.pb.go#L26-L40) for vsa 1.0 --------- Signed-off-by: Ramon Petgrave <[email protected]>
See VSA https://slsa.dev/verification_summary/v0.2
High-level verification in CLI:
The text was updated successfully, but these errors were encountered: