-
Notifications
You must be signed in to change notification settings - Fork 255
87 lines (74 loc) · 2.07 KB
/
trivy-analysis.yml
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
name: Trivy Scanner
on:
pull_request:
push:
branches:
- develop
schedule:
- cron: "0 21 * * 0"
jobs:
dotnet:
name: .NET Analysis
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: "8.0.x"
- name: dotnet backend
run: dotnet build CSETWebApi/CSETWeb_Api/CSETWeb_Api.sln
- name: Run vulnerability scanner
uses: aquasecurity/[email protected]
with:
format: sarif
output: trivy-dotnet-results.sarif
scan-type: fs
scan-ref: ./CSETWebApi
scanners: vuln
severity: CRITICAL,HIGH
- name: Upload SARIF artifact
id: upload
uses: actions/upload-artifact@v4
with:
name: trivy-dotnet-results
path: trivy-dotnet-results.sarif
nodejs:
name: Node.js Analysis
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Run vulnerability scanner
uses: aquasecurity/[email protected]
with:
format: sarif
output: trivy-nodejs-results.sarif
scan-type: fs
scan-ref: ./CSETWebNg
severity: CRITICAL,HIGH
- name: Upload SARIF artifact
id: upload
uses: actions/upload-artifact@v4
with:
name: trivy-nodejs-results
path: trivy-nodejs-results.sarif
results:
name: Upload scan results
runs-on: ubuntu-latest
needs: [dotnet, nodejs]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download All Artifacts
uses: actions/download-artifact@v4
with:
path: .
merge-multiple: true
- name: Merge results
run: |
jq -s 'reduce .[] as $item ({}; . * $item)' trivy-*.sarif > trivy-results.sarif
- name: Upload scan results to Security tab
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: "trivy-results.sarif"