-
Notifications
You must be signed in to change notification settings - Fork 0
109 lines (93 loc) · 2.69 KB
/
Copy pathsecurity.yaml
File metadata and controls
109 lines (93 loc) · 2.69 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
name: Security Scan
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
schedule:
- cron: "27 3 * * 1"
permissions:
contents: read
security-events: write
jobs:
security:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Python
if: always()
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install Python security tools
if: always()
continue-on-error: true
run: |
pip install bandit pip-audit safety || true
- name: Bandit scan
if: always()
continue-on-error: true
run: |
bandit -c .github/workflows/security/bandit.yml -r . --severity-level high --confidence-level high -f json -o bandit-report.json || true
- name: pip-audit dependencies
if: always()
continue-on-error: true
run: |
if [ -f requirements.txt ]; then
pip-audit -r requirements.txt -f json -o pip-audit-report.json || true
fi
- name: Setup Node
if: always()
uses: actions/setup-node@v4
with:
node-version: "20"
- name: Install JS dependencies
if: always()
continue-on-error: true
run: |
if [ -f package.json ]; then
npm install || true
fi
- name: NPM audit
if: always()
continue-on-error: true
run: |
if [ -f package.json ]; then
npm audit --audit-level=critical || true
fi
- name: ESLint security scan
if: always()
continue-on-error: true
run: |
if [ -f package.json ]; then
npm install eslint eslint-plugin-security || true
npx eslint . -c .github/workflows/security/eslint-security.json || true
fi
- name: Gitleaks scan
if: always()
continue-on-error: true
uses: gitleaks/gitleaks-action@v2
- name: Trivy filesystem scan
if: always()
continue-on-error: true
uses: aquasecurity/trivy-action@v0.36.0
with:
scan-type: fs
scan-ref: .
config: .github/workflows/security/trivy.yaml
- name: Upload Bandit report
if: always()
uses: actions/upload-artifact@v4
with:
name: bandit-report
path: bandit-report.json
if-no-files-found: ignore
- name: Upload pip-audit report
if: always()
uses: actions/upload-artifact@v4
with:
name: pip-audit-report
path: pip-audit-report.json
if-no-files-found: ignore