Repository navigation
fix(sbom): name Go components by their full module path - #139
Merged
Merged
Conversation
Grype and other scanners look Go vulnerabilities up by the component
name, so a module named by its last path element ("sdk" for
go.opentelemetry.io/otel/sdk) matched nothing and the SBOM looked clean.
Refs #138
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Section 1 of #138.
A Go component's
namewas the last element of its module path (sdkforgo.opentelemetry.io/otel/sdk). Grype keys Go vulnerabilities on that name, so it matched nothing and the SBOM looked clean. Now apkg:golangcomponent is always named by its full module path, detected or declared, as Syft and cyclonedx-gomod do. Other ecosystems are unchanged.Tests:
DisplayNamecases for Go (declared, detected, versioned/qualified PURL), and a CycloneDX writer test that runsotel/sdk@v1.45.0through and asserts the name.Checked on a real project:
scanoss-cli dependencies . --extract-local --format cyclonedxon scanoss.api v0.41.3, then Grype v0.121.2:The 88 include modules from nested
go.modfiles and test-only dependencies; scoping the SBOM to what ships is section 2 of #138, in a separate PR.