Skip to content

GODRIVER-3599 Add task and script to generate CycloneDX SBOM #2154

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jasonhills-mongodb
Copy link

GODRIVER-3599

Summary

Added a task, etc/script, and pre-commit hook for generating a CycloneDX SBOM using a pinned version of the cyclonedx-gomod tool. The SBOM includes the aggregate of modules required by packages in the mongo-go-driver library, excluding examples, tests and test packages (i.e., only components used at runtime).

The task (generate-sbom) is added to the default tasks and will run only when go.mod is newer than sbom.json.

The pre-commit hook (sbom-currency) ensures that if go.mod is staged for commit, that an updated sbom.json is also staged.

Future TODO: Add libmongocrypt as an optional component once the libmongocrypt SBOM is updated with newer automation

Background & Motivation

The GODRIVER SBOM (sbom.json) does not contain the direct and transitive dependencies defined in go.mod. Added code to generate a CycloneDX SBOM in order to better meet NITA Minimum Elements for Software Bill of Materials, OWASP Software Component Verification Standard (SCVS) Level 1, as well as include the necessary component identifiers for vulnerability discovery and VEX responses.

Copy link
Contributor

API Change Report

No changes found!

The GODRIVER SBOM (sbom.json) does not contain the direct and transitive dependencies defined in go.mod. Added code to generate a CycloneDX SBOM in order to better meet NITA Minimum Elements for Software Bill of Materials, OWASP Software Component Verification Standard (SCVS) Level 1, as well as include the necessary component identifiers for vulnerability discovery and VEX responses.

Added a task, etc/script, and pre-commit hook for generating a CycloneDX SBOM using a pinned version of the cyclonedx-gomod tool. The SBOM includes the aggregate of modules required by packages in the mongo-go-driver library, excluding examples, tests and test packages.

The task (generate-sbom) is added to the default tasks and will run only when go.mod is newer than sbom.cdx.json.

The pre-commit hook (sbom-currency) ensures that if go.mod is staged for commit, that an updated sbom.json is also staged.

Future TODO: Add libmongocrypt as an optional component once the libmongocrypt SBOM is updated with newer automation
@jasonhills-mongodb jasonhills-mongodb force-pushed the GODRIVER-3599/sbom_generation_using_cyclonedx-gomod branch from 7c63b31 to a0af51a Compare August 5, 2025 22:41
@jasonhills-mongodb jasonhills-mongodb marked this pull request as ready for review August 5, 2025 22:41
@jasonhills-mongodb jasonhills-mongodb requested a review from a team as a code owner August 5, 2025 22:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants