@cdxgen/cdxgen 13.4.0 → 13.6.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 (305) hide show
  1. package/README.md +9 -9
  2. package/bin/cdxgen-secure.js +15 -0
  3. package/bin/cdxgen.js +29 -5
  4. package/bin/evinse.js +8 -0
  5. package/bin/hbom.js +15 -7
  6. package/bin/repl.js +29 -0
  7. package/bin/validate.js +6 -0
  8. package/data/cbomosdb-queries.json +13 -1
  9. package/data/component-tags.json +8 -0
  10. package/data/license-aliases.json +24 -2
  11. package/data/queries-darwin.json +25 -1
  12. package/data/queries-win.json +19 -1
  13. package/data/queries.json +41 -0
  14. package/data/remediations.json +407 -1
  15. package/data/rules/ai-bom.yaml +1 -1
  16. package/data/rules/brotli-decoder.yaml +107 -0
  17. package/data/rules/cbom-security.yaml +235 -4
  18. package/data/rules/go-binaries.yaml +46 -0
  19. package/data/rules/golem-go.yaml +80 -0
  20. package/data/rules/hbom-compliance.yaml +40 -22
  21. package/data/rules/hbom-performance.yaml +7 -1
  22. package/data/rules/host-topology.yaml +1 -1
  23. package/data/rules/obom-runtime.yaml +31 -2
  24. package/data/rules/php-runtime.yaml +143 -0
  25. package/data/rules/vscode-extensions.yaml +75 -0
  26. package/data/spdx-license-list.json +121 -7
  27. package/data/spdx-licenses.json +69 -0
  28. package/data/spdx.schema.json +845 -2
  29. package/lib/audit/index.js +14 -0
  30. package/lib/cli/bomAssembly.js +120 -6
  31. package/lib/cli/cliOptions.js +110 -3
  32. package/lib/cli/index.js +182 -6
  33. package/lib/cli/jsBom.js +153 -64
  34. package/lib/cli/jvmBom.js +363 -66
  35. package/lib/cli/managedBom.js +853 -87
  36. package/lib/cli/nativeBom.js +267 -33
  37. package/lib/core/boundedFile.js +344 -0
  38. package/lib/core/brotliProbe.js +182 -0
  39. package/lib/core/env.js +38 -8
  40. package/lib/core/fs.js +40 -19
  41. package/lib/core/httpClient.js +172 -46
  42. package/lib/core/lockPaths.js +38 -0
  43. package/lib/core/paths.js +24 -1
  44. package/lib/core/processTree.js +5 -0
  45. package/lib/core/projectConfig.js +1 -0
  46. package/lib/core/projectTooling.js +97 -0
  47. package/lib/core/propertySanitizer.js +72 -0
  48. package/lib/core/toolRegistry.js +170 -0
  49. package/lib/ecosystems/cppEvidence.js +263 -106
  50. package/lib/ecosystems/cppIncludeResolver.js +16 -5
  51. package/lib/ecosystems/ecosystems.js +25 -10
  52. package/lib/ecosystems/gemHostProbe.js +301 -0
  53. package/lib/ecosystems/golem.js +550 -6
  54. package/lib/ecosystems/gradleutils.js +858 -244
  55. package/lib/ecosystems/parsers-bazel.js +107 -6
  56. package/lib/ecosystems/parsers-dotnet.js +117 -18
  57. package/lib/ecosystems/parsers-go.js +1090 -367
  58. package/lib/ecosystems/parsers-js.js +505 -22
  59. package/lib/ecosystems/parsers-jvm.js +259 -17
  60. package/lib/ecosystems/parsers-misc.js +438 -64
  61. package/lib/ecosystems/parsers-python.js +100 -12
  62. package/lib/ecosystems/pythonutils.js +128 -2
  63. package/lib/ecosystems/rubyutils.js +544 -34
  64. package/lib/ecosystems/rusi.js +10 -0
  65. package/lib/ecosystems/scalacliutils.js +4 -1
  66. package/lib/ecosystems/scalasem.js +798 -151
  67. package/lib/ecosystems/vendoredCode.js +237 -3
  68. package/lib/ecosystems/venvProbe.js +360 -0
  69. package/lib/evinser/evinser.js +472 -61
  70. package/lib/evinser/swiftsem.js +68 -5
  71. package/lib/helpers/agenticToolutils.js +413 -93
  72. package/lib/helpers/vsixutils.js +1574 -315
  73. package/lib/inventory/agentSkillSpec.js +17 -0
  74. package/lib/inventory/apkInstalledDb.js +243 -0
  75. package/lib/inventory/atomUtils.js +110 -0
  76. package/lib/inventory/auditCategories.js +3 -3
  77. package/lib/inventory/brotliDecoder.js +142 -0
  78. package/lib/inventory/buildToolRateLimit.js +1 -1
  79. package/lib/inventory/cacheDir.js +52 -9
  80. package/lib/inventory/cbomutils.js +56 -7
  81. package/lib/inventory/certificates.js +2371 -0
  82. package/lib/inventory/communityAiConfigParser.js +4 -9
  83. package/lib/inventory/deps.js +41 -4
  84. package/lib/inventory/display.js +200 -3
  85. package/lib/inventory/dosai.js +639 -63
  86. package/lib/inventory/dotnetRuntime.js +217 -0
  87. package/lib/inventory/dynamic.js +45 -3
  88. package/lib/inventory/envcontext.js +475 -18
  89. package/lib/inventory/evidenceUtils.js +447 -23
  90. package/lib/inventory/fetchBatch.js +1 -1
  91. package/lib/inventory/formulationParsers.js +32 -3
  92. package/lib/inventory/goBuildInfo.js +140 -0
  93. package/lib/inventory/gtfobins.js +13 -0
  94. package/lib/inventory/hbom.js +67 -7
  95. package/lib/inventory/hbomAnalysis.js +16 -0
  96. package/lib/inventory/hostRuntimeProbe.js +686 -0
  97. package/lib/inventory/hostTopology.js +21 -0
  98. package/lib/inventory/jvmLocalRepos.js +9 -2
  99. package/lib/inventory/jvmToolEnv.js +29 -0
  100. package/lib/inventory/licenseEnhancer.js +12 -0
  101. package/lib/inventory/mavenCentralMirror.js +534 -0
  102. package/lib/inventory/nodeBuildInfo.js +218 -0
  103. package/lib/inventory/nodeHostProbe.js +202 -0
  104. package/lib/inventory/osPackagePurl.js +244 -0
  105. package/lib/inventory/osPackageResolver.js +271 -87
  106. package/lib/inventory/osinfo.js +79 -31
  107. package/lib/inventory/osqueryTransform.js +114 -5
  108. package/lib/inventory/phpBuildInfo.js +438 -0
  109. package/lib/inventory/phpHostProbe.js +185 -0
  110. package/lib/inventory/rootfsCerts.js +426 -0
  111. package/lib/inventory/rubyBuildInfo.js +972 -0
  112. package/lib/inventory/rubyHostProbe.js +218 -0
  113. package/lib/inventory/scalaCoords.js +4 -3
  114. package/lib/inventory/scalaDedupe.js +440 -0
  115. package/lib/inventory/source.js +256 -5
  116. package/lib/inventory/spdx.js +144 -0
  117. package/lib/inventory/traceRunner.js +5 -1
  118. package/lib/inventory/tracedCrypto.js +129 -0
  119. package/lib/managers/binary.js +866 -186
  120. package/lib/managers/docker.js +245 -12
  121. package/lib/parsers/email.js +277 -0
  122. package/lib/parsers/largeJson.js +62 -13
  123. package/lib/parsers/vscodeExtensionId.js +183 -0
  124. package/lib/server/server.js +198 -2
  125. package/lib/stages/postgen/annotator.js +17 -1
  126. package/lib/stages/postgen/introspection/reflect.js +4 -1
  127. package/lib/stages/postgen/postgen.js +5 -5
  128. package/lib/stages/postgen/ruleEngine.js +71 -6
  129. package/lib/stages/postgen/specVersionCompat.js +30 -0
  130. package/lib/stages/pregen/envAudit.js +1 -0
  131. package/lib/stages/pregen/pregen.js +231 -62
  132. package/lib/validator/bomValidator.js +32 -6
  133. package/lib/validator/generated/runtime.mjs +13 -0
  134. package/lib/validator/generated/validate-1.6.mjs +27 -8
  135. package/lib/validator/generated/validate-1.7.mjs +32 -13
  136. package/lib/validator/generated/validate-2.0.mjs +31 -12
  137. package/lib/validator/index.js +1 -1
  138. package/package.json +19 -18
  139. package/types/bin/cdxgen-secure.d.ts +3 -0
  140. package/types/bin/cdxgen-secure.d.ts.map +1 -0
  141. package/types/bin/repl.d.ts.map +1 -1
  142. package/types/lib/audit/index.d.ts.map +1 -1
  143. package/types/lib/cli/bomAssembly.d.ts +22 -3
  144. package/types/lib/cli/bomAssembly.d.ts.map +1 -1
  145. package/types/lib/cli/cliOptions.d.ts +43 -0
  146. package/types/lib/cli/cliOptions.d.ts.map +1 -1
  147. package/types/lib/cli/index.d.ts.map +1 -1
  148. package/types/lib/cli/jsBom.d.ts +1 -17
  149. package/types/lib/cli/jsBom.d.ts.map +1 -1
  150. package/types/lib/cli/jvmBom.d.ts +20 -0
  151. package/types/lib/cli/jvmBom.d.ts.map +1 -1
  152. package/types/lib/cli/managedBom.d.ts.map +1 -1
  153. package/types/lib/cli/nativeBom.d.ts.map +1 -1
  154. package/types/lib/core/boundedFile.d.ts +70 -0
  155. package/types/lib/core/boundedFile.d.ts.map +1 -0
  156. package/types/lib/core/brotliProbe.d.ts +37 -0
  157. package/types/lib/core/brotliProbe.d.ts.map +1 -0
  158. package/types/lib/core/env.d.ts +22 -2
  159. package/types/lib/core/env.d.ts.map +1 -1
  160. package/types/lib/core/fs.d.ts.map +1 -1
  161. package/types/lib/core/httpClient.d.ts +24 -0
  162. package/types/lib/core/httpClient.d.ts.map +1 -1
  163. package/types/lib/core/lockPaths.d.ts +19 -0
  164. package/types/lib/core/lockPaths.d.ts.map +1 -0
  165. package/types/lib/core/processTree.d.ts +2 -0
  166. package/types/lib/core/processTree.d.ts.map +1 -1
  167. package/types/lib/core/projectConfig.d.ts.map +1 -1
  168. package/types/lib/core/projectTooling.d.ts +41 -0
  169. package/types/lib/core/projectTooling.d.ts.map +1 -0
  170. package/types/lib/core/propertySanitizer.d.ts +26 -0
  171. package/types/lib/core/propertySanitizer.d.ts.map +1 -1
  172. package/types/lib/core/toolRegistry.d.ts +36 -0
  173. package/types/lib/core/toolRegistry.d.ts.map +1 -0
  174. package/types/lib/ecosystems/cppEvidence.d.ts +40 -13
  175. package/types/lib/ecosystems/cppEvidence.d.ts.map +1 -1
  176. package/types/lib/ecosystems/cppIncludeResolver.d.ts +2 -1
  177. package/types/lib/ecosystems/cppIncludeResolver.d.ts.map +1 -1
  178. package/types/lib/ecosystems/ecosystems.d.ts.map +1 -1
  179. package/types/lib/ecosystems/gemHostProbe.d.ts +28 -0
  180. package/types/lib/ecosystems/gemHostProbe.d.ts.map +1 -0
  181. package/types/lib/ecosystems/golem.d.ts +81 -1
  182. package/types/lib/ecosystems/golem.d.ts.map +1 -1
  183. package/types/lib/ecosystems/gradleutils.d.ts +57 -21
  184. package/types/lib/ecosystems/gradleutils.d.ts.map +1 -1
  185. package/types/lib/ecosystems/parsers-bazel.d.ts.map +1 -1
  186. package/types/lib/ecosystems/parsers-dotnet.d.ts +40 -4
  187. package/types/lib/ecosystems/parsers-dotnet.d.ts.map +1 -1
  188. package/types/lib/ecosystems/parsers-go.d.ts +85 -13
  189. package/types/lib/ecosystems/parsers-go.d.ts.map +1 -1
  190. package/types/lib/ecosystems/parsers-js.d.ts +17 -20
  191. package/types/lib/ecosystems/parsers-js.d.ts.map +1 -1
  192. package/types/lib/ecosystems/parsers-jvm.d.ts +28 -2
  193. package/types/lib/ecosystems/parsers-jvm.d.ts.map +1 -1
  194. package/types/lib/ecosystems/parsers-misc.d.ts +37 -58
  195. package/types/lib/ecosystems/parsers-misc.d.ts.map +1 -1
  196. package/types/lib/ecosystems/parsers-python.d.ts +14 -3
  197. package/types/lib/ecosystems/parsers-python.d.ts.map +1 -1
  198. package/types/lib/ecosystems/pythonutils.d.ts +19 -1
  199. package/types/lib/ecosystems/pythonutils.d.ts.map +1 -1
  200. package/types/lib/ecosystems/rubyutils.d.ts +144 -12
  201. package/types/lib/ecosystems/rubyutils.d.ts.map +1 -1
  202. package/types/lib/ecosystems/rusi.d.ts.map +1 -1
  203. package/types/lib/ecosystems/scalacliutils.d.ts.map +1 -1
  204. package/types/lib/ecosystems/scalasem.d.ts.map +1 -1
  205. package/types/lib/ecosystems/vendoredCode.d.ts +26 -0
  206. package/types/lib/ecosystems/vendoredCode.d.ts.map +1 -1
  207. package/types/lib/ecosystems/venvProbe.d.ts +40 -0
  208. package/types/lib/ecosystems/venvProbe.d.ts.map +1 -0
  209. package/types/lib/evinser/evinser.d.ts +88 -8
  210. package/types/lib/evinser/evinser.d.ts.map +1 -1
  211. package/types/lib/evinser/swiftsem.d.ts +10 -0
  212. package/types/lib/evinser/swiftsem.d.ts.map +1 -1
  213. package/types/lib/inventory/agentSkillSpec.d.ts +13 -0
  214. package/types/lib/inventory/agentSkillSpec.d.ts.map +1 -0
  215. package/types/lib/inventory/apkInstalledDb.d.ts +42 -0
  216. package/types/lib/inventory/apkInstalledDb.d.ts.map +1 -0
  217. package/types/lib/inventory/atomUtils.d.ts +33 -0
  218. package/types/lib/inventory/atomUtils.d.ts.map +1 -1
  219. package/types/lib/inventory/brotliDecoder.d.ts +58 -0
  220. package/types/lib/inventory/brotliDecoder.d.ts.map +1 -0
  221. package/types/lib/inventory/cacheDir.d.ts +12 -4
  222. package/types/lib/inventory/cacheDir.d.ts.map +1 -1
  223. package/types/lib/inventory/cbomutils.d.ts +17 -0
  224. package/types/lib/inventory/cbomutils.d.ts.map +1 -1
  225. package/types/lib/inventory/certificates.d.ts +205 -0
  226. package/types/lib/inventory/certificates.d.ts.map +1 -0
  227. package/types/lib/inventory/communityAiConfigParser.d.ts.map +1 -1
  228. package/types/lib/inventory/deps.d.ts +2 -1
  229. package/types/lib/inventory/deps.d.ts.map +1 -1
  230. package/types/lib/inventory/display.d.ts +18 -0
  231. package/types/lib/inventory/display.d.ts.map +1 -1
  232. package/types/lib/inventory/dosai.d.ts +162 -7
  233. package/types/lib/inventory/dosai.d.ts.map +1 -1
  234. package/types/lib/inventory/dotnetRuntime.d.ts +44 -0
  235. package/types/lib/inventory/dotnetRuntime.d.ts.map +1 -0
  236. package/types/lib/inventory/dynamic.d.ts +6 -1
  237. package/types/lib/inventory/dynamic.d.ts.map +1 -1
  238. package/types/lib/inventory/envcontext.d.ts +92 -8
  239. package/types/lib/inventory/envcontext.d.ts.map +1 -1
  240. package/types/lib/inventory/evidenceUtils.d.ts +29 -10
  241. package/types/lib/inventory/evidenceUtils.d.ts.map +1 -1
  242. package/types/lib/inventory/formulationParsers.d.ts.map +1 -1
  243. package/types/lib/inventory/goBuildInfo.d.ts +10 -0
  244. package/types/lib/inventory/goBuildInfo.d.ts.map +1 -0
  245. package/types/lib/inventory/gtfobins.d.ts.map +1 -1
  246. package/types/lib/inventory/hbom.d.ts.map +1 -1
  247. package/types/lib/inventory/hbomAnalysis.d.ts +10 -0
  248. package/types/lib/inventory/hbomAnalysis.d.ts.map +1 -1
  249. package/types/lib/inventory/hostRuntimeProbe.d.ts +44 -0
  250. package/types/lib/inventory/hostRuntimeProbe.d.ts.map +1 -0
  251. package/types/lib/inventory/hostTopology.d.ts.map +1 -1
  252. package/types/lib/inventory/jvmToolEnv.d.ts +12 -0
  253. package/types/lib/inventory/jvmToolEnv.d.ts.map +1 -1
  254. package/types/lib/inventory/licenseEnhancer.d.ts.map +1 -1
  255. package/types/lib/inventory/mavenCentralMirror.d.ts +170 -0
  256. package/types/lib/inventory/mavenCentralMirror.d.ts.map +1 -0
  257. package/types/lib/inventory/nodeBuildInfo.d.ts +95 -0
  258. package/types/lib/inventory/nodeBuildInfo.d.ts.map +1 -0
  259. package/types/lib/inventory/nodeHostProbe.d.ts +15 -0
  260. package/types/lib/inventory/nodeHostProbe.d.ts.map +1 -0
  261. package/types/lib/inventory/osPackagePurl.d.ts +99 -0
  262. package/types/lib/inventory/osPackagePurl.d.ts.map +1 -0
  263. package/types/lib/inventory/osPackageResolver.d.ts +44 -2
  264. package/types/lib/inventory/osPackageResolver.d.ts.map +1 -1
  265. package/types/lib/inventory/osinfo.d.ts +31 -6
  266. package/types/lib/inventory/osinfo.d.ts.map +1 -1
  267. package/types/lib/inventory/osqueryTransform.d.ts +51 -0
  268. package/types/lib/inventory/osqueryTransform.d.ts.map +1 -1
  269. package/types/lib/inventory/phpBuildInfo.d.ts +142 -0
  270. package/types/lib/inventory/phpBuildInfo.d.ts.map +1 -0
  271. package/types/lib/inventory/phpHostProbe.d.ts +35 -0
  272. package/types/lib/inventory/phpHostProbe.d.ts.map +1 -0
  273. package/types/lib/inventory/rootfsCerts.d.ts +27 -0
  274. package/types/lib/inventory/rootfsCerts.d.ts.map +1 -0
  275. package/types/lib/inventory/rubyBuildInfo.d.ts +271 -0
  276. package/types/lib/inventory/rubyBuildInfo.d.ts.map +1 -0
  277. package/types/lib/inventory/rubyHostProbe.d.ts +47 -0
  278. package/types/lib/inventory/rubyHostProbe.d.ts.map +1 -0
  279. package/types/lib/inventory/source.d.ts +38 -0
  280. package/types/lib/inventory/source.d.ts.map +1 -1
  281. package/types/lib/inventory/spdx.d.ts +15 -0
  282. package/types/lib/inventory/spdx.d.ts.map +1 -1
  283. package/types/lib/inventory/traceRunner.d.ts +4 -1
  284. package/types/lib/inventory/traceRunner.d.ts.map +1 -1
  285. package/types/lib/inventory/tracedCrypto.d.ts +22 -0
  286. package/types/lib/inventory/tracedCrypto.d.ts.map +1 -1
  287. package/types/lib/managers/binary.d.ts +10 -0
  288. package/types/lib/managers/binary.d.ts.map +1 -1
  289. package/types/lib/managers/docker.d.ts +24 -0
  290. package/types/lib/managers/docker.d.ts.map +1 -1
  291. package/types/lib/parsers/email.d.ts +19 -0
  292. package/types/lib/parsers/email.d.ts.map +1 -0
  293. package/types/lib/parsers/largeJson.d.ts +17 -3
  294. package/types/lib/parsers/largeJson.d.ts.map +1 -1
  295. package/types/lib/server/server.d.ts +8 -0
  296. package/types/lib/server/server.d.ts.map +1 -1
  297. package/types/lib/stages/postgen/annotator.d.ts.map +1 -1
  298. package/types/lib/stages/postgen/introspection/reflect.d.ts.map +1 -1
  299. package/types/lib/stages/postgen/ruleEngine.d.ts +7 -4
  300. package/types/lib/stages/postgen/ruleEngine.d.ts.map +1 -1
  301. package/types/lib/stages/postgen/specVersionCompat.d.ts.map +1 -1
  302. package/types/lib/stages/pregen/envAudit.d.ts.map +1 -1
  303. package/types/lib/stages/pregen/pregen.d.ts +26 -9
  304. package/types/lib/stages/pregen/pregen.d.ts.map +1 -1
  305. package/types/lib/validator/bomValidator.d.ts.map +1 -1
@@ -0,0 +1,95 @@
1
+ /**
2
+ * The most node-named files one scan opens in search of a build version.
3
+ *
4
+ * @type {number}
5
+ */
6
+ export declare const MAX_NODE_PROBES: number;
7
+ /**
8
+ * Whether a file name is one the Node.js runtime is installed under.
9
+ *
10
+ * @param {string} fileName basename or path of the candidate
11
+ * @returns {boolean} true for `node`, `nodejs` and `node.exe`
12
+ */
13
+ export declare function isNodeBinaryName(fileName: string): boolean;
14
+ /**
15
+ * Parse a Node.js version in the grammar the release tooling produces:
16
+ * `24.22.1`, `25.0.0-rc.1`, `26.0.0-nightly20260301abcdef`.
17
+ *
18
+ * @param {string} text candidate version, without the leading `v`
19
+ * @returns {string|undefined} the version, or undefined
20
+ */
21
+ export declare function parseNodeVersion(text: string): string | undefined;
22
+ /**
23
+ * Read the Node.js version a `node` binary was built as.
24
+ *
25
+ * @param {string} absPath absolute path of the binary
26
+ * @param {string|undefined} rootDir extracted root, when the file came from one
27
+ * @returns {{version: string, source: string, channel?: string}|undefined}
28
+ * source is `release-url` or `binary`
29
+ */
30
+ export declare function readNodeBuildVersion(absPath: string, rootDir: string | undefined): {
31
+ version: string;
32
+ source: string;
33
+ channel?: string;
34
+ } | undefined;
35
+ /**
36
+ * The CPE that lets a downstream scanner match a Node.js version. NVD names the
37
+ * product node.js and keeps a pre-release in the update field.
38
+ *
39
+ * @param {string} version Node.js version
40
+ * @returns {string} CPE 2.3 string
41
+ */
42
+ export declare function nodeCpe(version: string): string;
43
+ /**
44
+ * A Node.js runtime is one `platform` component per distinct version, like the
45
+ * PHP and Go stdlib components. Its identity is `pkg:generic/node`: it is only
46
+ * used where no package manager owns the runtime.
47
+ *
48
+ * @param {string} version Node.js version
49
+ * @returns {Object} component with `purl`, `bom-ref` and `cpe`
50
+ */
51
+ export declare function createNodeRuntimeComponent(version: string): Object;
52
+ /**
53
+ * The properties a node file component carries once its build is known.
54
+ *
55
+ * @param {{version: string, source: string, channel?: string}} build result of readNodeBuildVersion
56
+ * @returns {{name: string, value: string}[]} properties to append
57
+ */
58
+ export declare function nodeBuildProperties(build: {
59
+ version: string;
60
+ source: string;
61
+ channel?: string;
62
+ }): {
63
+ name: string;
64
+ value: string;
65
+ }[];
66
+ /**
67
+ * Start collecting the runtime components and edges of one scan.
68
+ *
69
+ * @returns {{runtimeComponents: Object[], dependencies: Object[], runtimeRefs: Set<string>}}
70
+ */
71
+ export declare function createNodeRuntimeInventory(): {
72
+ runtimeComponents: Object[];
73
+ dependencies: Object[];
74
+ runtimeRefs: Set<string>;
75
+ };
76
+ /**
77
+ * Tag a node file component with its build facts and link it to the runtime
78
+ * component of its version, creating that component on first use. Mutates the
79
+ * component in place.
80
+ *
81
+ * @param {{runtimeComponents: Object[], dependencies: Object[], runtimeRefs: Set<string>}} inventory
82
+ * accumulator from createNodeRuntimeInventory
83
+ * @param {Object} component file component, with a `properties` array
84
+ * @param {{version: string, source: string, channel?: string}} build result of readNodeBuildVersion
85
+ */
86
+ export declare function attachNodeBuild(inventory: {
87
+ runtimeComponents: Object[];
88
+ dependencies: Object[];
89
+ runtimeRefs: Set<string>;
90
+ }, component: Object, build: {
91
+ version: string;
92
+ source: string;
93
+ channel?: string;
94
+ }): void;
95
+ //# sourceMappingURL=nodeBuildInfo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nodeBuildInfo.d.ts","sourceRoot":"","sources":["../../../lib/inventory/nodeBuildInfo.js"],"names":[],"mappings":"AAgCA;;;;GAIG;AACH,eAAO,MAAM,eAAe,EAFlB,MAEuB,CAAC;AAElC;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAH9B,MAG8B,GAF5B,OAAO,CAQnB;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAH1B,MAG0B,GAFxB,MAAM,GAAC,SAAS,CAO5B;AA6BD;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EALjC,MAKiC,EAAE,OAAO,EAJ1C,MAAM,GAAC,SAImC,GAHxC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAC,GAAC,SAAS,CA+BzE;AAED;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,OAAO,EAHpB,MAGoB,GAFlB,MAAM,CASlB;AAED;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,EAHvC,MAGuC,GAFrC,MAAM,CAOlB;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAH9B;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAGpB,GAF5B;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAC,EAAE,CAW3C;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,IAF7B;IAAC,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAAC,YAAY,EAAE,MAAM,EAAE,CAAC;IAAC,WAAW,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;CAAC,CAI3F;AAED;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAL9B;IAAC,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAAC,YAAY,EAAE,MAAM,EAAE,CAAC;IAAC,WAAW,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;CAKhD,EAAE,SAAS,EAHzC,MAGyC,EAAE,KAAK,EAFhD;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAEF,QAkB1D"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Look for Node.js no package manager owns on the host. Components come back
3
+ * only for the files nothing owns: a `file` component for each `node` binary
4
+ * with the cdx:node and cdx:brotli properties, one `platform` component per
5
+ * Node.js version with its CPE, and the brotli component when a binary embeds
6
+ * a decoder.
7
+ *
8
+ * @param {Object} [options] probe options, as probeHostPhp takes them
9
+ * @returns {{components: Object[], dependencies: Object[]}}
10
+ */
11
+ export declare function probeHostNode(options?: Object): {
12
+ components: Object[];
13
+ dependencies: Object[];
14
+ };
15
+ //# sourceMappingURL=nodeHostProbe.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nodeHostProbe.d.ts","sourceRoot":"","sources":["../../../lib/inventory/nodeHostProbe.js"],"names":[],"mappings":"AA2JA;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,OAAO,AAHlC,CACA,EADQ,MAG+B,GAF7B;IAAC,UAAU,EAAE,MAAM,EAAE,CAAC;IAAC,YAAY,EAAE,MAAM,EAAE,CAAA;CAAC,CAsC1D"}
@@ -0,0 +1,99 @@
1
+ /**
2
+ * The purl types an OS scan builds from what a package manager reports.
3
+ * deb, rpm, apk and alpm belong to a distro; brew, macports, snap and flatpak
4
+ * belong to none. brew, macports, snap and flatpak are not purl-spec types;
5
+ * cdx-purl builds them as it builds `pkg:chocolatey`.
6
+ */
7
+ export declare const OS_PACKAGE_PURL_TYPES: Set<string>;
8
+ /**
9
+ * Whether a purl type is one of the OS package managers handled here.
10
+ *
11
+ * @param {string|undefined} type Purl type
12
+ * @returns {boolean} true for the types in OS_PACKAGE_PURL_TYPES
13
+ */
14
+ export declare function isOsPackagePurlType(type: string | undefined): boolean;
15
+ /**
16
+ * Whether a value names an architecture. rpm says `(none)` and trivy says
17
+ * `None` for a package that has none, such as an rpm's `gpg-pubkey` key record;
18
+ * neither is an architecture, and neither belongs in a purl.
19
+ *
20
+ * @param {string|undefined|null} arch Architecture as a package manager reports it
21
+ * @returns {boolean} true for a real architecture
22
+ */
23
+ export declare function isRealArchitecture(arch: string | undefined | null): boolean;
24
+ /**
25
+ * The epoch of an OS package, as the `epoch` qualifier carries it.
26
+ *
27
+ * An rpm keeps its epoch in a field of its own. A deb keeps it in its version
28
+ * (`2:93`), so the version is read first. Epoch 0 and no epoch are the same,
29
+ * and apk and Homebrew packages have none.
30
+ *
31
+ * @param {{type: string, version?: string, epoch?: string|number}} pkg Package
32
+ * @returns {string|undefined} The epoch without leading zeros, or undefined
33
+ */
34
+ export declare function osPackageEpoch(pkg: {
35
+ type: string;
36
+ version?: string;
37
+ epoch?: string | number;
38
+ }): string | undefined;
39
+ /**
40
+ * The version an OS package carries on its component and in its purl.
41
+ *
42
+ * - rpm: `[epoch:]version-release`, the form the container scan writes. The
43
+ * purl spec keeps the epoch out of an rpm version, but the container scan
44
+ * puts it in the version as well as in the `epoch` qualifier, and an OBOM must
45
+ * name the package the same way.
46
+ * - deb: the version exactly as dpkg reports it, epoch included.
47
+ * - macports: `version_revision`, the form `port installed` prints.
48
+ * - apk, alpm, brew, snap and flatpak: the version as it is. A pacman version
49
+ * already holds its epoch and release (`1:1.3.2-4`).
50
+ *
51
+ * @param {{type: string, version?: string, release?: string, epoch?: string|number, revision?: string|number}} pkg Package
52
+ * @returns {string} The version, or an empty string when the package has none
53
+ */
54
+ export declare function osPackageVersion(pkg: {
55
+ type: string;
56
+ version?: string;
57
+ release?: string;
58
+ epoch?: string | number;
59
+ revision?: string | number;
60
+ }): string;
61
+ /**
62
+ * Build the purl of an OS package.
63
+ *
64
+ * deb, rpm and apk purls take their vendor (`ubuntu`, `almalinux`, `alpine`,
65
+ * `wolfi`) and the `distro` and `distro_name` qualifiers from the distro, plus
66
+ * `arch` and `epoch` from the package. alpm purls take the vendor (`arch`,
67
+ * `manjaro`) and `arch` only: that is all the alpm type defines, and an Arch
68
+ * system is rolling, with no release to name. A qualifier with no value is
69
+ * left out. brew, macports and snap purls carry neither vendor nor qualifiers;
70
+ * a flatpak purl carries the `arch` and `branch` of the flatpak ref.
71
+ *
72
+ * @param {Object} pkg The package
73
+ * @param {string} pkg.type One of OS_PACKAGE_PURL_TYPES
74
+ * @param {string} pkg.name Package name; a flatpak's application ID
75
+ * @param {string} [pkg.version] deb: the dpkg version. rpm: the version tag only. apk: version-rN. macports: the version without its revision.
76
+ * @param {string} [pkg.release] rpm release tag
77
+ * @param {string|number} [pkg.epoch] rpm epoch tag
78
+ * @param {string|number} [pkg.revision] MacPorts revision
79
+ * @param {string} [pkg.arch] Package architecture
80
+ * @param {string} [pkg.branch] flatpak branch (`stable`, `48`)
81
+ * @param {{namespace?: string, distroId?: string, distroName?: string}} [distro]
82
+ * What getDistroInfo() reports; read from the host's os-release when left out
83
+ * @returns {string|null} The purl, or null when the parts do not form a valid one
84
+ */
85
+ export declare function buildOsPackagePurl(pkg: {
86
+ type: string;
87
+ name: string;
88
+ version?: string;
89
+ release?: string;
90
+ epoch?: string | number;
91
+ revision?: string | number;
92
+ arch?: string;
93
+ branch?: string;
94
+ }, distro?: {
95
+ namespace?: string;
96
+ distroId?: string;
97
+ distroName?: string;
98
+ }): string | null;
99
+ //# sourceMappingURL=osPackagePurl.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"osPackagePurl.d.ts","sourceRoot":"","sources":["../../../lib/inventory/osPackagePurl.js"],"names":[],"mappings":"AAiBA;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,aAShC,CAAC;AAEH;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAH7B,MAAM,GAAC,SAGsB,GAF3B,OAAO,CAInB;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAH5B,MAAM,GAAC,SAAS,GAAC,IAGW,GAF1B,OAAO,CAKnB;AAqCD;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAHvB;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,GAAC,MAAM,CAAA;CAG/B,GAFrB,MAAM,GAAC,SAAS,CAe5B;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAHzB;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,GAAC,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,GAAC,MAAM,CAAA;CAGzE,GAFvB,MAAM,CA6BlB;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAZnC;IAAoB,IAAI,EAAhB,MAAM,CACd;IAAoB,IAAI,EAAhB,MAAM,CACd;IAAqB,OAAO,AAA5B,CACA,EADQ,MAAM,CACd;IAAqB,OAAO,AAA5B,CACA,EADQ,MAAM,CACd;IAA4B,KAAK,AAAjC,CACA,EADQ,MAAM,GAAC,MAAM,CACrB;IAA4B,QAAQ,AAApC,CACA,EADQ,MAAM,GAAC,MAAM,CACrB;IAAqB,IAAI,AAAzB,CACA,EADQ,MAAM,CACd;IAAqB,MAAM,AAA3B,CACA,EADQ,MAAM,CACd;CAImC,EAAE,MAAM,AAJ3C,CAEA,EAFQ;IAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAIxB,GAFjC,MAAM,GAAC,IAAI,CA4DvB"}
@@ -7,13 +7,14 @@ export declare function _resetOsInfoCache(): void;
7
7
  * correctly computed purl with distro qualifiers derived from /etc/os-release.
8
8
  *
9
9
  * @param {string} filePath - Absolute path to the library file
10
- * @returns {{ name: string, version: string, arch: string, type: string, purl: string } | undefined}
10
+ * @returns {{ name: string, version: string, arch: string, type: string, epoch?: string, purl: string } | undefined}
11
11
  */
12
12
  export declare function resolvePackageForFile(filePath: string): {
13
13
  name: string;
14
14
  version: string;
15
15
  arch: string;
16
16
  type: string;
17
+ epoch?: string;
17
18
  purl: string;
18
19
  } | undefined;
19
20
  /**
@@ -42,8 +43,49 @@ export declare function collectExecutables(basePath: any, binPaths: any, exclude
42
43
  * @param ldConf {String} Config file used by ldconfig to locate additional paths
43
44
  * @param ldConfDirPattern {String} Config directory that can contain more .conf files for ldconfig
44
45
  * @param excludePaths {Array[String]} Container-relative paths that should be excluded from the result set
46
+ * @param extraLibGlobs {Array[String]} Extra container-relative globs for files
47
+ * the default paths miss, such as libphp*.so under Apache's modules
48
+ * directory. The existing globs are unchanged; this adds candidates only.
45
49
  *
46
50
  * @return {Array[String]} List of executables
47
51
  */
48
- export declare function collectSharedLibs(basePath: any, libPaths: any, ldConf: string, ldConfDirPattern: string, excludePaths?: any): any;
52
+ export declare function collectSharedLibs(basePath: any, libPaths: any, ldConf: string, ldConfDirPattern: string, excludePaths?: any, extraLibGlobs?: any): any;
53
+ /**
54
+ * The most native extension candidates one scan returns.
55
+ *
56
+ * @type {number}
57
+ */
58
+ export declare const MAX_NATIVE_EXTENSIONS: number;
59
+ /**
60
+ * Collect native extension modules under a root file system that the library
61
+ * collector does not see, leaving out paths a package database owns and paths
62
+ * already collected. Symlinks are not followed, so a link pointing out of the
63
+ * root is never listed.
64
+ *
65
+ * @param {string} basePath extracted root file system
66
+ * @param {string[]} [excludePaths] root-relative paths to leave out
67
+ * @returns {string[]} root-relative paths, sorted, capped at MAX_NATIVE_EXTENSIONS
68
+ */
69
+ export declare function collectNativeExtensions(basePath: string, excludePaths?: string[]): string[];
70
+ /**
71
+ * Mark language packages that an OS package installed. Alpine's py3-brotli
72
+ * ships a Brotli-1.1.0.dist-info that a Python scan reports as
73
+ * pkg:pypi/brotli@1.1.0, but a distro fixes it by backporting under the same
74
+ * upstream version, so a PyPI advisory range keeps matching after the fix. The
75
+ * `cdx:os:installedBy` property names the OS package that owns the
76
+ * installation record, so a consumer can judge the component by that package
77
+ * instead.
78
+ *
79
+ * A component is marked only when every installation record it was read from
80
+ * belongs to an OS package: a copy that pip put in a virtual environment
81
+ * beside the distro's is not the distro's to fix. Run it after duplicates
82
+ * merge, so that a merged component carries all of its records.
83
+ *
84
+ * @param {Object[]} components BOM components, mutated in place
85
+ * @param {Map<string, string>|undefined} ownerByPath root-relative file path to
86
+ * owning OS package bom-ref
87
+ * @param {string} [rootDir] extracted root, stripped from absolute source paths
88
+ * @returns {number} how many components were marked
89
+ */
90
+ export declare function markOsInstalledLanguagePackages(components: Object[], ownerByPath: Map<string, string> | undefined, rootDir?: string): number;
49
91
  //# sourceMappingURL=osPackageResolver.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"osPackageResolver.d.ts","sourceRoot":"","sources":["../../../lib/inventory/osPackageResolver.js"],"names":[],"mappings":"AAwBA;;GAEG;AACH,wBAAgB,iBAAiB,SAGhC;AA8ED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAHnC,MAGmC,GAFjC;IAAE,IAAI,EAAE,MAAM,CA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AAgB,iBAAiB,CAC/B,QAAQ,KAAA,EACR,QAAQ,KAAA,EACR,MAAM,QAAA,EACN,gBAAgB,QAAA,EAChB,YAAY,MAAK,EACjB,aAAa,MAAK,OAiGnB;AAkDD;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,EAFxB,MAE+B,CAAC;AAE1C;;;;;;;;;GASG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAJrC,MAIqC,EAAE,YAAY,AAH3D,CACA,EADQ,MAAM,EAGkD,GAFtD,MAAM,EAAE,CA8BpB;AAqCD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,+BAA+B,CAC7C,UAAU,EAPD,MAAM,EAOL,EACV,WAAW,EAPF,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAC,SAOlB,EACX,OAAO,AANN,CACA,EADQ,MAMF,GALI,MAAM,CAyDlB"}
@@ -46,14 +46,34 @@ export declare const OS_DISTRO_ALIAS: {
46
46
  "ubuntu-24.10": string;
47
47
  "ubuntu-25.04": string;
48
48
  "ubuntu-25.10": string;
49
+ "ubuntu-26.04": string;
50
+ "ubuntu-26.10": string;
49
51
  "debian-15": string;
50
52
  "debian-14": string;
51
53
  "debian-14.5": string;
52
54
  "debian-13": string;
55
+ "debian-13.7": string;
56
+ "debian-13.6": string;
53
57
  "debian-13.5": string;
58
+ "debian-13.4": string;
59
+ "debian-13.3": string;
60
+ "debian-13.2": string;
61
+ "debian-13.1": string;
54
62
  "debian-12": string;
55
- "debian-12.5": string;
63
+ "debian-12.15": string;
64
+ "debian-12.14": string;
65
+ "debian-12.13": string;
66
+ "debian-12.12": string;
67
+ "debian-12.11": string;
68
+ "debian-12.10": string;
69
+ "debian-12.9": string;
70
+ "debian-12.8": string;
71
+ "debian-12.7": string;
56
72
  "debian-12.6": string;
73
+ "debian-12.5": string;
74
+ "debian-12.4": string;
75
+ "debian-12.2": string;
76
+ "debian-12.1": string;
57
77
  "debian-11": string;
58
78
  "debian-11.5": string;
59
79
  "debian-10": string;
@@ -179,15 +199,20 @@ export declare function _resetOsReleaseCache(): void;
179
199
  * Derive structured distro information from an os-release file.
180
200
  *
181
201
  * Returns an object with:
182
- * - purlType {string} "deb" | "apk" | "rpm"
202
+ * - purlType {string} "deb" | "apk" | "rpm" | "alpm" (Arch and the
203
+ * distros built on it)
183
204
  * - namespace {string} canonical purl namespace (e.g. "ubuntu", "alpine",
184
205
  * "azure-linux" for both Azure Linux and CBL-Mariner)
185
206
  * - distroId {string} ID + "-" + VERSION_ID with a canonical vendor
186
- * prefix (e.g. "ubuntu-22.04", "azure-linux-3.0")
187
- * - distroName {string} codename/alias (e.g. "jammy")
207
+ * prefix (e.g. "ubuntu-22.04", "azure-linux-3.0",
208
+ * "alpine-3.24.3")
209
+ * - distroName {string} release codename, or a token OS_DISTRO_ALIAS knows
210
+ * (e.g. "jammy", "rhel", "alpine-3.24"); empty when
211
+ * the distro has neither
188
212
  *
189
- * Mirrors the logic in lib/managers/binary.js getOSPackages() so that both
190
- * callers share a single implementation.
213
+ * lib/managers/binary.js getOSPackages() reads its distro from here, so a
214
+ * container scan and an OBOM run on the same system give a package the same
215
+ * `distro` and `distro_name` qualifiers.
191
216
  *
192
217
  * @param {string} [root="/"] - Filesystem root to look for os-release.
193
218
  * @returns {{ purlType: string, namespace: string, distroId: string, distroName: string }}
@@ -1 +1 @@
1
- {"version":3,"file":"osinfo.d.ts","sourceRoot":"","sources":["../../../lib/inventory/osinfo.js"],"names":[],"mappings":"AAGA;;;GAGG;AACH,eAAO,MAAM,eAAe;IAC1B,aAAa;IACb,aAAa;IACb,aAAa;IACb,aAAa;IACb,aAAa;IACb,aAAa;IACb,aAAa;IACb,aAAa;IACb,aAAa;IACb,aAAa;IACb,aAAa;IACb,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cA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,MAI6B,GAF3B,MAAM,CAqClB;AAGD;;GAEG;AACH,wBAAgB,oBAAoB,SAEnC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,aAAa,CAAC,IAAI,AAH/B,CACA,EADQ,MAG6B,GAF3B;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CAkHzF"}
1
+ {"version":3,"file":"osinfo.d.ts","sourceRoot":"","sources":["../../../lib/inventory/osinfo.js"],"names":[],"mappings":"AAGA;;;GAGG;AACH,eAAO,MAAM,eAAe;IAC1B,aAAa;IACb,aAAa;IACb,aAAa;IACb,aAAa;IACb,aAAa;IACb,aAAa;IACb,aAAa;IACb,aAAa;IACb,aAAa;IACb,aAAa;IACb,aAAa;IACb,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,WAAW;IACX,WAAW;IACX,aAAa;IACb,WAAW;IACX,aAAa;IACb,aAAa;IACb,aAAa;IACb,aAAa;IACb,aAAa;IACb,aAAa;IACb,aAAa;IACb,WAAW;IACX,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,aAAa;IACb,aAAa;IACb,aAAa;IACb,aAAa;IACb,aAAa;IACb,aAAa;IACb,aAAa;IACb,aAAa;IACb,WAAW;IACX,aAAa;IACb,WAAW;IACX,aA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-81,4 +81,55 @@ export declare function shouldCreateOsQueryPurl(componentType: string): boolean;
81
81
  * @returns {string|null} Canonical purl string, or `null` when the parts do not form a valid purl
82
82
  */
83
83
  export declare function createOsQueryPurl(purlType: string, group: string | null, name: string, version: string, qualifiers: Object | null, subpath: string | null): string | null;
84
+ /**
85
+ * The version and purl of a row from an OS package table: `deb_packages`,
86
+ * `rpm_packages`, `pacman_packages`, `homebrew_packages`, `macports_packages`,
87
+ * `snap_packages`, `flatpak_packages` or the rows of the apk database.
88
+ *
89
+ * Such a row is named the way the package manager's own scan names it: deb,
90
+ * rpm and apk with the vendor and the `arch`, `distro`, `distro_name` and
91
+ * `epoch` qualifiers of the container scan, an rpm version joined to its
92
+ * release, a MacPorts version joined to its revision, a flatpak by its
93
+ * application ID with the `arch` and `branch` of its ref. A row's `path`,
94
+ * `admindir` or source file is not a path inside the package, so none of them
95
+ * becomes a subpath.
96
+ *
97
+ * @param {string} purlType One of OS_PACKAGE_PURL_TYPES
98
+ * @param {Object} res osquery row
99
+ * @param {string} name Component name derived from the row
100
+ * @param {Object} [distro] What getDistroInfo() reports; the host's by default
101
+ * @returns {{version: string, purl: string|null}} The component version and the purl, which is null when the row cannot be expressed as one
102
+ */
103
+ export declare function createOsQueryPackageIdentity(purlType: string, res: Object, name: string, distro?: Object): {
104
+ version: string;
105
+ purl: string | null;
106
+ };
107
+ /**
108
+ * The columns of an OS package row that give its licence and its home page.
109
+ * They become the component's `licenses` and a `website` reference rather than
110
+ * properties. `separator` splits a licence column that lists several: pacman
111
+ * keeps one licence per entry, which osquery joins with commas.
112
+ */
113
+ export declare const OS_PACKAGE_LICENSE_COLUMNS: {
114
+ alpm: {
115
+ license: string;
116
+ separator: string;
117
+ website: string;
118
+ };
119
+ snap: {
120
+ license: string;
121
+ };
122
+ flatpak: {
123
+ license: string;
124
+ website: string;
125
+ };
126
+ };
127
+ /**
128
+ * The property name an OS package table column is emitted under.
129
+ *
130
+ * @param {string|undefined} purlType Purl type of the table
131
+ * @param {string} column Column name
132
+ * @returns {string|undefined} The property name, or undefined when the column is not emitted
133
+ */
134
+ export declare function osPackagePropertyName(purlType: string | undefined, column: string): string | undefined;
84
135
  //# sourceMappingURL=osqueryTransform.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"osqueryTransform.d.ts","sourceRoot":"","sources":["../../../lib/inventory/osqueryTransform.js"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAH7B,MAG6B,GAF3B,MAAM,GAAC,SAAS,CAa5B;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAL1B,MAK0B,EAAE,YAAY,EAJxC,OAIwC,EAAE,SAAS,EAHnD,MAGmD,GAFjD,MAAM,GAAC,SAAS,CAkB5B;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,EAH/B,MAG+B,GAF7B,MAAM,CAWlB;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,GAAG,EAHjC,MAGiC,GAF/B,MAAM,CAelB;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAHlC,MAGkC,GAFhC,MAAM,CAQlB;AAED;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CAAC,KAAK,EAJrC,MAIqC,EAAE,QAAQ,AAHvD,CACA,EADQ,MAG2D,GAFzD,MAAM,CAWlB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,2BAA2B,CACzC,aAAa,EATJ,MASI,EACb,aAAa,EATJ,MASI,EACb,IAAI,EATK,MAAM,GAAC,SASZ,EACJ,OAAO,EATE,MAAM,GAAC,SAST,EACP,aAAa,EATJ,MAAM,GAAC,SASH,EACb,aAAa,EATJ,MAAM,GAAC,SASH,GARF,MAAM,CA8BlB;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,aAAa,EAH1C,MAG0C,GAFxC,OAAO,CAMnB;AAaD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,iBAAiB,CAC/B,QAAQ,EATC,MASD,EACR,KAAK,EATI,MAAM,GAAC,IASX,EACL,IAAI,EATK,MASL,EACJ,OAAO,EATE,MASF,EACP,UAAU,EATD,MAAM,GAAC,IASN,EACV,OAAO,EATE,MAAM,GAAC,IAST,GARI,MAAM,GAAC,IAAI,CAuCvB"}
1
+ {"version":3,"file":"osqueryTransform.d.ts","sourceRoot":"","sources":["../../../lib/inventory/osqueryTransform.js"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAH7B,MAG6B,GAF3B,MAAM,GAAC,SAAS,CAa5B;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAL1B,MAK0B,EAAE,YAAY,EAJxC,OAIwC,EAAE,SAAS,EAHnD,MAGmD,GAFjD,MAAM,GAAC,SAAS,CAkB5B;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,EAH/B,MAG+B,GAF7B,MAAM,CAalB;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,GAAG,EAHjC,MAGiC,GAF/B,MAAM,CAelB;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAHlC,MAGkC,GAFhC,MAAM,CAQlB;AAED;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CAAC,KAAK,EAJrC,MAIqC,EAAE,QAAQ,AAHvD,CACA,EADQ,MAG2D,GAFzD,MAAM,CAWlB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,2BAA2B,CACzC,aAAa,EATJ,MASI,EACb,aAAa,EATJ,MASI,EACb,IAAI,EATK,MAAM,GAAC,SASZ,EACJ,OAAO,EATE,MAAM,GAAC,SAST,EACP,aAAa,EATJ,MAAM,GAAC,SASH,EACb,aAAa,EATJ,MAAM,GAAC,SASH,GARF,MAAM,CA8BlB;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,aAAa,EAH1C,MAG0C,GAFxC,OAAO,CAMnB;AAgBD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,iBAAiB,CAC/B,QAAQ,EATC,MASD,EACR,KAAK,EATI,MAAM,GAAC,IASX,EACL,IAAI,EATK,MASL,EACJ,OAAO,EATE,MASF,EACP,UAAU,EATD,MAAM,GAAC,IASN,EACV,OAAO,EATE,MAAM,GAAC,IAST,GARI,MAAM,GAAC,IAAI,CAsCvB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,4BAA4B,CAAC,QAAQ,EAN1C,MAM0C,EAAE,GAAG,EAL/C,MAK+C,EAAE,IAAI,EAJrD,MAIqD,EAAE,MAAM,AAHrE,CACA,EADQ,MAG6D,GAF3D;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,GAAC,IAAI,CAAA;CAAC,CAqBhD;AAmCD;;;;;GAKG;AACH,eAAO,MAAM,0BAA0B;IACrC,IAAI;QAAI,OAAO;QAAc,SAAS;QAAO,OAAO;;IACpD,IAAI;QAAI,OAAO;;IACf,OAAO;QAAI,OAAO;QAAa,OAAO;;CACvC,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAJnC,MAAM,GAAC,SAI4B,EAAE,MAAM,EAH3C,MAG2C,GAFzC,MAAM,GAAC,SAAS,CAY5B"}
@@ -0,0 +1,142 @@
1
+ /**
2
+ * The most PHP-named files one scan opens in search of a build version.
3
+ *
4
+ * @type {number}
5
+ */
6
+ export declare const MAX_PHP_PROBES: number;
7
+ /**
8
+ * Read the version a text starts with, in the grammar the build-version reader
9
+ * accepts: `8.4.27`, `8.5.0-dev`, `8.6.0RC3`. What follows the version must not
10
+ * continue it, so `8.4.26.1` and `8.4.26foo` parse to nothing. A distro
11
+ * revision such as Ubuntu's `8.1.2-1ubuntu2.14` is not an upstream version
12
+ * either, and parses to nothing rather than to a guess.
13
+ *
14
+ * @param {string} text text that begins with the version
15
+ * @returns {string|undefined} the version, or undefined when the text does not
16
+ * begin with one
17
+ */
18
+ export declare function parsePhpVersion(text: string): string | undefined;
19
+ /**
20
+ * Read the version a PHP reports about itself, as `php -v` prints it. An
21
+ * upstream version parses as parsePhpVersion does. A version with a distro
22
+ * revision, such as Ubuntu's `8.1.2-1ubuntu2.14`, is kept whole and marked: it
23
+ * is what that PHP reports, but the distro backports fixes without changing the
24
+ * upstream part, so it must not be matched against upstream advisories.
25
+ *
26
+ * @param {string} text text that begins with the version
27
+ * @returns {{version: string, distroRevision: boolean}|undefined} the version,
28
+ * or undefined when the text does not begin with one
29
+ */
30
+ export declare function parsePhpReportedVersion(text: string): {
31
+ version: string;
32
+ distroRevision: boolean;
33
+ } | undefined;
34
+ /**
35
+ * The package manager whose store a path lies in. Homebrew (`Cellar/<formula>/
36
+ * <version>/`), Nix (`nix/store/`) and Guix (`gnu/store/`) own everything under
37
+ * their stores, whatever links lead there, and a PHP they own is identified by
38
+ * their package, never as an unpackaged build.
39
+ *
40
+ * @param {string} filePath absolute or root-relative path, either separator
41
+ * @returns {string|undefined} `homebrew`, `nix` or `guix`, or undefined
42
+ */
43
+ export declare function packageStoreOf(filePath: string): string | undefined;
44
+ /**
45
+ * Classify a file by its basename into a PHP SAPI, or undefined when the name
46
+ * is not one php-src installs.
47
+ *
48
+ * @param {string} fileName basename or path of the candidate
49
+ * @returns {string|undefined} cli, fpm, cgi, phpdbg, libphp or frankenphp
50
+ */
51
+ export declare function classifyPhpSapi(fileName: string): string | undefined;
52
+ /**
53
+ * Read the PHP build version of a binary or shared library.
54
+ *
55
+ * @param {string} absPath absolute path
56
+ * @param {string|undefined} rootDir extracted root, when the file came from one
57
+ * @returns {{version: string, source: string}|undefined} source is `binary`
58
+ * or `php_version.h`
59
+ */
60
+ export declare function readPhpBuildVersion(absPath: string, rootDir: string | undefined): {
61
+ version: string;
62
+ source: string;
63
+ } | undefined;
64
+ /**
65
+ * The CPE that lets a downstream scanner match a PHP version. NVD puts a
66
+ * pre-release suffix in the update field, e.g.
67
+ * cpe:2.3:a:php:php:8.5.0:rc1:*:*:*:*:*:* (NVD CPE dictionary).
68
+ *
69
+ * @param {string} version PHP version in the build-version grammar
70
+ * @returns {string} CPE 2.3 string
71
+ */
72
+ export declare function phpCpe(version: string): string;
73
+ /**
74
+ * A PHP runtime is one `platform` component per distinct version, like the Go
75
+ * stdlib component. Its identity is `pkg:generic/php`: it is only used where no
76
+ * package manager owns PHP, or where a PATH probe cannot tell which one does.
77
+ *
78
+ * @param {string} version PHP version in the build-version grammar, or as a
79
+ * distro build reports it
80
+ * @param {Object} [options] options
81
+ * @param {boolean} [options.withCpe=true] false for a version with a distro
82
+ * revision, which no upstream CPE describes
83
+ * @returns {Object} component with `purl`, `bom-ref` and, unless left out, `cpe`
84
+ */
85
+ export declare function createPhpRuntimeComponent(version: string, { withCpe }?: {
86
+ withCpe?: boolean;
87
+ }): Object;
88
+ /**
89
+ * The bom-ref of the runtime component for a version.
90
+ *
91
+ * @param {string} version PHP version in the build-version grammar
92
+ * @returns {string} bom-ref, which is the runtime's purl
93
+ */
94
+ export declare function phpRuntimeRef(version: string): string;
95
+ /**
96
+ * The properties a PHP file component carries once its build version is known.
97
+ * They belong on unpackaged `file` components only: a package-owned PHP is
98
+ * identified by its package, and distro builds carry backported fixes under
99
+ * old version numbers, so the PHP-RCE audit rules that match these properties
100
+ * would raise false positives there.
101
+ *
102
+ * @param {{version: string, source: string}} build result of readPhpBuildVersion
103
+ * @param {string} sapi result of classifyPhpSapi
104
+ * @returns {{name: string, value: string}[]} properties to append
105
+ */
106
+ export declare function phpBuildProperties(build: {
107
+ version: string;
108
+ source: string;
109
+ }, sapi: string): {
110
+ name: string;
111
+ value: string;
112
+ }[];
113
+ /**
114
+ * Start collecting the runtime components and edges of one scan.
115
+ *
116
+ * @returns {{runtimeComponents: Object[], dependencies: Object[], runtimeRefs: Set<string>}}
117
+ */
118
+ export declare function createPhpRuntimeInventory(): {
119
+ runtimeComponents: Object[];
120
+ dependencies: Object[];
121
+ runtimeRefs: Set<string>;
122
+ };
123
+ /**
124
+ * Tag a PHP file component with its build facts and link it to the runtime
125
+ * component of its version, creating that component on first use. Mutates the
126
+ * component in place, as the Go collector does.
127
+ *
128
+ * @param {{runtimeComponents: Object[], dependencies: Object[], runtimeRefs: Set<string>}} inventory
129
+ * accumulator from createPhpRuntimeInventory
130
+ * @param {Object} component file component, with a `properties` array
131
+ * @param {{version: string, source: string}} build result of readPhpBuildVersion
132
+ * @param {string} sapi result of classifyPhpSapi
133
+ */
134
+ export declare function attachPhpBuild(inventory: {
135
+ runtimeComponents: Object[];
136
+ dependencies: Object[];
137
+ runtimeRefs: Set<string>;
138
+ }, component: Object, build: {
139
+ version: string;
140
+ source: string;
141
+ }, sapi: string): void;
142
+ //# sourceMappingURL=phpBuildInfo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"phpBuildInfo.d.ts","sourceRoot":"","sources":["../../../lib/inventory/phpBuildInfo.js"],"names":[],"mappings":"AAwCA;;;;GAIG;AACH,eAAO,MAAM,cAAc,EAFjB,MAEsB,CAAC;AAUjC;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAJzB,MAIyB,GAHvB,MAAM,GAAC,SAAS,CAc5B;AAQD;;;;;;;;;;GAUG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAJjC,MAIiC,GAH/B;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,cAAc,EAAE,OAAO,CAAA;CAAC,GAAC,SAAS,CAkBhE;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAH5B,MAG4B,GAF1B,MAAM,GAAC,SAAS,CAuB5B;AAoBD;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAH7B,MAG6B,GAF3B,MAAM,GAAC,SAAS,CAa5B;AAkHD;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EALhC,MAKgC,EAAE,OAAO,EAJzC,MAAM,GAAC,SAIkC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+ /**
2
+ * Look for PHP no package manager owns, in the fixed directories of the host.
3
+ * Components come back only for the files nothing owns: a `file` component for
4
+ * each PHP binary or library with the cdx:php properties, one `platform`
5
+ * component per version with its CPE, and the edges between them.
6
+ *
7
+ * @param {Object} [options] probe options
8
+ * @param {string} [options.rootPath] directory the fixed directories hang off:
9
+ * `/`, or the system drive on Windows. Tests point it at a built tree.
10
+ * @param {string} [options.platform] `linux`, `darwin` or `win32`
11
+ * @param {Object} [options.env] environment read for ProgramFiles, SystemDrive
12
+ * and ChocolateyInstall, instead of the process's
13
+ * @param {{dpkgInfoDirectory?: string, apkInstalledFile?: string, rpmDatabaseDirectories?: string[]}} [options.packageDatabases]
14
+ * where the package databases are, instead of under `rootPath`
15
+ * @param {function(string): (Object[]|undefined)} [options.executeOsQuery] runs
16
+ * an osquery query; the rpm database is only asked through it
17
+ * @param {Object[]} [options.packageComponents] the packages the OS scan has
18
+ * inventoried, from which Chocolatey's are known
19
+ * @param {number} [options.maxProbes] most candidate files to look at
20
+ * @returns {{components: Object[], dependencies: Object[]}}
21
+ */
22
+ export declare function probeHostPhp(options?: {
23
+ rootPath?: string;
24
+ platform?: string;
25
+ env?: Object;
26
+ packageDatabases?: {
27
+ dpkgInfoDirectory?: string;
28
+ apkInstalledFile?: string;
29
+ rpmDatabaseDirectories?: string[];
30
+ };
31
+ }): {
32
+ components: Object[];
33
+ dependencies: Object[];
34
+ };
35
+ //# sourceMappingURL=phpHostProbe.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"phpHostProbe.d.ts","sourceRoot":"","sources":["../../../lib/inventory/phpHostProbe.js"],"names":[],"mappings":"AAqIA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,YAAY,CAAC,OAAO,AAfjC,CAQA,EAPA;IAAyB,QAAQ,AAAjC,CAEA,EAFQ,MAAM,CAEd;IAAyB,QAAQ,AAAjC,CACA,EADQ,MAAM,CACd;IAAyB,GAAG,AAA5B,CAEA,EAFQ,MAAM,CAEd;IAA6G,gBAAgB,AAA7H,CAEA,EAFQ;QAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;QAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;QAAC,sBAAsB,CAAC,EAAE,MAAM,EAAE,CAAA;KAAC,CAElG;CAOsC,GAF5B;IAAC,UAAU,EAAE,MAAM,EAAE,CAAC;IAAC,YAAY,EAAE,MAAM,EAAE,CAAA;CAAC,CAgC1D"}
@@ -0,0 +1,27 @@
1
+ export declare const ROOTFS_CERT_LIMITS: Readonly<{
2
+ maxFileBytes: number;
3
+ maxFiles: 20000;
4
+ maxEntries: 500000;
5
+ maxDepth: 12;
6
+ }>;
7
+ /**
8
+ * Pure-JS inventory of the certificate locations trustinspector's rootfs
9
+ * mode covers, plus Kubernetes TLS secrets and Android pins. Used when the
10
+ * plugin is not available. Produces components through the shared
11
+ * CertificateCollector, so bom-refs, names and deduplication match the other
12
+ * producers; locations are root-relative ("/etc/ssl/certs/x.crt").
13
+ *
14
+ * Every access stays inside the root: symlinks (files or directories) are
15
+ * skipped, only regular files are opened, and the walk is bounded by entry,
16
+ * file, size and depth limits.
17
+ *
18
+ * @param {string} rootDir extracted root filesystem
19
+ * @param {object} [limits] overrides for ROOTFS_CERT_LIMITS (tests)
20
+ * @returns {{components: object[], dependencies: object[], warnings: string[]}}
21
+ */
22
+ export declare function collectRootfsCertificates(rootDir: string, limits?: object): {
23
+ components: object[];
24
+ dependencies: object[];
25
+ warnings: string[];
26
+ };
27
+ //# sourceMappingURL=rootfsCerts.d.ts.map