Skip to content

Vulnerability Scanning with Trivy #43

Vulnerability Scanning with Trivy

Vulnerability Scanning with Trivy #43

Workflow file for this run

name: Vulnerability Scanning with Trivy
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *' # Test Trivy daily at midnight
permissions:
contents: read
security-events: write # for uploading SARIF results to the security tab
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
cancel-in-progress: true
defaults:
run:
shell: bash
jobs:
trivy-repo:
name: Trivy vulnerability scanner - Repository
runs-on: ubuntu-22.04
strategy:
matrix:
version:
- v3
- v2
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ matrix.version }}
- name: Run Trivy vulnerability scanner in repo mode
uses: aquasecurity/trivy-action@master
with:
scan-type: "fs"
format: "sarif"
output: "trivy-microcluster-repo-scan-results.sarif"
severity: "LOW,MEDIUM,HIGH,CRITICAL"
- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: "trivy-microcluster-repo-scan-results.sarif"
sha: ${{ github.sha }}
ref: refs/heads/${{ matrix.version }}