Skip to main content

SBOMMerge

SBOMMerge merges two Software Bill of Materials (SBOMs) documents together. It supports SBOMs created in both SPDX and CycloneDX formats.

Installation

To install use the following command:

pip install sbommerge

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: sbommerge [-h] [--sbom {auto,spdx,cyclonedx}] [-d] [--format {tag,json,yaml}] [-o OUTPUT_FILE] [-V] FILE1 FILE2

SBOMMerge merges two Software Bill of Materials (SBOMs) documents together.

positional arguments:
  FILE1                 first SBOM file
  FILE2                 second SBOM file

options:
  -h, --help            show this help message and exit
  -V, --version         show program's version number and exit

Input:
  --sbom {auto,spdx,cyclonedx}
                        specify type of sbom to merge (default: auto)

Output:
  -d, --debug           show debug information
  --format {tag,json,yaml}
                        specify format of generated sbom (default: tag)
  -o OUTPUT_FILE, --output-file OUTPUT_FILE
                        output filename (default: output to stdout)

Operation

The --sbom option is used to specify the format of the SBOM files. The default is for the type and format of the SBOM to be automatically detected based on the extension of the file name.

SBOM Type Version Extension Format
SPDX 2.3 .spdx TagValue
SPDX 2.3 .spdx.json JSON
SPDX 2.3 .spdx.yml YAML
SPDX 2.3 .spdx.yaml YAML
CycloneDX 1.4 .json JSON
CycloneDX 1.5 .json JSON

Details of the formats for each of the supported SBOM formats are available for SPDX and CycloneDX.

For SPDX SBOM files, it is assumed that the name of a Package precedes the version information for the package. Only modules with a package name and associated version information shall be processed.

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

Implementation Notes

The following design decisions have been made in processing the SBOM files:

  1. Package data is merged if the package version matches. Otherwise separate packages will be created.

  2. It is assumed that the SBOM is valid and contains syntactically valid data. Invalid files will be silently ignored.

  3. A non-zero return value indicates that differences were detected.

License

Licensed under the Apache 2.0 Licence.

Limitations

This tool is meant to support software development and security audit functions. However 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 sbommerge 0.2.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 sbommerge 0.2.0
File Interpreter ABI Platform Actions
sbommerge-0.2.0-py2.py3-none-any.whl Python 3, Python 2 none any Details for sbommerge-0.2.0-py2.py3-none-any.whl

Release files / sbommerge-0.2.0-py2.py3-none-any.whl

Download URL sbommerge-0.2.0-py2.py3-none-any.whl
Size 25.3 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
b75ae56d6b0464122e03cb7261276b8b87568407f8f83a9dc3bf28639ec60e12
BLAKE2b-256 checksum
How to use checksums
fe26015bb1c526a1a2f884cf4bf4a604e7fa39403480aaff7fddaf1c8daed647
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.8

Security for sbommerge 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

1 release file No provenance

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