34
34
required : false
35
35
default : true
36
36
push-dirty :
37
- description : Push scanned images that have vulnerabilities?
37
+ description : Push scanned images that have critical 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
@@ -180,7 +179,7 @@ jobs:
180
179
KAYOBE_VAULT_PASSWORD : ${{ secrets.KAYOBE_VAULT_PASSWORD }}
181
180
182
181
- name : Create build logs output directory
183
- run : mkdir image-build-logs
182
+ run : mkdir image-build-logs
184
183
185
184
- name : Build kolla overcloud images
186
185
id : build_overcloud_images
@@ -239,9 +238,16 @@ jobs:
239
238
run : cp image-build-logs/image-scan-output/clean-images.txt image-build-logs/push-attempt-images.txt
240
239
if : inputs.push
241
240
241
+ # NOTE(seunghun1ee): This always appends dirty images with CVEs severity lower than critical.
242
+ # This should be reverted when it's decided to filter high level CVEs as well.
242
243
- name : Append dirty images to push list
243
244
run : |
244
245
cat image-build-logs/image-scan-output/dirty-images.txt >> image-build-logs/push-attempt-images.txt
246
+ if : ${{ inputs.push }}
247
+
248
+ - name : Append images with critical vulnerabilities to push list
249
+ run : |
250
+ cat image-build-logs/image-scan-output/critical-images.txt >> image-build-logs/push-attempt-images.txt
245
251
if : ${{ inputs.push && inputs.push-dirty }}
246
252
247
253
- name : Push images
@@ -253,7 +259,7 @@ jobs:
253
259
254
260
while read -r image; do
255
261
# Retries!
256
- for i in {1..5}; do
262
+ for i in {1..5}; do
257
263
if docker push $image; then
258
264
echo "Pushed $image"
259
265
break
@@ -287,8 +293,15 @@ jobs:
287
293
run : if [ $(wc -l < image-build-logs/push-failed-images.txt) -gt 0 ]; then cat image-build-logs/push-failed-images.txt && exit 1; fi
288
294
if : ${{ !cancelled() }}
289
295
290
- - name : Fail when images failed scanning
291
- run : if [ $(wc -l < image-build-logs/dirty-images.txt) -gt 0 ]; then cat image-build-logs/dirty-images.txt && exit 1; fi
296
+ # NOTE(seunghun1ee): Currently we want to mark the job fail only when critical CVEs are detected.
297
+ # This can be used again instead of "Fail when critical vulnerabilities are found" when it's
298
+ # decided to fail the job on detecting high CVEs as well.
299
+ # - name: Fail when images failed scanning
300
+ # run: if [ $(wc -l < image-build-logs/image-scan-output/dirty-images.txt) -gt 0 ]; then cat image-build-logs/image-scan-output/dirty-images.txt && exit 1; fi
301
+ # if: ${{ !inputs.push-dirty && !cancelled() }}
302
+
303
+ - name : Fail when critical vulnerabilities are found
304
+ run : if [ $(wc -l < image-build-logs/image-scan-output/critical-images.txt) -gt 0 ]; then cat image-build-logs/image-scan-output/critical-images.txt && exit 1; fi
292
305
if : ${{ !inputs.push-dirty && !cancelled() }}
293
306
294
307
# NOTE(mgoddard): Trigger another CI workflow in the
0 commit comments