Skip to content

scheduled trivy scan #59

scheduled trivy scan

scheduled trivy scan #59

Workflow file for this run

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: scheduled trivy scan
on:
schedule:
- cron: "16 17 * * 2"
permissions:
contents: read
jobs:
scan-image:
permissions:
contents: read # for actions/checkout to fetch code
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
name: scan
runs-on: "ubuntu-22.04"
steps:
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@f78e9ecf42a1271402d4f484518b9313235990e1 # 0.13.1
with:
image-ref: ghcr.io/${{ github.repository }}:latest
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@74483a38d39275f33fcff5f35b679b5ca4a26a99 # v2
with:
sarif_file: "trivy-results.sarif"