Trivy Nightly Scan #19
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: 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@v4 | |
- name: Run Trivy vulnerability scanner | |
uses: aquasecurity/trivy-action@d710430a6722f083d3b36b8339ff66b32f22ee55 # 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@1c270d01c75cd8a40d572ee225b0e4736a839e28 # v2.13.4 | |
with: | |
sarif_file: 'trivy-results.sarif' |