From c554a0366e0c777125d8a6daddccb0a9f8a0918a Mon Sep 17 00:00:00 2001 From: Nico Wellpott Date: Tue, 24 Oct 2023 09:23:47 +0200 Subject: [PATCH] ci: add trivy workflow to ensure critical and high vulnerabilties are detected quickly --- .github/workflows/trivy.yml | 43 +++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/trivy.yml diff --git a/.github/workflows/trivy.yml b/.github/workflows/trivy.yml new file mode 100644 index 00000000..7834a24a --- /dev/null +++ b/.github/workflows/trivy.yml @@ -0,0 +1,43 @@ +name: trivy + +on: + push: + branches: + - main + - release-build-revision + tags: + - '*' + pull_request: + branches: [ "main" ] + schedule: + - cron: '00 12 * * *' + +permissions: + contents: read + +jobs: + trivy-scan: + name: Check + runs-on: ubuntu-22.04 + timeout-minutes: 30 + permissions: + contents: read + security-events: write + actions: read + steps: + - name: Checkout code + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1 + + - name: Run Trivy vulnerability scanner + uses: aquasecurity/trivy-action@fbd16365eb88e12433951383f5e99bd901fc618f # v0.12.0 + with: + scan-type: repo + ignore-unfixed: true + format: sarif + output: trivy-results.sarif + severity: CRITICAL,HIGH + + - name: Upload Trivy scan results to GitHub Security tab + uses: github/codeql-action/upload-sarif@bad341350a2f5616f9e048e51360cedc49181ce8 # v2.22.4 + with: + sarif_file: 'trivy-results.sarif'