From 03b17acdce2a60d9d308116ebb7e5bfa4b6b1051 Mon Sep 17 00:00:00 2001 From: JoshuaLicense Date: Thu, 11 Jul 2024 13:42:41 +0100 Subject: [PATCH] ci: upload security scanning to GHCS --- .github/workflows/docker.yaml | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index e3c7a9d..17d0053 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -168,13 +168,18 @@ jobs: cache-from: type=gha - name: Scan + id: scan uses: aquasecurity/trivy-action@0.23.0 with: image-ref: ${{ steps.build-and-push.outputs.imageid }} - # format: 'sarif' - # output: 'trivy-results.sarif' - - # - name: Upload Trivy scan results to GitHub Code Scanning - # uses: github/codeql-action/upload-sarif@v3 - # with: - # sarif_file: 'trivy-results.sarif' + format: 'sarif' + exit-code: '1' + ignore-unfixed: true + vuln-type: 'os,library' + severity: 'CRITICAL,HIGH' + + - name: Upload Trivy scan results to GitHub Code Scanning + if: ${{ always() && !cancelled() && steps.scan.outcome == 'success' || steps.scan.outcome == 'failure' }} + uses: github/codeql-action/upload-sarif@v3 + with: + sarif_file: 'trivy-results.sarif'