mirror of
https://github.com/bitbaum/fleet.git
synced 2026-12-04 00:07:41 +01:00
scripts/audit/secret-in-response.py reads what actually crossed the wire
and reports credential material in it. It shipped 2026-09-15 with nine
test cases covering both directions, a README ending "Exit code is 1 if
anything CRITICAL or HIGH was found, so it can gate CI", and a real
cross-account disclosure to its name: vitareba's GET /api/admin/patients
returning every patient's bcrypt digest, which the code-level sweep had
missed because that route reads findMany() with no projection and a grep
for json(user) shapes does not match json({ success, data }).
Nothing ran it. Not a workflow, not ci.yml, not even its test. That is the
UNCALLED shape the floor audit exists to report, applied to the gate
templates/ci/README.md calls the one that catches what has actually cost
this fleet money — and it sat that way while the README said Rung 5 was
adopted nowhere, which was true only because nobody had looked in
scripts/audit.
WHAT LANDS
- secret-in-response-sweep.sh: every LIVE app from
loki:scripts/hetzner/apps.conf (the SSOT, read from its default branch,
never a local checkout), unauthenticated, three paths, GET only.
- secret-in-response.yml: daily, both suites before the verdict, Telegram
on failure, and fixtures-only on a PR because the live verdict is a
fact about the apps rather than about the change under review.
- both test suites into ci.yml, where neither had ever run.
First live sweep: 12/12 apps reached, 0 findings.
WHAT IT PROVES AND WHAT IT DOES NOT
Unauthenticated only. The README is explicit that the authenticated pass
is the real test — most interesting routes 401 without a session — and it
needs a live session cookie per app held as a rotating secret. A gate
needing twelve of those is a gate that stops running, so it stays manual
and the workflow says so rather than letting green imply more than it
proves. What it does cover is strictly the worse class: credential
material reachable with NO LOGIN AT ALL.
Still unbuilt: identity taken from the request body, and a query missing
its tenant filter. Both are per-repo assertions with no fleet-level
detector yet.
AND THE SAME BUG AGAIN, IN THE SWEEP WRITTEN TO CLOSE IT
With every host unreachable the sweep announced a clean fleet, having read
zero responses. Its own fixtures caught it before it ever ran on a bad
day. A verdict may only be claimed over what was actually READ: it now
reports scanned N/M, withholds unreachable hosts instead of counting them
clean, refuses to pass when N is zero, and when some hosts are missing
says "the N app(s) reached" rather than "the fleet".
13 aggregation cases, stubbed gh and stubbed scanner, no network.
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>