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

Adjust trivy scan workflow #154

Merged
merged 1 commit into from
Jul 8, 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
22 changes: 14 additions & 8 deletions .github/workflows/trivy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Loading