-
Notifications
You must be signed in to change notification settings - Fork 1
34 lines (28 loc) · 986 Bytes
/
trivy-scan.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
name: Trivy Vulnerability Scan
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
trivy-scan:
name: Run Trivy Vulnerability Scan
runs-on: ubuntu-latest
steps:
- name: Check out the code
uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: '^1.17' # Specify the Go version to match your project requirements
- name: Install Trivy
run: |
sudo apt-get install wget apt-transport-https software-properties-common -y
wget -qO - https://aquasecurity.github.io/trivy-repo/deb/public.key | sudo apt-key add -
echo deb https://aquasecurity.github.io/trivy-repo/deb $(lsb_release -sc) main | sudo tee -a /etc/apt/sources.list.d/trivy.list
sudo apt-get update
sudo apt-get install trivy -y
- name: Run Trivy filesystem scan on go.mod
run: trivy fs --exit-code 1 --no-progress --severity HIGH,CRITICAL ./go.mod