File tree Expand file tree Collapse file tree 3 files changed +38
-3
lines changed Expand file tree Collapse file tree 3 files changed +38
-3
lines changed Original file line number Diff line number Diff line change 37
37
description : Push scanned images that have vulnerabilities?
38
38
type : boolean
39
39
required : false
40
- # NOTE(Alex-Welsh): This default should be flipped once we resolve existing failures
41
- default : true
40
+ default : false
42
41
43
42
env :
44
43
ANSIBLE_FORCE_COLOR : True
@@ -136,6 +135,10 @@ jobs:
136
135
run : |
137
136
curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sudo sh -s -- -b /usr/local/bin v0.49.0
138
137
138
+ - name : Install yq
139
+ run : |
140
+ curl -sL https://github.com/mikefarah/yq/releases/download/v4.42.1/yq_linux_amd64.tar.gz | tar xz && sudo mv yq_linux_amd64 /usr/bin/yq
141
+
139
142
- name : Install Kayobe
140
143
run : |
141
144
mkdir -p venvs &&
Original file line number Diff line number Diff line change
1
+ ---
2
+ # ##############################################################################
3
+ # Trivy allowed vulnerabilities list
4
+
5
+ # Example allowed vulnerabilities file setup
6
+ #
7
+ # keystone_allowed_vulnerabilities:
8
+ # - CVE-2022-2447
9
+ #
10
+ # barbican-api_allowed_vulnerabilities:
11
+ # - CVE-2023-31047
12
+
13
+ global_allowed_vulnerabilities :
14
+ - CVE-2024-36039
15
+
16
+ # ##############################################################################
17
+ # Dummy variable to allow Ansible to accept this file.
18
+ workaround_ansible_issue_8743 : yes
Original file line number Diff line number Diff line change @@ -34,12 +34,25 @@ touch image-scan-output/clean-images.txt image-scan-output/dirty-images.txt
34
34
# generate a csv summary
35
35
for image in $images ; do
36
36
filename=$( basename $image | sed ' s/:/\./g' )
37
+ imagename=$( echo $filename | cut -d " ." -f 1)
38
+ global_vulnerabilities=$( yq .global_allowed_vulnerabilities[] src/kayobe-config/etc/kayobe/trivy/allowed-vulnerabilities.yml)
39
+ image_vulnerabilities=$( yq .$imagename ' _allowed_vulnerabilities[]' src/kayobe-config/etc/kayobe/trivy/allowed-vulnerabilities.yml)
40
+ rc=$?
41
+ touch .trivyignore
42
+ for vulnerability in $global_vulnerabilities ; do
43
+ echo $vulnerability >> .trivyignore
44
+ done
45
+ for vulnerability in $image_vulnerabilities ; do
46
+ if [ $rc -eq 0 ]; then
47
+ echo $vulnerability >> .trivyignore
48
+ fi
49
+ done
37
50
if $( trivy image \
38
51
--quiet \
39
52
--exit-code 1 \
40
53
--scanners vuln \
41
54
--format json \
42
- --severity HIGH, CRITICAL \
55
+ --severity CRITICAL \
43
56
--output image-scan-output/${filename} .json \
44
57
--ignore-unfixed \
45
58
$image ) ; then
@@ -76,4 +89,5 @@ for image in $images; do
76
89
| .[]
77
90
| @csv' image-scan-output/${filename} .json >> image-scan-output/${filename} .summary.csv
78
91
fi
92
+ rm .trivyignore
79
93
done
You can’t perform that action at this time.
0 commit comments