Skip to content

Commit 0a67b9c

Browse files
authored
fix untrusted_checkout_exec line numbers (#26)
1 parent eb79bca commit 0a67b9c

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

opa/rego/rules/untrusted_checkout_exec.rego

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ build_commands[cmd] = {
3737

3838
results contains poutine.finding(rule, pkg_purl, {
3939
"path": workflow_path,
40-
"line": step.line,
40+
"line": step.lines.run,
4141
"details": sprintf("Detected usage of `%s`", [cmd]),
4242
}) if {
4343
[pkg_purl, workflow_path, step] := _steps_after_untrusted_checkout[_]
@@ -49,7 +49,7 @@ results contains poutine.finding(rule, pkg_purl, {
4949

5050
results contains poutine.finding(rule, pkg_purl, {
5151
"path": workflow_path,
52-
"line": step.line,
52+
"line": step.lines.uses,
5353
"details": sprintf("Detected usage the GitHub Action `%s`", [step.action]),
5454
}) if {
5555
[pkg_purl, workflow_path, step] := _steps_after_untrusted_checkout[_]

scanner/inventory_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ func TestFindings(t *testing.T) {
145145
Purl: purl,
146146
Meta: opa.FindingMeta{
147147
Path: ".github/workflows/valid.yml",
148-
Line: 29,
148+
Line: 30,
149149
Details: "Detected usage of `npm`",
150150
},
151151
},
@@ -154,7 +154,7 @@ func TestFindings(t *testing.T) {
154154
Purl: purl,
155155
Meta: opa.FindingMeta{
156156
Path: ".github/workflows/valid.yml",
157-
Line: 55,
157+
Line: 56,
158158
Details: "Detected usage the GitHub Action `bridgecrewio/checkov-action`",
159159
},
160160
},
@@ -163,7 +163,7 @@ func TestFindings(t *testing.T) {
163163
Purl: purl,
164164
Meta: opa.FindingMeta{
165165
Path: ".github/workflows/valid.yml",
166-
Line: 59,
166+
Line: 60,
167167
Details: "Detected usage of `pre-commit`",
168168
},
169169
},

0 commit comments

Comments
 (0)