Keys never live in a repo: an ignore list and a scanner that actually looks - #1
Merged
Merged
Conversation
… looks
On 2026-07-30 a VPN profile with an unencrypted private key was found in the
planning repo. It had been there since 2026-07-01, readable by five people, and
the whole VPN trust chain had to be burned. Secret scanning did not miss it --
it never looked. Three holes, all closed here:
wrong repo - scanning ran on 3 of 14 repos. This goes on every one.
wrong trigger - it fired on pull requests only, and that repo pushes straight
to main. This fires on pushes too, every branch.
wrong scope - it read only a pull request's diff. The weekly run reads the
ENTIRE history, so anything that slipped in earlier surfaces.
Fail-closed: a hit fails the job, and so does a scanner that could not run. A
scan that cannot run must never report success.
The ignore list is the second layer -- it stops the file being staged at all.
It is preventive only: nothing already committed is untracked or removed.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Same change, opened on every repo in the org.
Why
On 2026-07-30 a VPN connection profile carrying an unencrypted private key was found committed to the planning repo. It had been there since 2026-07-01 — pushed as a side effect of a folder move, not a decision — readable by five people for 29 days. The entire VPN trust chain was burned the day it was found.
Secret scanning didn't miss it. It never looked. Three separate holes:
What this adds
.github/workflows/gitleaks.yml— scans on pull requests, on pushes, weekly over full history, and on demand. Fail-closed: a hit fails the job, and so does a scanner that couldn't run. A scan that can't run must never report success — that's the same trap as a test that passes while measuring nothing..gitignore— the credential patterns, as a second layer: VPN profiles, keys and certificates, environment files (.env.exampledeliberately still allowed), and cloud service-account files.What this does NOT do
It does not untrack or delete anything already committed. Purely preventive. If this repo already has files matching the patterns, they stay exactly as they are.
Note for infra / lambdas / cf-internal-hub
You already run gitleaks inside
review.ymlon pull requests. This is additive — it brings the push and full-history coverage that one doesn't have. Slight overlap on pull requests; ~30 seconds, and I'd rather have one identical file across all fourteen repos than fourteen variations.On a hit
The credential is compromised. Remove it, rotate it — git history keeps the old value — and confirm the ignore list covers it. Rewriting history alone does not make a leaked key safe. Today proved that: the object stayed retrievable from GitHub by hash after the rewrite.
🤖 Generated with Claude Code