Skip to content

Docker: Scan latest release image #820

Docker: Scan latest release image

Docker: Scan latest release image #820

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@v4
with:
fetch-depth: 0
-
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@v3
with:
sarif_file: 'trivy-results.sarif'