GODRIVER-3599 Add task and script to generate CycloneDX SBOM #2154
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 whengo.mod
is newer thansbom.json
.The pre-commit hook (
sbom-currency
) ensures that ifgo.mod
is staged for commit, that an updatedsbom.json
is also staged.Future TODO: Add
libmongocrypt
as an optional component once thelibmongocrypt
SBOM is updated with newer automationBackground & 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.