@cdxgen/cdxgen 13.4.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 (208) hide show
  1. package/README.md +7 -7
  2. package/bin/cdxgen-secure.js +15 -0
  3. package/bin/cdxgen.js +25 -5
  4. package/bin/evinse.js +5 -0
  5. package/bin/hbom.js +15 -7
  6. package/bin/repl.js +29 -0
  7. package/data/cbomosdb-queries.json +13 -1
  8. package/data/component-tags.json +8 -0
  9. package/data/queries-darwin.json +25 -1
  10. package/data/queries-win.json +19 -1
  11. package/data/queries.json +41 -0
  12. package/data/remediations.json +283 -1
  13. package/data/rules/cbom-security.yaml +235 -4
  14. package/data/rules/go-binaries.yaml +46 -0
  15. package/data/rules/golem-go.yaml +80 -0
  16. package/data/rules/hbom-compliance.yaml +40 -22
  17. package/data/rules/hbom-performance.yaml +7 -1
  18. package/data/rules/host-topology.yaml +1 -1
  19. package/data/rules/obom-runtime.yaml +31 -2
  20. package/data/rules/php-runtime.yaml +143 -0
  21. package/lib/audit/index.js +14 -0
  22. package/lib/cli/bomAssembly.js +28 -3
  23. package/lib/cli/cliOptions.js +110 -3
  24. package/lib/cli/index.js +73 -4
  25. package/lib/cli/jvmBom.js +126 -20
  26. package/lib/cli/managedBom.js +711 -71
  27. package/lib/cli/nativeBom.js +225 -28
  28. package/lib/core/env.js +30 -8
  29. package/lib/core/fs.js +28 -19
  30. package/lib/core/httpClient.js +74 -45
  31. package/lib/core/projectConfig.js +1 -0
  32. package/lib/core/projectTooling.js +97 -0
  33. package/lib/core/propertySanitizer.js +72 -0
  34. package/lib/ecosystems/golem.js +550 -6
  35. package/lib/ecosystems/gradleutils.js +30 -20
  36. package/lib/ecosystems/parsers-dotnet.js +117 -18
  37. package/lib/ecosystems/parsers-go.js +1090 -367
  38. package/lib/ecosystems/parsers-jvm.js +259 -17
  39. package/lib/ecosystems/parsers-misc.js +229 -44
  40. package/lib/ecosystems/parsers-python.js +11 -10
  41. package/lib/ecosystems/rubyutils.js +6 -3
  42. package/lib/ecosystems/rusi.js +10 -0
  43. package/lib/ecosystems/scalacliutils.js +2 -1
  44. package/lib/ecosystems/scalasem.js +3 -1
  45. package/lib/evinser/evinser.js +126 -18
  46. package/lib/evinser/swiftsem.js +68 -5
  47. package/lib/inventory/agentSkillSpec.js +17 -0
  48. package/lib/inventory/apkInstalledDb.js +243 -0
  49. package/lib/inventory/atomUtils.js +33 -0
  50. package/lib/inventory/auditCategories.js +3 -3
  51. package/lib/inventory/cacheDir.js +52 -9
  52. package/lib/inventory/certificates.js +2371 -0
  53. package/lib/inventory/communityAiConfigParser.js +4 -9
  54. package/lib/inventory/deps.js +6 -4
  55. package/lib/inventory/display.js +200 -3
  56. package/lib/inventory/dosai.js +500 -58
  57. package/lib/inventory/dynamic.js +45 -3
  58. package/lib/inventory/envcontext.js +168 -5
  59. package/lib/inventory/evidenceUtils.js +436 -23
  60. package/lib/inventory/formulationParsers.js +3 -2
  61. package/lib/inventory/goBuildInfo.js +140 -0
  62. package/lib/inventory/hbom.js +67 -7
  63. package/lib/inventory/hbomAnalysis.js +16 -0
  64. package/lib/inventory/hostTopology.js +21 -0
  65. package/lib/inventory/osPackagePurl.js +244 -0
  66. package/lib/inventory/osPackageResolver.js +89 -87
  67. package/lib/inventory/osinfo.js +79 -31
  68. package/lib/inventory/osqueryTransform.js +114 -5
  69. package/lib/inventory/phpBuildInfo.js +487 -0
  70. package/lib/inventory/phpHostProbe.js +641 -0
  71. package/lib/inventory/rootfsCerts.js +426 -0
  72. package/lib/inventory/source.js +207 -3
  73. package/lib/inventory/spdx.js +144 -0
  74. package/lib/inventory/traceRunner.js +5 -1
  75. package/lib/inventory/tracedCrypto.js +129 -0
  76. package/lib/managers/binary.js +529 -183
  77. package/lib/managers/docker.js +166 -12
  78. package/lib/parsers/email.js +277 -0
  79. package/lib/parsers/largeJson.js +34 -2
  80. package/lib/server/server.js +186 -1
  81. package/lib/stages/postgen/annotator.js +17 -1
  82. package/lib/stages/postgen/introspection/reflect.js +4 -1
  83. package/lib/stages/postgen/postgen.js +5 -5
  84. package/lib/stages/postgen/ruleEngine.js +58 -1
  85. package/lib/stages/postgen/specVersionCompat.js +30 -0
  86. package/lib/stages/pregen/pregen.js +117 -5
  87. package/lib/validator/bomValidator.js +26 -5
  88. package/lib/validator/generated/runtime.mjs +13 -0
  89. package/lib/validator/generated/validate-1.6.mjs +26 -7
  90. package/lib/validator/generated/validate-1.7.mjs +31 -12
  91. package/lib/validator/generated/validate-2.0.mjs +30 -11
  92. package/package.json +17 -17
  93. package/types/bin/cdxgen-secure.d.ts +3 -0
  94. package/types/bin/cdxgen-secure.d.ts.map +1 -0
  95. package/types/bin/repl.d.ts.map +1 -1
  96. package/types/lib/audit/index.d.ts.map +1 -1
  97. package/types/lib/cli/bomAssembly.d.ts +9 -2
  98. package/types/lib/cli/bomAssembly.d.ts.map +1 -1
  99. package/types/lib/cli/cliOptions.d.ts +43 -0
  100. package/types/lib/cli/cliOptions.d.ts.map +1 -1
  101. package/types/lib/cli/index.d.ts.map +1 -1
  102. package/types/lib/cli/jvmBom.d.ts +20 -0
  103. package/types/lib/cli/jvmBom.d.ts.map +1 -1
  104. package/types/lib/cli/managedBom.d.ts.map +1 -1
  105. package/types/lib/cli/nativeBom.d.ts.map +1 -1
  106. package/types/lib/core/env.d.ts +18 -2
  107. package/types/lib/core/env.d.ts.map +1 -1
  108. package/types/lib/core/fs.d.ts.map +1 -1
  109. package/types/lib/core/httpClient.d.ts.map +1 -1
  110. package/types/lib/core/projectConfig.d.ts.map +1 -1
  111. package/types/lib/core/projectTooling.d.ts +41 -0
  112. package/types/lib/core/projectTooling.d.ts.map +1 -0
  113. package/types/lib/core/propertySanitizer.d.ts +26 -0
  114. package/types/lib/core/propertySanitizer.d.ts.map +1 -1
  115. package/types/lib/ecosystems/cppEvidence.d.ts +1 -1
  116. package/types/lib/ecosystems/golem.d.ts +81 -1
  117. package/types/lib/ecosystems/golem.d.ts.map +1 -1
  118. package/types/lib/ecosystems/gradleutils.d.ts +10 -8
  119. package/types/lib/ecosystems/gradleutils.d.ts.map +1 -1
  120. package/types/lib/ecosystems/parsers-dotnet.d.ts +40 -4
  121. package/types/lib/ecosystems/parsers-dotnet.d.ts.map +1 -1
  122. package/types/lib/ecosystems/parsers-go.d.ts +85 -13
  123. package/types/lib/ecosystems/parsers-go.d.ts.map +1 -1
  124. package/types/lib/ecosystems/parsers-jvm.d.ts +28 -2
  125. package/types/lib/ecosystems/parsers-jvm.d.ts.map +1 -1
  126. package/types/lib/ecosystems/parsers-misc.d.ts +18 -58
  127. package/types/lib/ecosystems/parsers-misc.d.ts.map +1 -1
  128. package/types/lib/ecosystems/parsers-python.d.ts +4 -3
  129. package/types/lib/ecosystems/parsers-python.d.ts.map +1 -1
  130. package/types/lib/ecosystems/pythonutils.d.ts +1 -1
  131. package/types/lib/ecosystems/rubyutils.d.ts.map +1 -1
  132. package/types/lib/ecosystems/rusi.d.ts.map +1 -1
  133. package/types/lib/ecosystems/scalacliutils.d.ts.map +1 -1
  134. package/types/lib/ecosystems/scalasem.d.ts.map +1 -1
  135. package/types/lib/evinser/evinser.d.ts +25 -0
  136. package/types/lib/evinser/evinser.d.ts.map +1 -1
  137. package/types/lib/evinser/swiftsem.d.ts +10 -0
  138. package/types/lib/evinser/swiftsem.d.ts.map +1 -1
  139. package/types/lib/inventory/agentSkillSpec.d.ts +13 -0
  140. package/types/lib/inventory/agentSkillSpec.d.ts.map +1 -0
  141. package/types/lib/inventory/apkInstalledDb.d.ts +42 -0
  142. package/types/lib/inventory/apkInstalledDb.d.ts.map +1 -0
  143. package/types/lib/inventory/atomUtils.d.ts +14 -0
  144. package/types/lib/inventory/atomUtils.d.ts.map +1 -1
  145. package/types/lib/inventory/cacheDir.d.ts +12 -4
  146. package/types/lib/inventory/cacheDir.d.ts.map +1 -1
  147. package/types/lib/inventory/certificates.d.ts +205 -0
  148. package/types/lib/inventory/certificates.d.ts.map +1 -0
  149. package/types/lib/inventory/communityAiConfigParser.d.ts.map +1 -1
  150. package/types/lib/inventory/deps.d.ts +2 -1
  151. package/types/lib/inventory/deps.d.ts.map +1 -1
  152. package/types/lib/inventory/display.d.ts +18 -0
  153. package/types/lib/inventory/display.d.ts.map +1 -1
  154. package/types/lib/inventory/dosai.d.ts +145 -6
  155. package/types/lib/inventory/dosai.d.ts.map +1 -1
  156. package/types/lib/inventory/dynamic.d.ts +6 -1
  157. package/types/lib/inventory/dynamic.d.ts.map +1 -1
  158. package/types/lib/inventory/envcontext.d.ts +40 -2
  159. package/types/lib/inventory/envcontext.d.ts.map +1 -1
  160. package/types/lib/inventory/evidenceUtils.d.ts +29 -10
  161. package/types/lib/inventory/evidenceUtils.d.ts.map +1 -1
  162. package/types/lib/inventory/formulationParsers.d.ts.map +1 -1
  163. package/types/lib/inventory/goBuildInfo.d.ts +10 -0
  164. package/types/lib/inventory/goBuildInfo.d.ts.map +1 -0
  165. package/types/lib/inventory/hbom.d.ts.map +1 -1
  166. package/types/lib/inventory/hbomAnalysis.d.ts +10 -0
  167. package/types/lib/inventory/hbomAnalysis.d.ts.map +1 -1
  168. package/types/lib/inventory/hostTopology.d.ts.map +1 -1
  169. package/types/lib/inventory/osPackagePurl.d.ts +99 -0
  170. package/types/lib/inventory/osPackagePurl.d.ts.map +1 -0
  171. package/types/lib/inventory/osPackageResolver.d.ts +6 -2
  172. package/types/lib/inventory/osPackageResolver.d.ts.map +1 -1
  173. package/types/lib/inventory/osinfo.d.ts +31 -6
  174. package/types/lib/inventory/osinfo.d.ts.map +1 -1
  175. package/types/lib/inventory/osqueryTransform.d.ts +51 -0
  176. package/types/lib/inventory/osqueryTransform.d.ts.map +1 -1
  177. package/types/lib/inventory/phpBuildInfo.d.ts +142 -0
  178. package/types/lib/inventory/phpBuildInfo.d.ts.map +1 -0
  179. package/types/lib/inventory/phpHostProbe.d.ts +35 -0
  180. package/types/lib/inventory/phpHostProbe.d.ts.map +1 -0
  181. package/types/lib/inventory/rootfsCerts.d.ts +27 -0
  182. package/types/lib/inventory/rootfsCerts.d.ts.map +1 -0
  183. package/types/lib/inventory/source.d.ts +28 -0
  184. package/types/lib/inventory/source.d.ts.map +1 -1
  185. package/types/lib/inventory/spdx.d.ts +15 -0
  186. package/types/lib/inventory/spdx.d.ts.map +1 -1
  187. package/types/lib/inventory/traceRunner.d.ts +4 -1
  188. package/types/lib/inventory/traceRunner.d.ts.map +1 -1
  189. package/types/lib/inventory/tracedCrypto.d.ts +22 -0
  190. package/types/lib/inventory/tracedCrypto.d.ts.map +1 -1
  191. package/types/lib/managers/binary.d.ts +10 -0
  192. package/types/lib/managers/binary.d.ts.map +1 -1
  193. package/types/lib/managers/docker.d.ts +12 -0
  194. package/types/lib/managers/docker.d.ts.map +1 -1
  195. package/types/lib/parsers/email.d.ts +19 -0
  196. package/types/lib/parsers/email.d.ts.map +1 -0
  197. package/types/lib/parsers/largeJson.d.ts +13 -0
  198. package/types/lib/parsers/largeJson.d.ts.map +1 -1
  199. package/types/lib/server/server.d.ts +8 -0
  200. package/types/lib/server/server.d.ts.map +1 -1
  201. package/types/lib/stages/postgen/annotator.d.ts.map +1 -1
  202. package/types/lib/stages/postgen/introspection/reflect.d.ts.map +1 -1
  203. package/types/lib/stages/postgen/ruleEngine.d.ts +7 -4
  204. package/types/lib/stages/postgen/ruleEngine.d.ts.map +1 -1
  205. package/types/lib/stages/postgen/specVersionCompat.d.ts.map +1 -1
  206. package/types/lib/stages/pregen/pregen.d.ts +14 -1
  207. package/types/lib/stages/pregen/pregen.d.ts.map +1 -1
  208. package/types/lib/validator/bomValidator.d.ts.map +1 -1
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.4.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.4.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.4.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.4.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'
@@ -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,
@@ -39,6 +39,7 @@ import {
39
39
  PROJECT_CONFIG_FILENAMES,
40
40
  sanitizeProjectConfig,
41
41
  } from "../lib/core/projectConfig.js";
42
+ import { isSecureModeActive } from "../lib/core/projectTooling.js";
42
43
  import {
43
44
  ui as defaultUi,
44
45
  installConsoleShim,
@@ -103,6 +104,7 @@ import {
103
104
  printSummary,
104
105
  printTable,
105
106
  } from "../lib/inventory/display.js";
107
+ import { runsEvidenceAnalysis } from "../lib/inventory/dosai.js";
106
108
  import {
107
109
  ensureNoMixedHbomProjectTypes,
108
110
  ensureSupportedHbomSpecVersion,
@@ -138,6 +140,11 @@ import { prepareEnv } from "../lib/stages/pregen/pregen.js";
138
140
  import { validateSpdx } from "../lib/validator/bomValidator.js";
139
141
  import { validateGeneratedBom } from "../lib/validator/index.js";
140
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
+
141
148
  // Support for config files. The config file lives in the directory under
142
149
  // analysis, so it carries that directory's trust level; see
143
150
  // sanitizeProjectConfig for the boundary this applies.
@@ -1127,8 +1134,10 @@ let autoLedgerSidecar;
1127
1134
  if (options.introspect) {
1128
1135
  process.env.CDXGEN_INTROSPECT = "true";
1129
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.
1130
1139
  autoLedgerSidecar = join(
1131
- tmpdir(),
1140
+ getTmpDir(),
1132
1141
  `cdxgen-introspect-ledger-${process.pid}.jsonl`,
1133
1142
  );
1134
1143
  process.env.CDXGEN_INTROSPECT_LEDGER = autoLedgerSidecar;
@@ -1266,7 +1275,15 @@ if (options.lifecycle) {
1266
1275
  }
1267
1276
  const isHbomOnlyInvocation = isHbomOnlyProjectTypes(options.projectType);
1268
1277
  const advancedWarnings = applyAdvancedOptionsImpl(options, {
1269
- 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,
1270
1287
  });
1271
1288
  if (options?.technique && Array.isArray(options.technique)) {
1272
1289
  if (options.technique.length === 1) {
@@ -2128,7 +2145,7 @@ const writeCycloneDxOutput = (jsonFile, bomJson, options) => {
2128
2145
  }
2129
2146
  }
2130
2147
  let internalCycloneDxInputPath = outputPlan.outputs.cyclonedx;
2131
- if ((options.evidence || options.includeCrypto) && bomNSData?.bomJson) {
2148
+ if (runsEvidenceAnalysis(options) && bomNSData?.bomJson) {
2132
2149
  if (!internalCycloneDxInputPath) {
2133
2150
  internalCycloneDxInputPath = join(
2134
2151
  getTmpDir(),
@@ -2151,7 +2168,10 @@ const writeCycloneDxOutput = (jsonFile, bomJson, options) => {
2151
2168
  }
2152
2169
  }
2153
2170
  // Evidence generation
2154
- 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)) {
2155
2175
  if (isDryRun) {
2156
2176
  recordActivity({
2157
2177
  kind: "write",
package/bin/evinse.js CHANGED
@@ -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.",
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() {
@@ -2203,6 +2231,7 @@ cdxgenRepl.defineCommand("tagcloud", {
2203
2231
  });
2204
2232
  // Let's dynamically define more commands from the queries
2205
2233
  [
2234
+ "apk_packages",
2206
2235
  "apt_sources",
2207
2236
  "behavioral_reverse_shell",
2208
2237
  "certificates",
@@ -17,6 +17,12 @@
17
17
  "purlType": "rpm",
18
18
  "componentType": "library"
19
19
  },
20
+ "pacman_packages": {
21
+ "query": "select * from pacman_packages where name like '%ssl%' OR name like '%crypto%';",
22
+ "description": "Retrieves the crypto and TLS libraries pacman installed on Arch Linux and the distros built on it.",
23
+ "purlType": "alpm",
24
+ "componentType": "library"
25
+ },
20
26
  "python_packages": {
21
27
  "query": "select * from python_packages where name like '%ssl%' OR name like '%crypto%';",
22
28
  "description": "Python packages installed on system.",
@@ -32,7 +38,13 @@
32
38
  "homebrew_packages": {
33
39
  "query": "SELECT * FROM homebrew_packages where name like '%ssl%' OR name like '%crypto%';",
34
40
  "description": "List all homebrew_packages.",
35
- "purlType": "swid",
41
+ "purlType": "brew",
42
+ "componentType": "library"
43
+ },
44
+ "macports_packages": {
45
+ "query": "select * from macports_packages where name like '%ssl%' OR name like '%crypto%';",
46
+ "description": "Retrieves the crypto and TLS libraries among the active MacPorts ports.",
47
+ "purlType": "macports",
36
48
  "componentType": "library"
37
49
  },
38
50
  "authorized_keys": {
@@ -164,6 +164,7 @@
164
164
  "windows_programs",
165
165
  "processor",
166
166
  "services_snapshot",
167
+ "apk_packages",
167
168
  "apt_sources",
168
169
  "apt_ppa_sources",
169
170
  "behavioral_reverse_shell",
@@ -180,6 +181,13 @@
180
181
  "gatekeeper",
181
182
  "vscode_extensions",
182
183
  "homebrew_packages",
184
+ "macports_packages",
185
+ "pacman_packages",
186
+ "snap_packages",
187
+ "flatpak_packages",
188
+ "ai_agent_skills",
189
+ "gpu_info",
190
+ "chrome_search_engines",
183
191
  "installed_applications",
184
192
  "interface_addresses",
185
193
  "kernel_info",
@@ -29,6 +29,18 @@
29
29
  "purlType": "vscode-extension",
30
30
  "componentType": "application"
31
31
  },
32
+ "chrome_search_engines": {
33
+ "query": "SELECT chrome_search_engines.*, chrome_search_engines.browser_type || '/' || chrome_search_engines.uid || '/' || chrome_search_engines.profile AS label FROM users JOIN chrome_search_engines USING (uid);",
34
+ "description": "The default search engine of every Chromium-based browser profile, for each user.",
35
+ "purlType": "swid",
36
+ "componentType": "data"
37
+ },
38
+ "ai_agent_skills": {
39
+ "query": "SELECT ai_agent_skills.*, hash.sha256 FROM users JOIN ai_agent_skills USING (uid) LEFT JOIN hash ON hash.path = ai_agent_skills.path UNION ALL SELECT ai_agent_skills.*, hash.sha256 FROM ai_agent_skills LEFT JOIN hash ON hash.path = ai_agent_skills.path WHERE ai_agent_skills.scope = 'system';",
40
+ "description": "AI agent skills (SKILL.md packages) installed for each user, through Claude Code plugins and system-wide, with the SHA-256 of each SKILL.md. Skills have no package identity, so they get no purl.",
41
+ "purlType": "generic",
42
+ "componentType": "file"
43
+ },
32
44
  "apps": {
33
45
  "query": "select * from apps;",
34
46
  "description": "macOS applications installed in known search paths (e.g., /Applications).",
@@ -47,6 +59,12 @@
47
59
  "purlType": "swid",
48
60
  "componentType": "application"
49
61
  },
62
+ "gpu_info": {
63
+ "query": "SELECT *, driver_version AS version, vendor AS publisher FROM gpu_info;",
64
+ "description": "GPU inventory with the vendor, model and installed driver version.",
65
+ "purlType": "swid",
66
+ "componentType": "device"
67
+ },
50
68
  "certificates": {
51
69
  "query": "SELECT * FROM certificates WHERE path != 'Other People';",
52
70
  "description": "List all certificates in the trust store.",
@@ -74,7 +92,13 @@
74
92
  "homebrew_packages": {
75
93
  "query": "SELECT * FROM homebrew_packages;",
76
94
  "description": "Homebrew formula and cask inventory including auto-update behavior.",
77
- "purlType": "swid",
95
+ "purlType": "brew",
96
+ "componentType": "application"
97
+ },
98
+ "macports_packages": {
99
+ "query": "select * from macports_packages;",
100
+ "description": "Retrieves the active ports of the MacPorts registry.",
101
+ "purlType": "macports",
78
102
  "componentType": "application"
79
103
  },
80
104
  "npm_packages": {
@@ -30,6 +30,18 @@
30
30
  "purlType": "vscode-extension",
31
31
  "componentType": "application"
32
32
  },
33
+ "chrome_search_engines": {
34
+ "query": "SELECT chrome_search_engines.*, chrome_search_engines.browser_type || '/' || chrome_search_engines.uid || '/' || chrome_search_engines.profile AS label FROM users JOIN chrome_search_engines USING (uid);",
35
+ "description": "The default search engine of every Chromium-based browser profile, for each user.",
36
+ "purlType": "swid",
37
+ "componentType": "data"
38
+ },
39
+ "ai_agent_skills": {
40
+ "query": "SELECT ai_agent_skills.*, hash.sha256 FROM users JOIN ai_agent_skills USING (uid) LEFT JOIN hash ON hash.path = ai_agent_skills.path UNION ALL SELECT ai_agent_skills.*, hash.sha256 FROM ai_agent_skills LEFT JOIN hash ON hash.path = ai_agent_skills.path WHERE ai_agent_skills.scope = 'system';",
41
+ "description": "AI agent skills (SKILL.md packages) installed for each user, through Claude Code plugins and system-wide, with the SHA-256 of each SKILL.md. Skills have no package identity, so they get no purl.",
42
+ "purlType": "generic",
43
+ "componentType": "file"
44
+ },
33
45
  "browser_plugins": {
34
46
  "query": "select browser_plugins.* from users join browser_plugins using (uid);",
35
47
  "description": "Retrieves the list of C/NPAPI browser plugin in the target system.",
@@ -88,6 +100,12 @@
88
100
  "purlType": "swid",
89
101
  "componentType": "data"
90
102
  },
103
+ "gpu_info": {
104
+ "query": "SELECT *, driver_version AS version, vendor AS publisher FROM gpu_info;",
105
+ "description": "GPU inventory with the vendor, model and installed driver version.",
106
+ "purlType": "swid",
107
+ "componentType": "device"
108
+ },
91
109
  "users_snapshot": {
92
110
  "query": "SELECT username as name, uuid as version, description, directory, uid, type, gid FROM users;",
93
111
  "description": "Local and domain-backed user account inventory on Windows endpoints.",
@@ -167,7 +185,7 @@
167
185
  "componentType": "data"
168
186
  },
169
187
  "windows_bitlocker_info": {
170
- "query": "SELECT device_id as name, drive_letter as version, encryption_method as description, persistent_volume_id, conversion_status, protection_status, percentage_encrypted, lock_status FROM bitlocker_info;",
188
+ "query": "SELECT device_id as name, drive_letter as version, encryption_method as description, persistent_volume_id, conversion_status, protection_status, percentage_encrypted, lock_status, protector_types FROM bitlocker_info;",
171
189
  "description": "BitLocker protection and encryption state for local drives.",
172
190
  "purlType": "swid",
173
191
  "componentType": "data"
package/data/queries.json CHANGED
@@ -30,6 +30,18 @@
30
30
  "purlType": "vscode-extension",
31
31
  "componentType": "application"
32
32
  },
33
+ "chrome_search_engines": {
34
+ "query": "SELECT chrome_search_engines.*, chrome_search_engines.browser_type || '/' || chrome_search_engines.uid || '/' || chrome_search_engines.profile AS label FROM users JOIN chrome_search_engines USING (uid);",
35
+ "description": "The default search engine of every Chromium-based browser profile, for each user.",
36
+ "purlType": "swid",
37
+ "componentType": "data"
38
+ },
39
+ "ai_agent_skills": {
40
+ "query": "SELECT ai_agent_skills.*, hash.sha256 FROM users JOIN ai_agent_skills USING (uid) LEFT JOIN hash ON hash.path = ai_agent_skills.path UNION ALL SELECT ai_agent_skills.*, hash.sha256 FROM ai_agent_skills LEFT JOIN hash ON hash.path = ai_agent_skills.path WHERE ai_agent_skills.scope = 'system';",
41
+ "description": "AI agent skills (SKILL.md packages) installed for each user, through Claude Code plugins and system-wide, with the SHA-256 of each SKILL.md. Skills have no package identity, so they get no purl.",
42
+ "purlType": "generic",
43
+ "componentType": "file"
44
+ },
33
45
  "deb_packages": {
34
46
  "query": "select * from deb_packages;",
35
47
  "description": "Retrieves all the installed DEB packages in the target Linux system.",
@@ -69,6 +81,29 @@
69
81
  "description": "Retrieves all the installed RPM packages in the target Linux system.",
70
82
  "purlType": "rpm"
71
83
  },
84
+ "pacman_packages": {
85
+ "query": "select * from pacman_packages;",
86
+ "description": "Retrieves all the packages pacman installed on Arch Linux and the distros built on it.",
87
+ "purlType": "alpm"
88
+ },
89
+ "snap_packages": {
90
+ "query": "select * from snap_packages;",
91
+ "description": "Retrieves the installed snap packages at their current revision.",
92
+ "purlType": "snap",
93
+ "componentType": "application"
94
+ },
95
+ "flatpak_packages": {
96
+ "query": "select app_id as name, name as display_name, version, arch, branch, commit_hash, origin, runtime, type, installation, summary, description, license, homepage, developer_name from flatpak_packages;",
97
+ "description": "Retrieves the Flatpak applications and runtimes installed system-wide and for each user.",
98
+ "purlType": "flatpak",
99
+ "componentType": "application"
100
+ },
101
+ "homebrew_packages": {
102
+ "query": "SELECT * FROM homebrew_packages;",
103
+ "description": "Homebrew formula and cask inventory including auto-update behavior.",
104
+ "purlType": "brew",
105
+ "componentType": "application"
106
+ },
72
107
  "python_packages": {
73
108
  "query": "select * from python_packages;",
74
109
  "description": "Python packages installed on system.",
@@ -85,6 +120,12 @@
85
120
  "purlType": "swid",
86
121
  "componentType": "data"
87
122
  },
123
+ "gpu_info": {
124
+ "query": "SELECT *, driver_version AS version, vendor AS publisher FROM gpu_info;",
125
+ "description": "GPU inventory with the vendor, model and installed driver version.",
126
+ "purlType": "swid",
127
+ "componentType": "device"
128
+ },
88
129
  "users_snapshot": {
89
130
  "query": "SELECT username as name, uuid as version, description, directory, shell, uid, gid FROM users;",
90
131
  "description": "Local user inventory for account and shell posture analysis.",