Skip to content

fix(preflight): --redact the gitleaks gate so secret values never hit CI artifacts (#27)#30

Merged
FerroxLabs merged 1 commit into
mainfrom
feat/gitleaks-redact
Jul 10, 2026
Merged

fix(preflight): --redact the gitleaks gate so secret values never hit CI artifacts (#27)#30
FerroxLabs merged 1 commit into
mainfrom
feat/gitleaks-redact

Conversation

@FerroxLabs

@FerroxLabs FerroxLabs commented Jul 10, 2026

Copy link
Copy Markdown
Owner

Closes #27. Adds --redact to the gitleaks preflight gate so a real finding's plaintext secret value is never serialized into preflight-report.json / uploaded as a public-repo CI artifact. Adversarial review APPROVE-WITH-NITS (verified: no second unredacted path; the argv-pin test hardened against a commented-flag loophole). Installer 76/76, preflight 11/11, check-all.sh green.

… CI artifacts (#27)

The gate spawned `gitleaks detect ... -v` without --redact, then on FAIL
captured the raw stdout (which includes the literal `Secret: <value>`)
into the gate `details`. That serializes into preflight-report.json,
which ci.yml + publish.yml upload as a CI artifact (if: always(), 14-30d
retention) on a PUBLIC repo -- so the scanner that flags a leak became
its own amplifier, persisting the plaintext for weeks (long after a dev
scrubbed it from history via force-push/BFG).

Fix: add --redact to the detect argv. gitleaks still reports the
finding's location/rule/line with the value shown as REDACTED, so the
gate keeps its full diagnostic value. Empirically verified against the
pinned gitleaks 8.30.1: `Secret: ghp_...` plaintext without --redact,
`Secret: REDACTED` with it.

Test: argv-pin (matches the project's existing spawn-argv-pin pattern);
mutation-checked -- fails if --redact is dropped. Installer suite 76/76;
preflight 11/11 (gitleaks gate PASS on a clean tree).

Found + adversarially verified during the BRIEF-assigned v1.6.4 cross-
audit (dimension b); severity MEDIUM (harm is persistence-after-scrub).
@FerroxLabs FerroxLabs enabled auto-merge (squash) July 10, 2026 16:46
@FerroxLabs FerroxLabs merged commit c1d4e35 into main Jul 10, 2026
7 checks passed
@FerroxLabs FerroxLabs mentioned this pull request Jul 11, 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.

gitleaks preflight gate lacks --redact: plaintext secret value serialized into a public CI artifact

2 participants