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

Remove enabled setting from secret_push_protection #132

Merged
merged 1 commit into from
Jul 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions rule-types/github/secret_push_protection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ 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 @@ -60,15 +57,9 @@ 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 @@ -79,11 +70,7 @@ 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
Loading