MCPcopy Index your code
hub / github.com/CycloneDX/cyclonedx-rust-cargo

github.com/CycloneDX/cyclonedx-rust-cargo @cyclonedx-bom-0.8.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release cyclonedx-bom-0.8.1 ↗ · + Follow
1,310 symbols 3,536 edges 124 files 91 documented · 7%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Build Status Crates.io License Website Slack Invite Group Discussion Twitter

CycloneDX Rust (Cargo) Plugin

The CycloneDX module for Rust (Cargo) creates a valid CycloneDX Software Bill of Materials (SBOM) containing an aggregate of all project dependencies. OWASP CycloneDX is a full-stack Bill of Materials (BOM) standard providing advanced supply chain capabilities for cyber risk reduction.

Structure

This repository contains two separate projects:

  • cyclonedx-bom is a Rust library to read and write CycloneDX SBOMs to and from Rust structs.
  • cargo-cyclonedx is a Rust application, which generates CycloneDX SBOMs for Cargo based Rust projects (it uses cyclonedx-bom for that purpose).

Usage

Execute cargo-cyclonedx from within a Rust project directory containing Cargo.toml.

Installing

cargo install cargo-cyclonedx

Executing binary

~/.cargo/bin/cargo-cyclonedx cyclonedx

Executing from cargo

cargo cyclonedx

Security considerations

cargo-cyclonedx calls into Cargo internally to get information about a Rust project. Like nearly any other build system, Cargo may run arbitrary code when invoked on an untrusted project, so cargo-cyclonedx should not be called on untrusted projects either.

Some of the other tools for generating CycloneDX SBOMs do not invoke Cargo and only parse the Cargo.lock file. However, the only way to generate the Cargo.lock file for them to scan is to invoke Cargo, so this issue is currently unavoidable for any tool that describes a Cargo project.

Contributing

Contributions are welcome. See our CONTRIBUTING.md for details.

Copyright & License

CycloneDX Rust Cargo is Copyright (c) OWASP Foundation. All Rights Reserved.

Permission to modify and redistribute is granted under the terms of the Apache 2.0 license. See the LICENSE file for the full license.

Extension points exported contracts — how you extend this code

Validate (Interface)
The trait that SBOM structs need to implement to validate their content. [101 implementers]
cyclonedx-bom/src/validation.rs
ToXml (Interface)
(no doc) [109 implementers]
cyclonedx-bom/src/xml.rs
ToInnerXml (Interface)
(no doc) [16 implementers]
cyclonedx-bom/src/xml.rs
FromXml (Interface)
(no doc) [121 implementers]
cyclonedx-bom/src/xml.rs
FromXmlType (Interface)
(no doc) [3 implementers]
cyclonedx-bom/src/xml.rs

Core symbols most depended-on inside this repo

convert_optional
called by 284
cyclonedx-bom/src/utilities.rs
as_ref
called by 280
cyclonedx-bom/src/models/component.rs
write_simple_tag
called by 150
cyclonedx-bom/src/xml.rs
read_simple_tag
called by 137
cyclonedx-bom/src/xml.rs
write_close_tag
called by 114
cyclonedx-bom/src/xml.rs
to_xml_read_error
called by 104
cyclonedx-bom/src/xml.rs
write_start_tag
called by 96
cyclonedx-bom/src/xml.rs
add_struct_option
called by 95
cyclonedx-bom/src/validation.rs

Shape

Function 580
Method 385
Class 251
Enum 87
Interface 7

Languages

Rust100%

Modules by API surface

cyclonedx-bom/src/models/bom.rs55 symbols
cyclonedx-bom/src/xml.rs46 symbols
cyclonedx-bom/src/specs/v1_5/modelcard.rs40 symbols
cyclonedx-bom/src/models/component.rs40 symbols
cargo-cyclonedx/src/generator.rs39 symbols
cyclonedx-bom/src/validation.rs37 symbols
cyclonedx-bom/src/specs/common/component.rs36 symbols
cyclonedx-bom/src/specs/common/code.rs33 symbols
cyclonedx-bom/src/specs/common/vulnerability_target.rs29 symbols
cargo-cyclonedx/src/config.rs29 symbols
cyclonedx-bom/src/specs/v1_5/evidence.rs28 symbols
cyclonedx-bom/src/specs/common/signature.rs27 symbols

For agents

$ claude mcp add cyclonedx-rust-cargo \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page