Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
0553a1a1
Unverified
Commit
0553a1a1
authored
Oct 01, 2024
by
Guilherme Macedo
Committed by
GitHub
Oct 01, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pass Rancher's VEX report to Trivy to remove known false-positives CVEs (#10956)
Signed-off-by:
Guilherme Macedo
<
guilherme@gmacedo.com
>
parent
6c6d87d1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
3 deletions
+12
-3
trivy.yaml
.github/workflows/trivy.yaml
+7
-2
image_scan.sh
scripts/image_scan.sh
+5
-1
No files found.
.github/workflows/trivy.yaml
View file @
0553a1a1
...
...
@@ -40,6 +40,9 @@ jobs:
make package-image
make tag-image-latest
-
name
:
Download Rancher's VEX Hub report
run
:
curl -fsSO https://raw.githubusercontent.com/rancher/vexhub/refs/heads/main/reports/rancher.openvex.json
-
name
:
Run Trivy vulnerability scanner
uses
:
aquasecurity/trivy-action@0.24.0
with
:
...
...
@@ -47,6 +50,9 @@ jobs:
format
:
'
table'
severity
:
"
HIGH,CRITICAL"
output
:
"
trivy-report.txt"
env
:
TRIVY_VEX
:
rancher.openvex.json
TRIVY_SHOW_SUPPRESSED
:
true
-
name
:
Upload Trivy Report
uses
:
actions/upload-artifact@v4
...
...
@@ -93,4 +99,4 @@ jobs:
steps
:
-
name
:
Report Failure
run
:
|
gh issue comment ${{ github.event.issue.number }} -b ":x: Trivy scan action failed, check logs :x:"
\ No newline at end of file
gh issue comment ${{ github.event.issue.number }} -b ":x: Trivy scan action failed, check logs :x:"
scripts/image_scan.sh
View file @
0553a1a1
...
...
@@ -31,7 +31,11 @@ TRIVY_TEMPLATE='{{- $critical := 0 }}{{- $high := 0 }}
{{- end -}}
{{ end }}
Vulnerabilities - Critical: {{ $critical }}, High: {{ $high }}{{ println }}'
VEX_REPORT
=
"rancher.openvex.json"
trivy
--quiet
image
--severity
${
SEVERITIES
}
--no-progress
--ignore-unfixed
--format
template
--template
"
${
TRIVY_TEMPLATE
}
"
${
IMAGE
}
# Download Rancher's VEX Hub standalone report
curl
-fsS
-o
${
VEX_REPORT
}
https://raw.githubusercontent.com/rancher/vexhub/refs/heads/main/reports/rancher.openvex.json
trivy
--quiet
image
--severity
${
SEVERITIES
}
--vex
${
VEX_REPORT
}
--no-progress
--ignore-unfixed
--format
template
--template
"
${
TRIVY_TEMPLATE
}
"
${
IMAGE
}
exit
0
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment