@cyclonedx/cdxgen 12.3.3 → 12.4.1
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.
- package/README.md +69 -25
- package/bin/audit.js +21 -7
- package/bin/cdxgen.js +270 -127
- package/bin/convert.js +34 -15
- package/bin/hbom.js +495 -0
- package/bin/repl.js +592 -37
- package/bin/validate.js +31 -4
- package/bin/verify.js +18 -5
- package/data/README.md +298 -25
- package/data/component-tags.json +6 -0
- package/data/crypto-oid.json +16 -0
- package/data/cyclonedx-2.0-bundled.schema.json +7182 -0
- package/data/predictive-audit-allowlist.json +11 -0
- package/data/queries-darwin.json +12 -1
- package/data/queries-win.json +7 -1
- package/data/queries.json +39 -2
- package/data/rules/ai-agent-governance.yaml +16 -0
- package/data/rules/asar-archives.yaml +150 -0
- package/data/rules/chrome-extensions.yaml +8 -0
- package/data/rules/ci-permissions.yaml +42 -18
- package/data/rules/container-risk.yaml +14 -7
- package/data/rules/dependency-sources.yaml +11 -0
- package/data/rules/hbom-compliance.yaml +325 -0
- package/data/rules/hbom-performance.yaml +307 -0
- package/data/rules/hbom-security.yaml +248 -0
- package/data/rules/host-topology.yaml +165 -0
- package/data/rules/mcp-servers.yaml +18 -3
- package/data/rules/obom-runtime.yaml +907 -22
- package/data/rules/package-integrity.yaml +14 -0
- package/data/rules/rootfs-hardening.yaml +179 -0
- package/data/rules/vscode-extensions.yaml +9 -0
- package/lib/audit/index.js +210 -8
- package/lib/audit/index.poku.js +332 -0
- package/lib/audit/reporters.js +222 -0
- package/lib/audit/targets.js +146 -1
- package/lib/audit/targets.poku.js +186 -0
- package/lib/cli/asar.poku.js +328 -0
- package/lib/cli/index.js +527 -99
- package/lib/cli/index.poku.js +1469 -212
- package/lib/evinser/evinser.js +14 -9
- package/lib/helpers/analyzer.js +1406 -29
- package/lib/helpers/analyzer.poku.js +342 -0
- package/lib/helpers/analyzerScope.js +712 -0
- package/lib/helpers/asarutils.js +1556 -0
- package/lib/helpers/asarutils.poku.js +443 -0
- package/lib/helpers/auditCategories.js +12 -0
- package/lib/helpers/auditCategories.poku.js +32 -0
- package/lib/helpers/bomUtils.js +155 -1
- package/lib/helpers/bomUtils.poku.js +79 -1
- package/lib/helpers/cbomutils.js +271 -1
- package/lib/helpers/cbomutils.poku.js +248 -5
- package/lib/helpers/display.js +291 -1
- package/lib/helpers/display.poku.js +149 -0
- package/lib/helpers/evidenceUtils.js +58 -0
- package/lib/helpers/evidenceUtils.poku.js +54 -0
- package/lib/helpers/exportUtils.js +9 -0
- package/lib/helpers/gtfobins.js +142 -8
- package/lib/helpers/gtfobins.poku.js +24 -1
- package/lib/helpers/hbom.js +710 -0
- package/lib/helpers/hbom.poku.js +496 -0
- package/lib/helpers/hbomAnalysis.js +268 -0
- package/lib/helpers/hbomAnalysis.poku.js +249 -0
- package/lib/helpers/hbomLoader.js +35 -0
- package/lib/helpers/hostTopology.js +803 -0
- package/lib/helpers/hostTopology.poku.js +363 -0
- package/lib/helpers/inventoryStats.js +69 -0
- package/lib/helpers/inventoryStats.poku.js +86 -0
- package/lib/helpers/lolbas.js +19 -1
- package/lib/helpers/lolbas.poku.js +23 -0
- package/lib/helpers/osqueryTransform.js +47 -0
- package/lib/helpers/osqueryTransform.poku.js +47 -0
- package/lib/helpers/plugins.js +350 -0
- package/lib/helpers/plugins.poku.js +57 -0
- package/lib/helpers/protobom.js +209 -45
- package/lib/helpers/protobom.poku.js +183 -5
- package/lib/helpers/protobomLoader.js +43 -0
- package/lib/helpers/protobomLoader.poku.js +31 -0
- package/lib/helpers/remote/dependency-track.js +36 -3
- package/lib/helpers/remote/dependency-track.poku.js +44 -0
- package/lib/helpers/source.js +24 -0
- package/lib/helpers/source.poku.js +32 -0
- package/lib/helpers/utils.js +1438 -93
- package/lib/helpers/utils.poku.js +846 -4
- package/lib/managers/binary.e2e.poku.js +367 -0
- package/lib/managers/binary.js +2293 -353
- package/lib/managers/binary.poku.js +1699 -1
- package/lib/managers/docker.js +201 -79
- package/lib/managers/docker.poku.js +337 -12
- package/lib/server/server.js +4 -28
- package/lib/stages/postgen/annotator.js +38 -0
- package/lib/stages/postgen/annotator.poku.js +107 -1
- package/lib/stages/postgen/auditBom.js +121 -18
- package/lib/stages/postgen/auditBom.poku.js +1366 -31
- package/lib/stages/postgen/hostTopologyAudit.poku.js +186 -0
- package/lib/stages/postgen/postgen.js +406 -8
- package/lib/stages/postgen/postgen.poku.js +484 -0
- package/lib/stages/postgen/ruleEngine.js +116 -0
- package/lib/stages/pregen/envAudit.js +14 -3
- package/lib/validator/bomValidator.js +90 -38
- package/lib/validator/bomValidator.poku.js +90 -0
- package/lib/validator/complianceRules.js +4 -2
- package/lib/validator/index.poku.js +14 -0
- package/package.json +23 -21
- package/types/bin/hbom.d.ts +3 -0
- package/types/bin/hbom.d.ts.map +1 -0
- package/types/bin/repl.d.ts +1 -1
- package/types/bin/repl.d.ts.map +1 -1
- package/types/lib/audit/index.d.ts +44 -0
- package/types/lib/audit/index.d.ts.map +1 -1
- package/types/lib/audit/reporters.d.ts +16 -0
- package/types/lib/audit/reporters.d.ts.map +1 -1
- package/types/lib/audit/targets.d.ts.map +1 -1
- package/types/lib/cli/index.d.ts +16 -0
- package/types/lib/cli/index.d.ts.map +1 -1
- package/types/lib/evinser/evinser.d.ts +4 -0
- package/types/lib/evinser/evinser.d.ts.map +1 -1
- package/types/lib/helpers/analyzer.d.ts +33 -0
- package/types/lib/helpers/analyzer.d.ts.map +1 -1
- package/types/lib/helpers/analyzerScope.d.ts +11 -0
- package/types/lib/helpers/analyzerScope.d.ts.map +1 -0
- package/types/lib/helpers/asarutils.d.ts +34 -0
- package/types/lib/helpers/asarutils.d.ts.map +1 -0
- package/types/lib/helpers/auditCategories.d.ts +5 -0
- package/types/lib/helpers/auditCategories.d.ts.map +1 -1
- package/types/lib/helpers/bomUtils.d.ts +10 -0
- package/types/lib/helpers/bomUtils.d.ts.map +1 -1
- package/types/lib/helpers/cbomutils.d.ts +3 -2
- package/types/lib/helpers/cbomutils.d.ts.map +1 -1
- package/types/lib/helpers/display.d.ts.map +1 -1
- package/types/lib/helpers/evidenceUtils.d.ts +8 -0
- package/types/lib/helpers/evidenceUtils.d.ts.map +1 -0
- package/types/lib/helpers/exportUtils.d.ts.map +1 -1
- package/types/lib/helpers/gtfobins.d.ts +8 -0
- package/types/lib/helpers/gtfobins.d.ts.map +1 -1
- package/types/lib/helpers/hbom.d.ts +49 -0
- package/types/lib/helpers/hbom.d.ts.map +1 -0
- package/types/lib/helpers/hbomAnalysis.d.ts +76 -0
- package/types/lib/helpers/hbomAnalysis.d.ts.map +1 -0
- package/types/lib/helpers/hbomLoader.d.ts +7 -0
- package/types/lib/helpers/hbomLoader.d.ts.map +1 -0
- package/types/lib/helpers/hostTopology.d.ts +12 -0
- package/types/lib/helpers/hostTopology.d.ts.map +1 -0
- package/types/lib/helpers/inventoryStats.d.ts +11 -0
- package/types/lib/helpers/inventoryStats.d.ts.map +1 -0
- package/types/lib/helpers/lolbas.d.ts.map +1 -1
- package/types/lib/helpers/osqueryTransform.d.ts +3 -0
- package/types/lib/helpers/osqueryTransform.d.ts.map +1 -1
- package/types/lib/helpers/plugins.d.ts +58 -0
- package/types/lib/helpers/plugins.d.ts.map +1 -0
- package/types/lib/helpers/protobom.d.ts +5 -4
- package/types/lib/helpers/protobom.d.ts.map +1 -1
- package/types/lib/helpers/protobomLoader.d.ts +17 -0
- package/types/lib/helpers/protobomLoader.d.ts.map +1 -0
- package/types/lib/helpers/remote/dependency-track.d.ts +10 -3
- package/types/lib/helpers/remote/dependency-track.d.ts.map +1 -1
- package/types/lib/helpers/source.d.ts.map +1 -1
- package/types/lib/helpers/utils.d.ts +45 -8
- package/types/lib/helpers/utils.d.ts.map +1 -1
- package/types/lib/managers/binary.d.ts +5 -0
- package/types/lib/managers/binary.d.ts.map +1 -1
- package/types/lib/managers/docker.d.ts.map +1 -1
- package/types/lib/server/server.d.ts +2 -1
- package/types/lib/server/server.d.ts.map +1 -1
- package/types/lib/stages/postgen/annotator.d.ts.map +1 -1
- package/types/lib/stages/postgen/auditBom.d.ts +26 -1
- package/types/lib/stages/postgen/auditBom.d.ts.map +1 -1
- package/types/lib/stages/postgen/postgen.d.ts +2 -1
- package/types/lib/stages/postgen/postgen.d.ts.map +1 -1
- package/types/lib/stages/postgen/ruleEngine.d.ts.map +1 -1
- package/types/lib/stages/pregen/envAudit.d.ts.map +1 -1
- package/types/lib/third-party/arborist/lib/node.d.ts +23 -0
- package/types/lib/third-party/arborist/lib/node.d.ts.map +1 -1
- package/types/lib/validator/bomValidator.d.ts.map +1 -1
- package/types/lib/validator/complianceRules.d.ts.map +1 -1
- 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
|
|
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
|
|
55
|
-
- Focus on [OBOM lessons](docs/OBOM_LESSONS.md) when you need host triage, persistence review,
|
|
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 |
|
|
@@ -122,16 +136,22 @@ Installing `@cyclonedx/cdxgen` exposes these commands:
|
|
|
122
136
|
| `cdx-verify` | Verify BOM signatures | yes |
|
|
123
137
|
| `cdxi` | Open the interactive REPL | no |
|
|
124
138
|
| `evinse` | Add evidence, reachability, and service context | no |
|
|
125
|
-
| `cbom` | Alias for CBOM-oriented `cdxgen` defaults |
|
|
126
|
-
| `obom` | Alias for `cdxgen -t os` |
|
|
127
|
-
| `saasbom` | Alias for SaaSBOM-oriented `cdxgen` defaults |
|
|
139
|
+
| `cbom` | Alias for CBOM-oriented `cdxgen` defaults | yes |
|
|
140
|
+
| `obom` | Alias for `cdxgen -t os` | yes |
|
|
141
|
+
| `saasbom` | Alias for SaaSBOM-oriented `cdxgen` defaults | yes |
|
|
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`, `cbom`, `obom`, `saasbom`, `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.
|
|
148
|
+
|
|
149
|
+
The `cbom` and `saasbom` release binaries bundle the Atom analysis stack (`@appthreat/atom` and `@appthreat/atom-parsetools`) plus protobuf export support (`@appthreat/cdx-proto` and `@bufbuild/protobuf`). The `obom` release binary bundles the matching platform plugin package, pruned to runtime OS inventory helpers, plus the same protobuf export support. These aliases therefore support `--export-proto --proto-bin-file <file>` without requiring a separate npm install.
|
|
132
150
|
|
|
133
151
|
`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
152
|
|
|
153
|
+
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.
|
|
154
|
+
|
|
135
155
|
To run cdxgen without installing (hotloading), use the [pnpm dlx](https://pnpm.io/cli/dlx) command.
|
|
136
156
|
|
|
137
157
|
```shell
|
|
@@ -146,6 +166,8 @@ corepack pnpm dlx --package=@cyclonedx/cdxgen cdx-convert --help
|
|
|
146
166
|
corepack pnpm dlx --package=@cyclonedx/cdxgen cdx-validate --help
|
|
147
167
|
corepack pnpm dlx --package=@cyclonedx/cdxgen cdx-sign --help
|
|
148
168
|
corepack pnpm dlx --package=@cyclonedx/cdxgen cdx-verify --help
|
|
169
|
+
corepack pnpm dlx --package=@cyclonedx/cdxgen hbom --help
|
|
170
|
+
corepack pnpm dlx --package=@cyclonedx/cdxgen hbom diagnostics --help
|
|
149
171
|
corepack pnpm dlx --package=@cyclonedx/cdxgen evinse --help
|
|
150
172
|
corepack pnpm dlx --package=@cyclonedx/cdxgen cdxi --help
|
|
151
173
|
```
|
|
@@ -172,6 +194,10 @@ Common asset names:
|
|
|
172
194
|
- `cdxgen-linux-amd64-musl`
|
|
173
195
|
- `cdxgen-darwin-arm64`
|
|
174
196
|
- `cdxgen-windows-amd64.exe`
|
|
197
|
+
- `hbom-linux-amd64`
|
|
198
|
+
- `hbom-linux-amd64-slim`
|
|
199
|
+
- `hbom-darwin-arm64`
|
|
200
|
+
- `hbom-windows-amd64.exe`
|
|
175
201
|
- `cdx-audit-linux-amd64`
|
|
176
202
|
- `cdx-audit-darwin-arm64`
|
|
177
203
|
- `cdx-audit-windows-amd64.exe`
|
|
@@ -276,17 +302,19 @@ import { createBom, submitBom } from "npm:@cyclonedx/cdxgen@^12.2.1";
|
|
|
276
302
|
|
|
277
303
|
## Common workflows
|
|
278
304
|
|
|
279
|
-
| Goal | First command
|
|
280
|
-
| ---------------------------------------------------------- |
|
|
281
|
-
| Generate a BOM from the current repository | `cdxgen -o bom.json .`
|
|
282
|
-
| Generate a BOM from a git URL | `cdxgen -o bom.json https://github.com/example/project.git`
|
|
283
|
-
| Generate a BOM from a package URL | `cdxgen -o bom.json "pkg:npm/lodash@4.17.21"`
|
|
284
|
-
| Scan a container image | `cdxgen ghcr.io/owasp-dep-scan/depscan:nightly -o bom.json -t docker`
|
|
285
|
-
| Audit a generated BOM for built-in supply-chain findings | `cdxgen -o bom.json --bom-audit .`
|
|
286
|
-
| Prioritize an existing BOM for upstream risk-driven review | `cdx-audit --bom bom.json`
|
|
287
|
-
|
|
|
288
|
-
|
|
|
289
|
-
|
|
|
305
|
+
| Goal | First command | Read next |
|
|
306
|
+
| ---------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ------------------------------------ |
|
|
307
|
+
| Generate a BOM from the current repository | `cdxgen -o bom.json .` | [CLI Usage][docs-cli] |
|
|
308
|
+
| Generate a BOM from a git URL | `cdxgen -o bom.json https://github.com/example/project.git` | [CLI Usage][docs-cli] |
|
|
309
|
+
| Generate a BOM from a package URL | `cdxgen -o bom.json "pkg:npm/lodash@4.17.21"` | [CLI Usage][docs-cli] |
|
|
310
|
+
| Scan a container image | `cdxgen ghcr.io/owasp-dep-scan/depscan:nightly -o bom.json -t docker` | [Server Usage][docs-server] |
|
|
311
|
+
| Audit a generated BOM for built-in supply-chain findings | `cdxgen -o bom.json --bom-audit .` | [BOM Audit](docs/BOM_AUDIT.md) |
|
|
312
|
+
| Prioritize an existing BOM for upstream risk-driven review | `cdx-audit --bom bom.json` | [cdx-audit](docs/CDX_AUDIT.md) |
|
|
313
|
+
| 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) |
|
|
314
|
+
| Validate a BOM against structural and compliance checks | `cdx-validate -i bom.json` | [cdx-validate](docs/CDX_VALIDATE.md) |
|
|
315
|
+
| Convert CycloneDX JSON to SPDX JSON-LD | `cdx-convert -i bom.json -o bom.spdx.json` | [cdx-convert](docs/CDX_CONVERT.md) |
|
|
316
|
+
| 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) |
|
|
317
|
+
| 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
318
|
|
|
291
319
|
For the full option reference, use `cdxgen --help` or visit [CLI Usage][docs-cli].
|
|
292
320
|
|
|
@@ -494,7 +522,7 @@ cdxgen can retain the dependency tree under the `dependencies` attribute for a s
|
|
|
494
522
|
|
|
495
523
|
## Plugins
|
|
496
524
|
|
|
497
|
-
cdxgen could be extended with external binary plugins to support more SBOM use cases. These are
|
|
525
|
+
cdxgen could be extended with external binary plugins to support more SBOM use cases. These are installed as an optional dependency.
|
|
498
526
|
|
|
499
527
|
```shell
|
|
500
528
|
sudo npm install -g @cdxgen/cdxgen-plugins-bin
|
|
@@ -503,7 +531,7 @@ sudo npm install -g @cdxgen/cdxgen-plugins-bin
|
|
|
503
531
|
## Plugins (pnpm)
|
|
504
532
|
|
|
505
533
|
`cdxgen` can be extended with external binary plugins to support more SBOM use cases.
|
|
506
|
-
These are
|
|
534
|
+
These are installed as optional dependencies and can be used without a global install.
|
|
507
535
|
|
|
508
536
|
```shell
|
|
509
537
|
pnpm dlx @cdxgen/cdxgen-plugins-bin
|
|
@@ -529,6 +557,8 @@ For offline or staged scans, point cdxgen at a locally reconstructed root filesy
|
|
|
529
557
|
cdxgen /tmp/remote_target -o /tmp/bom.json -t rootfs
|
|
530
558
|
```
|
|
531
559
|
|
|
560
|
+
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`.
|
|
561
|
+
|
|
532
562
|
You can also pass the .tar file of a container image.
|
|
533
563
|
|
|
534
564
|
```shell
|
|
@@ -552,7 +582,7 @@ podman system service -t 0 &
|
|
|
552
582
|
|
|
553
583
|
## Generate OBOM for a live system
|
|
554
584
|
|
|
555
|
-
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
|
|
585
|
+
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.
|
|
556
586
|
|
|
557
587
|
```shell
|
|
558
588
|
# obom is an alias for cdxgen -t os
|
|
@@ -560,19 +590,33 @@ obom
|
|
|
560
590
|
# cdxgen -t os
|
|
561
591
|
```
|
|
562
592
|
|
|
563
|
-
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
|
|
593
|
+
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:
|
|
564
594
|
|
|
565
|
-
|
|
595
|
+
- macOS code-signing authority, team ID, and notarization assessment metadata for discovered application paths
|
|
596
|
+
- Windows Authenticode signer/timestamp metadata for discovered executable paths
|
|
597
|
+
- Windows WDAC active-policy inventory
|
|
598
|
+
- batched path inspection so large host inventories keep their trust metadata instead of stopping at the first few hundred paths
|
|
599
|
+
|
|
600
|
+
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.
|
|
601
|
+
|
|
602
|
+
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.
|
|
603
|
+
|
|
604
|
+
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).
|
|
566
605
|
|
|
567
606
|
## Generate Cryptography Bill of Materials (CBOM)
|
|
568
607
|
|
|
569
|
-
Use the `cbom` alias to generate a CBOM.
|
|
608
|
+
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.
|
|
570
609
|
|
|
571
610
|
```shell
|
|
572
611
|
cbom -t java
|
|
573
612
|
# cdxgen -t java --include-crypto -o bom.json .
|
|
613
|
+
|
|
614
|
+
# Add source-derived crypto algorithms for a JS or TS project
|
|
615
|
+
cdxgen --include-crypto -o bom.json /absolute/path/to/js-project
|
|
574
616
|
```
|
|
575
617
|
|
|
618
|
+
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.
|
|
619
|
+
|
|
576
620
|
## Generating SaaSBOM and component evidences
|
|
577
621
|
|
|
578
622
|
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
|
|
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"
|