You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CSHARP-5626: Add evergreen script to generate CycloneDX SBOM
Added a bash script to generate a 'build' lifecycle CycloneDX SBOM using
the cyclonedx-dotnet tool. The script installed a fixed version of
cyclonedx-dotnet, runs a versioned dotnet 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
heirarchical SBOM file.
The file is saved as sbom.cdx.json (as opposed to the current sbom.json)
which is the preferred file extention 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 intefering with the current
workflow to upload the current static sbom.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 th sbom.json file and update
download-augmented-sbom.sh to use the new sbom.cdx.json file.
# There are nuances to how cyclonedx-dotnet handles <PackageReference> items in Directory.Build.props that lead to private packages being included in SBOM
45
+
# results even when PrivateAssets is set to "All". As a safeguard, this command lists the PackageReferences and adds the references with PrivateAssets="All"
46
+
# to an exclusion filter variable to be fed into cyclonedx-dotnet
# The ProjectReference items do not resolve as the Nuget packages they represent. This causes duplicate components when the SBOMs are merged. To address this
51
+
# we add the Nuget PURL to the JSON. This command lists the ProjectReferences for processing.
0 commit comments