Skip to content

Commit a5b26d8

Browse files
committed
apply security review fixes to workflows and lint config
1 parent eb2bd3e commit a5b26d8

3 files changed

Lines changed: 2566 additions & 15 deletions

File tree

.github/workflows/security.yml

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ on:
88

99
permissions:
1010
contents: read
11-
security-events: write # CodeQL needs this to upload SARIF results
1211

1312
jobs:
1413

@@ -19,9 +18,9 @@ jobs:
1918
name: Dependency Audit
2019
runs-on: ubuntu-latest
2120
steps:
22-
- uses: actions/checkout@v5
21+
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
2322

24-
- uses: actions/setup-node@v5
23+
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5
2524
with:
2625
node-version: 22
2726
cache: 'npm'
@@ -42,8 +41,8 @@ jobs:
4241
runs-on: ubuntu-latest
4342
if: github.event_name == 'pull_request'
4443
steps:
45-
- uses: actions/checkout@v5
46-
- uses: actions/dependency-review-action@v4
44+
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
45+
- uses: actions/dependency-review-action@2031cfc080254a8a887f58cffee85186f0e49e48 # v4.9.0
4746
with:
4847
fail-on-severity: high
4948

@@ -57,23 +56,26 @@ jobs:
5756
codeql:
5857
name: CodeQL
5958
runs-on: ubuntu-latest
59+
permissions:
60+
contents: read
61+
security-events: write # needed to upload SARIF results
6062
steps:
61-
- uses: actions/checkout@v5
63+
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
6264

63-
- uses: actions/setup-node@v5
65+
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5
6466
with:
6567
node-version: 22
6668

6769
- name: Initialize CodeQL
68-
uses: github/codeql-action/init@v3
70+
uses: github/codeql-action/init@02c5e83432fe5497fd85b873b6c9f16a8578e1d9 # v3
6971
with:
7072
languages: javascript-typescript
7173
queries: security-extended
7274

7375
- run: npm ci && npm run build
7476

7577
- name: Analyze
76-
uses: github/codeql-action/analyze@v3
78+
uses: github/codeql-action/analyze@02c5e83432fe5497fd85b873b6c9f16a8578e1d9 # v3
7779
with:
7880
category: '/language:javascript-typescript'
7981

@@ -85,9 +87,9 @@ jobs:
8587
name: ESLint Security
8688
runs-on: ubuntu-latest
8789
steps:
88-
- uses: actions/checkout@v5
90+
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
8991

90-
- uses: actions/setup-node@v5
92+
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5
9193
with:
9294
node-version: 22
9395
cache: 'npm'
@@ -107,12 +109,12 @@ jobs:
107109
name: Secret Scan
108110
runs-on: ubuntu-latest
109111
steps:
110-
- uses: actions/checkout@v5
112+
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
111113
with:
112114
fetch-depth: 0 # full history needed for git log scan
113115

114116
- name: Scan for secrets with gitleaks
115-
uses: gitleaks/gitleaks-action@v2
117+
uses: gitleaks/gitleaks-action@dcedce43c6f43de0b836d1fe38946645c9c638dc # v2
116118
env:
117119
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
118120
# GITLEAKS_LICENSE not set — free mode scans public repos without limit

eslint.security.config.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ export default tseslint.config(
2727
'security/detect-object-injection': 'warn',
2828
// Warn on timing-unsafe comparisons (token equality checks)
2929
'security/detect-possible-timing-attacks': 'warn',
30-
// Error on non-literal RegExp (ReDoS)
30+
// Warn on non-literal RegExp (ReDoS)
3131
'security/detect-non-literal-regexp': 'warn',
3232
// Error on child_process with non-literal args
3333
'security/detect-child-process': 'error',
34-
// Disable rules that generate too much noise for a CLI codebase
34+
// Disable/reduce noisy rules for a CLI codebase
3535
'security/detect-non-literal-require': 'off',
3636
'security/detect-unsafe-regex': 'warn',
3737
},

0 commit comments

Comments
 (0)