项目 / cdxgen/cdxgen

cdxgen/cdxgen

行业候选
语言 JavaScript标签 bomscacyclonedxsbomdockerocicontainersowasppackage-urlpurlsoftware-bill-of-materialssaasbomsupply-chaincbomspdxspdx-sbom数据更新 2026-11-25 06:49:28 · 仓库 2026-11-24

一段话介绍

Creates CycloneDX Bill of Materials (BOM) for your projects from source and container images. Supports many languages and package managers. Integrate in your CI/CD pipeline with automatic submission to Dependency Track server

本站整理,非 GitHub 官方 description。

官方 description(GitHub API 原样)
Creates CycloneDX Bill of Materials (BOM) for your projects from source and container images. Supports many languages and package managers. Integrate in your CI/CD pipeline with automatic submission to Dependency Track server
1,129累计星
279Fork
—峰值日增
0上榜次数
总榜
暂未入榜
日榜
暂未入榜
周榜
暂未入榜
月榜
暂未入榜

官方快照(gh_history.db,2026-11-25):总榜 未进 Top50 · 日榜 未进 Top50 · 周榜未满 7 天基线(官方不生成) · 月榜暂无官方口径;下方四卡为站内趋势聚合(周卡按上榜次数,非官方 7 日增量窗)。

行业与场景 物流 暂无可用场景

更多信息

以下三段按该项目自己的 GitHub README 章节摘录(可合理截断并标明);README 没有对应章节的留空,不编造。

我的用法
cdxgen 用法可从本地路径、Git URL 或 purl 生成 BOM,并支持硬件 HBOM、诊断、运行时合并、安全审计与动态 tracebom 等流程。
特点或设计要点
cdxgen 强调可解释性、精确性、面向安全研究人员与合规审计者等多类角色、为机器学习优化数据,并以硬化默认值和安全模式防御性执行外部构建工具与处理不可信输入。
星标走势还差一天的数据,明天就能看到曲线
每天 10:30 记一次星标,连续两天后自动生成曲线
首次发现 — · 最近在榜 2026-11-24 · 语言 JavaScript · 贡献者 —
image

GitHub 项目主页介绍

来自 GitHub 仓库 README / 主页介绍正文,正文较长,已截断:保留前 20000 字符(原始 58,492 字节),完整内容见 GitHub 仓库。

[![SBOM](https://img.shields.io/badge/SBOM-with_%E2%9D%A4%EF%B8%8F_by_cdxgen-FF753D)](https://github.com/cdxgen/cdxgen)
[![AI-DECLARATION: pair](https://img.shields.io/badge/䷼%20AI--DECLARATION-pair-ffedd5?labelColor=ffedd5)](./AI-DECLARATION.md)
[![JSR][badge-jsr]][jsr-cdxgen]
[![NPM][badge-npm]][npmjs-cdxgen]
[![GitHub Releases][badge-github-releases]][github-releases]
[![NPM Downloads][badge-npm-downloads]][npmjs-cdxgen]
[![GitHub License][badge-github-license]][github-license]
[![GitHub Contributors][badge-github-contributors]][github-contributors]
[![SWH][badge-swh]][swh-cdxgen]

# CycloneDX Generator (cdxgen)

<img src="./docs/_media/cdxgen.png" width="200" height="auto" />

cdxgen is a CLI tool, library, [REPL](./ADVANCED.md), and server to create, validate, sign, and verify software BOMs. It generates CycloneDX JSON BOMs and supports SPDX 3.0.1 JSON-LD export. CycloneDX is a full-stack BOM specification that is easily created, human and machine-readable, and simple to parse. The tool generates BOMs targeting CycloneDX specification versions 1.6, 1.7, and 2.0, and the output can be downgraded to 1.4 or 1.5 for legacy consumers.

Supported BOM formats:

- Hardware (HBOM) - For supported live hosts such as Apple Silicon macOS, Linux amd64/arm64, and Windows amd64/arm64 systems.
- Software (SBOM) - For many languages and container images.
- Cryptography (CBOM) - For Java keystores and certificates, plus JavaScript and TypeScript source-level algorithm inventory.
- Operations (OBOM) - For Linux container images and VMs running Linux or Windows operating systems.
- Software-as-a-Service (SaaSBOM) - For Java, Python, JavaScript, TypeScript, and PHP projects.
- AI/ML (AI-BOM) - For prompt files, AI services, MCP configs, and model metadata with explainable AI-governance, security, performance, and agentic findings.
- Attestations (CDXA) - Generate SBOM with templates for multiple standards. Sign the BOM document at a granular level to improve authenticity.
- Vulnerability Disclosure Report (VDR) - Use cdxgen with [OWASP depscan](https://github.com/owasp-dep-scan/dep-scan) to automate the generation of VDR at scale.

Supported output document formats:

- CycloneDX JSON (primary native format)
- SPDX 3.0.1 JSON-LD (`cdxgen --format spdx` or `cdx-convert`)

## Choose your path

| Persona               | What cdxgen helps you do                                                                                             | First command                                                              | Read next                                                                                                       |
| --------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
| **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]                                            |
| **AI platform teams** | Generate AI/ML BOMs, catalog prompt/model/MCP surfaces, and run AI-BOM governance                                    | `aibom .`                                                                  | [AI-BOM Guide](docs/AI_BOM.md), [AI-BOM lesson](docs/LESSON15.md)                                               |
| **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)                                                     |
| **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)                                            |
| **Build engineers**   | Grade how completely the SBOM captured the project, and get ranked fixes when the build environment degraded it      | `cdxgen --profile introspect --introspect-fail-below 70 -o bom.json .`     | [Build Introspection](docs/INTROSPECTION.md), [Fidelity loop skill](.agents/skills/sbom-fidelity-loop/SKILL.md) |
| **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]                                               |
| **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]       |
| **Security Teams**    | Dynamically trace executions to capture cryptographic activities, CBOM properties, software components, and services | `tracebom --cmd "npm test" --trace-crypto -o cbom.json`                    | [Threat Model](docs/THREAT_MODEL.md)                                                                            |

### Role-based quick starts

#### For developers

- Start with a local path, git URL, or purl and generate a BOM in one command.
- Use [Supported Project Types][docs-project-types] to confirm ecosystem coverage before wiring cdxgen into CI.

#### For hardware and platform teams

- Use `hbom` when you need a CycloneDX hardware inventory for the current host rather than a software dependency graph.
- Start with the [HBOM guide](docs/HBOM.md) and the [HBOM lesson](docs/LESSON13.md) for supported platforms, enrichment options, and validation workflows.
- 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.
- 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`.
- 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.

#### For AppSec

- Use `--profile appsec`, `--evidence`, and `--bom-audit` when you want richer security context.
- Combine generation with [BOM Audit](docs/BOM_AUDIT.md), [cdx-validate](docs/CDX_VALIDATE.md), signing, and verification for a fuller secure-SBOM workflow.
- Use `tracebom` to dynamically profile applications & services and capture negotiated TLS cipher suites, protocols, cryptographic libraries, dynamically resolved software components, and services in CycloneDX 1.7 format.

#### For AI platform and governance teams

- Use `--include-formulation` plus `--bom-audit --bom-audit-categories ai-bom` when you want one AI-BOM workflow for prompt files, AI services, MCP configs, and model metadata.
- Use `aibom` when you want the same defaults in one dedicated CLI, including direct Hugging Face purls/URLs and direct Modelfile / `.gguf` inputs.
- Start with the [AI-BOM Guide](docs/AI_BOM.md) and the [AI-BOM lesson](docs/LESSON15.md) for the preferred alias, review flow, and category breakdown.

#### For SOC analysts

- Use `obom` for live-system and runtime inventory on Linux, Windows, and macOS hosts.
- 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.

#### For compliance and platform governance

- Use `cdx-validate` to assess structural and compliance posture, then `cdx-convert` when SPDX output is required.
- Review [Permissions][docs-permissions] and hardened-environment guidance before adopting cdxgen in controlled pipelines.

## Why cdxgen?

Most SBOM tools are like simple barcode scanners. For easy applications, they can parse a few package manifests and create a list of components only based on these files without any deep inspection. Further, a typical application might have several repos, components, and libraries with complex build requirements. Traditional techniques to generate an SBOM per language or package manifest either do not work in enterprise environments or don't provide the confidence required for both compliance and automated analysis. So we built cdxgen - the universal polyglot SBOM generator that is user-friendly, precise, and comprehensive!

**Our philosophy:**

- _Explainability:_ Don't list, but explain with evidence.
- _Precision:_ Try using multiple techniques to improve precision, even if it takes extra time.
- _Personas:_ Cater to the needs of a range of personas such as security researchers, compliance auditors, developers, and SOC.
- _Machine Learning:_ Optimize the generated data for Machine Learning (ML) purposes by considering the various model properties.
- _Safety:_ Execute external build tools and handle untrusted inputs defensively, with hardened defaults, a [secure mode](docs/PERMISSIONS.md) for sensitive environments, and a read-only `--dry-run` mode for review-first workflows.

## Documentation

Please visit our [documentation site][docs-homepage] for detailed usage, tutorials, and support documentation.

Sections include:

- [Getting Started][docs-homepage]
- [CLI Usage][docs-cli]
- [Migration to v13](MIGRATING-TO-V13.md)
- [HBOM Guide](docs/HBOM.md)
- [Merged Host View Lesson](docs/LESSON13.md)
- [Server Usage][docs-server]
- [Hands-on Lessons](docs/LESSON8.md)
- [Container Escape & Privilege Lesson](docs/LESSON9.md)
- [HBOM Lesson](docs/LESSON13.md)
- [Supported Project Types][docs-project-types]
- [Environment Variables][docs-env-vars]
- [Advanced Usage][docs-advanced-usage]
- [Permissions][docs-permissions]
- [cdx-audit Guide](docs/CDX_AUDIT.md)
- [cdx-convert Guide](docs/CDX_CONVERT.md)
- [cdx-validate Guide](docs/CDX_VALIDATE.md)
- [cdx-verify Guide](docs/CDX_VERIFY.md)
- [cdx-sign Guide](docs/CDX_SIGN.md)
- [Tracebom Guide](docs/TRACEBOM.md)
- [AI-BOM Guide](docs/AI_BOM.md)
- [MCP Inventory](docs/MCP.md)
- [REPL Guide](docs/REPL.md)
- [Custom Properties](docs/CUSTOM_PROPERTIES.md)
- [Coding Agent Plugin](agent-plugin/README.md)
- [Installing the plugin in coding agents](docs/AGENT_PLUGINS.md)
- [Agent CI recipes](docs/AGENT_CI.md)
- [Deprecations](docs/DEPRECATIONS.md)
- [Security Policy](SECURITY.md)
- [Threat Model](docs/THREAT_MODEL.md)
- [Support (Enterprise & Community)][docs-support]

## Usage

## Installing

> [!IMPORTANT]
> **The npm package was renamed in v13.** v13 and later are published as
> [`@cdxgen/cdxgen`][npmjs-cdxgen]. v12 and earlier are published as
> [`@cyclonedx/cdxgen`][npmjs-cdxgen-v12], which stays on npm and continues to
> receive fixes on the `release/12.0.x` branch, but does not receive v13
> features.
>
> Upgrading means changing the package name, not just the version:
>
> ```shell
> npm uninstall -g @cyclonedx/cdxgen
> npm install -g @cdxgen/cdxgen --ignore-scripts --min-release-age=2
> ```
>
> The `cdxgen` command, the CLI flags, and the container images are unchanged.
> If you import cdxgen as a library, update the specifier:
> `import { createBom } from "@cdxgen/cdxgen"`.

cdxgen is distributed three ways. The **standalone executables** and **container
images** are the recommended choice for CI, production, and any environment
where you want a self-contained tool with no Node.js dependency. The npm package
is an alternative when you already manage JavaScript tooling or need cdxgen as a
library. See [npm and JavaScript package managers](#npm-and-javascript-package-managers)
below.

Regardless of how you install, the following commands are available:

| Command         | Purpose                                                                                                              | Standalone GitHub release binary |
| --------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------- |
| `cdxgen`        | Generate CycloneDX / SPDX BOMs from source, images, binaries, git URLs, or purls                                     | yes                              |
| `aibom`         | Generate CycloneDX AI/ML BOMs from source, Hugging Face URLs/purls, Modelfiles, or GGUF artifacts (`-t ai` defaults) | yes                              |
| `hbom`          | Generate a CycloneDX hardware BOM for the current host                                                               | yes (`hbom`, `hbom-slim`)        |
| `tracebom`      | Trace command execution to capture dynamic CBOM, cryptographic properties, software components, and services         | yes                              |
| `cdx-audit`     | Prioritize existing BOM dependencies for upstream supply-chain review using explainable risk signals                 | yes                              |
| `cdx-convert`   | Convert CycloneDX JSON to SPDX 3.0.1 JSON-LD                                                                         | yes                              |
| `cdx-sign`      | Sign BOMs with JSF signatures                                                                                        | yes                              |
| `cdx-validate`  | Validate BOMs and benchmark posture                                                                                  | yes                              |
| `cdx-verify`    | Verify BOM signatures                                                                                                | yes                              |
| `cdxi`          | Open the interactive REPL                                                                                            | no                               |
| `evinse`        | Add evidence, reachability, and service context                                                                      | no                               |
| `cbom`          | Alias for CBOM-oriented `cdxgen` defaults                                                                            | yes                              |
| `obom`          | Alias for `cdxgen -t os`                                                                                             | yes                              |
| `saasbom`       | Alias for SaaSBOM-oriented `cdxgen` defaults                                                                         | yes                              |
| `spdxgen`       | Alias for `cdxgen --format spdx`                                                                                     | use `cdxgen`                     |
| `cdxgen-secure` | `cdxgen` in secure mode, with dependency installation always off                                                     | use `cdxgen`                     |

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`.

`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.

The `cbom` and `saasbom` release binaries bundle the Atom analysis stack (`@appthreat/atom` and `@appthreat/atom-parsetools`) plus protobuf export support (`@cdxgen/cdx-proto`, which installs `@bufbuild/protobuf`). As of atom 3, `cbom` and `saasbom` embed a native atom binary and need **no JDK** on linux-amd64, linux-arm64 (glibc), linux-amd64-musl, darwin-arm64, and windows-amd64. On the jar-kind triples (darwin-amd64, windows-arm64, and linux-arm64-musl), the embedded atom still runs on the JVM and requires Java 23+. The bundled atom-parsetools includes the `parsa` platform package for the target, so the JavaScript and TypeScript type maps behind usage evidence are produced natively on every triple that has one. 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.

`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. Beyond the basic `cdx-audit --bom bom.json` usage, it supports three reporters (`--report console|json|sarif`), scope selection (`--scope all|required`), trusted-publishing filters (`--include-trusted` and `--only-trusted`), and license policies via `--license-policy`. Non-zero exit codes on findings make it easy to gate CI pipelines. See the [cdx-audit guide](docs/CDX_AUDIT.md) for the full reference.

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.

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).

### Standalone executables (recommended)

For a self-contained tool with no runtime dependencies, download a published
release asset and verify its hash before executing it. This is the recommended
method for CI and production use.

Common asset names:

- `cdxgen-linux-amd64`
- `cdxgen-linux-amd64-musl`
- `cdxgen-darwin-arm64`
- `cdxgen-windows-amd64.exe`
- `aibom-linux-amd64`
- `aibom-darwin-arm64`
- `aibom-windows-amd64.exe`
- `hbom-linux-amd64`
- `hbom-linux-amd64-slim`
- `hbom-darwin-arm64`
- `hbom-windows-amd64.exe`
- `cdx-audit-linux-amd64`
- `cdx-audit-darwin-arm64`
- `cdx-audit-windows-amd64.exe`
- `cdx-convert-*`, `cdx-sign-*`, `cdx-validate-*`, `cdx-verify-*`

#### Linux

```bash
VERSION="v13.9.0"
ASSET="cdx-audit-linux-amd64"
BASE_URL="https://github.com/cdxgen/cdxgen/releases/download/${VERSION}"

curl -fsSLO "${BASE_URL}/${ASSET}"
curl -fsSLO "${BASE_URL}/${ASSET}.sha256"
sha256sum -c "${ASSET}.sha256"
chmod +x "${ASSET}"
./"${ASSET}" --help
```

#### macOS

```bash
VERSION="v13.9.0"
ASSET="cdx-audit-darwin-arm64"
BASE_URL="https://github.com/cdxgen/cdxgen/releases/download/${VERSION}"

curl -fsSLO "${BASE_URL}/${ASSET}"
curl -fsSLO "${BASE_URL}/${ASSET}.sha256"
shasum -a 256 -c "${ASSET}.sha256"
chmod +x "${ASSET}"
./"${ASSET}" --help
```

#### Windows (PowerShell)

```powershell
$Version = "v13.9.0"
$Asset = "cdx-audit-windows-amd64.exe"
$BaseUrl = "http
↑