-
Notifications
You must be signed in to change notification settings - Fork 55
133 lines (121 loc) · 4.03 KB
/
Copy pathsecurity.yml
File metadata and controls
133 lines (121 loc) · 4.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
name: Security
on:
pull_request:
branches: [main]
push:
branches: [main]
schedule:
- cron: '30 2 * * 1'
workflow_dispatch:
permissions:
contents: read
jobs:
codeql:
name: CodeQL
runs-on: ubuntu-latest
permissions:
contents: read
security-events: write
actions: read
strategy:
fail-fast: false
matrix:
language: [javascript-typescript]
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Initialize CodeQL
uses: github/codeql-action/init@v4
with:
languages: ${{ matrix.language }}
- name: Autobuild
uses: github/codeql-action/autobuild@v4
- name: Analyze
uses: github/codeql-action/analyze@v4
with:
category: /language:${{ matrix.language }}
dependency-review:
name: Dependency review
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v6
# Requires the repository's "Dependency graph" setting to be enabled
# (Settings → Code security and analysis). Until that is flipped, the
# action exits with "Dependency review is not supported on this
# repository"; the step is advisory so CI stays green, and becomes a
# blocking gate as soon as the setting is enabled.
- name: Review dependency changes
continue-on-error: true
uses: actions/dependency-review-action@v5
with:
fail-on-severity: high
fail-on-scopes: runtime, development
# Residual-risk advisories accepted for the current Next.js 14.x
# toolchain (see SECURITY.md → "Dependency audit status"). They only
# clear with the Next.js 16 major upgrade; allow-listing them keeps
# this gate strict (any *new* advisory still fails the check).
allow-ghsas: |
GHSA-9g9p-9gw9-jx7f
GHSA-h25m-26qc-wcjf
GHSA-ggv3-7p47-pfv8
GHSA-3x4c-7xq6-9pq8
GHSA-q4gf-8mx6-v5v3
GHSA-8h8q-6873-q5fj
GHSA-3g8h-86w9-wvmq
GHSA-ffhc-5mcf-pf4q
GHSA-vfv6-92ff-j949
GHSA-gx5p-jg67-6x7h
GHSA-h64f-5h5j-jqjh
GHSA-c4j6-fc7j-m34r
GHSA-wfc6-r584-vfw7
GHSA-36qx-fr4f-26g5
GHSA-m99w-x7hq-7vfj
GHSA-89xv-2m56-2m9x
GHSA-68g3-v927-f742
GHSA-4633-3j49-mh5q
GHSA-4c39-4ccg-62r3
GHSA-p9j2-gv94-2wf4
GHSA-955p-x3mx-jcvp
GHSA-qx2v-qp2m-jg93
GHSA-6g55-p6wh-862q
GHSA-fxqj-rqcc-2cmp
GHSA-r28c-9q8g-f849
secret-scan:
name: Secret scan
runs-on: ubuntu-latest
permissions:
contents: read
security-events: write
steps:
- name: Checkout full history
uses: actions/checkout@v6
with:
fetch-depth: 0
# Runs the gitleaks CLI directly instead of gitleaks/gitleaks-action
# because that action requires a (free) GITLEAKS_LICENSE secret for
# organization-owned repositories. The pinned release binary keeps this
# job self-contained; the SARIF report is uploaded to code scanning so
# findings surface alongside CodeQL alerts.
- name: Scan repository history for secrets
run: |
curl -sSfL https://github.com/gitleaks/gitleaks/releases/download/v8.30.1/gitleaks_8.30.1_linux_x64.tar.gz | tar -xz gitleaks
./gitleaks git --redact --no-banner --exit-code=1 \
--report-format sarif --report-path gitleaks.sarif
- name: Upload SARIF to code scanning
if: always()
uses: github/codeql-action/upload-sarif@v4
with:
sarif_file: gitleaks.sarif
- name: Upload SARIF artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: gitleaks-sarif
path: gitleaks.sarif
if-no-files-found: warn
retention-days: 7