Skip to content

Switch to betterleaks (again)#1043

Merged
Soph merged 4 commits intomainfrom
soph/switch-to-betterleaks
Apr 27, 2026
Merged

Switch to betterleaks (again)#1043
Soph merged 4 commits intomainfrom
soph/switch-to-betterleaks

Conversation

@Soph
Copy link
Copy Markdown
Collaborator

@Soph Soph commented Apr 27, 2026

https://entire.io/gh/entireio/cli/trails/234

  • switching from goleaks to betterleaks
  • added specific tests to cases we hadn't covered or failed before that they work with betterleaks

Note

Medium Risk
Updates the always-on secret redaction engine and dependency graph, which could change what gets redacted (or missed) in stored transcripts. Adds new URL credential redaction and regression tests to reduce the chance of false negatives and tooling side effects.

Overview
Switches transcript secret scanning from gitleaks to betterleaks (new dependency + updated go.mod/go.sum) and updates security docs accordingly.

Extends always-on redaction by also matching and redacting credentialed URLs (e.g., scheme://user:password@host) and adds coverage for private key blocks and these URLs in redact tests.

Adds a regression test (betterleaks_env_test.go) to ensure importing/using the redactor does not leak git-isolation environment variables into subsequent git subprocesses, and updates allowed licenses to include 0BSD.

Reviewed by Cursor Bugbot for commit 1843314. Configure here.

@Soph Soph requested a review from a team as a code owner April 27, 2026 11:38
Copilot AI review requested due to automatic review settings April 27, 2026 11:38
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR switches the redaction engine’s pattern-based secret scanning from gitleaks to betterleaks, and extends redaction coverage (and tests) for credentialed URIs and private key blocks to ensure the new detector catches previously missed cases.

Changes:

  • Replace gitleaks detector usage with betterleaks in redact.String.
  • Add always-on redaction for credentialed URIs (scheme://user:password@host...) plus new unit tests covering common DSN/URL variants.
  • Add a regression test ensuring betterleaks initialization doesn’t leak git-related environment variables into subsequent subprocesses; update docs and license allowlist accordingly.

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
redact/redact.go Switches detector import to betterleaks and adds credentialed-URI regex redaction.
redact/redact_test.go Adds coverage for credentialed URIs and OpenSSH private key block redaction (including JSONL).
redact/betterleaks_env_test.go Adds regression test to ensure betterleaks usage doesn’t poison git environment variables.
go.mod Adds github.com/betterleaks/betterleaks and removes direct gitleaks/v8 dependency.
go.sum Updates dependency checksums after the detector/library switch.
docs/security-and-privacy.md Updates documentation to reference Betterleaks and credentialed-URI redaction.
.allowed-licenses Adds 0BSD to accommodate the new dependency’s license.

Comment thread redact/redact_test.go Outdated
Soph added 4 commits April 27, 2026 14:25
Entire-Checkpoint: 9d5605c135fd
Entire-Checkpoint: f8d603dd2f7b
Entire-Checkpoint: af9e61f1f149
Entire-Checkpoint: 63c9ce749c49
@Soph Soph force-pushed the soph/switch-to-betterleaks branch from 23787c8 to f0c2ea9 Compare April 27, 2026 12:29
@Soph Soph merged commit b40d0b0 into main Apr 27, 2026
9 checks passed
@Soph Soph deleted the soph/switch-to-betterleaks branch April 27, 2026 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants