Skip to content

Trivy Nightly Scan

Trivy Nightly Scan #66

Workflow file for this run

name: Trivy Nightly Scan
on:
schedule:
- cron: '0 2 * * 5' # Run at 2AM UTC on every Friday
permissions: read-all
jobs:
nightly-scan:
name: Trivy Scan nightly
strategy:
fail-fast: false
matrix:
# It will test for only the latest version as older version is not maintained
versions: [latest]
permissions:
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@6e7b7d1fd3e4fef0c5fa8cce1229c54b2c9bd0d8 # master
with:
image-ref: 'docker.io/coredns/coredns:${{ matrix.versions }}'
severity: 'CRITICAL,HIGH'
format: 'sarif'
output: 'trivy-results.sarif'
- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@2c779ab0d087cd7fe7b826087247c2c81f27bfa6 # v3.26.5
with:
sarif_file: 'trivy-results.sarif'