-
Notifications
You must be signed in to change notification settings - Fork 8
98 lines (79 loc) · 2.48 KB
/
security.yml
File metadata and controls
98 lines (79 loc) · 2.48 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
name: Security Scanning
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
paths-ignore:
- 'CHANGELOG.md'
- 'docs/**'
- '*.md'
schedule:
- cron: '0 0 * * 1' # Weekly on Monday
permissions:
contents: read
security-events: write
actions: read
jobs:
docker-scan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build Docker image
run: docker build -t claude-telemetry:scan .
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
image-ref: 'claude-telemetry:scan'
format: 'table'
exit-code: '1'
severity: 'CRITICAL,HIGH'
dependency-scan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 18
- name: Install dependencies
run: npm ci
- name: Run npm audit
run: |
npm audit --json > npm-audit-report.json || true
npm audit
- name: Upload audit results
uses: actions/upload-artifact@v4
if: always()
with:
name: npm-audit-report
path: npm-audit-report.json
secrets-scan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Run git secrets scan
run: |
# Simple regex-based secrets detection
echo "Scanning for potential secrets..."
# Check for common secret patterns
if git grep -E '(api[_-]?key|api[_-]?secret|auth[_-]?token|private[_-]?key|secret[_-]?key)\s*[:=]\s*["'"'"']?[A-Za-z0-9+/]{20,}' -- ':(exclude)*.md' ':(exclude)test/*' ':(exclude)*.json'; then
echo "::error::Potential secrets found in codebase"
exit 1
fi
echo "No secrets detected"
license-scan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 18
- name: Install dependencies
run: npm ci
- name: Check licenses
run: |
npx license-checker --summary --excludePrivatePackages --onlyAllow "MIT;Apache-2.0;BSD-2-Clause;BSD-3-Clause;ISC;CC0-1.0;Unlicense;Python-2.0;CC-BY-4.0;BlueOak-1.0.0"