Dependency Vulnerability Scanning
Overview
The platform scans its dependencies for known vulnerabilities (SCA) on every commit, PR and push — the counterpart to the bandit static analysis (SAST) that scans first-party code.
Two tools, split by what they can do rather than by ecosystem:
| Tool | Scope | Can auto-fix |
|---|---|---|
osv-scanner | Every lockfile — Python and Node | No |
osv-scanner queries the OSV database, which aggregates GHSA, PYSEC and CVE advisories. It reads uv.lock natively, so there is no export step and no second source of truth — the lockfile that gets installed is the lockfile that gets scanned.
What is covered
modules/svc-ai/uv.lock modules/fe/package-lock.json
modules/svc-auth/uv.lock tools/requirements.txt
modules/svc-bff/uv.lock tools/collectors/requirements.txt
modules/svc-core/uv.lock modules/svc-core/requirements.txt
modules/test/uv.lock
Discovery is by glob, not by a hardcoded list — a new service with a uv.lock is picked up with no change to the tooling.
Running it
make audit # npm audit fix + Python scan (the everyday command)
make audit-fe # npm audit fix only
make audit-be # Python lockfiles only
make audit-deps # every lockfile, Python and Node, in one pass
The binary is installed automatically on first use (and by the devcontainer's post-create step) via tools/security/install-osv-scanner.sh, which pins a release version and is idempotent.
The severity gate
OSV_FAIL_ON is the single policy knob, honoured identically by the Makefile, the pre-commit hook and CI:
| Value | Behaviour |
|---|---|
any | Fail on any finding at all |
low | Fail at CVSS ≥ 0.1 |
medium | Fail at CVSS ≥ 4.0 |
high | Fail at CVSS ≥ 7.0 |
critical | Fail at CVSS ≥ 9.0 |
OSV_FAIL_ON=high make audit-be # try a stricter policy locally
Flipping CI to blocking
The repo is report-only today because the existing lockfiles carry a backlog of findings. Making the gate blocking is two edits:
Set
OSV_FAIL_ONin thedependency-scanjob in.github/workflows/ci.ymltocritical,highorany.Add
dependency-scanto theneeds:list of the jobs that should wait on it (the job is deliberately independent of the pipeline while report-only).
Change OSV_FAIL_ON ?= in the Makefile to move the local default in step.
Where it runs
| Surface | Scope | Blocking |
|---|---|---|
| CI | Whole repo, every ecosystem | No (OSV_FAIL_ON) |
make audit | Whole repo | No (OSV_FAIL_ON) |
The pre-commit hook runs with OSV_ON_ERROR=warn, so a machine with no network still commits — the scan is skipped with a warning rather than blocking. CI uses the default fail, so a broken scan there is a real failure, not a silent pass.
The CI job writes the findings table to the GitHub step summary and uploads the raw JSON as an osv-results artifact (30-day retention).
Fixing a finding
Upgrade in the lockfile first: uv lock --upgrade-package <pkg> in the service, npm update <pkg> in modules/fe. Take the earliest fixed release that has been out for at least a week; a release days old is a supply-chain risk of its own. Then re-run make audit-deps and the service's tests.
When no upstream release fixes it — the package that pulls it in pins the vulnerable version — force the fixed one with npm overrides in modules/fe/package.json, and record it here, since package.json takes no comments:
| Override | Why | Remove when |
|---|---|---|
postcss-selector-parser 7.1.6 under @tailwindcss/typography | GHSA-rj75-hqrm-r3gf is fixed only in 7.1.6; @tailwindcss/typography 0.5.20 (latest) pins 6.0.10 exactly. 7.0's only breaking change is safe insertion during iteration; the plugin runs at build time on our own CSS | the plugin depends on 7.1.6 or later |
Suppressing a finding
Never widen the severity gate to silence one advisory. Add an entry to .osv-scanner.toml instead:
[[IgnoredVulns]]
id = "GHSA-xxxx-xxxx-xxxx"
ignoreUntil = 2026-12-31
reason = "Only reachable via the CLI entrypoint, which we do not ship."
ignoreUntil is required by convention so suppressions expire and come back for review rather than accumulating silently.
Implementation
| File | Role |
|---|---|
tools/security/osv-scan.sh | Scan wrapper — resolves targets, applies OSV_FAIL_ON |
tools/security/osv_report.py | Renders the JSON result (text/markdown) and decides exit |
.osv-scanner.toml | Suppressions and package overrides |
osv-scanner emits one format per run, so the wrapper always requests JSON — the canonical form — and osv_report.py renders it for logs or for a GitHub step summary and applies the severity policy. One scan, one network round-trip, one policy shared by every surface.