feat(sbom): transitive NuGet packages resolved from nuget.org metadata (#461) #489

Merged
sharang merged 1 commits from feat/461-transitive-nuget into main 2026-10-06 09:07:36 +00:00
1 Commits
Author SHA1 Message Date
Sharang ParnerkarandClaude Opus 5.5 8b58d14ca9 feat(sbom): transitive NuGet packages resolved from nuget.org metadata (#461)
CI / Check (push) Skipped
CI / Detect Changes (pull_request) Skipped
CI / Deploy Agent (pull_request) Skipped
CI / Deploy Dashboard (pull_request) Skipped
CI / Deploy Docs (pull_request) Skipped
CI / Deploy MCP (pull_request) Skipped
CI / Check (pull_request) Successful in 8m6s
Closes #461. SDK-style projects without packages.lock.json or
obj/project.assets.json named only their direct packages, and each was
its own "Nicht ausgeführt" entry.

- sbom/nuget_resolve.rs resolves the transitive graph from nuget.org's
  catalog entries (dependencyGroups per target framework) with NuGet's
  rules: a direct reference fixes its version, a dependency takes its
  range's lower bound, the highest of several; the dependency group
  nearest the project's framework applies (.NET Framework, .NET/.NET
  Core, .NET Standard incl. the Framework→Standard map, framework-free).
  Frameworks from TargetFramework(s) or TargetFrameworkVersion.
- No dotnet restore: it evaluates the repository's MSBuild files, which
  can run code. Requests go through the guarded nuget.org registry of
  #467 (shared catalog() fetch), honour nuget.config/packageSourceMapping
  (an id routed to another feed is never asked about, direct ones
  included), and are capped (400 lookups, 90 s per scan).
- A project counts as resolved only when every package of its graph was
  answered; the rest stay a gap, now ONE sbom_dependencies entry naming
  all such projects ("A.csproj, B.csproj and N more"). What was found is
  in the SBOM either way, with evidence "<project> (transitive,
  nuget.org)"; licences are filled by the existing lookup.
- packages.config projects need nothing: the file lists every installed
  package, transitive ones included.
- Switch NUGET_TRANSITIVE_RESOLVE: on by default, off with
  APP_ENV=production until tested on stage.
- Tests: fake nuget.org (framework group choice, lowest applicable,
  direct pin, missing package, private feed), framework/range parsing,
  the aggregated gap; an ignored test against the real nuget.org
  (Serilog.Sinks.File 5.0.0 on net48 → Serilog 2.10.0) passes.
- Docs (dotnet DE/EN); staging test plan: check 16.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p
2026-10-06 10:58:32 +02:00