Skip to content

Commit

Permalink
Revert "Remove enabled setting from secret_push_protection (#132)" (#…
Browse files Browse the repository at this point in the history
…133)

This reverts commit faf2060.
  • Loading branch information
dmjb authored Jul 26, 2024
1 parent faf2060 commit ea6ac1f
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions rule-types/github/secret_push_protection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ def:
# Defines the schema for writing a rule with this rule being checked
rule_schema:
properties:
enabled:
type: boolean
default: true
skip_private_repos:
type: boolean
default: true
Expand Down Expand Up @@ -57,9 +60,15 @@ def:
default skip := false
allow if {
input.profile.enabled
input.ingested.security_and_analysis.secret_scanning_push_protection.status == "enabled"
}
allow if {
not input.profile.enabled
input.ingested.security_and_analysis.secret_scanning_push_protection.status == "disabled"
}
skip if {
input.profile.skip_private_repos == true
input.ingested.private == true
Expand All @@ -70,7 +79,11 @@ def:
method: PATCH
endpoint: "/repos/{{.Entity.Owner}}/{{.Entity.Name}}"
body: |
{{- if .Profile.enabled }}
{ "security_and_analysis": {"secret_scanning_push_protection": { "status": "enabled" } } }
{{- else }}
{ "security_and_analysis": {"secret_scanning_push_protection": { "status": "disabled" } } }
{{- end }}
# Defines the configuration for alerting on the rule
alert:
type: security_advisory
Expand Down

0 comments on commit ea6ac1f

Please sign in to comment.