Skip to content

fix(sbom): name Go components by their full module path - #139

Merged
matiasdaloia merged 1 commit into
mainfrom
fix/go-component-name
Nov 17, 2026
Merged

matiasdaloia merged 1 commit into
mainfrom
fix/go-component-name

Conversation

@matiasdaloia

Copy link
Copy Markdown
Contributor

Section 1 of #138.

A Go component's name was the last element of its module path (sdk for go.opentelemetry.io/otel/sdk). Grype keys Go vulnerabilities on that name, so it matched nothing and the SBOM looked clean. Now a pkg:golang component is always named by its full module path, detected or declared, as Syft and cyclonedx-gomod do. Other ecosystems are unchanged.

Tests: DisplayName cases for Go (declared, detected, versioned/qualified PURL), and a CycloneDX writer test that runs otel/sdk@v1.45.0 through and asserts the name.

Checked on a real project: scanoss-cli dependencies . --extract-local --format cyclonedx on scanoss.api v0.41.3, then Grype v0.121.2:

  • before: 0 matches
  • after: 88 matches, 0 Go components with a short name

The 88 include modules from nested go.mod files and test-only dependencies; scoping the SBOM to what ships is section 2 of #138, in a separate PR.

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
@matiasdaloia
matiasdaloia merged commit 0b9ca1a into main Nov 17, 2026
15 checks passed
@matiasdaloia
matiasdaloia deleted the fix/go-component-name branch November 17, 2026 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant