-
Notifications
You must be signed in to change notification settings - Fork 1
72 lines (58 loc) · 1.76 KB
/
Copy pathsecurity.yml
File metadata and controls
72 lines (58 loc) · 1.76 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
name: Security Scan
on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
schedule:
- cron: '0 6 * * 1' # Weekly on Monday
jobs:
security:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
# Backend dependencies scan
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install backend dependencies
working-directory: ./rag-api
run: npm ci
- name: Run npm audit (backend)
working-directory: ./rag-api
run: npm audit --audit-level=moderate
continue-on-error: true
# Frontend dependencies scan
- name: Install frontend dependencies
working-directory: ./rag-ui
run: npm ci
- name: Run npm audit (frontend)
working-directory: ./rag-ui
run: npm audit --audit-level=moderate
continue-on-error: true
# CodeQL Analysis
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: javascript, typescript
- name: Autobuild
uses: github/codeql-action/autobuild@v2
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
# Docker image scan
- name: Build backend image
working-directory: ./rag-api
run: docker build -t pkm-backend:test .
- name: Scan backend image
uses: aquasecurity/trivy-action@master
with:
image-ref: pkm-backend:test
format: 'sarif'
output: 'trivy-results.sarif'
- name: Upload scan results
uses: github/codeql-action/upload-sarif@v2
if: always()
with:
sarif_file: 'trivy-results.sarif'