Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Updated Trivy workflow #97

Merged
merged 2 commits into from
Apr 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions .github/workflows/trivy-scan.yml
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -25,7 +26,7 @@ on:
- main
schedule:
# Once a day
- cron: "0 0 * * *"
- cron: "0 0 * * 0"

workflow_dispatch:
# Trigger manually
Expand All @@ -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"

Expand Down
Loading