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