fix(sbom): stop resolving tenant manifests in shared deployments (#330) (#333)
CI / Check (push) Skipped
CI / Detect Changes (push) Successful in 3s
CI / Deploy Docs (push) Successful in 57s
CI / Deploy MCP (push) Successful in 3m41s
CI / Deploy Dashboard (push) Successful in 5m26s
CI / Deploy Agent (push) Successful in 6m48s

This commit was merged in pull request #333.
This commit is contained in:
sharang committed 2026-09-23 08:59:35 +00:00
1 parent 44a48957c1
commit c6d2d07999
9 files changed
+282 -136

No files matched your search

+31 -8
View File
@@ -101,8 +101,9 @@ platform's own services.
## What the scanner runs on your code
Nearly every stage only *reads* your code: Semgrep, gitleaks, Syft, Ruff and the
PLC parser parse files and never execute them. Four stages are different, because
the tool has to run the project to do its job:
PLC parser parse files and never execute them, and they connect nowhere your
repository chooses. Two kinds of stage are different. Four have to run the
project to do their job:
| Stage | What it executes |
|---|---|
@@ -111,12 +112,34 @@ the tool has to run the project to do its job:
| `pip-compile` | builds source distributions to read their metadata, running `setup.py` |
| Firmware reproducible build | the project's build system, through Nix |
In a shared deployment those stages are **off**: the scanner holds many
tenants' data, and a lint warning is worth less than the blast radius of
running a stranger's build. Lockfile-based dependency resolution still happens —
npm runs with `--ignore-scripts`, and `cargo generate-lockfile` and
`cargo metadata` resolve without compiling — so your SBOM is unaffected. For a
complete firmware SBOM, build with Firmwerk on your side and import the bundle.
Three more run nothing of yours, but fetch from whatever hosts your manifests
name — a registry in a committed `.npmrc`, a URL dependency in `package.json`,
a git dependency in `Cargo.toml`:
| Stage | What it fetches |
|---|---|
| `npm install --package-lock-only` | every dependency `package.json` names, to write a missing lockfile |
| `cargo generate-lockfile` | every dependency `Cargo.toml` names, to write a missing `Cargo.lock` |
| `cargo metadata` | every dependency's sources, to read its licence |
In a shared deployment all of these stages are **off**: the scanner holds many
tenants' data, and a lint warning or a generated lockfile is worth less than the
blast radius of running a stranger's build or connecting where a stranger
chooses.
**Commit your lockfile.** The SBOM is built from `package-lock.json`,
`yarn.lock`, `pnpm-lock.yaml`, `bun.lock`, `Cargo.lock`, `requirements.txt`,
`poetry.lock`, `Pipfile.lock` or `uv.lock`. A manifest without one gets no
dependency versions, and the scan run records a skipped `sbom_dependencies`
stage naming the file to commit. Bun's binary `bun.lockb` cannot be read;
commit the text `bun.lock` (`bun install --save-text-lockfile`).
`cargo audit` still runs over a committed `Cargo.lock`. It reads configuration
from the directory it runs in, so it runs from an empty one: a committed
`.cargo/audit.toml` can neither point it at another advisory database nor
silence advisories.
For a complete firmware SBOM, build with Firmwerk on your side and import the bundle.
A single-tenant or sandboxed deployment can turn them on with
`PW_ALLOW_UNTRUSTED_CODE_EXEC=1`; a hardened deployment ignores it. The stages