Skip to content

Commit 63e0c29

Browse files
chore: always pin harden-runner unless exempted
1 parent fcd7381 commit 63e0c29

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

remediation/workflow/secureworkflow.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,12 @@ func SecureWorkflow(queryStringParams map[string]string, inputYaml string, svc d
8585
}
8686

8787
if addHardenRunner {
88+
// Always pin harden-runner unless exempted
89+
pinHardenRunner := true
8890
if pin.ActionExists(HardenRunnerActionPath, exemptedActions) {
89-
pinActions = false
91+
pinHardenRunner = false
9092
}
91-
secureWorkflowReponse.FinalOutput, addedHardenRunner, _ = hardenrunner.AddAction(secureWorkflowReponse.FinalOutput, HardenRunnerActionPathWithTag, pinActions, pinToImmutable)
93+
secureWorkflowReponse.FinalOutput, addedHardenRunner, _ = hardenrunner.AddAction(secureWorkflowReponse.FinalOutput, HardenRunnerActionPathWithTag, pinHardenRunner, pinToImmutable)
9294
}
9395

9496
// Setting appropriate flags

testfiles/secureworkflow/output/nopin.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
runs-on: ubuntu-latest
1616
steps:
1717
- name: Harden the runner (Audit all outbound calls)
18-
uses: step-security/harden-runner@v2
18+
uses: step-security/harden-runner@ebacdc22ef6c2cfb85ee5ded8f2e640f4c776dd5 # v2.0.0
1919
with:
2020
egress-policy: audit
2121

0 commit comments

Comments
 (0)