Skip to main content

SBOM4Rust

SBOM4Rust generates a SBOM (Software Bill of Materials) for Rust application or library in a number of formats including SPDX and CycloneDX. It identifies all the dependent components which are explicity defined in the Cargo.lock file and reports the relationships between the components.

It is intended to be used as part of a continuous integration system to enable accurate records of SBOMs to be maintained and also to support subsequent audit needs to determine if a particular component (and version) has been used.

Installation

To install use the following command:

pip install sbom4rust

Alternatively, just clone the repo and install dependencies using the following command:

pip install -U -r requirements.txt

The tool requires Python 3 (3.7+). It is recommended to use a virtual python environment especially if you are using different versions of python. virtualenv is a tool for setting up virtual python environments which allows you to have all the dependencies for the tool set up in a single environment, or have different environments set up for testing using different versions of Python.

Usage

usage: sbom4rust [-h] [-d DEPENDENCY] [-a APPLICATION] [--debug]
                 [--sbom {spdx,cyclonedx}] [--format {tag,json,yaml}]
                 [-o OUTPUT_FILE] [-V]
options:
  -h, --help            show this help message and exit
  -V, --version         show program's version number and exit

Input:
  -d DEPENDENCY, --dependency DEPENDENCY
                        Directory containing Cargo.lock dependency file
  -a APPLICATION, --application APPLICATION
                        Name of application

Output:
  --debug               add debug information
  --sbom {spdx,cyclonedx}
                        specify type of sbom to generate (default: spdx)
  --format {tag,json,yaml}
                        format for SPDX software bill of materials (sbom) (default: tag)
  -o OUTPUT_FILE, --output-file OUTPUT_FILE
                        output filename (default: output to stdout)

Operation

The --dependency option is used to identify the directory containing the Cargo.lock dependency file. If this option is not specified, the current directory is assumed.

The --application option is used to specify an application within the Cargo.lock dependency file. This option must be specified.

The --sbom option is used to specify the format of the generated SBOM (the default is SPDX). The --format option can be used to specify the formatting of the SPDX SBOM (the default is Tag Value format but JSON and YAML format are also supported). All CycloneDX SBOMs are generated in JSON format.

The --output-file option is used to control the destination of the output generated by the tool. The default is to report to the console but can be stored in a file (specified using --output-file option).

All module licences are reported as 'NOASSERTION'. All module suppliers are reported as 'UNKNOWN'.

Licence

Licenced under the Apache 2.0 Licence.

Limitations

This tool is meant to support software development and security audit functions. The usefulness of the tool is dependent on the SBOM data which is provided to the tool. Unfortunately, the tool is unable to determine the validity or completeness of such a SBOM file; users of the tool are therefore reminded that they should assert the quality of any data which is provided to the tool.

Feedback and Contributions

Bugs and feature requests can be made via GitHub Issues.

Metadata

Release files for sbom4rust 0.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for sbom4rust 0.6.0
File Interpreter ABI Platform
sbom4rust-0.6.0-py2.py3-none-any.whl Python 2, Python 3 none any Details

Release files / sbom4rust-0.6.0-py2.py3-none-any.whl

Download URL sbom4rust-0.6.0-py2.py3-none-any.whl
Size 12.2 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
0607ce963dfb710f33e0f947e19f4ab5a0a69a1bdffb4d444b00db2723654e5b
BLAKE2b-256 checksum
How to use checksums
e7040498c2cdfd584b642222ef38d2cbd77245aa39e51d15fb5f3100c4166608
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.10.8

Release history Release notifications | RSS feed

This release

0.6.0 This release

1 release file

0.5.3

1 release file

0.5.2

1 release file

0.5.1

1 release file

0.5.0

1 release file

0.4.1

1 release file

0.4.0

1 release file

0.3.0

1 release file

0.2.0

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page