diff --git a/.github/workflows/trivy.yml b/.github/workflows/trivy.yml index 9c93151..f744c60 100644 --- a/.github/workflows/trivy.yml +++ b/.github/workflows/trivy.yml @@ -44,17 +44,20 @@ jobs: uses: actions/checkout@v3 - name: Run Trivy vulnerability scanner in repo mode - uses: aquasecurity/trivy-action@0.14.0 + uses: aquasecurity/trivy-action@0.18.0 with: scan-type: "config" - # ignore-unfixed: true - hide-progress: false format: "sarif" output: "trivy-results1.sarif" + severity: "CRITICAL,HIGH" # While vulnerabilities of all severities are reported in the SARIF output, the exit code and workflow failure are triggered only by these specified severities (CRITICAL or HIGH). + # ignore-unfixed: true + hide-progress: false vuln-type: "os,library" + exit-code: "1" # Trivy exits with code 1 if vulnerabilities are found, causing the workflow step to fail. + limit-severities-for-sarif: true - name: Upload Trivy scan results to GitHub Security tab - uses: github/codeql-action/upload-sarif@v2 + uses: github/codeql-action/upload-sarif@v3 if: always() with: sarif_file: "trivy-results1.sarif" @@ -79,17 +82,20 @@ jobs: run: mvn clean package - name: Run Trivy vulnerability scanner - uses: aquasecurity/trivy-action@0.14.0 + uses: aquasecurity/trivy-action@0.18.0 with: image-ref: "tractusx/sldt-bpn-discovery:latest" - # ignore-unfixed: true - hide-progress: false format: "sarif" output: "trivy-results-bpn-discovery.sarif" + severity: "CRITICAL,HIGH" # While vulnerabilities of all severities are reported in the SARIF output, the exit code and workflow failure are triggered only by these specified severities (CRITICAL or HIGH). + # ignore-unfixed: true + hide-progress: false + exit-code: "1" # Trivy exits with code 1 if vulnerabilities are found, causing the workflow step to fail. vuln-type: "os,library" + limit-severities-for-sarif: true - name: Upload Trivy scan results to GitHub Security tab - uses: github/codeql-action/upload-sarif@v2 + uses: github/codeql-action/upload-sarif@v3 if: always() with: sarif_file: "trivy-results-bpn-discovery.sarif"