From 8ff60f562d8cdf43775bf5e59a7170aa9785587f Mon Sep 17 00:00:00 2001 From: Thomas Ferrandiz Date: Mon, 9 Dec 2024 13:23:29 +0000 Subject: [PATCH] Add trivy vulnerability scanner build step --- .github/workflows/image-build.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/image-build.yml b/.github/workflows/image-build.yml index a83377faf..ac1d9afb4 100644 --- a/.github/workflows/image-build.yml +++ b/.github/workflows/image-build.yml @@ -18,6 +18,22 @@ jobs: push: false tags: ghcr.io/${{ github.repository }}:latest-amd64 file: Dockerfile + + - name: Run Trivy vulnerability scanner + uses: aquasecurity/trivy-action@0.28.0 + with: + image-ref: ghcr.io/${{ github.repository }}:latest-amd64 + ignore-unfixed: true + vuln-type: 'os,library' + severity: 'CRITICAL,HIGH' + format: 'sarif' + output: 'trivy-results.sarif' + + - name: Upload Trivy scan results to GitHub Security tab + uses: github/codeql-action/upload-sarif@v3 + if: always() + with: + sarif_file: 'trivy-results.sarif' build-openshift: name: Image build/openshift