-
Notifications
You must be signed in to change notification settings - Fork 13
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
Github SLSA Provenance #105
Conversation
Signed-off-by: Adolfo García Veytia (Puerco) <[email protected]>
@puerco I pushed a new patch into your branch (hopefully that's OK since you can just delete it if you don't like the patch). I will point out the changes in inline comments. |
@@ -1,7 +1,7 @@ | |||
--- | |||
version: v1 | |||
type: rule-type | |||
name: artifact_signature | |||
name: artifact_signature_slsa |
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.
I think we should not change the existing type but add a new one.
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.
I agree with this, if we want to change the signature, behavior or even deprecate the previous behavior, we should just document the deprecation and create a new rule type.
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.
yes totally agree i had not gotten to that part
- push | ||
default: ["worflow_dispatch", "push"] | ||
items: | ||
type: string |
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.
I was getting errors unless I made the array type a string and then enumerated the allowed values.
enum: | ||
- workflow_dispatch | ||
- push | ||
default: ["workflow_dispatch", "push"] |
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.
Note that the default has no effect on minder right now...
|
||
allow if { | ||
artifacts_github_provenance = {artifact | |
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.
this filter is the most important change and one I am not sure is correct. But based on my reading of your code what you wanted was to:
- evaluate only artifacts whose
predicate_type
is"https://slsa.dev/provenance/v1"
and thebuildType
is"https://slsa-framework.github.io/github-actions-buildtypes/workflow/v1"
and skip the rest right? - those that match the two conditions above must match the profile
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.
Yes correct! Thank you 🙏
# #} | ||
# } | ||
#} | ||
skip if { |
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.
this should mark the rule as skipped if there are no matching artifacts (with "https://slsa-framework.github.io/github-actions-buildtypes/workflow/v1" == buildType and ""https://slsa.dev/provenance/v1" == predicate_type)
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.
Oh interesting. Is skip
a custom value that minder recognizes or is it just vanilla rego?
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.
every artifact in artifacts_github_provenance { | ||
artifact.Verification.attestation.predicate.buildDefinition.externalParameters.workflow.path == input.profile.signer_identity | ||
artifact.Verification.attestation.predicate.buildDefinition.externalParameters.workflow.ref == input.profile.workflow_ref | ||
artifact.Verification.attestation.predicate.buildDefinition.externalParameters.workflow.repository == input.profile.workflow_repository |
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.
note that these conditions don't handle all the parameters in the rule_schema
but I wasn't sure if you only want to match those under the attestation or also those in the top-level attributes.
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.
Do we want to match all parameters? At some point it would be good just to have minimal rules that check different aspects of the attestation. That way we'd get more relevant error messages. Similar to what we did for branch protection rules.
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.
yes, that's why I think we should create a new rule.
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.
I think we should match all that are defined if possible. But I expect these to evolve, possible to a more advanced and general SLSA rule type.
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.
sorry, can you elaborate? Now we do match all defined as params in the ruletype did you mean all that exist in the ingestion result that we send?
here's the profile I was testing with:
|
- Get rid of the is_verified, allowed_workflow and cert_issuer attributes - fix descriptions - check that if is_verified and is_signed is present, it must be true - check runner_environment
note: I just updated the |
Signed-off-by: Adolfo García Veytia (Puerco) <[email protected]>
Signed-off-by: Adolfo García Veytia (Puerco) <[email protected]>
Closing this one in favor of #106 (from a branch, not a fork) |
Work in progress:
Attestation rules