-
Notifications
You must be signed in to change notification settings - Fork 216
44 lines (41 loc) · 1.21 KB
/
trivy.yaml
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
name: trivy
on:
schedule:
- cron: "40 11 * * 0"
workflow_dispatch:
workflow_run:
workflows:
- Release Retina Container Images
types:
- completed
permissions:
contents: read
jobs:
scan:
permissions:
contents: read
security-events: write
name: Trivy Scan
strategy:
fail-fast: false
matrix:
image: ["retina-agent", "retina-init", "retina-operator", "kubectl-retina", "retina-shell"]
runs-on: ubuntu-latest # trivy only supports running on Linux
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Get Tag
run: |
echo "TAG=$(make version)" >> $GITHUB_ENV
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@18f2510ee396bbf400402947b394f2dd8c87dbb0
with:
image-ref: "ghcr.io/${{ github.repository }}/${{ matrix.image }}:${{ env.TAG }}"
format: "template"
template: "@/contrib/sarif.tpl"
output: "trivy-results.sarif"
severity: "CRITICAL,HIGH"
- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: "trivy-results.sarif"