Repository navigation
fix(secrets-detection): redact complete PEM private key blocks - #212
Merged
Merged
Conversation
Signed-off-by: lucarlig <[email protected]>
lucarlig
marked this pull request as ready for review
October 28, 2026 09:40
lucarlig
requested review from
gandhipratik203 and
msureshkumar88
as code owners
October 28, 2026 09:40
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.
private_key_blockcurrently replaces only the opening PEM marker, leaving the key body and closing marker in tool output. Generic PKCS#8 and encrypted private keys also evade detection and blocking.Match the full block through the closing marker of the same key type for RSA, DSA, EC, OpenSSH, encrypted, and generic PKCS#8 keys. If the matching closing marker is missing, redact through the end of the string. Separate complete blocks retain the text between them.
Adds Rust regressions for multiline, single-line, CRLF, repeated, truncated, mismatched-marker, and overlapping-detector cases, plus Python hook coverage for redaction, blocking, and payload isolation. Documents the behavior and bumps the plugin to
0.3.15.Refs #162 (private-key detection/redaction item).
Validation:
make installfollowed bymake ci NEXTEST_PROFILE=ci: 100 Rust tests and 118 Python hook tests passed; formatting, Clippy, wheel build/install, stubs, and benchmark compilation passed.make plugins-validate: catalog validation and 41 repository tests passed.pre-commit run: all hooks, including secret scanning, passed. Baseline changes remove the old literal PEM fixture and refresh existing finding locations.cargo deny ... check advisories: passed.The full-workspace security scan fails on existing
RUSTSEC-2026-0382in the rate limiter'srustls-webpki 0.103.15, which is also present onorigin/main. Workspace bans, licenses, and sources checks passed.