Skip to content

Commit 09463a0

Browse files
author
dev-ecd-dm
committed
ci: add GitHub security validation
1 parent 93b1f83 commit 09463a0

5 files changed

Lines changed: 168 additions & 0 deletions

File tree

.github/dependabot.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
version: 2
2+
3+
updates:
4+
- package-ecosystem: npm
5+
directory: /csreview
6+
schedule:
7+
interval: weekly
8+
day: monday
9+
time: "06:00"
10+
timezone: America/Sao_Paulo
11+
groups:
12+
npm-runtime:
13+
patterns:
14+
- "*"
15+
16+
- package-ecosystem: github-actions
17+
directory: /
18+
schedule:
19+
interval: weekly
20+
day: monday
21+
time: "06:30"
22+
timezone: America/Sao_Paulo

.github/workflows/ci.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
test:
14+
name: Node ${{ matrix.node-version }}
15+
runs-on: ubuntu-latest
16+
timeout-minutes: 15
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
node-version:
21+
- 20
22+
- 24
23+
24+
defaults:
25+
run:
26+
working-directory: csreview
27+
28+
steps:
29+
- name: Checkout
30+
uses: actions/checkout@v5
31+
32+
- name: Setup Node.js
33+
uses: actions/setup-node@v5
34+
with:
35+
node-version: ${{ matrix.node-version }}
36+
cache: npm
37+
cache-dependency-path: csreview/package-lock.json
38+
39+
- name: Install dependencies
40+
run: npm ci
41+
42+
- name: Run tests
43+
run: npm test
44+
45+
- name: Audit dependencies
46+
run: npm audit --audit-level=low
47+
48+
- name: Verify package contents
49+
run: npm pack --dry-run

.github/workflows/codeql.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: CodeQL
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
schedule:
9+
- cron: "31 3 * * 1"
10+
11+
permissions:
12+
actions: read
13+
contents: read
14+
security-events: write
15+
16+
jobs:
17+
analyze:
18+
name: Analyze JavaScript/TypeScript
19+
runs-on: ubuntu-latest
20+
timeout-minutes: 20
21+
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v5
25+
26+
- name: Initialize CodeQL
27+
uses: github/codeql-action/init@v4
28+
with:
29+
languages: javascript-typescript
30+
queries: security-extended,security-and-quality
31+
32+
- name: Perform CodeQL analysis
33+
uses: github/codeql-action/analyze@v4
34+
with:
35+
category: /language:javascript-typescript

.github/workflows/semgrep.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Semgrep
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
schedule:
9+
- cron: "47 3 * * 1"
10+
11+
permissions:
12+
contents: read
13+
security-events: write
14+
15+
jobs:
16+
semgrep:
17+
name: Semgrep SARIF
18+
runs-on: ubuntu-latest
19+
timeout-minutes: 20
20+
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v5
24+
25+
- name: Install Semgrep
26+
run: python -m pip install --upgrade semgrep
27+
28+
- name: Run Semgrep
29+
continue-on-error: true
30+
run: |
31+
semgrep scan \
32+
--config auto \
33+
--sarif \
34+
--output semgrep.sarif \
35+
--exclude node_modules \
36+
--exclude csreview-reports \
37+
.
38+
39+
- name: Upload Semgrep SARIF
40+
uses: github/codeql-action/upload-sarif@v4
41+
if: always() && hashFiles('semgrep.sarif') != ''
42+
with:
43+
sarif_file: semgrep.sarif

SECURITY.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Security Policy
2+
3+
## Supported Scope
4+
5+
CSReview is a development-time, white-hat security alignment tool for local workspaces. Reports should concern the CSReview package, its documentation, generated reports, or its static analysis behavior.
6+
7+
Do not test, probe, or call live systems, production services, external application endpoints, or user data while reporting an issue here.
8+
9+
## Reporting a Vulnerability
10+
11+
Open a private GitHub security advisory when available, or contact the repository maintainers with:
12+
13+
- affected version or commit
14+
- local reproduction steps
15+
- expected versus actual behavior
16+
- relevant static evidence
17+
- suggested remediation, if known
18+
19+
Avoid including real secrets, tokens, private customer data, or exploit output. Redact sensitive values before sharing evidence.

0 commit comments

Comments
 (0)