Repository navigation
fix(secrets_detection): preserve secret field names during redaction - #142
Merged
Merged
Conversation
Signed-off-by: lucarlig <luca.carlig@ibm.com>
lucarlig
marked this pull request as ready for review
July 21, 2026 09:39
lucarlig
requested review from
gandhipratik203 and
msureshkumar88
as code owners
July 21, 2026 09:39
gandhipratik203
approved these changes
Jul 21, 2026
gandhipratik203
left a comment
Collaborator
There was a problem hiding this comment.
Clean fix, and the exact-output tests are a nice upgrade. One non-blocking nit: the README Notes only mention capture-group redaction for base64_24, but this now applies to aws_secret_access_key and generic_api_key_assignment too — worth a one-line doc update.
Signed-off-by: lucarlig <luca.carlig@ibm.com>
9 of 14 tasks
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.
Summary
aws_secret_access_keyassignments, preserving the field name, separator, whitespace, and quotesgeneric_api_key_assignmentsecrets_detectionto 0.3.10Root cause
The AWS detector matched the full labeled assignment and captured the value, but the scanner only used capture-group spans for the base64 detector. Redaction therefore replaced the detector's full match, including the field name. The generic API-key assignment detector had the same whole-assignment replacement behavior and did not expose a value capture.
Impact
An input such as:
is now returned as:
instead of replacing the entire assignment.
Validation
make ciinplugins/rust/python-package/secrets_detectionTracker
Addresses the follow-up reported in WatsonOrchestrate/wo-tracker#78411.