Files
pruefwerk/docs/guide/sbom.md
T
Sharang ParnerkarandClaude Opus 5.5 0b6c7a46d3
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 7m8s
fix(sbom): no clean-looking result for mobile apps without readable lockfiles
A Gradle, CocoaPods, SwiftPM or Flutter app without a lockfile got an SBOM
with no packages and no CVEs and no word about it. Now:

- sbom/mobile.rs walks the tree (android/, ios/, Xcode projects) and
  records a skipped sbom_dependencies stage for each mobile ecosystem whose
  manifest has no lockfile anywhere (Gradle, CocoaPods, SwiftPM incl.
  Xcode package references, Pub), and for Carthage, which no tool reads.
- The CRA view rates the SBOM requirements Nicht bewertet with the new
  reason dependencies_unresolved when a manifest was not resolved.
- Swift purls are rewritten to the repository form OSV keys advisories
  by; in Syft's form no Swift package ever matched an advisory.
- CocoaPods components are not sent to OSV (it has no such ecosystem) and
  are listed as unchecked, as are components of a batch OSV refused.
- OSV answers are mapped back by entry index: an entry without a purl
  shifted every later answer onto the wrong component.
- Seven nightly fixtures (Android with and without lockfile, CocoaPods,
  SwiftPM in Xcode with and without Package.resolved, Flutter, React
  Native) with blessed baselines; docs/guide/sbom.md covers mobile.

Refs #434.

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

140 lines
5.9 KiB
Markdown

# SBOM & Licenses
The SBOM (software bill of materials, *Stückliste*) lists the components of
each target, with their versions, licenses and known vulnerabilities.
## What is an SBOM?
A Software Bill of Materials is a list of every component (library, package, framework) that your software depends on, along with version numbers, licenses, and known vulnerabilities. The CRA expects manufacturers to know the components of their products; SBOMs are also asked for in customer security questionnaires and audits.
## Where the components come from
Prüfwerk builds the SBOM during each scan:
- **Package dependencies** -- read with Syft from the lockfiles in the code
(`package-lock.json`, `yarn.lock`, `pnpm-lock.yaml`, `bun.lock`, `Cargo.lock`,
`requirements.txt`, `poetry.lock`, `Pipfile.lock`, `uv.lock`). A manifest
without a lockfile gives no versions; the scan lists it under **Nicht
ausgeführt** (see [Prüfungen](/guide/scanning#what-the-scanner-runs-on-your-code)).
- **Mobile apps** -- the lockfiles of Android, iOS and Flutter apps, wherever
they sit in the tree (`android/`, `ios/`, an Xcode project): `gradle.lockfile`,
`Podfile.lock`, `Package.resolved` (also the one inside
`*.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/`) and `pubspec.lock`.
Gradle writes `gradle.lockfile` only with dependency locking switched on
(`dependencyLocking { lockAllConfigurations() }`, then
`./gradlew dependencies --write-locks`). Without it, and for Carthage, whose
`Cartfile.resolved` no tool reads, the scan reports the manifest under
**Nicht ausgeführt** and the SBOM requirements of the CRA view are
**Nicht bewertet**: an app whose dependencies are unknown is not shown as
clean.
- **Libraries copied into a firmware tree** -- microcontroller projects carry
their RTOS, TCP/IP stack and TLS library as source, with no manifest. Prüfwerk
recognises **FreeRTOS**, **FreeRTOS+TCP**, **lwIP**, **Mbed TLS**, **wolfSSL**
and **FatFs** and reads each one's version from its header. They appear with
the package source `embedded`.
- **Firmware builds** -- for a firmware target, the libraries and toolchain
named by the build files in the source tree (Make, CMake, Zephyr, ESP-IDF,
PlatformIO, Arduino, embedded Rust).
- **CODESYS projects** -- the referenced libraries and the runtime version from
a `.projectarchive`; see [SPS / PLC (CODESYS)](/guide/plc).
Firmware images, container images and app packages are not unpacked yet; their
components come from the source code.
## Known vulnerabilities
Package dependencies are matched against [OSV.dev](https://osv.dev/). Libraries
copied into a firmware tree and the CODESYS runtime have no package identifier
OSV could look up, so they are matched against [NVD](https://nvd.nist.gov/) by
CPE: all CVEs of the product are fetched and their affected version ranges are
compared with the version in use. OSV publishes no advisories for CocoaPods, so
pods are not matched. Components that could not be matched are listed on the
scan run under **CVE-Abgleich unvollständig**.
Known components are re-checked hourly, so a CVE published against an unchanged
component still raises an alert.
## Packages Tab
Open **Stückliste** in the sidebar. The **Pakete** (Packages) tab lists the
components of all targets, 50 per page.
### Filtering
- **Alle Prüfobjekte** -- one target, or all
- **Alle Paketquellen** (All managers) -- the package source, e.g. npm, cargo,
pip, or `embedded` for libraries found in a firmware tree
- **Pakete durchsuchen …** -- search by package name
- **Alle Pakete** / **Mit Schwachstellen** / **Ohne Schwachstellen**
- **Alle Lizenzen** -- one license
### Columns
| Column | Description |
|--------|-------------|
| **Paket** (Package) | Package name |
| **Version** | The version in use |
| **Paketquelle** (Manager) | Where the component comes from (npm, cargo, pip, embedded, …) |
| **Lizenz** (License) | License identifier |
| **Schwachstellen** (Vulnerabilities) | **Keine**, or the number of CVEs |
Click the CVE count to expand the details: the vulnerability ID, the source
database, the severity where known, and **Hinweis ansehen →** (View advisory).
## Licenses Tab
The **Lizenzen** tab summarises the licenses.
### Copyleft Warnings
If any component uses a copyleft license (GPL, AGPL, LGPL, MPL and their
variants), the banner **Copyleft-Lizenzen gefunden** lists the affected
packages. Copyleft licenses may impose obligations when you distribute your
software.
::: warning
Copyleft-licensed dependencies can require you to release your source code under the same license. Review flagged packages carefully with your legal team if you distribute proprietary software.
:::
### License Distribution
**Lizenzverteilung** shows the share of each license across the components.
### License Table
**Alle Lizenzen** lists every license:
| Column | Description |
|--------|-------------|
| **Lizenz** | License identifier |
| **Art** | **Copyleft** or **Freizügig** (permissive) |
| **Pakete** | The packages using it |
| **Anzahl** | Number of packages |
## Export
1. On the **Pakete** tab, select a target under **Alle Prüfobjekte**. Export
works for one target at a time; without a selection the export says
**Zuerst ein Prüfobjekt wählen**.
2. Click **Exportieren** and choose a format:
- **CycloneDX 1.5** -- JSON, widely supported by security tools
- **SPDX 2.3** -- the Linux Foundation standard, common for license compliance
3. Click **Herunterladen**. The SBOM downloads as a JSON file.
The evidence pack on the target's page also contains both formats.
## Compare Tab
**Vergleich** compares the SBOMs of two targets, for example two firmware
releases:
1. Select **Prüfobjekt A** and **Prüfobjekt B**.
2. The result shows:
| Section | Description |
|---------|-------------|
| **Nur in A** | Packages only in target A |
| **Nur in B** | Packages only in target B |
| **Versionsunterschiede** | The same package in different versions |
| **Gemeinsam** | Number of packages that match exactly |