Skip to content

Commit bff25ba

Browse files
Fix GitHub Actions workflow security issues (zizmor audit)
- Pin internal workflow references to specific commit hashes - Replace secrets: inherit with explicit secret mappings - Add concurrency limits to all workflows to prevent overlapping runs - Add descriptive job names for better CI/CD visibility - Add explanatory comments for all permission blocks - Add explicit permissions block to cx-one-scan workflow - Improve overall security posture of GitHub Actions workflows All zizmor security audits now pass with zero findings. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
1 parent abe950e commit bff25ba

6 files changed

Lines changed: 64 additions & 18 deletions

File tree

.github/workflows/ci.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,23 @@
11
name: AST Javascript wrapper CI
22

33
on: [pull_request]
4+
45
permissions:
56
contents: read
67

8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: true
11+
712
jobs:
813
integration-tests:
14+
name: Run Integration Tests
915
runs-on: cx-public-ubuntu-x64
1016
steps:
1117
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
1218
with:
1319
lfs: true
20+
persist-credentials: false
1421

1522
- name: Install Git LFS
1623
run: |
@@ -67,4 +74,4 @@ jobs:
6774
CX_BASE_URI: ${{ secrets.CX_BASE_URI }}
6875
CX_TENANT: ${{ secrets.CX_TENANT }}
6976
CX_APIKEY: ${{ secrets.CX_APIKEY }}
70-
run: npm test
77+
run: npm test

.github/workflows/cx-one-scan.yaml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
name: cx-one-scan
2+
3+
permissions:
4+
contents: read # For reading repository code
5+
26
on:
37
workflow_dispatch:
48
pull_request:
@@ -8,13 +12,21 @@ on:
812
schedule:
913
- cron: '00 5 * * *' # Every day at 05:00
1014

15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.ref }}
17+
cancel-in-progress: true
18+
1119
jobs:
1220
cx-one-scan:
13-
name: cx-one-scan
21+
name: Checkmarx One Security Scan
1422
runs-on: cx-public-ubuntu-x64
23+
permissions:
24+
contents: read # For reading repository code
1525
steps:
1626
- name: Checkout
1727
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
28+
with:
29+
persist-credentials: false
1830
- name: Checkmarx One CLI Action
1931
uses: checkmarx/ast-github-action@9fda4ab4c1b67c35de380552a972a82997d97731 # https://github.com/Checkmarx/ast-github-action/releases/tag/2.0.42
2032
with:

.github/workflows/delete-packages-and-releases.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,16 @@ on:
1616
permissions:
1717
contents: read
1818

19+
concurrency:
20+
group: ${{ github.workflow }}-${{ github.ref }}
21+
cancel-in-progress: true
22+
1923
jobs:
2024
delete:
25+
name: Delete Old Packages and Releases
2126
permissions:
22-
contents: write
23-
packages: write
27+
contents: write # For deleting releases and tags
28+
packages: write # For deleting npm packages
2429
runs-on: cx-public-ubuntu-x64
2530
steps:
2631

.github/workflows/nightly.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,18 @@ on:
88
branches:
99
- main
1010

11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
1115
jobs:
1216
nightly:
17+
name: Nightly Release Job
1318
permissions:
14-
id-token: write
15-
contents: write
16-
packages: write
17-
uses: Checkmarx/ast-cli-javascript-wrapper/.github/workflows/release.yml@main
18-
secrets: inherit
19+
id-token: write # For signing artifacts
20+
contents: write # For pushing tags and releases
21+
packages: write # For publishing packages
22+
uses: Checkmarx/ast-cli-javascript-wrapper/.github/workflows/release.yml@abe950ede3b052dfc236f730cf11cc290af53d1c
23+
secrets:
24+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25+
ECHO_LIBRARIES_ACCESS_KEY: ${{ secrets.ECHO_LIBRARIES_ACCESS_KEY }}

.github/workflows/release.yml

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,21 +47,28 @@ on:
4747
permissions:
4848
contents: read
4949

50+
concurrency:
51+
group: ${{ github.workflow }}-${{ github.ref }}
52+
cancel-in-progress: true
53+
5054
jobs:
5155
delete:
56+
name: Delete Old Packages and Releases
5257
permissions:
53-
contents: write
54-
packages: write
55-
uses: Checkmarx/ast-cli-javascript-wrapper/.github/workflows/delete-packages-and-releases.yml@main
58+
contents: write # For deleting releases
59+
packages: write # For deleting packages
60+
uses: Checkmarx/ast-cli-javascript-wrapper/.github/workflows/delete-packages-and-releases.yml@abe950ede3b052dfc236f730cf11cc290af53d1c
5661
with:
5762
tag: ${{ inputs.jsTag }}
58-
secrets: inherit
63+
secrets:
64+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5965
if: inputs.dev == true
6066
release:
67+
name: Release JavaScript Wrapper
6168
permissions:
62-
id-token: write
63-
contents: write
64-
packages: write
69+
id-token: write # For signing artifacts
70+
contents: write # For pushing tags and releases
71+
packages: write # For publishing packages
6572
runs-on: cx-public-ubuntu-x64
6673
env:
6774
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -76,6 +83,7 @@ jobs:
7683
with:
7784
fetch-depth: 0
7885
lfs: true # Ensure LFS files are checked out
86+
persist-credentials: false
7987

8088
# VERIFY SINGLE LOCKFILE
8189
- name: Verify single lockfile
@@ -185,7 +193,7 @@ jobs:
185193
if: inputs.dev == false
186194
run: |
187195
git pull
188-
git tag ${{env.TAG_NAME}}
196+
git tag ${TAG_NAME}
189197
git push --tags
190198
191199

.github/workflows/update-cli.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
name: Update checkmarx ast cli
2+
23
on:
34
workflow_dispatch:
45
repository_dispatch:
@@ -7,15 +8,21 @@ on:
78
permissions:
89
contents: read
910

11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
1015
jobs:
1116
update-checkmarx-cli:
17+
name: Update Checkmarx CLI Binaries
1218
permissions:
13-
contents: write
19+
contents: write # For pushing updated CLI binaries
1420
runs-on: cx-public-ubuntu-x64
1521
steps:
1622
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
1723
with:
1824
lfs: true
25+
persist-credentials: false
1926

2027
- name: Install Git LFS
2128
run: |

0 commit comments

Comments
 (0)