Repository navigation
Redact nested secrets and proxy credentials in debug logs - #1536
Open
giri-kondisetty wants to merge 1 commit into
Open
giri-kondisetty wants to merge 1 commit into
giri-kondisetty wants to merge 1 commit into
Conversation
sanitize_dictionary() only redacted five key names at the top level and in the body, so secrets under other names or nested in lists (for example private_key or a nested client_secret) were logged in clear. The proxy dictionary was logged with the credentials of its URLs. Secret values are now redacted at any depth, and proxy URLs are logged without their credentials when log sanitization is enabled.
giri-kondisetty
requested review from
alhumaw,
crowdstrikedcs and
jshcodes
as code owners
November 27, 2026 01:09
giri-kondisetty
force-pushed
the
fix/debug-log-redaction
branch
from
November 27, 2026 02:19
ff2cee0 to
e711a82
Compare
This branch has not been deployed
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.
Redact nested secrets and proxy credentials in debug logs
With log sanitization enabled, debug logs still showed secrets nested in request bodies (for example
private_key) and the credentials in proxy URLs.sanitize_dictionary()now also walks nested dictionaries and lists and redacts string values whose key isprivate_keyor containspasswordorsecret. The existing top-level behaviour is unchanged.New
sanitize_proxy()returns a copy of the proxy dictionary with the credentials removed from each URL.log_class_startup()uses it whensanitize_logis enabled. The proxy dictionary used for requests is not modified.Bug fixes
Updated unit tests
Unit test coverage
I could not run the full suite:
tests/test_api_request.pyand most other modules need API credentials at import. I ran theTestSanitizeDictionaryand newTestSanitizeProxyclasses on their own (11 tests, all pass) and checked the log output by hand:BODY: {'resources': [{'client_email': '[email protected]', 'private_key': 'REDACTED', 'project_id': 'p'}]} CONFIG: Proxy dictionary: {'https': 'http://[email protected]:9'}With
sanitize_log=Falsethe proxy URL is logged unchanged, as before.Bandit analysis
flake8,pylint(10.00/10) andpydocstyleare clean forsrc/falconpy/_util.Issues resolved
Other
reset_password: Truestay readable.private_key_idis not redacted.