fix: add missing secret patterns to redact_sensitive_patterns#3
Merged
Conversation
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.
Closes #2
Adds type-tagged detection for GitHub PATs, LLM API keys (OpenAI/Anthropic/DeepSeek), AWS access keys, Slack tokens, and URI credentials. Formats that don't rely on a nearby trigger word. Each gets its own tag (
[REDACTED:GITHUB_TOKEN],[REDACTED:AWS_KEY], etc.); the 4 existing patterns keep emitting plain[REDACTED], unchanged.Also extended the trigger-word group with secret_key/private_key/auth_token (covers SECRET_KEY=, PRIVATE_KEY=, AUTH_TOKEN= style names).
Two bugs caught while testing the patterns discussed in the issue:
token=ghp_XXXX) doesn't actually reproduce the bug. It already matches the existingtoken=trigger pattern.sk-char class excluding-/_only redacts the prefix of keys likesk-ant-api03-..., leaving the rest of a live key exposed. Fixed.Out of scope (deferred, not yet discussed in enough detail to scope safely):
-p/--passwordCLI flags (collides withdocker run -p,git log -p), barekeyas a trigger word (false-positives onKEY=VALUE), env var assignment, SSH key blocks, entropy heuristics.12 new regression tests. Full suite: 262 passed, 0 failed. ruff clean.