-
Notifications
You must be signed in to change notification settings - Fork 6
48 lines (42 loc) · 1.32 KB
/
security.yml
File metadata and controls
48 lines (42 loc) · 1.32 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
name: Security Scan
on:
pull_request:
branches: [ main ]
schedule:
- cron: '0 0 * * 0' # Run weekly on Sundays at midnight
jobs:
trivy-scan:
name: Trivy Security Scan
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Run Trivy vulnerability scanner in repo mode
uses: aquasecurity/trivy-action@0.33.1
with:
scan-type: 'fs'
ignore-unfixed: true
format: 'sarif'
output: 'trivy-results.sarif'
severity: 'CRITICAL,HIGH'
- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v4
if: always()
with:
sarif_file: 'trivy-results.sarif'
category: 'trivy-fs'
- name: Run Trivy vulnerability scanner in IaC mode
uses: aquasecurity/trivy-action@0.33.1
with:
scan-type: 'config'
hide-progress: false
format: 'sarif'
output: 'trivy-config-results.sarif'
exit-code: '1'
severity: 'CRITICAL,HIGH'
- name: Upload Trivy IaC scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v4
if: always()
with:
sarif_file: 'trivy-config-results.sarif'
category: 'trivy-config'