diff --git a/.github/workflows/trivy-scan.yml b/.github/workflows/trivy-scan.yml index 6bcc0959..4a85c40c 100644 --- a/.github/workflows/trivy-scan.yml +++ b/.github/workflows/trivy-scan.yml @@ -1,5 +1,6 @@ ################################################################################ -# Copyright (c) 2021-2022 Contributors to the Eclipse Foundation +# Copyright (c) 2021,2024 Contributors to the Eclipse Foundation +# Copyright (c) 2024 T-Systems International GmbH # See the NOTICE file(s) distributed with this work for additional # information regarding copyright ownership. @@ -25,7 +26,7 @@ on: - main schedule: # Once a day - - cron: "0 0 * * *" + - cron: "0 0 * * 0" workflow_dispatch: # Trigger manually @@ -41,16 +42,18 @@ jobs: steps: - name: Run Trivy vulnerability scanner - uses: aquasecurity/trivy-action@0.12.0 + uses: aquasecurity/trivy-action@0.18.0 with: - # Path to Docker image - image-ref: "tractusx/managed-simple-data-exchanger-frontend:latest" + image-ref: "tractusx/managed-simple-data-exchanger-backend:latest" # Pull image from Docker Hub and run Trivy vulnerability scanner format: "sarif" output: "trivy-results.sarif" - vuln-type: "os,library" + exit-code: "1" # Trivy exits with code 1 if vulnerabilities are found, causing the workflow step to fail. + 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). + hide-progress: false - 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.sarif"