CSHARP-5626: Add evergreen script to generate CycloneDX SBOM #1718
+102
−1
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.
Added a bash script to generate a
build
lifecycle CycloneDX SBOM using thecyclonedx-dotnet
tool. The script installs a fixed version ofcyclonedx-dotnet
, runs a versioneddotnet restore
, and generates an SBOM for each of the 4 MongoDB.Driver Nuget packages.To ensure accurate results, two queries are run against each of the
.csproj
files to ensure all development packages are excluded and that any local<ProjectReference>
items are marked in the SBOM as Nuget packages. Once all 4 SBOMs are created, they are merged into a single hierarchical SBOM file.The file is saved as
sbom.cdx.json
(as opposed to the currentsbom.json
) which is the preferred file extension for CycloneDX files. There is not yet any code to commit the new SBOM to the repo. This is to allow for evaluation of the new SBOM first without interfering with the current workflow to upload the current staticsbom.json
file to Kondukto.There is also a line added to download-augmented-sbom.sh to copy the augmented SBOM to
vex.cdx.json
(also not yet committed to repo) after it has been uploaded to the release artifacts bucket, as this is how we should be storing the augmented SBOM for public consumption.Once the SBOM generation process has been approved, I will add commit code for both of the
cdx.json
files, remove thesbom.json
file and updatedownload-augmented-sbom.sh
to use the newsbom.cdx.json
file.