DATA-12974: redact sensitive request headers before logging - #32
Open
pragyash258 wants to merge 2 commits into
Open
DATA-12974: redact sensitive request headers before logging#32pragyash258 wants to merge 2 commits into
pragyash258 wants to merge 2 commits into
Conversation
pragyash258
force-pushed
the
data-12974-secure-headers-and-ci-hygiene
branch
from
August 16, 2026 19:27
7b9d866 to
336de33
Compare
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.
Fixes DATA-12974:
populateServerDataserialised every request header verbatim, so Authorization, Cookie and API-key values reached the log sink in cleartext.Changes:
[REDACTED]before serialisation, keeping the header names so a reader still sees which headers were sent.Chitragupta.extendSensitiveHeaders([...])for hosts that need additional header names, and document it in the README.test/headers.jstonpm test, covering redaction, case-insensitive matching, request-object immutability and the extension API.1.7.7.Validation:
npm testpasses on Node 8, 10, 12, 14, 18, 20 and 26. The emitted JSON envelope and its key set are unchanged, and the request object itself is not modified, so host auth code still reads the original header value.No
enginesfloor is added: the code runs unchanged on Node 8, and a floor would break installs for consumers on older runtimes.