Skip to content

fix(security): precise SEC001 rule and a fresh full-history baseline - #2107

Merged
yvgude merged 1 commit into
mainfrom
fix/history-gate-precision
Oct 17, 2026
Merged

yvgude merged 1 commit into
mainfrom
fix/history-gate-precision

Conversation

@yvgude

@yvgude yvgude commented Oct 17, 2026

Copy link
Copy Markdown
Owner

The history gate's SEC001 rule matched bare prefixes (ghp_, AKIA, sk_live_, PRIVATE KEY-----) and any database URL with a password field. On the private integration tree it reported 93 findings — every one a secret detector, test fake, warning doc, ${VAR}/{placeholder} password, local dev default or a self-signed loopback test key. The noise hid a real signal: the precise rule's full audit surfaced one live credential in an archive tag, now rotated and the tag deleted.

Rule

  • Two stages: an interval-free POSIX ERE narrows candidates for git log -S/git grep (intervals made the pickaxe exceed the per-command timeout on the larger private tree); a precise in-process check decides — full-length GitHub tokens, github_pat_, AWS key IDs (…EXAMPLE excluded), Stripe live keys, PEM blocks with base64 key material, DB URLs with a literal password ≥ 8 chars that is no placeholder and no documented dev default.
  • Narrow filters: ascending 8-character runs mark hand-made fixtures; one reviewed self-signed loopback test key is exempt by Git blob ID only.
  • History reports introductions only (precise count rises).
  • command_timeout_seconds 120 → 300 (candidate pickaxe 81 s on the private tree).
  • Strict contract validation of the rule in load_policy.

Baseline

Fresh audit at b37ee3be11 over main, cla-signatures and tags (the documented ref set; open PR branches excluded): 17,061 commits, 109,865 objects, 369 findings (368 IP path classes, 1 credential — rotated), current tree 0 (was 11). Full audit 533 s. Review doc updated, including the 8,818-commit discrepancy of the evidence shipped with 3.11.0.

Tests

17 positive credential shapes built at runtime, 17 negative false-positive classes, introduction vs removal, blob exemption bound to content, interval-free ERE, strict contract. tests/security: 178 passed. Gate on this branch: 0 new findings. Private integration tree: 0 of the previous 93 remain.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LXrM9CHahK6TaGE4yuHGPx

The history gate matched bare prefixes (ghp_, AKIA, sk_live_, PRIVATE
KEY-----) and any database URL with a password field, so it flagged
secret detectors, test fakes, warning docs, ${VAR} placeholders and dev
defaults; on the private integration tree 93 findings, all noise, hid
real signals.

- Two stages: an interval-free candidate ERE for git pickaxe/grep (keeps
  git fast), then a precise in-process check: full-length GitHub tokens,
  github_pat_, AWS key IDs (EXAMPLE keys excluded), Stripe live keys, PEM
  blocks with key material, DB URLs with a real literal password.
- Narrow filters: ascending 8-character runs mark hand-made fixtures; one
  reviewed self-signed loopback test key is exempt by blob ID only.
- History counts introductions only (precise count rises in a commit).
- command_timeout_seconds 120 -> 300 (candidate pickaxe took 81 s on the
  private tree).
- New baseline at b37ee3b over main, cla-signatures and tags: 17,061
  commits, 369 findings (368 path classes, 1 credential tracked for
  rotation), 0 current-tree findings (was 11). Full audit 533 s.
- Tests: 17 positive credential shapes built at runtime, 17 negative
  false-positive classes, introduction vs removal, blob exemption bound to
  content, strict rule contract. tests/security: 178 passed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LXrM9CHahK6TaGE4yuHGPx
@yvgude
yvgude merged commit 23739ed into main Oct 17, 2026
105 of 111 checks passed
@yvgude
yvgude deleted the fix/history-gate-precision branch October 17, 2026 18:15
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 17, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant