Skip to content

Commit

Permalink
metadata updates
Browse files Browse the repository at this point in the history
  • Loading branch information
furi0us333 committed Jul 12, 2024
1 parent d2b4a38 commit 3271f69
Show file tree
Hide file tree
Showing 15 changed files with 58 additions and 39 deletions.
7 changes: 4 additions & 3 deletions show_all.rego → block_all.rego
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# METADATA
# title: Show All
# title: Block All Issues
# description: |
# Returns a violation for all identified issues
# Blocks all identified issues
package policy.v1

import rego.v1

# Policy Violation
# METADATA
# title: Policy Violation
deny contains issue if {
some issue in data.issues
}
14 changes: 9 additions & 5 deletions confirmed_malicious.rego
Original file line number Diff line number Diff line change
@@ -1,30 +1,34 @@
# METADATA
# title: Confirmed Malicious
# description: |
# Return a violation if the pacakge or author is tied to known malicious behavior
# Blocks if the package or author is tied to known malicious behavior
package policy.v1

import rego.v1

# Returns a violation if the author is known malicious
# METADATA
# title: Author is known malicious
deny contains issue if {
some issue in data.issues
issue.tag == "CA0001"
}

# Returns a violation if the package contains verified malware
# METADATA
# title: Verified malware
deny contains issue if {
some issue in data.issues
issue.tag == "CM0037"
}

# Returns a violation if the package contains a known-bad compiled binary
# METADATA
# title: Known-bad compiled binary
deny contains issue if {
some issue in data.issues
issue.tag == "CM0038"
}

# Returns a violation if the package depends on a known malicious package
# METADATA
# title: Depends on a known malicious package
deny contains issue if {
some issue in data.issues
issue.tag == "CM0039"
Expand Down
8 changes: 5 additions & 3 deletions data_exfiltration.rego
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
# METADATA
# title: Data Exfiltration
# description: |
# Returns a violation if the package contains common data exfiltration techniques
# Blocks common data exfiltration techniques
package policy.v1

import rego.v1

# Package contains environment variable enumeration
# METADATA
# title: Environment variable enumeration
deny contains issue if {
some issue in data.issues
issue.tag == "HM0025"
}

# Package contains webhook exfiltration
# METADATA
# title: Webhook exfiltration
deny contains issue if {
some issue in data.issues
issue.tag == "HM0036"
Expand Down
5 changes: 3 additions & 2 deletions dependency_confusion.rego
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# METADATA
# title: Dependency Confusion
# description: |
# Returns a violation if the package appears to be a dependency confusion
# Blocks dependency confusion
package policy.v1

import rego.v1

# Package contains environment variable enumeration
# METADATA
# title: Dependency confusion
deny contains issue if {
some issue in data.issues
issue.tag == "HM0018"
Expand Down
5 changes: 3 additions & 2 deletions install_code.rego
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# METADATA
# title: Install Code Execution
# description: |
# Returns a violation if there is code execution on package install
# Blocks code execution on package install
package policy.v1

import rego.v1

# Package contains code execution on install
# METADATA
# title: Code execution on install
deny contains issue if {
some issue in data.issues
issue.tag in {"IM0042", "IM0043", "IM0044"}
Expand Down
7 changes: 4 additions & 3 deletions install_code_suspicious.rego
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
# METADATA
# title: Install Code Execution (Suspicious)
# description: |
# Returns a violation if there is suspicious code execution on pacakge install
# Blocks suspicious code execution on pacakge install
package policy.v1

import rego.v1

# Package contains suspicious code execution on install
# METADATA
# title: Suspicious code execution on install
deny contains issue if {
some issue in data.issues
issue.tag == "CM0007"
}

# Package contains suspicious code execution on install
# title: Suspicious code execution on install
deny contains issue if {
some issue in data.issues
endswith(issue.tag, "M0031")
Expand Down
5 changes: 3 additions & 2 deletions license_mismatch.rego
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# METADATA
# title: License Mismatch
# description: |
# Returns a violation if there is a license mismatch between metadata and files
# Blocks a license mismatch between metadata and files
package policy.v1

import rego.v1

# License mismatch
# METADATA
# title: License mismatch
deny contains issue if {
some issue in data.issues
issue.tag == "IL0022"
Expand Down
5 changes: 3 additions & 2 deletions minimal_code.rego
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# METADATA
# title: Minimal Code
# description: |
# Returns a violation if the package contains minimal code and is unlikley worth the security risk
# Blocks packages containing minimal code
package policy.v1

import rego.v1

# Package contains minimal code
# METADATA
# title: Minimal code
deny contains issue if {
some issue in data.issues
issue.tag == "IE0027"
Expand Down
5 changes: 3 additions & 2 deletions obfuscated_code.rego
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# METADATA
# title: Obfuscated Code
# description: |
# Returns a violation if the package contains obfuscated code
# Blocks obfuscated code
package policy.v1

import rego.v1

# Package contains obfuscated code
# METADATA
# title: Obfuscated code
deny contains issue if {
some issue in data.issues
issue.tag in {"HM0029", "HM0099", "HM0023", "IM0040", "IM0041"}
Expand Down
5 changes: 3 additions & 2 deletions runs_remote_code.rego
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# METADATA
# title: Runs Remote Code
# description: |
# Returns a violation if the package runs remote code
# Blocks packages that run remote code
package policy.v1

import rego.v1

# Runs remote code
# METADATA
# title: Runs remote code
deny contains issue if {
some issue in data.issues
issue.tag in {"CM0024", "MM0024", "HM0032"}
Expand Down
7 changes: 4 additions & 3 deletions secret_non_test.rego
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# METADATA
# title: Minimal Code
# title: Secrets in non-test files
# description: |
# Returns a violation if the package contains secrets/tokens excluding test/example files
# Blocks packages containing secrets/tokens in non-test files
package policy.v1

import rego.v1

# Secrets in non-test file
# METADATA
# title: Secrets in non-test file
deny contains issue if {
some issue in data.issues
issue.tag == "ME0016"
Expand Down
5 changes: 3 additions & 2 deletions suspicious_url.rego
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# METADATA
# title: Suspicious URL References
# description: |
# Returns a violation if the package references sites uncommon to legitimate software
# Block packages referencing sites uncommon to legitimate software
package policy.v1

import rego.v1

# Suspicious URL reference
# METADATA
# title: Suspicious URL reference
deny contains issue if {
some issue in data.issues
issue.tag == "MM0028"
Expand Down
5 changes: 3 additions & 2 deletions typosquat.rego
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
# METADATA
# title: Typosquat
# description: |
# Returns a violation if the package contains a potential typosquat with malicious characteristics
# Blocks potential typosquat with malicious characteristics
package policy.v1

import data.phylum.domain
import rego.v1

# Potential typosquat with malicious characteristics
# METADATA
# title: Potential typosquat with malicious characteristics
deny contains typosquat_issue if {
some dependency in data.dependencies

Expand Down
7 changes: 4 additions & 3 deletions vuln_crit.rego
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
# METADATA
# title: Critical Software Vulnerability
# title: Software Vulnerability - Critical
# description: |
# Returns a violation if the package has a Critical software vulnerability
# Blocks Critical software vulnerabilities
package policy.v1

import data.phylum.domain
import data.phylum.level
import rego.v1

# Critical software vulnerability
# METADATA
# title: Critical software vulnerability
deny contains issue if {
some issue in data.issues
issue.domain == domain.VULNERABILITY
Expand Down
7 changes: 4 additions & 3 deletions vuln_crit_high.rego
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
# METADATA
# title: Critical/High Software Vulnerability
# title: Software Vulnerability - Critical/High
# description: |
# Returns a violation if the package has a Critical or High software vulnerability
# Blocks Critical and High software vulnerabilities
package policy.v1

import data.phylum.domain
import data.phylum.level
import rego.v1

# Critical or High software vulnerability
# METADATA
# title: Critical or High software vulnerability
deny contains issue if {
some issue in data.issues
issue.domain == domain.VULNERABILITY
Expand Down

0 comments on commit 3271f69

Please sign in to comment.