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