Docker: Scan latest release image #781
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |