From 97dbc9750ab833769603436bd403075566fbe5cf Mon Sep 17 00:00:00 2001 From: Sunjay Bhatia Date: Mon, 25 Mar 2024 11:57:04 -0400 Subject: [PATCH] Add trivy scan workflow Runs on main and release-1.10.0 branches Will scan for vulnerabilities and checked in secrets Signed-off-by: Sunjay Bhatia --- .github/workflows/trivy-scan.yml | 38 ++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/trivy-scan.yml diff --git a/.github/workflows/trivy-scan.yml b/.github/workflows/trivy-scan.yml new file mode 100644 index 00000000..5c45843e --- /dev/null +++ b/.github/workflows/trivy-scan.yml @@ -0,0 +1,38 @@ +name: Trivy Scan + +on: + # Run weekly + schedule: + - cron: '0 12 * * 1' + # Allow manual runs + workflow_dispatch: + +permissions: + contents: read + +jobs: + trivy-scan: + strategy: + matrix: + branch: + - main + - release-1.10.0 + runs-on: ubuntu-latest + permissions: + security-events: write + steps: + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + with: + persist-credentials: false + ref: ${{ matrix.branch }} + - uses: aquasecurity/trivy-action@062f2592684a31eb3aa050cc61e7ca1451cecd3d # 0.18.0 + with: + scanners: 'vuln,secret' + scan-type: 'fs' + format: 'sarif' + output: 'trivy-results.sarif' + ignore-unfixed: true + severity: 'HIGH,CRITICAL' + - uses: github/codeql-action/upload-sarif@1b1aada464948af03b950897e5eb522f92603cc2 # v3.24.9 + with: + sarif_file: 'trivy-results.sarif'