File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -256,6 +256,16 @@ printf "%s\n" "${INVENTORY_DATA}" >"${ROOT_MOUNT}/usr/share/bottlerocket/applica
256256# can access the inventory without needed to dig into the generated image.
257257printf " %s\n" " ${INVENTORY_DATA} " > " ${OUTPUT_DIR} /application-inventory.json"
258258
259+ # Merge SBOM's into a single json file
260+ KIT_SBOMS_DIR=" ${ROOT_MOUNT} /usr/share/sboms"
261+ IMAGE_SBOM_DIR=" ${ROOT_MOUNT} /usr/share/bottlerocket/sbom"
262+ mkdir -p " ${IMAGE_SBOM_DIR} "
263+ for format in " spdx" " cyclonedx" ; do
264+ find " ${KIT_SBOMS_DIR} " -name " *-${format} .json" -type f -exec sbomtool merge --output " ${IMAGE_SBOM_DIR} /image-${format} .json" {} \+
265+ done
266+ # Clean up old SBOM packages
267+ rm -rf " ${KIT_SBOMS_DIR} "
268+
259269# Regenerate module dependencies, if possible.
260270KMOD_DIR=" ${ROOT_MOUNT} /lib/modules"
261271# First decompress the kernel modules, so they can be recompressed by EROFS.
You can’t perform that action at this time.
0 commit comments