Skip to content

Commit

Permalink
Update install_code_suspicious.rego
Browse files Browse the repository at this point in the history
  • Loading branch information
furi0us333 authored Jul 3, 2024
1 parent edcc8af commit 3130ebd
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions install_code_suspicious.rego
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
package policy
# METADATA

Check failure on line 1 in install_code_suspicious.rego

View workflow job for this annotation

GitHub Actions / lint

Detached metadata annotation. To learn more, see: https://docs.styra.com/regal/rules/style/detached-metadata
# title: Install Code Execution (Suspicious)
# description: |
# Returns a violation if there is suspicious code execution on pacakge install

package policy.v1

Check failure on line 6 in install_code_suspicious.rego

View workflow job for this annotation

GitHub Actions / lint

File should be formatted with `opa fmt`. To learn more, see: https://docs.styra.com/regal/rules/style/opa-fmt

import rego.v1

# Returns a violation if there is suspicious code execution on package install
# METADATA
# scope: rule
# schemas:
# - data.issue: schema.issue
issue contains "Package contains suspicious code execution on install" if {
data.issue.tag == "CM0007"
# Package contains suspicious code execution on install
deny contains issue if {
some issue in data.issues
issue.tag == "CM0007"
}

issue contains "Package contains suspicious code execution on install" if {
endswith(data.issue.tag, "M0031")
# Package contains suspicious code execution on install
deny contains issue if {
some issue in data.issues
endswith(issue.tag, "M0031")
}

0 comments on commit 3130ebd

Please sign in to comment.