-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (42 loc) · 1.49 KB
/
security.yml
File metadata and controls
52 lines (42 loc) · 1.49 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
name: Security scan
on:
push:
branches: ["main"]
schedule:
# Every Monday at 08:00 UTC – catches newly disclosed CVEs between pushes
- cron: "0 8 * * 1"
jobs:
# ── npm audit ──────────────────────────────────────────────────────────────
npm-audit:
name: npm audit
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "18"
cache: "npm"
cache-dependency-path: package-lock.json
- name: Install production deps
run: npm ci --omit=dev
- name: Audit (fail on high/critical)
run: npm audit --audit-level=high
# ── Docker image scan (Trivy) ─────────────────────────────────────────────
trivy:
name: Trivy image scan
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build image for scanning
run: docker build -t spectracleanse-api:scan .
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
image-ref: spectracleanse-api:scan
format: table
exit-code: "1"
ignore-unfixed: true
severity: "HIGH,CRITICAL"