Skip to content

chore(security): pin the env-backup findings in .gitleaksignore - #167

Closed
ralyodio wants to merge 1 commit into
masterfrom
worktree-gitleaks-ignore
Closed

ralyodio wants to merge 1 commit into
masterfrom
worktree-gitleaks-ignore

Conversation

@ralyodio

Copy link
Copy Markdown
Contributor

Draft on purpose — this should not merge until the credentials are rotated. See "Why this is a draft" below.

Pairs with #166 (which untracks the file). Independent of it; either can land first.

The problem

gitleaks detect --source . scans history, so untracking the environment backup did nothing for the check — it still reports the original commit, 925da5e (#160), 21 findings, on every PR in this repo.

Three ways out: rewrite history, pin the findings, or narrow the workflow. Rewriting means a force-push to master, all 8 collaborators re-cloning, invalidated open PRs, and a rewritten v0.2.0 tag — and it still doesn't remove the objects from GitHub's servers (verified: a commit remains fetchable via the API after its branch is deleted). Pinning is the documented mechanism for exactly this situation.

What this does

Appends the 21 fingerprints to the existing .gitleaksignore. The two entries already there — the curl-auth-header docs placeholder and the tracker-test pk_test_ fixture — are preserved untouched, along with their explanatory comments.

Each pin is scoped to <commit>:<file>:<rule>:<line>, so it silences only these specific historical findings. A new leak anywhere still fails the scan — this does not blanket-disable the check.

Why this is a draft

The two pre-existing entries are genuine false positives — placeholder strings that were never secret. These 21 are not. The values were real. Pinning them is only defensible once they've been rotated, because rotation is what turns the recorded values into dead data and makes the finding genuinely stale.

Merged before rotation, this file suppresses an alarm about a live exposure. The file says so in a comment block, so whoever reads it next sees the condition attached. Mark ready and merge once rotation is done.

Verification

Run against a pristine clone of master with gitleaks 8.21.2 — the exact version .github/workflows/security.yml installs:

findings
before 21 (all .env.bak-2026-07-28 @ 925da5e)
after 0 — INF no leaks found, exit 0

Worth noting the check is continue-on-error: true, so it has been reporting failure without blocking merges. This turns the signal back on rather than unblocking anything.

🤖 Generated with Claude Code

`gitleaks detect` scans history, so the 21 findings from the environment
backup committed in cfb23d2 (#160) keep failing the scan no matter what
HEAD contains — untracking the file did nothing for them. The alternative
is rewriting master to drop the blob, which forces all 8 collaborators to
re-clone and still leaves the objects on GitHub's servers.

Appended to the existing ignore list rather than replacing it; the two
false-positive pins already there (the docs placeholder and the tracker
test fixture) are untouched.

These 21 differ from those two in kind: the values were real, not false
positives. Pinning them is only honest after rotation, since rotation is
what makes the recorded values dead. The file says so, at length, where
the next person to read it will see it.

Verified against a pristine clone of master with gitleaks 8.21.2 — the
same version CI installs: 21 findings before, "no leaks found" after.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

vu1nz Security Review

0 finding(s) in PR #?

No security issues found.

@ralyodio
ralyodio force-pushed the worktree-gitleaks-ignore branch from 51af7c9 to 99a5586 Compare July 30, 2026 22:05
@ralyodio

Copy link
Copy Markdown
Contributor Author

Superseded: the history was scrubbed. .env.bak-2026-07-28 and its 21 findings no longer exist in any commit — git filter-repo removed the blob and master was force-pushed (e3d0f63 → 5a51ce2). A fresh clone reports 0 references and GitHub refuses to serve the old commit (upload-pack: not our ref).

There is nothing left for this PR to pin, and it now conflicts. The two genuine false positives are handled separately — note that the rewrite invalidated every existing fingerprint, since a fingerprint pins a commit SHA.

Credential rotation is still required: removing the blob does not un-publish what was already exposed.

@ralyodio ralyodio closed this Jul 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant