-
Notifications
You must be signed in to change notification settings - Fork 50
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
fix: address gcb verifier comments and add gcb documentation #300
Conversation
Signed-off-by: Asra Ali <asraa@google.com>
verifiers/internal/gcb/provenance.go
Outdated
// In v0.2, it uses the formats | ||
// `https://github.com/laurentsimon/gcb-tests/commit/01ce393d04eb6df2a7b2b3e95d4126e687afb7ae` | ||
// `gs://slsa-tooling_cloudbuild/source/1663616632.078353-fc7db143dcc64b5f9fe71d0497125ca1.tgz#1663616635134845` | ||
if uri.Fragment == "" && !strings.HasPrefix(uri.Path, expectedURI.Path+"/commit/") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it may be better to switch on scheme here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I think that's a more clear way to differentiate the URL types.
Though I wonder about the gs://
URLs. Do those show up when you submit a build via gcloud builds submit
? or something else? Do we really want to verify builds that are built that way?
I guess users would have to pass a --source gs://slsa-tooling_cloudbuild/source
argument to slsa-verifier
? I think the source check mostly looses all meaning in this case. No?
TBC, I'm not sure we need to support source checks for builds submitted as gcloud builds submit
. I also wonder how v0.3 handles builds that are submitted this way.
verifiers/internal/gcb/provenance.go
Outdated
// In v0.2, it uses the formats | ||
// `https://github.com/laurentsimon/gcb-tests/commit/01ce393d04eb6df2a7b2b3e95d4126e687afb7ae` | ||
// `gs://slsa-tooling_cloudbuild/source/1663616632.078353-fc7db143dcc64b5f9fe71d0497125ca1.tgz#1663616635134845` | ||
if uri.Fragment == "" && !strings.HasPrefix(uri.Path, expectedURI.Path+"/commit/") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I think that's a more clear way to differentiate the URL types.
Though I wonder about the gs://
URLs. Do those show up when you submit a build via gcloud builds submit
? or something else? Do we really want to verify builds that are built that way?
I guess users would have to pass a --source gs://slsa-tooling_cloudbuild/source
argument to slsa-verifier
? I think the source check mostly looses all meaning in this case. No?
TBC, I'm not sure we need to support source checks for builds submitted as gcloud builds submit
. I also wonder how v0.3 handles builds that are submitted this way.
The v0.3 builds use the same v0.3 doesn't mean SLSA 3 unfortunately, also. SOME gcloud builds submit, if configured with a github trigger, will appear with |
Tabling this for some feedback with Laurent and GCB team on dropping the source bucket requirement entirely. |
Yeah. The reason I asked was because you don't have any special logic for |
Signed-off-by: Asra Ali <asraa@google.com>
I updated this PR to mostly add documentation but preserve the original behavior (see updated PR description). I decided not to mess with allowing users to specify a short source bucket, and keep the original behavior. |
will this include the trailing |
The current behavior when I made it did not: we match on everything up to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I left a question i a comment about the trailing #<id>
in the matching. I recall you said there was one sometimes. Will it be required for the match? I think yes, but wanted confirmaiton.
@@ -116,6 +116,8 @@ PASSED: Verified SLSA provenance | |||
|
|||
The verified in-toto statement may be written to stdout with the `--print-provenance` flag to pipe into policy engines. | |||
|
|||
Only GitHub URIs are supported with the `--source-uri` flag. A tag should not be specified, even if the provenance was built at some tag. If you intend to do source versioning validation, use `--print-provenance` and inspect the commit SHA of the config source or materials. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shall we create an issue for --source-sha1
? Probably nor urgent...
I see. The commit is omitted for the source-uri matching because it's not supposed to be there - it should be in a dedicated field |
To some degree it may not matter at all until they expose source provenance FOR the bucket. That bucket just contains anything in the context of the |
* updates * updates * updates
Signed-off-by: Asra Ali asraa@google.com
Addressing comments from https://github.com/slsa-framework/slsa-verifier/pull/292/files/dcb49d5bc9d6bc0119b3a41d64c529eda79a112c
Note: I reverted the behavior and clarified expectations in the README.md:
gs://[PROEJCT_ID]_cloudbuild/source/[BUCKET].tar.gz
to preserve behavior.