3333 type : boolean
3434 required : false
3535 default : true
36- push-dirty :
36+ sbom :
37+ description : Generate SBOM?
38+ type : boolean
39+ required : false
40+ default : true
41+ push-critical :
3742 description : Push scanned images that have critical vulnerabilities?
3843 type : boolean
3944 required : false
@@ -244,14 +249,14 @@ jobs:
244249 run : if [ $(wc -l < ${{ matrix.distro.name }}-${{ matrix.distro.release }}-container-images) -le 1 ]; then exit 1; fi
245250
246251 - name : Scan built container images
247- run : src/kayobe-config/tools/scan-images.sh ${{ matrix.distro.name }}-${{ matrix.distro.release }} ${{ steps.write-kolla-tag.outputs.kolla-tag }}
252+ run : src/kayobe-config/tools/scan-images.sh ${{ matrix.distro.name }}-${{ matrix.distro.release }} ${{ steps.write-kolla-tag.outputs.kolla-tag }} ${{ inputs.sbom && '--sbom'}}
248253
249254 - name : Move image scan logs to output artifact
250255 run : mv image-scan-output image-build-logs/image-scan-output
251256
252- - name : Fail if no images have passed scanning
257+ - name : Fail if any images have critical vulnerabilities
253258 run : if [ $(wc -l < image-build-logs/image-scan-output/critical-images.txt) -gt 0 ]; then exit 1; fi
254- if : ${{ !inputs.push-dirty }}
259+ if : ${{ !inputs.push-critical }}
255260
256261 - name : Copy clean images to push-attempt-images list
257262 run : cp image-build-logs/image-scan-output/clean-images.txt image-build-logs/push-attempt-images.txt
@@ -261,13 +266,13 @@ jobs:
261266 # This should be reverted when it's decided to filter high level CVEs as well.
262267 - name : Append dirty images to push list
263268 run : |
264- cat image-build-logs/image-scan-output/dirty -images.txt >> image-build-logs/push-attempt-images.txt
269+ cat image-build-logs/image-scan-output/high -images.txt >> image-build-logs/push-attempt-images.txt
265270 if : ${{ inputs.push }}
266271
267272 - name : Append images with critical vulnerabilities to push list
268273 run : |
269274 cat image-build-logs/image-scan-output/critical-images.txt >> image-build-logs/push-attempt-images.txt
270- if : ${{ inputs.push && inputs.push-dirty }}
275+ if : ${{ inputs.push && inputs.push-critical }}
271276
272277 - name : Push images
273278 run : |
@@ -316,12 +321,12 @@ jobs:
316321 # This can be used again instead of "Fail when critical vulnerabilities are found" when it's
317322 # decided to fail the job on detecting high CVEs as well.
318323 # - name: Fail when images failed scanning
319- # 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
320- # if: ${{ !inputs.push-dirty && !cancelled() }}
324+ # run: if [ $(wc -l < image-build-logs/image-scan-output/high -images.txt) -gt 0 ]; then cat image-build-logs/image-scan-output/high -images.txt && exit 1; fi
325+ # if: ${{ !inputs.push-critical && !cancelled() }}
321326
322327 - name : Fail when critical vulnerabilities are found
323328 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
324- if : ${{ !inputs.push-dirty && !cancelled() }}
329+ if : ${{ !inputs.push-critical && !cancelled() }}
325330
326331 # NOTE(mgoddard): Trigger another CI workflow in the
327332 # stackhpc-release-train repository.
0 commit comments