feat(secrets): Betterleaks instead of gitleaks, findings carry over (#516)
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 11m59s

- The agent image ships Betterleaks 1.9.0 (MIT, gitleaks' successor by its
  author; pinned with checksum) instead of gitleaks 8.21.2. It reads our
  rules/gitleaks.toml unchanged, incl. the #464/#482 allowlists; `git .`
  replaces `detect --source .`, `dir .` stays. Live validation (which sends
  secrets to their providers) is never passed and a test pins that; the
  scan runs without network.
- The findings keep the scanner name `gitleaks` (finding_store::
  SECRET_SCANNER), so fingerprints (#491) and tracker issues carry over.
- RunFindings::adopt_renamed_secrets: a secret now reported under another
  rule (Betterleaks' composite aws-access-token reports a lone key id as
  generic-api-key; renamed vendor rules) takes over the stored row of the
  same target, file and match whose old rule no longer reports it: same id,
  status, triage and issue, with the new rule, title and severity.
- Compared on every fixture tree: identical results, except two planted
  hard-coded passwords Betterleaks finds in the C firmware fixture
  (generic-password), added to its nightly baseline.
- Docs (tools, guides), test plan check 33.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p
This commit is contained in:
Sharang ParnerkarandClaude Opus 5.5 committed 2026-10-06 17:46:20 +02:00
1 parent 908e6b8449
commit ee30ecfddb
10 files changed
+375 -45

No files matched your search

@@ -32,6 +32,7 @@ together on stage in one pass before the next prod promotion.
| #508 (B2) | Component creator (project URL) in the SBOM |
| #498 (4/4) | Draft ENISA notifications (CRA Art. 14) for actively exploited vulnerabilities |
| #498 (follow-up) | ENISA deadlines evaluated by the agent; one notification per CVE |
| #516 | Secret scanning with Betterleaks instead of gitleaks |
**Customer-visible on the next prod rescan** is marked **[visible]**: these
change what a customer sees on their existing targets, without them doing
@@ -702,6 +703,27 @@ Use the log4j target of check 31.
- **[visible]** deadlines as "fällig in"/"überfällig seit"; one draft per
vulnerability.
### 33. #516 Betterleaks instead of gitleaks
- **Do:** check the agent image: `betterleaks version` gives 1.9.0, no
`gitleaks` binary; `/opt/pruefwerk/tool-versions.json` lists
`betterleaks`.
- **Do:** rescan a target that had secret findings before (e.g. the Android
target with signing passwords, `fixtures/nightly/archive`). **Expect:** the
same findings (same ids and statuses, no close/reopen), scanner name still
`gitleaks`; tracker issues unchanged.
- **Do:** upload `fixtures/nightly/firmware/c-sensor-node`. **Expect:** two
new **Zugangsdaten im Code** findings, `generic-password` in `cli.cpp:8`
and `comms.c:9` (the planted passwords gitleaks missed).
- **Do:** a git target with a lone AWS key id `AKIA…` that had an
`aws-access-token` finding, which you mark "Risiko akzeptiert"; rescan.
**Expect:** the same finding, still accepted, now `generic-api-key`. Log:
`secrets stored under another rule of the secret scanner kept their
findings`.
- **Expect:** no outbound connection from the secret stage (no validation).
- **[visible]** more secret findings on some targets (new Betterleaks
rules); a few existing ones show another rule name.
## After the pass
- The nightly job on `main` is green with the new mobile targets.