Skip to content

Commit 758c961

Browse files
authored
Sort untrusted command list + add OpenTofu and Maven (#254)
* feat(rules): add opentofu to untrusted checkout exec * style(rules): sort untrusted exec commands * feat(rules): add additional mvnw script names
1 parent 7fe4f3b commit 758c961

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

opa/rego/rules/untrusted_checkout_exec.rego

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,21 +32,22 @@ build_github_actions[action] = {
3232
}[action]
3333

3434
build_commands[cmd] = {
35-
"npm": {"npm install", "npm run ", "yarn ", "npm ci(\\b|$)"},
36-
"make": {"make "},
37-
"terraform": {"terraform plan", "terraform apply"},
38-
"gomplate": {"gomplate "},
39-
"pre-commit": {"pre-commit run", "pre-commit install"},
40-
"go generate": {"go generate"},
41-
"msbuild": {"msbuild "},
42-
"maven": {"mvn ", "./mvnw "},
43-
"gradle": {"gradle ", "./gradlew "},
44-
"bundler": {"bundle install", "bundle exec "},
4535
"ant": {"^ant "},
36+
"bundler": {"bundle install", "bundle exec "},
37+
"cargo": {"cargo build", "cargo run"},
38+
"go generate": {"go generate"},
39+
"gomplate": {"gomplate "},
40+
"gradle": {"gradle ", "./gradlew ", "./gradlew.bat "}, # https://docs.gradle.org/current/userguide/gradle_wrapper_basics.html
41+
"make": {"make "},
42+
"maven": {"mvn ", "./mvnw ", "./mvnw.bat", "./mvnw.cmd", "./mvnw.sh "}, # https://maven.apache.org/wrapper/
4643
"mkdocs": {"mkdocs build"},
47-
"vale": {"vale "},
44+
"msbuild": {"msbuild "},
45+
"npm": {"npm install", "npm run ", "yarn ", "npm ci(\\b|$)"},
4846
"pip": {"pip install", "pipenv install", "pipenv run "},
49-
"cargo": {"cargo build", "cargo run"},
47+
"pre-commit": {"pre-commit run", "pre-commit install"},
48+
"terraform": {"terraform plan", "terraform apply"},
49+
"tofu": {"tofu plan", "tofu apply"},
50+
"vale": {"vale "},
5051
}[cmd]
5152

5253
results contains poutine.finding(rule, pkg_purl, {

0 commit comments

Comments
 (0)