File tree Expand file tree Collapse file tree 3 files changed +36
-3
lines changed Expand file tree Collapse file tree 3 files changed +36
-3
lines changed Original file line number Diff line number Diff line change @@ -145,6 +145,10 @@ jobs:
145
145
run : |
146
146
curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sudo sh -s -- -b /usr/local/bin v0.49.0
147
147
148
+ - name : Install yq
149
+ run : |
150
+ 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
151
+
148
152
- name : Install Kayobe
149
153
run : |
150
154
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
+ horizon_allowed_vulnerabilities :
14
+ - CVE-2022-28346
15
+ - CVE-2022-28347
16
+ - CVE-2022-34265
17
+ - CVE-2023-31047
18
+
19
+ # ##############################################################################
20
+ # Dummy variable to allow Ansible to accept this file.
21
+ workaround_ansible_issue_8743 : yes
Original file line number Diff line number Diff line change @@ -34,14 +34,22 @@ 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
+ vulnerabilities=$( yq .$imagename ' _allowed_vulnerabilities[]' src/kayobe-config/etc/kayobe/trivy/allowed-vulnerabilities.yml)
39
+ rc=$?
40
+ rm .trivyignore && touch .trivyignore
41
+ for vulnerability in $vulnerabilities ; do
42
+ if [ $rc -eq 0 ]; then
43
+ echo $vulnerability >> .trivyignore;
44
+ fi
45
+ done
37
46
if $( trivy image \
38
- --quiet \
47
+ --debug \
39
48
--exit-code 1 \
40
49
--scanners vuln \
41
50
--format json \
42
- --severity HIGH, CRITICAL \
51
+ --severity CRITICAL \
43
52
--output image-scan-output/${filename} .json \
44
- --ignore-unfixed \
45
53
$image ) ; then
46
54
# Clean up the output file for any images with no vulnerabilities
47
55
rm -f image-scan-output/${filename} .json
You can’t perform that action at this time.
0 commit comments