Skip to content

Commit 014798e

Browse files
authored
security: disable git credential persistence in checkout actions (#281)
Remediate zizmor security finding by setting persist-credentials: false on all actions/checkout usages. This prevents unnecessary storage of git credentials in the GitHub Actions runner environment, reducing the attack surface if the runner is compromised. Changes: - Set persist-credentials: false on all 6 checkout actions across 3 workflows - Applied to dockerimage.yml, linting.yml, and update-current-image.yml - Credentials are still available for the current job but not persisted after
1 parent 369497d commit 014798e

3 files changed

Lines changed: 12 additions & 0 deletions

File tree

.github/workflows/dockerimage.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ jobs:
3131
steps:
3232
- name: Checkout
3333
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
34+
with:
35+
persist-credentials: false
3436

3537
- name: ccache
3638
uses: hendrikmuhs/ccache-action@d62db5f07c26379fc4b4e0916f098a92573c3b03 # v1.2.23

.github/workflows/linting.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ jobs:
99
steps:
1010
- name: Checkout
1111
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
12+
with:
13+
persist-credentials: false
1214

1315
- name: shfmt
1416
run: |
@@ -20,6 +22,8 @@ jobs:
2022
steps:
2123
- name: Checkout
2224
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
25+
with:
26+
persist-credentials: false
2327

2428
- name: Shellcheck
2529
run: |
@@ -31,6 +35,8 @@ jobs:
3135
steps:
3236
- name: Checkout
3337
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
38+
with:
39+
persist-credentials: false
3440

3541
- name: Markdownlint
3642
uses: DavidAnson/markdownlint-cli2-action@ded1f9488f68a970bc66ea5619e13e9b52e601cd # v23.2.0

.github/workflows/update-current-image.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ jobs:
2121
steps:
2222
- name: Checkout
2323
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
24+
with:
25+
persist-credentials: false
2426

2527
- name: Validate and Get NODE_VERSION
2628
id: get_version
@@ -69,6 +71,8 @@ jobs:
6971
steps:
7072
- name: Checkout
7173
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
74+
with:
75+
persist-credentials: false
7276

7377
- name: ccache
7478
uses: hendrikmuhs/ccache-action@d62db5f07c26379fc4b4e0916f098a92573c3b03 # v1.2.23

0 commit comments

Comments
 (0)