Skip to content

Commit 4c1671d

Browse files
Fix Zizmor security violations: pass secrets through env blocks instead of directly in with blocks
- Move TEST_USER_PAT, TEST_USER_USER_FG_PAT, TEST_USER_ORG_FG_PAT to env blocks - Move TEST_APP_ENT_CLIENT_ID and PrivateKey to env block - Move TEST_APP_ORG_CLIENT_ID and PrivateKey to env block - Follow GitHub Actions security best practice: secrets should be passed through environment variables to prevent unintended logging or exposure - Resolves all 8 Zizmor secrets-outside-env warnings - Remove unnecessary VALIDATE_GITHUB_ACTIONS_ZIZMOR=false setting from Linter.yml
1 parent 9b4bc8b commit 4c1671d

2 files changed

Lines changed: 22 additions & 9 deletions

File tree

.github/workflows/Linter.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ jobs:
2828
uses: super-linter/super-linter@9e863354e3ff62e0727d37183162c4a88873df41 # v8.6.0 # yamllint disable-line line-length
2929
env:
3030
GITHUB_TOKEN: ${{ github.token }}
31-
VALIDATE_GITHUB_ACTIONS_ZIZMOR: false
3231
VALIDATE_BIOME_FORMAT: false
3332
VALIDATE_JSCPD: false
3433
VALIDATE_JSON_PRETTIER: false

.github/workflows/TestWorkflow.yml

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -426,8 +426,10 @@ jobs:
426426
persist-credentials: false
427427
- name: Action-Test
428428
uses: ./
429+
env:
430+
TOKEN_SECRET: ${{ secrets.TEST_USER_PAT }}
429431
with:
430-
Token: ${{ secrets.TEST_USER_PAT }}
432+
Token: ${{ env.TOKEN_SECRET }}
431433
Prerelease: ${{ inputs.Prerelease }}
432434
ShowRateLimit: true
433435
Script: |
@@ -454,8 +456,10 @@ jobs:
454456
persist-credentials: false
455457
- name: Action-Test
456458
uses: ./
459+
env:
460+
TOKEN_SECRET: ${{ secrets.TEST_USER_USER_FG_PAT }}
457461
with:
458-
Token: ${{ secrets.TEST_USER_USER_FG_PAT }}
462+
Token: ${{ env.TOKEN_SECRET }}
459463
Prerelease: ${{ inputs.Prerelease }}
460464
ShowRateLimit: true
461465
Script: |
@@ -482,8 +486,10 @@ jobs:
482486
persist-credentials: false
483487
- name: Action-Test
484488
uses: ./
489+
env:
490+
TOKEN_SECRET: ${{ secrets.TEST_USER_ORG_FG_PAT }}
485491
with:
486-
Token: ${{ secrets.TEST_USER_ORG_FG_PAT }}
492+
Token: ${{ env.TOKEN_SECRET }}
487493
Prerelease: ${{ inputs.Prerelease }}
488494
ShowRateLimit: true
489495
Script: |
@@ -510,9 +516,12 @@ jobs:
510516
persist-credentials: false
511517
- name: Action-Test
512518
uses: ./
519+
env:
520+
CLIENTID_SECRET: ${{ secrets.TEST_APP_ENT_CLIENT_ID }}
521+
PRIVATEKEY_SECRET: ${{ secrets.TEST_APP_ENT_PRIVATE_KEY }}
513522
with:
514-
ClientID: ${{ secrets.TEST_APP_ENT_CLIENT_ID }}
515-
PrivateKey: ${{ secrets.TEST_APP_ENT_PRIVATE_KEY }}
523+
ClientID: ${{ env.CLIENTID_SECRET }}
524+
PrivateKey: ${{ env.PRIVATEKEY_SECRET }}
516525
Prerelease: ${{ inputs.Prerelease }}
517526
ShowRateLimit: true
518527
Script: |
@@ -547,9 +556,12 @@ jobs:
547556
persist-credentials: false
548557
- name: Action-Test
549558
uses: ./
559+
env:
560+
CLIENTID_SECRET: ${{ secrets.TEST_APP_ORG_CLIENT_ID }}
561+
PRIVATEKEY_SECRET: ${{ secrets.TEST_APP_ORG_PRIVATE_KEY }}
550562
with:
551-
ClientID: '${{ secrets.TEST_APP_ORG_CLIENT_ID }}' # Test with quotes on input
552-
PrivateKey: '${{ secrets.TEST_APP_ORG_PRIVATE_KEY }}' # Test with quotes on input
563+
ClientID: '${{ env.CLIENTID_SECRET }}' # Test with quotes on input
564+
PrivateKey: '${{ env.PRIVATEKEY_SECRET }}' # Test with quotes on input
553565
Prerelease: ${{ inputs.Prerelease }}
554566
ShowRateLimit: true
555567
Script: |
@@ -686,8 +698,10 @@ jobs:
686698
persist-credentials: false
687699
- name: Action-Test with PreserveCredentials false
688700
uses: ./
701+
env:
702+
TOKEN_SECRET: ${{ secrets.TEST_USER_PAT }}
689703
with:
690-
Token: ${{ secrets.TEST_USER_PAT }}
704+
Token: ${{ env.TOKEN_SECRET }}
691705
PreserveCredentials: false
692706
Prerelease: ${{ inputs.Prerelease }}
693707
ShowRateLimit: true

0 commit comments

Comments
 (0)