feat(sbom): NuGet licenses from .nuspec files, then nuget.org (#468)
CI / Detect Changes (push) Successful in 3s
CI / Deploy Dashboard (push) Skipped
CI / Deploy MCP (push) Skipped
CI / Deploy Docs (push) Successful in 1m9s
CI / Deploy Agent (push) Successful in 4m44s
CI / Check (push) Skipped

NuGet SBOM entries carried no license: none of the files they come from
names one. Fill it in after the NuGet components are merged (#467):

- local first: the .nuspec of a restored package; <license
  type="expression"> as SPDX, type="file" as LicenseRef-file, an old
  <licenseUrl> mapped to SPDX for well-known license pages, else kept
- then nuget.org: registration leaf (gzip) -> catalogEntry (inline or
  linked on api.nuget.org) -> licenseExpression / licenseFile / licenseUrl
- only real ids at exact versions (no ranges, no DLL-metadata names);
  versions normalised as nuget.org files them (6.2.0.0 -> 6.2.0, 2.0 ->
  2.0.0)
- ids a nuget.config maps to another feed are never sent; a tree whose
  nuget.config lists another feed without a mapping is not looked up
- through guarded_net, 8 at once, 10 s per request, 60 s and 300
  uncached packages per scan; failures stay empty, one warning per scan
- cached across tenants in the admin database (nuget_licenses, TTL: a
  year for a license, a week for none)
- NUGET_LICENSE_LOOKUP=false turns the nuget.org step off

Closes #467

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
This commit was merged in pull request #468.
This commit is contained in:
sharangandClaude Opus 5.5 committed 2026-10-05 21:50:32 +00:00
1 parent 04b4f32807
commit 34688fa322
9 files changed
+1582 -5

No files matched your search

+4
View File
@@ -45,6 +45,10 @@ CVE_MONITOR_SCHEDULE=0 0 0 * * *
# GIT_SOURCE_SYNC_MINUTES=30
# WEBHOOK_PUBLIC_URL=https://pruefwerk-hooks.example.com
GIT_CLONE_BASE_PATH=/tmp/compliance-scanner/repos
# NuGet licenses (#467): look up licenses the tree's .nuspec files do not give
# on api.nuget.org (package id and version only; never for ids a nuget.config
# routes to another feed). Set to false to keep the lookup offline.
NUGET_LICENSE_LOOKUP=true
# Dynamic PLC testing — ephemeral soft-PLC provisioning (#183). Off unless
# enabled; requires the agent container to have Docker access (socket mount).