-
Notifications
You must be signed in to change notification settings - Fork 25
34 lines (31 loc) · 938 Bytes
/
trivy.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
on:
push:
branches:
- master
pull_request:
jobs:
build:
name: Scan
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Get Cargo.lock
# According to this https://aquasecurity.github.io/trivy/v0.44/docs/scanner/vulnerability/language/rust/
# Cargo.lock needs to be next to Cargo.toml (works for packages not for
# workspaces).
run: |
cargo update
cp ./Cargo.lock ./casr
- name: Run Trivy vulnerability scanner in repo mode
uses: aquasecurity/trivy-action@master
with:
scan-type: 'fs'
format: 'sarif'
output: 'trivy-results.sarif'
severity: 'CRITICAL,HIGH'
- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: 'trivy-results.sarif'