-
Notifications
You must be signed in to change notification settings - Fork 130
30 lines (28 loc) · 941 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
name: Trivy Security Scan
on:
schedule:
- cron: '0 1 * * 1'
workflow_dispatch:
inputs: {}
jobs:
security-scan:
permissions:
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
name: Security Scan
runs-on: ubuntu-20.04
steps:
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@7b7aa264d83dc58691451798b4d117d53d21edfe
with:
# just scan the latest released image
image-ref: 'ghcr.io/groundnuty/k8s-wait-for:latest'
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'
- name: Fail if scan found vulnerabilities
run: |
grep -q '"rules": \[],' trivy-results.sarif