-
Notifications
You must be signed in to change notification settings - Fork 22
38 lines (36 loc) · 1.17 KB
/
container-scan-release.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
name: 'Docker: Scan latest release image'
on:
schedule:
# Scan the image regularly (once a day).
- cron: '44 4 * * *'
jobs:
build:
permissions:
contents: read # For actions/checkout to fetch code.
security-events: write # For github/codeql-action/upload-sarif to upload SARIF results.
name: Scan current image & report results
runs-on: "ubuntu-latest"
steps:
# -
# name: Check out repository code
# uses: actions/checkout@v3
# with:
# fetch-depth: 0
# -
# name: Extract tag of latest release
# run: |
# echo "TAG_VERSION=$(git describe --tags `git rev-list --tags --max-count=1`)" >> $GITHUB_ENV
-
name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
image-ref: 'ghcr.io/${{ github.repository }}:latest'
format: 'sarif'
output: 'trivy-results.sarif'
severity: 'CRITICAL,HIGH,MEDIUM'
vuln-type: "os"
-
name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: 'trivy-results.sarif'