From 64dc51ae44944b93b1809f6a87c8902986a0f889 Mon Sep 17 00:00:00 2001 From: sushiMix <53741704+sushiMix@users.noreply.github.com> Date: Mon, 11 Dec 2023 12:04:35 +0100 Subject: [PATCH] allow dockerfile scan on filesystem analysis Signed-off-by: sushiMix <53741704+sushiMix@users.noreply.github.com> --- index.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/index.js b/index.js index 26cf5fdde..118a60bfb 100644 --- a/index.js +++ b/index.js @@ -4925,6 +4925,31 @@ export const createMultiXBom = async (pathList, options) => { listComponents(options, {}, bomData.bomJson.components, "maven", "xml") ); } + bomData = await createContainerSpecLikeBom(path, options); + if ( + bomData && + bomData.bomJson && + bomData.bomJson.components && + bomData.bomJson.components.length + ) { + if (DEBUG_MODE) { + console.log( + `Found ${bomData.bomJson.components.length} docker dependencies at ${path}` + ); + } + components = components.concat(bomData.bomJson.components); + dependencies = dependencies.concat(bomData.bomJson.dependencies); + if ( + bomData.parentComponent && + Object.keys(bomData.parentComponent).length + ) { + parentSubComponents.push(bomData.parentComponent); + } + componentsXmls = componentsXmls.concat( + // COPIED FROM SECTION ABOVE BUT NO IDEA OF PARAMETERS VALUES TO PUT + listComponents(options, {}, bomData.bomJson.components, "docker", "tar") + ); + } } // for if (options.lastWorkingDir && options.lastWorkingDir !== "") { bomData = await createJarBom(options.lastWorkingDir, options);