@cdxgen/cdxgen 13.3.0 → 13.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (372) hide show
  1. package/README.md +12 -9
  2. package/bin/cdxgen-secure.js +15 -0
  3. package/bin/cdxgen.js +115 -31
  4. package/bin/evinse.js +23 -1
  5. package/bin/hbom.js +15 -7
  6. package/bin/repl.js +115 -0
  7. package/bin/sign.js +45 -15
  8. package/bin/tracebom.js +5 -1
  9. package/bin/validate.js +84 -18
  10. package/bin/verify.js +155 -86
  11. package/data/cbomosdb-queries.json +13 -1
  12. package/data/component-tags.json +8 -0
  13. package/data/helpers/init.gradle +46 -21
  14. package/data/queries-darwin.json +25 -1
  15. package/data/queries-win.json +19 -1
  16. package/data/queries.json +41 -0
  17. package/data/remediations.json +344 -1
  18. package/data/rules/cbom-security.yaml +235 -4
  19. package/data/rules/dependency-sources.yaml +67 -0
  20. package/data/rules/go-binaries.yaml +46 -0
  21. package/data/rules/golem-go.yaml +80 -0
  22. package/data/rules/hbom-compliance.yaml +40 -22
  23. package/data/rules/hbom-performance.yaml +7 -1
  24. package/data/rules/host-topology.yaml +1 -1
  25. package/data/rules/obom-runtime.yaml +31 -2
  26. package/data/rules/php-runtime.yaml +143 -0
  27. package/data/rules/scala-evidence.yaml +115 -0
  28. package/lib/audit/index.js +52 -6
  29. package/lib/cli/bomAssembly.js +28 -3
  30. package/lib/cli/cliOptions.js +110 -3
  31. package/lib/cli/index.js +186 -58
  32. package/lib/cli/jsBom.js +50 -29
  33. package/lib/cli/jvmBom.js +779 -146
  34. package/lib/cli/managedBom.js +1021 -261
  35. package/lib/cli/nativeBom.js +364 -58
  36. package/lib/core/activity.js +12 -0
  37. package/lib/core/env.js +47 -17
  38. package/lib/core/fs.js +31 -21
  39. package/lib/core/httpClient.js +233 -69
  40. package/lib/core/pluginRun.js +184 -0
  41. package/lib/core/processTree.js +100 -0
  42. package/lib/core/projectConfig.js +1 -0
  43. package/lib/core/projectTooling.js +97 -0
  44. package/lib/core/propertySanitizer.js +72 -0
  45. package/lib/core/runState.js +39 -0
  46. package/lib/core/toml.js +72 -0
  47. package/lib/ecosystems/asarutils.js +4 -2
  48. package/lib/ecosystems/bunutils.js +5 -7
  49. package/lib/ecosystems/cargoCache.js +231 -8
  50. package/lib/ecosystems/cmakeResolver.js +10 -21
  51. package/lib/ecosystems/cppBuildContext.js +631 -0
  52. package/lib/ecosystems/cppEvidence.js +337 -22
  53. package/lib/ecosystems/cppIncludeResolver.js +294 -0
  54. package/lib/ecosystems/denoutils.js +93 -66
  55. package/lib/ecosystems/ecosystems.js +1967 -788
  56. package/lib/ecosystems/golem.js +578 -18
  57. package/lib/ecosystems/gradleutils.js +340 -46
  58. package/lib/ecosystems/jsEvidence.js +85 -24
  59. package/lib/ecosystems/kosi.js +21 -4
  60. package/lib/ecosystems/npmutils.js +64 -0
  61. package/lib/ecosystems/parsers-dotnet.js +668 -153
  62. package/lib/ecosystems/parsers-elm.js +46 -28
  63. package/lib/ecosystems/parsers-gleam.js +3 -4
  64. package/lib/ecosystems/parsers-go.js +1283 -297
  65. package/lib/ecosystems/parsers-js.js +92 -26
  66. package/lib/ecosystems/parsers-julia.js +2 -3
  67. package/lib/ecosystems/parsers-jvm.js +463 -29
  68. package/lib/ecosystems/parsers-misc.js +405 -93
  69. package/lib/ecosystems/parsers-python.js +152 -20
  70. package/lib/ecosystems/parsers-rust.js +4 -4
  71. package/lib/ecosystems/parsers-terraform.js +1573 -19
  72. package/lib/ecosystems/pythonutils.js +102 -6
  73. package/lib/ecosystems/remote/huggingface.js +3 -0
  74. package/lib/ecosystems/rubyutils.js +73 -20
  75. package/lib/ecosystems/rusi.js +32 -9
  76. package/lib/ecosystems/sbtutils.js +243 -187
  77. package/lib/ecosystems/scalacliutils.js +343 -0
  78. package/lib/ecosystems/scalasem.js +2620 -0
  79. package/lib/ecosystems/terraformRegistry.js +288 -0
  80. package/lib/ecosystems/utils.js +2 -0
  81. package/lib/ecosystems/vendoredCode.js +156 -0
  82. package/lib/evinser/evinser.js +695 -78
  83. package/lib/evinser/swiftsem.js +68 -5
  84. package/lib/helpers/agenticToolutils.js +2 -2
  85. package/lib/helpers/bomSigner.js +576 -128
  86. package/lib/inventory/agentSkillSpec.js +17 -0
  87. package/lib/inventory/aiCollector.js +4 -1
  88. package/lib/inventory/analyzer.js +110 -127
  89. package/lib/inventory/apkInstalledDb.js +243 -0
  90. package/lib/inventory/atomUtils.js +204 -48
  91. package/lib/inventory/auditCategories.js +10 -3
  92. package/lib/inventory/buildToolRateLimit.js +144 -0
  93. package/lib/inventory/cacheCommands.js +2 -1
  94. package/lib/inventory/cacheDir.js +52 -9
  95. package/lib/inventory/certificates.js +2371 -0
  96. package/lib/inventory/cmakeBuildDirs.js +254 -0
  97. package/lib/inventory/communityAiConfigParser.js +4 -9
  98. package/lib/inventory/deps.js +507 -128
  99. package/lib/inventory/display.js +200 -3
  100. package/lib/inventory/dosai.js +747 -101
  101. package/lib/inventory/dosaiParsers.js +310 -15
  102. package/lib/inventory/dynamic.js +96 -8
  103. package/lib/inventory/envcontext.js +168 -5
  104. package/lib/inventory/evidenceUtils.js +590 -132
  105. package/lib/inventory/fetchBatch.js +574 -38
  106. package/lib/inventory/fetchDiskCache.js +597 -0
  107. package/lib/inventory/forgeEnricher.js +14 -5
  108. package/lib/inventory/formulationParsers.js +3 -2
  109. package/lib/inventory/goBuildInfo.js +140 -0
  110. package/lib/inventory/hbom.js +67 -7
  111. package/lib/inventory/hbomAnalysis.js +16 -0
  112. package/lib/inventory/hostTopology.js +21 -0
  113. package/lib/inventory/jvmLocalRepos.js +917 -0
  114. package/lib/inventory/mcpConfigParser.js +2 -3
  115. package/lib/inventory/osPackagePurl.js +244 -0
  116. package/lib/inventory/osPackageResolver.js +89 -87
  117. package/lib/inventory/osinfo.js +79 -31
  118. package/lib/inventory/osqueryTransform.js +114 -5
  119. package/lib/inventory/parentSelection.js +146 -0
  120. package/lib/inventory/phpBuildInfo.js +487 -0
  121. package/lib/inventory/phpHostProbe.js +641 -0
  122. package/lib/inventory/rootfsCerts.js +426 -0
  123. package/lib/inventory/rustFormulationParser.js +3 -4
  124. package/lib/inventory/scalaCoords.js +153 -0
  125. package/lib/inventory/source.js +215 -11
  126. package/lib/inventory/spdx.js +245 -0
  127. package/lib/inventory/traceRunner.js +93 -8
  128. package/lib/inventory/tracedCrypto.js +423 -0
  129. package/lib/managers/binary.js +529 -183
  130. package/lib/managers/docker.js +199 -44
  131. package/lib/managers/oci.js +24 -2
  132. package/lib/parsers/cmakeCache.js +69 -0
  133. package/lib/parsers/cmakeLists.js +16 -2
  134. package/lib/parsers/cmakePresets.js +400 -0
  135. package/lib/parsers/compileCommands.js +557 -0
  136. package/lib/parsers/email.js +277 -0
  137. package/lib/parsers/largeJson.js +34 -2
  138. package/lib/parsers/strictJson.js +322 -0
  139. package/lib/parsers/terraformConfig.js +1073 -0
  140. package/lib/parsers/terraformSource.js +652 -0
  141. package/lib/server/server.js +209 -1
  142. package/lib/stages/postgen/annotator.js +17 -1
  143. package/lib/stages/postgen/introspection/markers.js +1 -1
  144. package/lib/stages/postgen/introspection/reflect.js +4 -1
  145. package/lib/stages/postgen/postgen.js +20 -6
  146. package/lib/stages/postgen/ruleEngine.js +58 -1
  147. package/lib/stages/postgen/specVersionCompat.js +62 -0
  148. package/lib/stages/pregen/pregen.js +117 -5
  149. package/lib/validator/bomValidator.js +26 -5
  150. package/lib/validator/generated/runtime.mjs +13 -0
  151. package/lib/validator/generated/validate-1.6.mjs +26 -7
  152. package/lib/validator/generated/validate-1.7.mjs +31 -12
  153. package/lib/validator/generated/validate-2.0.mjs +30 -11
  154. package/lib/validator/index.js +25 -10
  155. package/lib/validator/reporters/json.js +1 -0
  156. package/package.json +23 -23
  157. package/types/bin/cdxgen-secure.d.ts +3 -0
  158. package/types/bin/cdxgen-secure.d.ts.map +1 -0
  159. package/types/bin/repl.d.ts.map +1 -1
  160. package/types/lib/audit/index.d.ts.map +1 -1
  161. package/types/lib/cli/bomAssembly.d.ts +9 -2
  162. package/types/lib/cli/bomAssembly.d.ts.map +1 -1
  163. package/types/lib/cli/cliOptions.d.ts +43 -0
  164. package/types/lib/cli/cliOptions.d.ts.map +1 -1
  165. package/types/lib/cli/index.d.ts.map +1 -1
  166. package/types/lib/cli/jsBom.d.ts.map +1 -1
  167. package/types/lib/cli/jvmBom.d.ts +44 -1
  168. package/types/lib/cli/jvmBom.d.ts.map +1 -1
  169. package/types/lib/cli/managedBom.d.ts +7 -4
  170. package/types/lib/cli/managedBom.d.ts.map +1 -1
  171. package/types/lib/cli/nativeBom.d.ts +3 -1
  172. package/types/lib/cli/nativeBom.d.ts.map +1 -1
  173. package/types/lib/core/activity.d.ts.map +1 -1
  174. package/types/lib/core/env.d.ts +27 -2
  175. package/types/lib/core/env.d.ts.map +1 -1
  176. package/types/lib/core/fs.d.ts.map +1 -1
  177. package/types/lib/core/httpClient.d.ts +13 -8
  178. package/types/lib/core/httpClient.d.ts.map +1 -1
  179. package/types/lib/core/pluginRun.d.ts +97 -0
  180. package/types/lib/core/pluginRun.d.ts.map +1 -0
  181. package/types/lib/core/processTree.d.ts +36 -0
  182. package/types/lib/core/processTree.d.ts.map +1 -0
  183. package/types/lib/core/projectConfig.d.ts.map +1 -1
  184. package/types/lib/core/projectTooling.d.ts +41 -0
  185. package/types/lib/core/projectTooling.d.ts.map +1 -0
  186. package/types/lib/core/propertySanitizer.d.ts +26 -0
  187. package/types/lib/core/propertySanitizer.d.ts.map +1 -1
  188. package/types/lib/core/runState.d.ts +29 -0
  189. package/types/lib/core/runState.d.ts.map +1 -0
  190. package/types/lib/core/toml.d.ts +20 -0
  191. package/types/lib/core/toml.d.ts.map +1 -0
  192. package/types/lib/ecosystems/asarutils.d.ts.map +1 -1
  193. package/types/lib/ecosystems/bunutils.d.ts.map +1 -1
  194. package/types/lib/ecosystems/cargoCache.d.ts +12 -0
  195. package/types/lib/ecosystems/cargoCache.d.ts.map +1 -1
  196. package/types/lib/ecosystems/cmakeResolver.d.ts +5 -3
  197. package/types/lib/ecosystems/cmakeResolver.d.ts.map +1 -1
  198. package/types/lib/ecosystems/cppBuildContext.d.ts +55 -0
  199. package/types/lib/ecosystems/cppBuildContext.d.ts.map +1 -0
  200. package/types/lib/ecosystems/cppEvidence.d.ts +19 -3
  201. package/types/lib/ecosystems/cppEvidence.d.ts.map +1 -1
  202. package/types/lib/ecosystems/cppIncludeResolver.d.ts +92 -0
  203. package/types/lib/ecosystems/cppIncludeResolver.d.ts.map +1 -0
  204. package/types/lib/ecosystems/denoutils.d.ts +9 -3
  205. package/types/lib/ecosystems/denoutils.d.ts.map +1 -1
  206. package/types/lib/ecosystems/ecosystems.d.ts +62 -13
  207. package/types/lib/ecosystems/ecosystems.d.ts.map +1 -1
  208. package/types/lib/ecosystems/golem.d.ts +81 -1
  209. package/types/lib/ecosystems/golem.d.ts.map +1 -1
  210. package/types/lib/ecosystems/gradleutils.d.ts +59 -7
  211. package/types/lib/ecosystems/gradleutils.d.ts.map +1 -1
  212. package/types/lib/ecosystems/jsEvidence.d.ts.map +1 -1
  213. package/types/lib/ecosystems/kosi.d.ts.map +1 -1
  214. package/types/lib/ecosystems/npmutils.d.ts +15 -0
  215. package/types/lib/ecosystems/npmutils.d.ts.map +1 -1
  216. package/types/lib/ecosystems/parsers-dotnet.d.ts +155 -5
  217. package/types/lib/ecosystems/parsers-dotnet.d.ts.map +1 -1
  218. package/types/lib/ecosystems/parsers-elm.d.ts.map +1 -1
  219. package/types/lib/ecosystems/parsers-gleam.d.ts.map +1 -1
  220. package/types/lib/ecosystems/parsers-go.d.ts +119 -5
  221. package/types/lib/ecosystems/parsers-go.d.ts.map +1 -1
  222. package/types/lib/ecosystems/parsers-js.d.ts +6 -1
  223. package/types/lib/ecosystems/parsers-js.d.ts.map +1 -1
  224. package/types/lib/ecosystems/parsers-julia.d.ts.map +1 -1
  225. package/types/lib/ecosystems/parsers-jvm.d.ts +74 -3
  226. package/types/lib/ecosystems/parsers-jvm.d.ts.map +1 -1
  227. package/types/lib/ecosystems/parsers-misc.d.ts +21 -59
  228. package/types/lib/ecosystems/parsers-misc.d.ts.map +1 -1
  229. package/types/lib/ecosystems/parsers-python.d.ts +57 -6
  230. package/types/lib/ecosystems/parsers-python.d.ts.map +1 -1
  231. package/types/lib/ecosystems/parsers-terraform.d.ts +38 -21
  232. package/types/lib/ecosystems/parsers-terraform.d.ts.map +1 -1
  233. package/types/lib/ecosystems/pythonutils.d.ts +26 -1
  234. package/types/lib/ecosystems/pythonutils.d.ts.map +1 -1
  235. package/types/lib/ecosystems/remote/huggingface.d.ts.map +1 -1
  236. package/types/lib/ecosystems/rubyutils.d.ts +21 -1
  237. package/types/lib/ecosystems/rubyutils.d.ts.map +1 -1
  238. package/types/lib/ecosystems/rusi.d.ts.map +1 -1
  239. package/types/lib/ecosystems/sbtutils.d.ts +88 -2
  240. package/types/lib/ecosystems/sbtutils.d.ts.map +1 -1
  241. package/types/lib/ecosystems/scalacliutils.d.ts +56 -0
  242. package/types/lib/ecosystems/scalacliutils.d.ts.map +1 -0
  243. package/types/lib/ecosystems/scalasem.d.ts +311 -0
  244. package/types/lib/ecosystems/scalasem.d.ts.map +1 -0
  245. package/types/lib/ecosystems/terraformRegistry.d.ts +9 -0
  246. package/types/lib/ecosystems/terraformRegistry.d.ts.map +1 -0
  247. package/types/lib/ecosystems/utils.d.ts +2 -2
  248. package/types/lib/ecosystems/utils.d.ts.map +1 -1
  249. package/types/lib/ecosystems/vendoredCode.d.ts +32 -0
  250. package/types/lib/ecosystems/vendoredCode.d.ts.map +1 -0
  251. package/types/lib/evinser/evinser.d.ts +100 -8
  252. package/types/lib/evinser/evinser.d.ts.map +1 -1
  253. package/types/lib/evinser/swiftsem.d.ts +10 -0
  254. package/types/lib/evinser/swiftsem.d.ts.map +1 -1
  255. package/types/lib/helpers/bomSigner.d.ts +80 -4
  256. package/types/lib/helpers/bomSigner.d.ts.map +1 -1
  257. package/types/lib/inventory/agentSkillSpec.d.ts +13 -0
  258. package/types/lib/inventory/agentSkillSpec.d.ts.map +1 -0
  259. package/types/lib/inventory/aiCollector.d.ts.map +1 -1
  260. package/types/lib/inventory/analyzer.d.ts.map +1 -1
  261. package/types/lib/inventory/apkInstalledDb.d.ts +42 -0
  262. package/types/lib/inventory/apkInstalledDb.d.ts.map +1 -0
  263. package/types/lib/inventory/atomUtils.d.ts +96 -10
  264. package/types/lib/inventory/atomUtils.d.ts.map +1 -1
  265. package/types/lib/inventory/auditCategories.d.ts +3 -0
  266. package/types/lib/inventory/auditCategories.d.ts.map +1 -1
  267. package/types/lib/inventory/buildToolRateLimit.d.ts +38 -0
  268. package/types/lib/inventory/buildToolRateLimit.d.ts.map +1 -0
  269. package/types/lib/inventory/cacheCommands.d.ts +2 -1
  270. package/types/lib/inventory/cacheCommands.d.ts.map +1 -1
  271. package/types/lib/inventory/cacheDir.d.ts +12 -4
  272. package/types/lib/inventory/cacheDir.d.ts.map +1 -1
  273. package/types/lib/inventory/certificates.d.ts +205 -0
  274. package/types/lib/inventory/certificates.d.ts.map +1 -0
  275. package/types/lib/inventory/cmakeBuildDirs.d.ts +58 -0
  276. package/types/lib/inventory/cmakeBuildDirs.d.ts.map +1 -0
  277. package/types/lib/inventory/communityAiConfigParser.d.ts.map +1 -1
  278. package/types/lib/inventory/deps.d.ts +61 -2
  279. package/types/lib/inventory/deps.d.ts.map +1 -1
  280. package/types/lib/inventory/display.d.ts +18 -0
  281. package/types/lib/inventory/display.d.ts.map +1 -1
  282. package/types/lib/inventory/dosai.d.ts +202 -14
  283. package/types/lib/inventory/dosai.d.ts.map +1 -1
  284. package/types/lib/inventory/dosaiParsers.d.ts +53 -7
  285. package/types/lib/inventory/dosaiParsers.d.ts.map +1 -1
  286. package/types/lib/inventory/dynamic.d.ts +16 -1
  287. package/types/lib/inventory/dynamic.d.ts.map +1 -1
  288. package/types/lib/inventory/envcontext.d.ts +40 -2
  289. package/types/lib/inventory/envcontext.d.ts.map +1 -1
  290. package/types/lib/inventory/evidenceUtils.d.ts +48 -14
  291. package/types/lib/inventory/evidenceUtils.d.ts.map +1 -1
  292. package/types/lib/inventory/fetchBatch.d.ts +83 -14
  293. package/types/lib/inventory/fetchBatch.d.ts.map +1 -1
  294. package/types/lib/inventory/fetchDiskCache.d.ts +169 -0
  295. package/types/lib/inventory/fetchDiskCache.d.ts.map +1 -0
  296. package/types/lib/inventory/forgeEnricher.d.ts.map +1 -1
  297. package/types/lib/inventory/formulationParsers.d.ts.map +1 -1
  298. package/types/lib/inventory/goBuildInfo.d.ts +10 -0
  299. package/types/lib/inventory/goBuildInfo.d.ts.map +1 -0
  300. package/types/lib/inventory/hbom.d.ts.map +1 -1
  301. package/types/lib/inventory/hbomAnalysis.d.ts +10 -0
  302. package/types/lib/inventory/hbomAnalysis.d.ts.map +1 -1
  303. package/types/lib/inventory/hostTopology.d.ts.map +1 -1
  304. package/types/lib/inventory/jvmLocalRepos.d.ts +178 -0
  305. package/types/lib/inventory/jvmLocalRepos.d.ts.map +1 -0
  306. package/types/lib/inventory/mcpConfigParser.d.ts.map +1 -1
  307. package/types/lib/inventory/osPackagePurl.d.ts +99 -0
  308. package/types/lib/inventory/osPackagePurl.d.ts.map +1 -0
  309. package/types/lib/inventory/osPackageResolver.d.ts +6 -2
  310. package/types/lib/inventory/osPackageResolver.d.ts.map +1 -1
  311. package/types/lib/inventory/osinfo.d.ts +31 -6
  312. package/types/lib/inventory/osinfo.d.ts.map +1 -1
  313. package/types/lib/inventory/osqueryTransform.d.ts +51 -0
  314. package/types/lib/inventory/osqueryTransform.d.ts.map +1 -1
  315. package/types/lib/inventory/parentSelection.d.ts +34 -0
  316. package/types/lib/inventory/parentSelection.d.ts.map +1 -0
  317. package/types/lib/inventory/phpBuildInfo.d.ts +142 -0
  318. package/types/lib/inventory/phpBuildInfo.d.ts.map +1 -0
  319. package/types/lib/inventory/phpHostProbe.d.ts +35 -0
  320. package/types/lib/inventory/phpHostProbe.d.ts.map +1 -0
  321. package/types/lib/inventory/rootfsCerts.d.ts +27 -0
  322. package/types/lib/inventory/rootfsCerts.d.ts.map +1 -0
  323. package/types/lib/inventory/rustFormulationParser.d.ts.map +1 -1
  324. package/types/lib/inventory/scalaCoords.d.ts +80 -0
  325. package/types/lib/inventory/scalaCoords.d.ts.map +1 -0
  326. package/types/lib/inventory/source.d.ts +28 -0
  327. package/types/lib/inventory/source.d.ts.map +1 -1
  328. package/types/lib/inventory/spdx.d.ts +24 -0
  329. package/types/lib/inventory/spdx.d.ts.map +1 -1
  330. package/types/lib/inventory/traceRunner.d.ts +16 -1
  331. package/types/lib/inventory/traceRunner.d.ts.map +1 -1
  332. package/types/lib/inventory/tracedCrypto.d.ts +64 -0
  333. package/types/lib/inventory/tracedCrypto.d.ts.map +1 -0
  334. package/types/lib/managers/binary.d.ts +10 -0
  335. package/types/lib/managers/binary.d.ts.map +1 -1
  336. package/types/lib/managers/docker.d.ts +12 -0
  337. package/types/lib/managers/docker.d.ts.map +1 -1
  338. package/types/lib/managers/oci.d.ts +3 -1
  339. package/types/lib/managers/oci.d.ts.map +1 -1
  340. package/types/lib/parsers/cmakeCache.d.ts +16 -0
  341. package/types/lib/parsers/cmakeCache.d.ts.map +1 -1
  342. package/types/lib/parsers/cmakeLists.d.ts +2 -1
  343. package/types/lib/parsers/cmakeLists.d.ts.map +1 -1
  344. package/types/lib/parsers/cmakePresets.d.ts +78 -0
  345. package/types/lib/parsers/cmakePresets.d.ts.map +1 -0
  346. package/types/lib/parsers/compileCommands.d.ts +115 -0
  347. package/types/lib/parsers/compileCommands.d.ts.map +1 -0
  348. package/types/lib/parsers/email.d.ts +19 -0
  349. package/types/lib/parsers/email.d.ts.map +1 -0
  350. package/types/lib/parsers/largeJson.d.ts +13 -0
  351. package/types/lib/parsers/largeJson.d.ts.map +1 -1
  352. package/types/lib/parsers/strictJson.d.ts +46 -0
  353. package/types/lib/parsers/strictJson.d.ts.map +1 -0
  354. package/types/lib/parsers/terraformConfig.d.ts +70 -0
  355. package/types/lib/parsers/terraformConfig.d.ts.map +1 -0
  356. package/types/lib/parsers/terraformSource.d.ts +66 -0
  357. package/types/lib/parsers/terraformSource.d.ts.map +1 -0
  358. package/types/lib/server/server.d.ts +8 -0
  359. package/types/lib/server/server.d.ts.map +1 -1
  360. package/types/lib/stages/postgen/annotator.d.ts.map +1 -1
  361. package/types/lib/stages/postgen/introspection/reflect.d.ts.map +1 -1
  362. package/types/lib/stages/postgen/postgen.d.ts.map +1 -1
  363. package/types/lib/stages/postgen/ruleEngine.d.ts +7 -4
  364. package/types/lib/stages/postgen/ruleEngine.d.ts.map +1 -1
  365. package/types/lib/stages/postgen/specVersionCompat.d.ts.map +1 -1
  366. package/types/lib/stages/pregen/pregen.d.ts +14 -1
  367. package/types/lib/stages/pregen/pregen.d.ts.map +1 -1
  368. package/types/lib/validator/bomValidator.d.ts.map +1 -1
  369. package/types/lib/validator/index.d.ts +8 -0
  370. package/types/lib/validator/index.d.ts.map +1 -1
  371. package/types/lib/validator/reporters/json.d.ts.map +1 -1
  372. package/lib/third-party/arborist/snapshots/calc-dep-flags.test.cjs +0 -462
package/README.md CHANGED
@@ -16,7 +16,7 @@ cdxgen is a CLI tool, library, [REPL](./ADVANCED.md), and server to create, vali
16
16
 
17
17
  Supported BOM formats:
18
18
 
19
- - Hardware (HBOM) - For supported live hosts such as Apple Silicon macOS and Linux amd64/arm64 systems.
19
+ - Hardware (HBOM) - For supported live hosts such as Apple Silicon macOS, Linux amd64/arm64, and Windows amd64/arm64 systems.
20
20
  - Software (SBOM) - For many languages and container images.
21
21
  - Cryptography (CBOM) - For Java keystores and certificates, plus JavaScript and TypeScript source-level algorithm inventory.
22
22
  - Operations (OBOM) - For Linux container images and VMs running Linux or Windows operating systems.
@@ -175,7 +175,7 @@ Regardless of how you install, the following commands are available:
175
175
  | `obom` | Alias for `cdxgen -t os` | yes |
176
176
  | `saasbom` | Alias for SaaSBOM-oriented `cdxgen` defaults | yes |
177
177
  | `spdxgen` | Alias for `cdxgen --format spdx` | use `cdxgen` |
178
- | `cdxgen-secure` | Alias for hardened `cdxgen` defaults | use `cdxgen` |
178
+ | `cdxgen-secure` | `cdxgen` in secure mode, with dependency installation always off | use `cdxgen` |
179
179
 
180
180
  Standalone GitHub release binaries are published for `cdxgen`, `cdxgen-slim`, `aibom`, `cbom`, `obom`, `saasbom`, `hbom`, `hbom-slim`, `cdx-audit`, `cdx-convert`, `cdx-sign`, `cdx-validate`, `cdx-verify`, and `tracebom`.
181
181
 
@@ -187,7 +187,7 @@ The `cbom` and `saasbom` release binaries bundle the Atom analysis stack (`@appt
187
187
 
188
188
  For AI-heavy repositories, cdxgen also supports an AI-BOM workflow via the `aibom` command or the `-t ai` project type aliases (`ai`, `aibom`, `ai-bom`). This emits AI service/model evidence and pairs naturally with the `ai-bom` BOM-audit category alias for governance, security, performance, AI-agent, and MCP findings.
189
189
 
190
- For host inventories, `hbom --include-runtime` produces a merged HBOM + OBOM view with strict topology links such as interface-name, driver-module, storage/runtime, and explicit secure-boot trust matches, plus a `host-topology` BOM audit pack for higher-confidence host findings. When the live hardware collector reports missing utilities or permission-sensitive enrichments, use `hbom diagnostics` (or inspect the derived `cdx:hbom:analysis:*` summary properties) before deciding whether a rerun with `--privileged` is justified.
190
+ For host inventories, `hbom --include-runtime` produces a merged HBOM + OBOM view with strict topology links such as interface-name, driver-module, storage/runtime (including Windows drive letters), and explicit secure-boot trust matches, plus a `host-topology` BOM audit pack for higher-confidence host findings. When the live hardware collector reports missing utilities or permission-sensitive enrichments, use `hbom diagnostics` (or inspect the derived `cdx:hbom:analysis:*` summary properties) before deciding whether a rerun with `--privileged` is justified. On Windows, `--privileged` only helps from an already-elevated session, and a non-administrator over SSH or WinRM is denied every WMI query; see [HBOM permissions](docs/PERMISSIONS.md#hbom-permissions).
191
191
 
192
192
  ### Standalone executables (recommended)
193
193
 
@@ -216,7 +216,7 @@ Common asset names:
216
216
  #### Linux
217
217
 
218
218
  ```bash
219
- VERSION="v13.3.0"
219
+ VERSION="v13.5.0"
220
220
  ASSET="cdx-audit-linux-amd64"
221
221
  BASE_URL="https://github.com/cdxgen/cdxgen/releases/download/${VERSION}"
222
222
 
@@ -230,7 +230,7 @@ chmod +x "${ASSET}"
230
230
  #### macOS
231
231
 
232
232
  ```bash
233
- VERSION="v13.3.0"
233
+ VERSION="v13.5.0"
234
234
  ASSET="cdx-audit-darwin-arm64"
235
235
  BASE_URL="https://github.com/cdxgen/cdxgen/releases/download/${VERSION}"
236
236
 
@@ -244,7 +244,7 @@ chmod +x "${ASSET}"
244
244
  #### Windows (PowerShell)
245
245
 
246
246
  ```powershell
247
- $Version = "v13.3.0"
247
+ $Version = "v13.5.0"
248
248
  $Asset = "cdx-audit-windows-amd64.exe"
249
249
  $BaseUrl = "https://github.com/cdxgen/cdxgen/releases/download/$Version"
250
250
 
@@ -269,7 +269,7 @@ steps:
269
269
  env:
270
270
  GH_TOKEN: ${{ github.token }}
271
271
  run: |
272
- gh release download v13.3.0 \
272
+ gh release download v13.5.0 \
273
273
  --repo cdxgen/cdxgen \
274
274
  --pattern 'cdx-audit-linux-amd64' \
275
275
  --pattern 'cdx-audit-linux-amd64.sha256'
@@ -759,9 +759,9 @@ BOMs signed with cdxgen 13.2.0 or earlier must be re-signed with the current `cd
759
759
  For complex supply chain orchestration, use the bundled `cdx-sign` CLI. This tool allows multiple entities (e.g., a Builder and an Auditor) to co-sign an existing BOM without modifying its original data.
760
760
 
761
761
  ```shell
762
- # Append a parallel multi-signature (Auditor co-signing)
762
+ # Append a parallel multi-signature (Auditor co-signing) after checking the Builder's signature
763
763
  # Note: Granular component signing is disabled to preserve the Builder's original signature payload.
764
- cdx-sign -i bom.json -k auditor_private.pem -a ES256 --key-id "auditor-qa" --mode signers --no-sign-components
764
+ cdx-sign -i bom.json -k auditor_private.pem -a ES256 --key-id "auditor-qa" --mode signers --no-sign-components --verify-existing-with builder_public.pem
765
765
  ```
766
766
 
767
767
  ### Validating CycloneDX BOMs
@@ -780,6 +780,9 @@ cdx-verify -i bom.json --public-key public.key
780
780
 
781
781
  # Verify ONLY the top-level root signature (useful for verifying a multi-signer who didn't sign nested components)
782
782
  cdx-verify -i bom.json --public-key auditor_public.key --no-deep
783
+
784
+ # Require every co-signer
785
+ cdx-verify -i bom.json --public-key builder_public.key --public-key auditor_public.key --require-all
783
786
  ```
784
787
 
785
788
  ### Verifying the signature (pnpm)
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env node
2
+ // cdxgen-secure: cdxgen in secure mode.
3
+ //
4
+ // This is an entry point of its own rather than a second name for
5
+ // bin/cdxgen.js. cdxgen recognised the command from the script path in
6
+ // process.argv[1], but bun reports the real file behind a symlink there and
7
+ // the npm shims on Windows always name bin/cdxgen.js, so in both cases a
8
+ // `cdxgen-secure` that pointed at bin/cdxgen.js ran as plain cdxgen. Turning
9
+ // secure mode on here, before any cdxgen module loads, also means the modules
10
+ // that read CDXGEN_SECURE_MODE once at import see it.
11
+ import process from "node:process";
12
+
13
+ process.env.CDXGEN_SECURE_MODE = "true";
14
+
15
+ await import("./cdxgen.js");
package/bin/cdxgen.js CHANGED
@@ -4,7 +4,6 @@ import crypto from "node:crypto";
4
4
  import fs from "node:fs";
5
5
  import http from "node:http";
6
6
  import https from "node:https";
7
- import { tmpdir } from "node:os";
8
7
  import {
9
8
  basename,
10
9
  dirname,
@@ -22,6 +21,7 @@ import { hideBin } from "yargs/helpers";
22
21
  import { getExactAiInventoryType } from "../lib/cli/bomAssembly.js";
23
22
  import {
24
23
  applyAdvancedOptions as applyAdvancedOptionsImpl,
24
+ applyOperatorToolingChoice,
25
25
  buildOptionsFromArgs,
26
26
  isUserProvided,
27
27
  validateSpecVersion,
@@ -34,10 +34,12 @@ import {
34
34
  isDeferredFailOnError,
35
35
  } from "../lib/core/deferredExit.js";
36
36
  import { TRACE_MODE, thoughtEnd, thoughtLog } from "../lib/core/logger.js";
37
+ import { resolveSourcePathArgument } from "../lib/core/pluginRun.js";
37
38
  import {
38
39
  PROJECT_CONFIG_FILENAMES,
39
40
  sanitizeProjectConfig,
40
41
  } from "../lib/core/projectConfig.js";
42
+ import { isSecureModeActive } from "../lib/core/projectTooling.js";
41
43
  import {
42
44
  ui as defaultUi,
43
45
  installConsoleShim,
@@ -102,6 +104,7 @@ import {
102
104
  printSummary,
103
105
  printTable,
104
106
  } from "../lib/inventory/display.js";
107
+ import { runsEvidenceAnalysis } from "../lib/inventory/dosai.js";
105
108
  import {
106
109
  ensureNoMixedHbomProjectTypes,
107
110
  ensureSupportedHbomSpecVersion,
@@ -137,6 +140,11 @@ import { prepareEnv } from "../lib/stages/pregen/pregen.js";
137
140
  import { validateSpdx } from "../lib/validator/bomValidator.js";
138
141
  import { validateGeneratedBom } from "../lib/validator/index.js";
139
142
 
143
+ // The environment as the operator launched cdxgen. The CLI later copies some
144
+ // parsed options into the environment (--introspect becomes
145
+ // CDXGEN_INTROSPECT), so the operator's own choices are read from this copy.
146
+ const launchEnv = { ...process.env };
147
+
140
148
  // Support for config files. The config file lives in the directory under
141
149
  // analysis, so it carries that directory's trust level; see
142
150
  // sanitizeProjectConfig for the boundary this applies.
@@ -263,12 +271,12 @@ const args = _yargs
263
271
  .option("cmake-cache", {
264
272
  type: "string",
265
273
  description:
266
- "Path to the CMakeCache.txt of a configured C/C++ build. Overrides the lookup under build/, out/ and cmake-build-*/.",
274
+ "Path to the CMakeCache.txt of a configured C/C++ build. Overrides the lookup in the build directories of the CMake presets, build*/, out/, builddir/ and cmake-build-*/.",
267
275
  })
268
276
  .option("compile-commands", {
269
277
  type: "string",
270
278
  description:
271
- "Path to the compile_commands.json of a C/C++ build, or a directory holding one. atom then parses each file with its build's include paths, macros and language. Overrides the lookup in the project root, build/, out/, builddir/ and cmake-build-*/, which is skipped in secure mode.",
279
+ "Path to the compile_commands.json of a C/C++ build, or a directory holding one. atom then parses each file with its build's include paths, macros and language. Overrides the lookup in the project root and its build directories (those of the CMake presets, build*/, out/, builddir/, cmake-build-*/), which is skipped in secure mode.",
272
280
  })
273
281
  .option("git-branch", {
274
282
  description: "Git branch to clone when the source is a git URL or purl",
@@ -456,6 +464,23 @@ const args = _yargs
456
464
  default: false,
457
465
  description: "Generate SBOM with evidence for supported languages.",
458
466
  })
467
+ .option("scalasem", {
468
+ type: "boolean",
469
+ default: true,
470
+ description:
471
+ "Run the Scala semantic analyzer for the evidence of Scala projects. Use --no-scalasem to skip it.",
472
+ })
473
+ .option("scalasem-command", {
474
+ type: "string",
475
+ description:
476
+ "Use a specific scalasem script for the Scala evidence. Defaults to SCALASEM_CMD.",
477
+ })
478
+ .option("scalasem-include-tests", {
479
+ type: "boolean",
480
+ default: false,
481
+ description:
482
+ "Include test sources in the Scala evidence, tagged with their usage scope.",
483
+ })
459
484
  .option("deps-slices-file", {
460
485
  description: "Path for the parsedeps slice file created by atom.",
461
486
  default: "deps.slices.json",
@@ -893,7 +918,7 @@ const args = _yargs
893
918
  type: "boolean",
894
919
  default: true,
895
920
  description:
896
- "Use the on-disk metadata cache for registry lookups. Pass --no-cache to bypass it for this run.",
921
+ "Use the on-disk metadata cache for registry lookups. Pass --no-cache to bypass it for this run; answers are still remembered within the run.",
897
922
  })
898
923
  .option("cache-ttl", {
899
924
  type: "number",
@@ -1013,9 +1038,24 @@ if (!readEnvironmentVariable("NODE_USE_SYSTEM_CA")) {
1013
1038
  process.env.NODE_USE_SYSTEM_CA = "1";
1014
1039
  }
1015
1040
 
1016
- const filePath = args._[0] || process.cwd();
1041
+ let filePath = args._[0] || process.cwd();
1017
1042
  const sourceInputIsRemoteOrPurl =
1018
1043
  maybeRemotePath(filePath) || maybePurlSource(filePath);
1044
+ // Resolve the source argument once, before anything uses it. With the working
1045
+ // directory already set to the project and the argument relative to a
1046
+ // repository root (depscan's launch shape), every later resolve would produce
1047
+ // <project>/<argument>, a directory that does not exist: the BOM came out
1048
+ // empty and the plugins analyzed nothing, while the run still exited 0.
1049
+ if (!sourceInputIsRemoteOrPurl && args._?.[0]) {
1050
+ const sourceResolution = resolveSourcePathArgument(filePath);
1051
+ if (sourceResolution.rewritten) {
1052
+ console.warn(
1053
+ `Source path '${filePath}' does not exist relative to the working directory, which is itself the directory it names; using '${sourceResolution.path}'.`,
1054
+ );
1055
+ filePath = sourceResolution.path;
1056
+ args._[0] = filePath;
1057
+ }
1058
+ }
1019
1059
  if (!args.projectName) {
1020
1060
  if (filePath !== ".") {
1021
1061
  args.projectName = basename(filePath);
@@ -1094,8 +1134,10 @@ let autoLedgerSidecar;
1094
1134
  if (options.introspect) {
1095
1135
  process.env.CDXGEN_INTROSPECT = "true";
1096
1136
  if (!isDryRun && !readEnvironmentVariable("CDXGEN_INTROSPECT_LEDGER")) {
1137
+ // The temp directory, not the OS one: under the permission model it is
1138
+ // the directory cdxgen is granted writes to.
1097
1139
  autoLedgerSidecar = join(
1098
- tmpdir(),
1140
+ getTmpDir(),
1099
1141
  `cdxgen-introspect-ledger-${process.pid}.jsonl`,
1100
1142
  );
1101
1143
  process.env.CDXGEN_INTROSPECT_LEDGER = autoLedgerSidecar;
@@ -1233,7 +1275,15 @@ if (options.lifecycle) {
1233
1275
  }
1234
1276
  const isHbomOnlyInvocation = isHbomOnlyProjectTypes(options.projectType);
1235
1277
  const advancedWarnings = applyAdvancedOptionsImpl(options, {
1236
- isSecureMode,
1278
+ isSecureMode: isSecureModeActive(),
1279
+ });
1280
+ // The config file comes from the working directory, usually the scanned
1281
+ // project, so whether the project's own code may run stays the operator's
1282
+ // choice from the command line and environment.
1283
+ applyOperatorToolingChoice(options, {
1284
+ env: launchEnv,
1285
+ isSecureMode: isSecureModeActive(),
1286
+ projectConfig: config,
1237
1287
  });
1238
1288
  if (options?.technique && Array.isArray(options.technique)) {
1239
1289
  if (options.technique.length === 1) {
@@ -2095,7 +2145,7 @@ const writeCycloneDxOutput = (jsonFile, bomJson, options) => {
2095
2145
  }
2096
2146
  }
2097
2147
  let internalCycloneDxInputPath = outputPlan.outputs.cyclonedx;
2098
- if ((options.evidence || options.includeCrypto) && bomNSData?.bomJson) {
2148
+ if (runsEvidenceAnalysis(options) && bomNSData?.bomJson) {
2099
2149
  if (!internalCycloneDxInputPath) {
2100
2150
  internalCycloneDxInputPath = join(
2101
2151
  getTmpDir(),
@@ -2118,7 +2168,10 @@ const writeCycloneDxOutput = (jsonFile, bomJson, options) => {
2118
2168
  }
2119
2169
  }
2120
2170
  // Evidence generation
2121
- if (options.evidence || options.includeCrypto) {
2171
+ // The same helper decides in createCsharpBom whether the dosai methods
2172
+ // report may be trimmed: --include-crypto alone runs evinse too, so testing
2173
+ // options.evidence alone here would trim a report this scan needs full.
2174
+ if (runsEvidenceAnalysis(options)) {
2122
2175
  if (isDryRun) {
2123
2176
  recordActivity({
2124
2177
  kind: "write",
@@ -2137,30 +2190,61 @@ const writeCycloneDxOutput = (jsonFile, bomJson, options) => {
2137
2190
  sourcePath: filePath,
2138
2191
  });
2139
2192
  const evinserModule = await import("../lib/evinser/evinser.js");
2140
- options.projectType = options.projectType || ["java"];
2141
- const evinseOptions = evinserModule.buildEvinseOptions(
2142
- options,
2143
- args,
2144
- internalCycloneDxInputPath || options.output,
2145
- );
2146
- const dbObjMap = await evinserModule.prepareDB(evinseOptions);
2147
- if (dbObjMap) {
2148
- const sliceArtefacts = await evinserModule.analyzeProject(
2149
- dbObjMap,
2150
- evinseOptions,
2193
+ if (!options.projectType) {
2194
+ const evidenceLanguage = evinserModule.defaultEvidenceLanguage(
2195
+ filePath,
2196
+ bomNSData?.bomJson,
2197
+ options,
2198
+ );
2199
+ if (evidenceLanguage) {
2200
+ options.projectType = [evidenceLanguage];
2201
+ }
2202
+ }
2203
+ if (!options.projectType) {
2204
+ console.log(
2205
+ "Skipping the evidence analysis since the BOM lists no package in a language it supports. Pass -t to choose the language.",
2151
2206
  );
2152
- const evinseJson = await evinserModule.createEvinseFile(
2153
- sliceArtefacts,
2154
- evinseOptions,
2207
+ if (bomNSData) {
2208
+ bomNSData.bomJson = applyEvidenceBasedFilter(
2209
+ bomNSData.bomJson,
2210
+ options,
2211
+ );
2212
+ }
2213
+ } else {
2214
+ const evinseOptions = evinserModule.buildEvinseOptions(
2215
+ options,
2216
+ args,
2217
+ internalCycloneDxInputPath || options.output,
2155
2218
  );
2156
- // The scope filter is deferred until here so the analyzers get to
2157
- // prove that an optional dependency is actually used.
2158
- bomNSData.bomJson = applyEvidenceBasedFilter(evinseJson, options);
2159
- if (options.print && evinseJson) {
2160
- printOccurrences(evinseJson);
2161
- printCallStack(evinseJson);
2162
- printReachables(sliceArtefacts);
2163
- printServices(evinseJson);
2219
+ try {
2220
+ const dbObjMap = await evinserModule.prepareDB(evinseOptions);
2221
+ if (dbObjMap) {
2222
+ const sliceArtefacts = await evinserModule.analyzeProject(
2223
+ dbObjMap,
2224
+ evinseOptions,
2225
+ );
2226
+ const evinseJson = await evinserModule.createEvinseFile(
2227
+ sliceArtefacts,
2228
+ evinseOptions,
2229
+ );
2230
+ // The scope filter is deferred until here so the analyzers get to
2231
+ // prove that an optional dependency is actually used.
2232
+ bomNSData.bomJson = applyEvidenceBasedFilter(evinseJson, options);
2233
+ if (options.print && evinseJson) {
2234
+ printOccurrences(evinseJson);
2235
+ printCallStack(evinseJson);
2236
+ printReachables(sliceArtefacts);
2237
+ printServices(evinseJson);
2238
+ }
2239
+ }
2240
+ } catch (err) {
2241
+ // A rusi/golem analysis failure under --fail-on-error on an
2242
+ // introspected run defers its exit so the BOM and the reports are
2243
+ // still written; the run continues here without the reachability
2244
+ // evidence, exactly as the deferral contract describes.
2245
+ if (!isDeferredFailOnError(err)) {
2246
+ throw err;
2247
+ }
2164
2248
  }
2165
2249
  }
2166
2250
  }
package/bin/evinse.js CHANGED
@@ -91,7 +91,7 @@ const args = yargs(hideBin(process.argv))
91
91
  })
92
92
  .option("compile-commands", {
93
93
  description:
94
- "Path to the compile_commands.json of a C/C++ build, or a directory holding one, for atom to parse each file as its build does. Overrides the lookup in the project root, build/, out/, builddir/ and cmake-build-*/, which is skipped in secure mode.",
94
+ "Path to the compile_commands.json of a C/C++ build, or a directory holding one, for atom to parse each file as its build does. Overrides the lookup in the project root and its build directories (those of the CMake presets, build*/, out/, builddir/, cmake-build-*/), which is skipped in secure mode.",
95
95
  type: "string",
96
96
  })
97
97
  .option("golem-command", {
@@ -226,6 +226,11 @@ const args = yargs(hideBin(process.argv))
226
226
  default: false,
227
227
  type: "boolean",
228
228
  })
229
+ .option("install-deps", {
230
+ description:
231
+ "Let evinse run the project's own build tools, such as Maven and SwiftPM, to collect evidence. On by default, and off in secure mode. Pass --no-install-deps for projects you do not trust.",
232
+ type: "boolean",
233
+ })
229
234
  .option("with-deep-jar-collector", {
230
235
  description:
231
236
  "Enable collection of all jars from maven cache directory. Useful to improve the recall for callstack evidence.",
@@ -264,6 +269,23 @@ const args = yargs(hideBin(process.argv))
264
269
  description: "Use an existing usages slices file.",
265
270
  default: "usages.slices.json",
266
271
  })
272
+ .option("scalasem-command", {
273
+ description:
274
+ "Use a specific scalasem script for Scala evidence analysis. Defaults to SCALASEM_CMD.",
275
+ default: readEnvironmentVariable("SCALASEM_CMD"),
276
+ })
277
+ .option("scalasem-include-tests", {
278
+ description:
279
+ "Include test sources in the Scala semantic evidence, tagged with their usage scope.",
280
+ default: false,
281
+ type: "boolean",
282
+ })
283
+ .option("scalasem", {
284
+ description:
285
+ "Run the Scala semantic analyzer for Scala projects. Use --no-scalasem to skip it and keep the plain BOM.",
286
+ default: true,
287
+ type: "boolean",
288
+ })
267
289
  .option("data-flow-slices-file", {
268
290
  description: "Use an existing data-flow slices file.",
269
291
  default: "data-flow.slices.json",
package/bin/hbom.js CHANGED
@@ -26,7 +26,10 @@ import {
26
26
  ensureSupportedHbomSpecVersion,
27
27
  hasHbomProjectType,
28
28
  } from "../lib/inventory/hbom.js";
29
- import { getHbomSummary } from "../lib/inventory/hbomAnalysis.js";
29
+ import {
30
+ getHbomPrivilegeGuidance,
31
+ getHbomSummary,
32
+ } from "../lib/inventory/hbomAnalysis.js";
30
33
  import {
31
34
  importProtobomModule,
32
35
  isProtoBomPath,
@@ -130,12 +133,13 @@ const args = _yargs
130
133
  })
131
134
  .option("privileged", {
132
135
  description:
133
- "Enable privileged Linux enrichment and non-interactive sudo retries for documented permission-sensitive commands.",
136
+ "Enable privileged enrichment for documented permission-sensitive sources. Linux: privileged enrichment and non-interactive sudo retries. Windows: the TPM, BitLocker, storage-reliability and Secure Boot batch, which only an already-elevated (Run as administrator) session can read; HBOM never prompts for UAC and records permission-denied diagnostics otherwise. No effect on macOS.",
134
137
  type: "boolean",
135
138
  default: false,
136
139
  })
137
140
  .option("plist-enrichment", {
138
- description: "Enable additional Darwin plist-based enrichment.",
141
+ description:
142
+ "Enable additional plist-based enrichment. Darwin only; ignored on Linux and Windows.",
139
143
  type: "boolean",
140
144
  default: false,
141
145
  })
@@ -172,7 +176,10 @@ const args = _yargs
172
176
  ["$0", "Generate an HBOM file for the current host"],
173
177
  ["$0 -p", "Print the generated HBOM to stdout"],
174
178
  ["$0 --platform linux --arch amd64", "Override target selection"],
175
- ["$0 --privileged --pretty", "Enable privileged Linux enrichment"],
179
+ [
180
+ "$0 --privileged --pretty",
181
+ "Enable privileged enrichment: sudo retries on Linux, the elevated-only batch on Windows (run from an administrator prompt)",
182
+ ],
176
183
  [
177
184
  "$0 diagnostics",
178
185
  "Run a live HBOM diagnostic pass and summarize missing commands or permission-sensitive enrichments",
@@ -226,6 +233,9 @@ const options = {
226
233
  arch: args.arch,
227
234
  command: selectedCommand,
228
235
  commandName: hbomCommandName,
236
+ // yargs turns `--no-command-enrichment` into `commandEnrichment: false` and
237
+ // leaves `noCommandEnrichment` at its default, so forward both spellings.
238
+ commandEnrichment: args.commandEnrichment,
229
239
  dryRun: args.dryRun,
230
240
  input: args.input ? resolve(args.input) : undefined,
231
241
  noCommandEnrichment: args.noCommandEnrichment,
@@ -420,9 +430,7 @@ function printHbomDiagnosticsReport(bomJson) {
420
430
  }
421
431
 
422
432
  if (hbomSummary.requiresPrivilegedEnrichment) {
423
- console.log(
424
- "\nSome Linux enrichments can likely succeed only with --privileged and a target environment that allows non-interactive sudo.",
425
- );
433
+ console.log(`\n${getHbomPrivilegeGuidance(hbomSummary.platform)}`);
426
434
  }
427
435
  }
428
436
 
package/bin/repl.js CHANGED
@@ -25,6 +25,8 @@ import {
25
25
  printAiBomPedigree,
26
26
  printAiBomVariants,
27
27
  printCallStack,
28
+ printCertificateChain,
29
+ printCertificatesTable,
28
30
  printDependencyTree,
29
31
  printFormulation,
30
32
  printOccurrences,
@@ -1224,6 +1226,32 @@ cdxgenRepl.defineCommand("cryptos", {
1224
1226
  this.displayPrompt();
1225
1227
  },
1226
1228
  });
1229
+ cdxgenRepl.defineCommand("certs", {
1230
+ help: "print the certificate components with role, issuer, expiry and SPKI prefix",
1231
+ action() {
1232
+ if (sbom) {
1233
+ printCertificatesTable(sbom);
1234
+ } else {
1235
+ console.log(
1236
+ "⚠ No BOM is loaded. Use .import command to import an existing BOM",
1237
+ );
1238
+ }
1239
+ this.displayPrompt();
1240
+ },
1241
+ });
1242
+ cdxgenRepl.defineCommand("certchain", {
1243
+ help: "show the issuer chain above a certificate and the certificates issued under it (.certchain <bom-ref|spki-prefix|cert-prefix>)",
1244
+ action(selector) {
1245
+ if (sbom) {
1246
+ printCertificateChain(sbom, selector);
1247
+ } else {
1248
+ console.log(
1249
+ "⚠ No BOM is loaded. Use .import command to import an existing BOM",
1250
+ );
1251
+ }
1252
+ this.displayPrompt();
1253
+ },
1254
+ });
1227
1255
  cdxgenRepl.defineCommand("sourcecryptos", {
1228
1256
  help: "show source-derived cryptographic assets detected from JS AST analysis",
1229
1257
  action() {
@@ -1741,6 +1769,92 @@ cdxgenRepl.defineCommand("golemcoverage", {
1741
1769
  this.displayPrompt();
1742
1770
  },
1743
1771
  });
1772
+ function hasScalasemProperties(component) {
1773
+ return Boolean(
1774
+ component?.properties?.some((property) =>
1775
+ property?.name?.startsWith("cdx:scalasem:"),
1776
+ ),
1777
+ );
1778
+ }
1779
+
1780
+ cdxgenRepl.defineCommand("scalasemsummary", {
1781
+ help: "summarize Scala Evinse/scalasem metadata and evidence coverage",
1782
+ action() {
1783
+ const interactiveBom = getInteractiveBom();
1784
+ if (!interactiveBom) {
1785
+ console.log("⚠ No BOM is loaded. Use .import command to import an SBOM");
1786
+ this.displayPrompt();
1787
+ return;
1788
+ }
1789
+ if (!hasScalasemProperties(interactiveBom.metadata?.component)) {
1790
+ console.log(
1791
+ "No scalasem properties found. Generate an evidence BOM with evinse -l scala or cdxgen --evidence to use this view.",
1792
+ );
1793
+ this.displayPrompt();
1794
+ return;
1795
+ }
1796
+ const rootComponent = interactiveBom.metadata?.component || {};
1797
+ const components = interactiveBom.components || [];
1798
+ const occurrences = components.reduce(
1799
+ (total, component) =>
1800
+ total + (component?.evidence?.occurrences?.length || 0),
1801
+ 0,
1802
+ );
1803
+ const occurrencesWithLine = components.reduce(
1804
+ (total, component) =>
1805
+ total +
1806
+ (component?.evidence?.occurrences || []).filter(
1807
+ (occurrence) => occurrence?.line,
1808
+ ).length,
1809
+ 0,
1810
+ );
1811
+ const callstacks = components.filter(
1812
+ (component) => component?.evidence?.callstack?.frames?.length,
1813
+ ).length;
1814
+ const cryptoAssets = components.filter(
1815
+ (component) => component?.type === "cryptographic-asset",
1816
+ ).length;
1817
+ printKeyValueTable("Scala Evinse / scalasem summary", [
1818
+ [
1819
+ "Schema version",
1820
+ getPropertyValue(rootComponent, "cdx:scalasem:schemaVersion"),
1821
+ ],
1822
+ [
1823
+ "Facts source",
1824
+ getPropertyValue(rootComponent, "cdx:scalasem:factsSource"),
1825
+ ],
1826
+ [
1827
+ "Scala versions",
1828
+ getPropertyValue(rootComponent, "cdx:scalasem:scalaVersions"),
1829
+ ],
1830
+ ["Platforms", getPropertyValue(rootComponent, "cdx:scalasem:platforms")],
1831
+ [
1832
+ "Files analyzed",
1833
+ getPropertyValue(rootComponent, "cdx:scalasem:filesAnalyzed"),
1834
+ ],
1835
+ ["Degraded", getPropertyValue(rootComponent, "cdx:scalasem:degraded")],
1836
+ ...(rootComponent.properties || [])
1837
+ .filter((property) =>
1838
+ property?.name?.startsWith("cdx:scalasem:diagnostic:"),
1839
+ )
1840
+ .map((property) => [
1841
+ `Diagnostic ${property.name.slice("cdx:scalasem:diagnostic:".length)}`,
1842
+ property.value,
1843
+ ]),
1844
+ [
1845
+ "Components with occurrences",
1846
+ components.filter((c) => c?.evidence?.occurrences?.length).length,
1847
+ ],
1848
+ ["Occurrences", occurrences],
1849
+ ["Occurrences with line", occurrencesWithLine],
1850
+ ["Components with call stacks", callstacks],
1851
+ ["Crypto assets", cryptoAssets],
1852
+ ["Services", (interactiveBom.services || []).length],
1853
+ ]);
1854
+ this.displayPrompt();
1855
+ },
1856
+ });
1857
+
1744
1858
  cdxgenRepl.defineCommand("auditfindings", {
1745
1859
  help: "summarize cdx-audit and bom-audit annotations from the loaded BOM",
1746
1860
  action() {
@@ -2117,6 +2231,7 @@ cdxgenRepl.defineCommand("tagcloud", {
2117
2231
  });
2118
2232
  // Let's dynamically define more commands from the queries
2119
2233
  [
2234
+ "apk_packages",
2120
2235
  "apt_sources",
2121
2236
  "behavioral_reverse_shell",
2122
2237
  "certificates",