@cyclonedx/cdxgen 12.3.2 → 12.4.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 (182) hide show
  1. package/README.md +70 -22
  2. package/bin/audit.js +21 -7
  3. package/bin/cdxgen.js +238 -116
  4. package/bin/convert.js +28 -13
  5. package/bin/hbom.js +490 -0
  6. package/bin/repl.js +580 -29
  7. package/bin/validate.js +34 -4
  8. package/bin/verify.js +40 -5
  9. package/data/README.md +298 -25
  10. package/data/component-tags.json +6 -0
  11. package/data/crypto-oid.json +16 -0
  12. package/data/predictive-audit-allowlist.json +11 -0
  13. package/data/queries-darwin.json +12 -1
  14. package/data/queries-win.json +7 -1
  15. package/data/queries.json +39 -2
  16. package/data/rules/ai-agent-governance.yaml +16 -0
  17. package/data/rules/asar-archives.yaml +150 -0
  18. package/data/rules/chrome-extensions.yaml +8 -0
  19. package/data/rules/ci-permissions.yaml +171 -15
  20. package/data/rules/container-risk.yaml +14 -7
  21. package/data/rules/dependency-sources.yaml +76 -5
  22. package/data/rules/hbom-compliance.yaml +325 -0
  23. package/data/rules/hbom-performance.yaml +307 -0
  24. package/data/rules/hbom-security.yaml +248 -0
  25. package/data/rules/host-topology.yaml +165 -0
  26. package/data/rules/mcp-servers.yaml +18 -3
  27. package/data/rules/obom-runtime.yaml +907 -22
  28. package/data/rules/package-integrity.yaml +36 -0
  29. package/data/rules/rootfs-hardening.yaml +179 -0
  30. package/data/rules/vscode-extensions.yaml +9 -0
  31. package/lib/audit/index.js +209 -8
  32. package/lib/audit/index.poku.js +332 -0
  33. package/lib/audit/reporters.js +222 -0
  34. package/lib/audit/targets.js +146 -1
  35. package/lib/audit/targets.poku.js +186 -0
  36. package/lib/cli/asar.poku.js +328 -0
  37. package/lib/cli/index.js +647 -127
  38. package/lib/cli/index.poku.js +1905 -187
  39. package/lib/evinser/evinser.js +14 -9
  40. package/lib/helpers/agentFormulationParser.js +6 -2
  41. package/lib/helpers/agentFormulationParser.poku.js +42 -0
  42. package/lib/helpers/analyzer.js +1444 -38
  43. package/lib/helpers/analyzer.poku.js +409 -0
  44. package/lib/helpers/analyzerScope.js +712 -0
  45. package/lib/helpers/asarutils.js +1556 -0
  46. package/lib/helpers/asarutils.poku.js +443 -0
  47. package/lib/helpers/auditCategories.js +12 -0
  48. package/lib/helpers/auditCategories.poku.js +32 -0
  49. package/lib/helpers/cbomutils.js +271 -1
  50. package/lib/helpers/cbomutils.poku.js +248 -5
  51. package/lib/helpers/chromextutils.js +25 -3
  52. package/lib/helpers/chromextutils.poku.js +68 -0
  53. package/lib/helpers/ciParsers/githubActions.js +79 -0
  54. package/lib/helpers/ciParsers/githubActions.poku.js +103 -0
  55. package/lib/helpers/communityAiConfigParser.js +15 -5
  56. package/lib/helpers/communityAiConfigParser.poku.js +71 -0
  57. package/lib/helpers/depsUtils.js +5 -0
  58. package/lib/helpers/depsUtils.poku.js +55 -0
  59. package/lib/helpers/display.js +336 -23
  60. package/lib/helpers/display.poku.js +179 -43
  61. package/lib/helpers/evidenceUtils.js +58 -0
  62. package/lib/helpers/evidenceUtils.poku.js +54 -0
  63. package/lib/helpers/exportUtils.js +9 -0
  64. package/lib/helpers/gtfobins.js +142 -8
  65. package/lib/helpers/gtfobins.poku.js +24 -1
  66. package/lib/helpers/hbom.js +710 -0
  67. package/lib/helpers/hbom.poku.js +496 -0
  68. package/lib/helpers/hbomAnalysis.js +268 -0
  69. package/lib/helpers/hbomAnalysis.poku.js +249 -0
  70. package/lib/helpers/hbomLoader.js +35 -0
  71. package/lib/helpers/hostTopology.js +803 -0
  72. package/lib/helpers/hostTopology.poku.js +363 -0
  73. package/lib/helpers/inventoryStats.js +69 -0
  74. package/lib/helpers/inventoryStats.poku.js +86 -0
  75. package/lib/helpers/lolbas.js +19 -1
  76. package/lib/helpers/lolbas.poku.js +23 -0
  77. package/lib/helpers/mcpConfigParser.js +21 -5
  78. package/lib/helpers/mcpConfigParser.poku.js +39 -2
  79. package/lib/helpers/osqueryTransform.js +47 -0
  80. package/lib/helpers/osqueryTransform.poku.js +47 -0
  81. package/lib/helpers/plugins.js +349 -0
  82. package/lib/helpers/plugins.poku.js +57 -0
  83. package/lib/helpers/propertySanitizer.js +121 -0
  84. package/lib/helpers/protobom.js +156 -45
  85. package/lib/helpers/protobom.poku.js +140 -5
  86. package/lib/helpers/remote/dependency-track.js +36 -3
  87. package/lib/helpers/remote/dependency-track.poku.js +44 -0
  88. package/lib/helpers/source.js +24 -0
  89. package/lib/helpers/source.poku.js +32 -0
  90. package/lib/helpers/utils.js +2454 -198
  91. package/lib/helpers/utils.poku.js +1798 -74
  92. package/lib/managers/binary.e2e.poku.js +367 -0
  93. package/lib/managers/binary.js +2306 -350
  94. package/lib/managers/binary.poku.js +1700 -1
  95. package/lib/managers/docker.js +441 -95
  96. package/lib/managers/docker.poku.js +1479 -14
  97. package/lib/server/server.js +2 -24
  98. package/lib/server/server.poku.js +36 -1
  99. package/lib/stages/postgen/annotator.js +38 -0
  100. package/lib/stages/postgen/annotator.poku.js +107 -1
  101. package/lib/stages/postgen/auditBom.js +121 -18
  102. package/lib/stages/postgen/auditBom.poku.js +2967 -990
  103. package/lib/stages/postgen/hostTopologyAudit.poku.js +186 -0
  104. package/lib/stages/postgen/postgen.js +192 -1
  105. package/lib/stages/postgen/postgen.poku.js +321 -0
  106. package/lib/stages/postgen/ruleEngine.js +116 -0
  107. package/lib/stages/pregen/envAudit.js +14 -3
  108. package/package.json +24 -21
  109. package/types/bin/hbom.d.ts +3 -0
  110. package/types/bin/hbom.d.ts.map +1 -0
  111. package/types/bin/repl.d.ts.map +1 -1
  112. package/types/lib/audit/index.d.ts +44 -0
  113. package/types/lib/audit/index.d.ts.map +1 -1
  114. package/types/lib/audit/reporters.d.ts +16 -0
  115. package/types/lib/audit/reporters.d.ts.map +1 -1
  116. package/types/lib/audit/targets.d.ts.map +1 -1
  117. package/types/lib/cli/index.d.ts +16 -0
  118. package/types/lib/cli/index.d.ts.map +1 -1
  119. package/types/lib/evinser/evinser.d.ts +4 -0
  120. package/types/lib/evinser/evinser.d.ts.map +1 -1
  121. package/types/lib/helpers/agentFormulationParser.d.ts.map +1 -1
  122. package/types/lib/helpers/analyzer.d.ts +33 -0
  123. package/types/lib/helpers/analyzer.d.ts.map +1 -1
  124. package/types/lib/helpers/analyzerScope.d.ts +11 -0
  125. package/types/lib/helpers/analyzerScope.d.ts.map +1 -0
  126. package/types/lib/helpers/asarutils.d.ts +34 -0
  127. package/types/lib/helpers/asarutils.d.ts.map +1 -0
  128. package/types/lib/helpers/auditCategories.d.ts +5 -0
  129. package/types/lib/helpers/auditCategories.d.ts.map +1 -1
  130. package/types/lib/helpers/cbomutils.d.ts +3 -2
  131. package/types/lib/helpers/cbomutils.d.ts.map +1 -1
  132. package/types/lib/helpers/chromextutils.d.ts.map +1 -1
  133. package/types/lib/helpers/ciParsers/githubActions.d.ts.map +1 -1
  134. package/types/lib/helpers/communityAiConfigParser.d.ts.map +1 -1
  135. package/types/lib/helpers/depsUtils.d.ts.map +1 -1
  136. package/types/lib/helpers/display.d.ts +1 -0
  137. package/types/lib/helpers/display.d.ts.map +1 -1
  138. package/types/lib/helpers/evidenceUtils.d.ts +8 -0
  139. package/types/lib/helpers/evidenceUtils.d.ts.map +1 -0
  140. package/types/lib/helpers/exportUtils.d.ts.map +1 -1
  141. package/types/lib/helpers/gtfobins.d.ts +8 -0
  142. package/types/lib/helpers/gtfobins.d.ts.map +1 -1
  143. package/types/lib/helpers/hbom.d.ts +49 -0
  144. package/types/lib/helpers/hbom.d.ts.map +1 -0
  145. package/types/lib/helpers/hbomAnalysis.d.ts +62 -0
  146. package/types/lib/helpers/hbomAnalysis.d.ts.map +1 -0
  147. package/types/lib/helpers/hbomLoader.d.ts +7 -0
  148. package/types/lib/helpers/hbomLoader.d.ts.map +1 -0
  149. package/types/lib/helpers/hostTopology.d.ts +12 -0
  150. package/types/lib/helpers/hostTopology.d.ts.map +1 -0
  151. package/types/lib/helpers/inventoryStats.d.ts +11 -0
  152. package/types/lib/helpers/inventoryStats.d.ts.map +1 -0
  153. package/types/lib/helpers/lolbas.d.ts.map +1 -1
  154. package/types/lib/helpers/mcpConfigParser.d.ts +1 -1
  155. package/types/lib/helpers/mcpConfigParser.d.ts.map +1 -1
  156. package/types/lib/helpers/osqueryTransform.d.ts +3 -0
  157. package/types/lib/helpers/osqueryTransform.d.ts.map +1 -1
  158. package/types/lib/helpers/plugins.d.ts +58 -0
  159. package/types/lib/helpers/plugins.d.ts.map +1 -0
  160. package/types/lib/helpers/propertySanitizer.d.ts +3 -0
  161. package/types/lib/helpers/propertySanitizer.d.ts.map +1 -0
  162. package/types/lib/helpers/protobom.d.ts +3 -4
  163. package/types/lib/helpers/protobom.d.ts.map +1 -1
  164. package/types/lib/helpers/remote/dependency-track.d.ts +10 -3
  165. package/types/lib/helpers/remote/dependency-track.d.ts.map +1 -1
  166. package/types/lib/helpers/source.d.ts.map +1 -1
  167. package/types/lib/helpers/utils.d.ts +74 -8
  168. package/types/lib/helpers/utils.d.ts.map +1 -1
  169. package/types/lib/managers/binary.d.ts +5 -0
  170. package/types/lib/managers/binary.d.ts.map +1 -1
  171. package/types/lib/managers/docker.d.ts +3 -0
  172. package/types/lib/managers/docker.d.ts.map +1 -1
  173. package/types/lib/server/server.d.ts +2 -0
  174. package/types/lib/server/server.d.ts.map +1 -1
  175. package/types/lib/stages/postgen/annotator.d.ts.map +1 -1
  176. package/types/lib/stages/postgen/auditBom.d.ts +26 -1
  177. package/types/lib/stages/postgen/auditBom.d.ts.map +1 -1
  178. package/types/lib/stages/postgen/postgen.d.ts +2 -1
  179. package/types/lib/stages/postgen/postgen.d.ts.map +1 -1
  180. package/types/lib/stages/postgen/ruleEngine.d.ts.map +1 -1
  181. package/types/lib/stages/pregen/envAudit.d.ts.map +1 -1
  182. package/data/spdx-model-v3.0.1.jsonld +0 -15999
package/README.md CHANGED
@@ -16,8 +16,9 @@ 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
20
  - Software (SBOM) - For many languages and container images.
20
- - Cryptography (CBOM) - For Java and Python projects.
21
+ - Cryptography (CBOM) - For Java keystores and certificates, plus JavaScript and TypeScript source-level algorithm inventory.
21
22
  - Operations (OBOM) - For Linux container images and VMs running Linux or Windows operating systems.
22
23
  - Software-as-a-Service (SaaSBOM) - For Java, Python, JavaScript, TypeScript, and PHP projects.
23
24
  - Attestations (CDXA) - Generate SBOM with templates for multiple standards. Sign the BOM document at a granular level to improve authenticity.
@@ -33,6 +34,7 @@ Supported output document formats:
33
34
  | Persona | What cdxgen helps you do | First command | Read next |
34
35
  | -------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- |
35
36
  | **Developers** | Generate a CycloneDX BOM from a local repo, git URL, purl, or container image | `cdxgen -o bom.json .` | [CLI Usage][docs-cli], [Supported Project Types][docs-project-types] |
37
+ | **Hardware teams** | Generate an HBOM or merged HBOM+OBOM host view for the current host | `hbom -o hbom.json` | [HBOM guide](docs/HBOM.md), [HBOM lesson](docs/LESSON13.md) |
36
38
  | **AppSec** | Enrich BOMs with evidence, run BOM audit rules, and feed downstream security workflows | `cdxgen -o bom.json --profile appsec --evidence --bom-audit .` | [BOM Audit](docs/BOM_AUDIT.md), [Threat Model](docs/THREAT_MODEL.md) |
37
39
  | **SOC analysts** | Build OBOM inventories for live hosts and triage runtime posture issues | `obom -o obom.json --deep --bom-audit --bom-audit-categories obom-runtime` | [OBOM lessons](docs/OBOM_LESSONS.md), [Server Usage][docs-server] |
38
40
  | **Compliance teams** | Validate BOM quality, check SCVS/CRA posture, and export SPDX deliverables | `cdx-validate -i bom.json --benchmark scvs-l2,cra` | [cdx-validate](docs/CDX_VALIDATE.md), [cdx-convert](docs/CDX_CONVERT.md), [Permissions][docs-permissions] |
@@ -44,6 +46,14 @@ Supported output document formats:
44
46
  - Start with a local path, git URL, or purl and generate a BOM in one command.
45
47
  - Use [Supported Project Types][docs-project-types] to confirm ecosystem coverage before wiring cdxgen into CI.
46
48
 
49
+ #### For hardware and platform teams
50
+
51
+ - Use `hbom` when you need a CycloneDX hardware inventory for the current host rather than a software dependency graph.
52
+ - Start with the [HBOM guide](docs/HBOM.md) and the [HBOM lesson](docs/LESSON13.md) for supported platforms, enrichment options, and validation workflows.
53
+ - Use `hbom --dry-run` first when you want a read-only partial HBOM plus an exact list of blocked hardware probe commands before a full collection run.
54
+ - Use `hbom diagnostics` when you want a focused summary of missing native utilities and permission-denied enrichments before deciding whether to install host packages or rerun with `--privileged`.
55
+ - Use `hbom --include-runtime` when you want one topology-aware CycloneDX host document that merges hardware inventory with runtime evidence using strict, non-guessing joins.
56
+
47
57
  #### For AppSec
48
58
 
49
59
  - Use `--profile appsec`, `--evidence`, and `--bom-audit` when you want richer security context.
@@ -51,8 +61,8 @@ Supported output document formats:
51
61
 
52
62
  #### For SOC analysts
53
63
 
54
- - Use `obom` for live-system and runtime inventory on Linux and Windows hosts.
55
- - Focus on [OBOM lessons](docs/OBOM_LESSONS.md) when you need host triage, persistence review, LOLBAS-backed Windows startup analysis, or incident-response evidence.
64
+ - Use `obom` for live-system and runtime inventory on Linux, Windows, and macOS hosts.
65
+ - Focus on [OBOM lessons](docs/OBOM_LESSONS.md) when you need host triage, persistence review, Linux GTFOBins-backed runtime analysis, hardening drift review, or incident-response evidence.
56
66
 
57
67
  #### For compliance and platform governance
58
68
 
@@ -79,7 +89,7 @@ When you want to inspect what cdxgen would do before allowing side effects, use
79
89
  cdxgen --dry-run -p -t js .
80
90
  ```
81
91
 
82
- Dry-run mode keeps cdxgen read-only: it reads local files, blocks writes/exec/temp creation/cloning/submission, and prints an activity summary table for both beginners and power users.
92
+ Dry-run mode keeps cdxgen read-only: it reads local files, blocks writes/exec/temp creation/cloning/submission, and prints an activity summary table for both beginners and power users. When available, the recorded activity data also captures archive extraction intent, command I/O volume, and followed symlink-resolution traces.
83
93
 
84
94
  ## Documentation
85
95
 
@@ -89,9 +99,12 @@ Sections include:
89
99
 
90
100
  - [Getting Started][docs-homepage]
91
101
  - [CLI Usage][docs-cli]
102
+ - [HBOM Guide](docs/HBOM.md)
103
+ - [Merged Host View Lesson](docs/LESSON13.md)
92
104
  - [Server Usage][docs-server]
93
105
  - [Hands-on Lessons](docs/LESSON8.md)
94
106
  - [Container Escape & Privilege Lesson](docs/LESSON9.md)
107
+ - [HBOM Lesson](docs/LESSON13.md)
95
108
  - [Supported Project Types][docs-project-types]
96
109
  - [Environment Variables][docs-env-vars]
97
110
  - [Advanced Usage][docs-advanced-usage]
@@ -115,6 +128,7 @@ Installing `@cyclonedx/cdxgen` exposes these commands:
115
128
  | Command | Purpose | Standalone GitHub release binary |
116
129
  | --------------- | ---------------------------------------------------------------------------------------------------- | -------------------------------- |
117
130
  | `cdxgen` | Generate CycloneDX / SPDX BOMs from source, images, binaries, git URLs, or purls | yes |
131
+ | `hbom` | Generate a CycloneDX hardware BOM for the current host | yes (`hbom`, `hbom-slim`) |
118
132
  | `cdx-audit` | Prioritize existing BOM dependencies for upstream supply-chain review using explainable risk signals | yes |
119
133
  | `cdx-convert` | Convert CycloneDX JSON to SPDX 3.0.1 JSON-LD | yes |
120
134
  | `cdx-sign` | Sign BOMs with JSF signatures | yes |
@@ -128,10 +142,14 @@ Installing `@cyclonedx/cdxgen` exposes these commands:
128
142
  | `spdxgen` | Alias for `cdxgen --format spdx` | use `cdxgen` |
129
143
  | `cdxgen-secure` | Alias for hardened `cdxgen` defaults | use `cdxgen` |
130
144
 
131
- Standalone GitHub release binaries are published for `cdxgen`, `cdxgen-slim`, `cdx-audit`, `cdx-convert`, `cdx-sign`, `cdx-validate`, and `cdx-verify`.
145
+ Standalone GitHub release binaries are published for `cdxgen`, `cdxgen-slim`, `hbom`, `hbom-slim`, `cdx-audit`, `cdx-convert`, `cdx-sign`, `cdx-validate`, and `cdx-verify`.
146
+
147
+ `hbom` release binaries bundle both `@cdxgen/cdx-hbom` and the matching `@cdxgen/cdxgen-plugins-bin*` companion helpers for the target platform. `hbom-slim` keeps the dedicated hardware collector (`@cdxgen/cdx-hbom`) but omits the companion plugin bundle when you want the smallest single-file HBOM executable.
132
148
 
133
149
  `cdx-audit` is designed to accelerate upstream dependency review with explainable, evidence-backed risk prioritization. It complements provenance, reproducibility, and manual investigation rather than replacing them.
134
150
 
151
+ 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.
152
+
135
153
  To run cdxgen without installing (hotloading), use the [pnpm dlx](https://pnpm.io/cli/dlx) command.
136
154
 
137
155
  ```shell
@@ -146,6 +164,8 @@ corepack pnpm dlx --package=@cyclonedx/cdxgen cdx-convert --help
146
164
  corepack pnpm dlx --package=@cyclonedx/cdxgen cdx-validate --help
147
165
  corepack pnpm dlx --package=@cyclonedx/cdxgen cdx-sign --help
148
166
  corepack pnpm dlx --package=@cyclonedx/cdxgen cdx-verify --help
167
+ corepack pnpm dlx --package=@cyclonedx/cdxgen hbom --help
168
+ corepack pnpm dlx --package=@cyclonedx/cdxgen hbom diagnostics --help
149
169
  corepack pnpm dlx --package=@cyclonedx/cdxgen evinse --help
150
170
  corepack pnpm dlx --package=@cyclonedx/cdxgen cdxi --help
151
171
  ```
@@ -172,6 +192,10 @@ Common asset names:
172
192
  - `cdxgen-linux-amd64-musl`
173
193
  - `cdxgen-darwin-arm64`
174
194
  - `cdxgen-windows-amd64.exe`
195
+ - `hbom-linux-amd64`
196
+ - `hbom-linux-amd64-slim`
197
+ - `hbom-darwin-arm64`
198
+ - `hbom-windows-amd64.exe`
175
199
  - `cdx-audit-linux-amd64`
176
200
  - `cdx-audit-darwin-arm64`
177
201
  - `cdx-audit-windows-amd64.exe`
@@ -276,17 +300,19 @@ import { createBom, submitBom } from "npm:@cyclonedx/cdxgen@^12.2.1";
276
300
 
277
301
  ## Common workflows
278
302
 
279
- | Goal | First command | Read next |
280
- | ---------------------------------------------------------- | -------------------------------------------------------------------------- | ------------------------------------ |
281
- | Generate a BOM from the current repository | `cdxgen -o bom.json .` | [CLI Usage][docs-cli] |
282
- | Generate a BOM from a git URL | `cdxgen -o bom.json https://github.com/example/project.git` | [CLI Usage][docs-cli] |
283
- | Generate a BOM from a package URL | `cdxgen -o bom.json "pkg:npm/lodash@4.17.21"` | [CLI Usage][docs-cli] |
284
- | Scan a container image | `cdxgen ghcr.io/owasp-dep-scan/depscan:nightly -o bom.json -t docker` | [Server Usage][docs-server] |
285
- | Audit a generated BOM for built-in supply-chain findings | `cdxgen -o bom.json --bom-audit .` | [BOM Audit](docs/BOM_AUDIT.md) |
286
- | Prioritize an existing BOM for upstream risk-driven review | `cdx-audit --bom bom.json` | [cdx-audit](docs/CDX_AUDIT.md) |
287
- | Validate a BOM against structural and compliance checks | `cdx-validate -i bom.json` | [cdx-validate](docs/CDX_VALIDATE.md) |
288
- | Convert CycloneDX JSON to SPDX JSON-LD | `cdx-convert -i bom.json -o bom.spdx.json` | [cdx-convert](docs/CDX_CONVERT.md) |
289
- | Generate an OBOM for live-system triage | `obom -o obom.json --deep --bom-audit --bom-audit-categories obom-runtime` | [OBOM lessons](docs/OBOM_LESSONS.md) |
303
+ | Goal | First command | Read next |
304
+ | ---------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ------------------------------------ |
305
+ | Generate a BOM from the current repository | `cdxgen -o bom.json .` | [CLI Usage][docs-cli] |
306
+ | Generate a BOM from a git URL | `cdxgen -o bom.json https://github.com/example/project.git` | [CLI Usage][docs-cli] |
307
+ | Generate a BOM from a package URL | `cdxgen -o bom.json "pkg:npm/lodash@4.17.21"` | [CLI Usage][docs-cli] |
308
+ | Scan a container image | `cdxgen ghcr.io/owasp-dep-scan/depscan:nightly -o bom.json -t docker` | [Server Usage][docs-server] |
309
+ | Audit a generated BOM for built-in supply-chain findings | `cdxgen -o bom.json --bom-audit .` | [BOM Audit](docs/BOM_AUDIT.md) |
310
+ | Prioritize an existing BOM for upstream risk-driven review | `cdx-audit --bom bom.json` | [cdx-audit](docs/CDX_AUDIT.md) |
311
+ | Re-audit a saved OBOM or BOM directly later | `cdx-audit --bom obom.json --direct-bom-audit --categories obom-runtime` | [cdx-audit](docs/CDX_AUDIT.md) |
312
+ | Validate a BOM against structural and compliance checks | `cdx-validate -i bom.json` | [cdx-validate](docs/CDX_VALIDATE.md) |
313
+ | Convert CycloneDX JSON to SPDX JSON-LD | `cdx-convert -i bom.json -o bom.spdx.json` | [cdx-convert](docs/CDX_CONVERT.md) |
314
+ | Generate an OBOM for live-system triage | `obom -o obom.json --deep --bom-audit --bom-audit-categories obom-runtime` | [OBOM lessons](docs/OBOM_LESSONS.md) |
315
+ | Review an offline rootfs for hardening drift | `cdxgen /absolute/path/to/rootfs -t rootfs -o bom.json --bom-audit --bom-audit-categories rootfs-hardening` | [BOM Audit](docs/BOM_AUDIT.md) |
290
316
 
291
317
  For the full option reference, use `cdxgen --help` or visit [CLI Usage][docs-cli].
292
318
 
@@ -494,7 +520,7 @@ cdxgen can retain the dependency tree under the `dependencies` attribute for a s
494
520
 
495
521
  ## Plugins
496
522
 
497
- cdxgen could be extended with external binary plugins to support more SBOM use cases. These are now installed as an optional dependency.
523
+ cdxgen could be extended with external binary plugins to support more SBOM use cases. These are installed as an optional dependency.
498
524
 
499
525
  ```shell
500
526
  sudo npm install -g @cdxgen/cdxgen-plugins-bin
@@ -503,7 +529,7 @@ sudo npm install -g @cdxgen/cdxgen-plugins-bin
503
529
  ## Plugins (pnpm)
504
530
 
505
531
  `cdxgen` can be extended with external binary plugins to support more SBOM use cases.
506
- These are now installed as optional dependencies and can be used without a global install.
532
+ These are installed as optional dependencies and can be used without a global install.
507
533
 
508
534
  ```shell
509
535
  pnpm dlx @cdxgen/cdxgen-plugins-bin
@@ -523,6 +549,14 @@ You can also pass `-t docker` with repository names. Only the `latest` tag would
523
549
  cdxgen shiftleft/scan-slim -o /tmp/bom.json -t docker
524
550
  ```
525
551
 
552
+ For offline or staged scans, point cdxgen at a locally reconstructed root filesystem directory. The container pipeline accepts `-t docker`, `-t rootfs`, or `-t oci-dir` for this mode.
553
+
554
+ ```shell
555
+ cdxgen /tmp/remote_target -o /tmp/bom.json -t rootfs
556
+ ```
557
+
558
+ With the packaged helpers installed, rootfs and container BOMs gain repository trust-source components, deep keyring / CA-store `cryptographic-asset` components, native CycloneDX origin fields such as `supplier`, `manufacturer`, and `authors` for OS package trust metadata, plus additional package trust-state properties such as `PackageArchitecture`, `PackageSource`, and `PackageStatus`.
559
+
526
560
  You can also pass the .tar file of a container image.
527
561
 
528
562
  ```shell
@@ -546,7 +580,7 @@ podman system service -t 0 &
546
580
 
547
581
  ## Generate OBOM for a live system
548
582
 
549
- You can use the `obom` command to generate an OBOM for a live system or a VM for compliance and vulnerability management purposes. Windows and Linux operating systems are supported in this mode.
583
+ You can use the `obom` command to generate an OBOM for a live system or a VM for compliance and vulnerability management purposes. Linux, Windows, and macOS are supported in this mode, though some macOS tables require elevated privileges and Full Disk Access.
550
584
 
551
585
  ```shell
552
586
  # obom is an alias for cdxgen -t os
@@ -554,19 +588,33 @@ obom
554
588
  # cdxgen -t os
555
589
  ```
556
590
 
557
- This feature is powered by osquery, which is [installed](https://github.com/cdxgen/cdxgen-plugins-bin/blob/main/build.sh#L8) along with the binary plugins. cdxgen would opportunistically try to detect as many components, apps, and extensions as possible using the [default queries](data/queries.json). The process would take several minutes and result in an SBOM file with thousands of components of various types, such as operating-system, device-drivers, files, and data.
591
+ This feature is powered by osquery, which is [installed](https://github.com/cdxgen/cdxgen-plugins-bin/blob/main/build.sh#L8) along with the binary plugins. cdxgen would opportunistically try to detect as many components, apps, and extensions as possible using the platform-specific default queries under `data/queries*.json`. The Linux profile includes dedicated `sysctl_hardening` and `mount_hardening` snapshots, GTFOBins enrichment for privileged and network-active runtime rows, Secure Boot certificate inventory, and improved npm package discovery. When the optional `trustinspector` helper is available, OBOM collection is further enriched with:
592
+
593
+ - macOS code-signing authority, team ID, and notarization assessment metadata for discovered application paths
594
+ - Windows Authenticode signer/timestamp metadata for discovered executable paths
595
+ - Windows WDAC active-policy inventory
596
+ - batched path inspection so large host inventories keep their trust metadata instead of stopping at the first few hundred paths
597
+
598
+ Container and rootfs BOMs also summarize how many executable and shared-library file components were discovered outside OS package ownership. Look for `cdx:container:unpackagedExecutableCount` and `cdx:container:unpackagedSharedLibraryCount` in metadata, or use `.unpackagedbins` and `.unpackagedlibs` in `cdxi` for an interactive pivot.
558
599
 
559
- For practical SOC/IR and compliance workflows, see the dedicated [OBOM lessons](./docs/OBOM_LESSONS.md).
600
+ The process would take several minutes and result in an SBOM file with thousands of components of various types, such as operating-system, device-drivers, files, and data.
601
+
602
+ For practical SOC/IR and compliance workflows, see the dedicated [OBOM lessons](./docs/OBOM_LESSONS.md). For macOS-specific setup and permission caveats, see [OBOM macOS troubleshooting](./docs/OBOM_MACOS_TROUBLESHOOTING.md). For compact before/after examples of the new trust metadata, see [Trust enrichment BOM diff examples](./docs/TRUST_ENRICHMENT_DIFF.md).
560
603
 
561
604
  ## Generate Cryptography Bill of Materials (CBOM)
562
605
 
563
- Use the `cbom` alias to generate a CBOM. This is currently supported only for Java projects.
606
+ Use the `cbom` alias to generate a CBOM. In addition to keystores and certificates, cdxgen can also derive cryptographic algorithm inventory from JavaScript and TypeScript source by following lightweight constant propagation through common `node:crypto`, WebCrypto, and JWT call sites.
564
607
 
565
608
  ```shell
566
609
  cbom -t java
567
610
  # cdxgen -t java --include-crypto -o bom.json .
611
+
612
+ # Add source-derived crypto algorithms for a JS or TS project
613
+ cdxgen --include-crypto -o bom.json /absolute/path/to/js-project
568
614
  ```
569
615
 
616
+ When reviewing the result in `cdxi`, use `.cryptos` for the full cryptographic asset view or `.sourcecryptos` to narrow the list to source-derived algorithm components only.
617
+
570
618
  ## Generating SaaSBOM and component evidences
571
619
 
572
620
  See [evinse mode](./ADVANCED.md) in the advanced documentation.
package/bin/audit.js CHANGED
@@ -7,11 +7,7 @@ import process from "node:process";
7
7
  import yargs from "yargs";
8
8
  import { hideBin } from "yargs/helpers";
9
9
 
10
- import {
11
- DEFAULT_AUDIT_CATEGORIES,
12
- finalizeAuditReport,
13
- runAudit,
14
- } from "../lib/audit/index.js";
10
+ import { finalizeAuditReport, runAudit } from "../lib/audit/index.js";
15
11
  import { createProgressTracker } from "../lib/audit/progress.js";
16
12
  import {
17
13
  retrieveCdxgenVersion,
@@ -38,6 +34,17 @@ const args = yargs(hideBin(process.argv))
38
34
  "Optional directory to store generated per-purl SBOMs and findings.",
39
35
  type: "string",
40
36
  })
37
+ .option("direct-bom-audit", {
38
+ default: false,
39
+ description:
40
+ "Evaluate audit rules directly against the supplied BOM(s) instead of running only the predictive dependency audit.",
41
+ type: "boolean",
42
+ })
43
+ .option("rules-dir", {
44
+ description:
45
+ "Directory containing additional YAML audit rules (merged with built-in). Applies to direct BOM audit and predictive child-SBOM rule evaluation.",
46
+ type: "string",
47
+ })
41
48
  .option("report", {
42
49
  choices: ["console", "json", "sarif"],
43
50
  default: "console",
@@ -49,9 +56,8 @@ const args = yargs(hideBin(process.argv))
49
56
  type: "string",
50
57
  })
51
58
  .option("categories", {
52
- default: DEFAULT_AUDIT_CATEGORIES.join(","),
53
59
  description:
54
- "Comma-separated rule categories to evaluate for each generated child SBOM.",
60
+ "Comma-separated rule categories. In predictive mode this applies to generated child SBOMs (default: ai-agent, ci-permission, dependency-source, package-integrity). In direct BOM audit mode it applies to the supplied BOM(s) themselves (default: obom-runtime for OBOMs, all categories otherwise).",
55
61
  type: "string",
56
62
  })
57
63
  .option("min-severity", {
@@ -98,6 +104,11 @@ const args = yargs(hideBin(process.argv))
98
104
  "Prioritize direct runtime dependencies ahead of optional, development-only, or platform-specific transitive packages during target selection.",
99
105
  type: "boolean",
100
106
  })
107
+ .option("allowlist-file", {
108
+ description:
109
+ "Optional JSON array or newline-delimited file of purl prefixes to exclude from predictive audit target selection in addition to the built-in well-known allowlist.",
110
+ type: "string",
111
+ })
101
112
  .check((argv) => {
102
113
  if (!argv.bom && !argv.bomDir) {
103
114
  throw new Error("Specify --bom or --bom-dir.");
@@ -162,9 +173,11 @@ function writeOrPrint(output, outputPath) {
162
173
  try {
163
174
  const reportFile = args.reportFile || args.output;
164
175
  const report = await runAudit({
176
+ allowlistFile: args.allowlistFile,
165
177
  bom: args.bom,
166
178
  bomDir: args.bomDir,
167
179
  categories: splitCsv(args.categories),
180
+ directBomAudit: args.directBomAudit,
168
181
  failSeverity: args.failSeverity,
169
182
  maxTargets: args.maxTargets,
170
183
  minSeverity: args.minSeverity,
@@ -172,6 +185,7 @@ function writeOrPrint(output, outputPath) {
172
185
  prioritizeDirectRuntime: args.prioritizeDirectRuntime,
173
186
  report: args.report,
174
187
  reportsDir: args.reportsDir,
188
+ rulesDir: args.rulesDir,
175
189
  scope: args.scope === "required" ? "required" : undefined,
176
190
  trusted: args.onlyTrusted
177
191
  ? "only"