Skip to content

DATA-12974: redact sensitive request headers before logging - #32

Open
pragyash258 wants to merge 2 commits into
masterfrom
data-12974-secure-headers-and-ci-hygiene
Open

DATA-12974: redact sensitive request headers before logging#32
pragyash258 wants to merge 2 commits into
masterfrom
data-12974-secure-headers-and-ci-hygiene

Conversation

@pragyash258

@pragyash258 pragyash258 commented May 26, 2026

Copy link
Copy Markdown
Collaborator

Fixes DATA-12974: populateServerData serialised every request header verbatim, so Authorization, Cookie and API-key values reached the log sink in cleartext.

Changes:

  • Redact credential-bearing header values as [REDACTED] before serialisation, keeping the header names so a reader still sees which headers were sent.
  • Expose Chitragupta.extendSensitiveHeaders([...]) for hosts that need additional header names, and document it in the README.
  • Add test/headers.js to npm test, covering redaction, case-insensitive matching, request-object immutability and the extension API.
  • Bump the package version to 1.7.7.

Validation: npm test passes 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 engines floor is added: the code runs unchanged on Node 8, and a floor would break installs for consumers on older runtimes.

@pragyash258
pragyash258 requested a review from a team as a code owner May 26, 2026 11:42
@pragyash258 pragyash258 changed the title Redact sensitive headers, allowlist log-id, proto guard (DATA-12974 et al) Redact sensitive headers before logging (DATA-12974) May 26, 2026
@pragyash258 pragyash258 changed the title Redact sensitive headers before logging (DATA-12974) Redact sensitive headers in populateServerData (DATA-12974) May 26, 2026
@pragyash258 pragyash258 reopened this Aug 16, 2026
@pragyash258
pragyash258 force-pushed the data-12974-secure-headers-and-ci-hygiene branch from 7b9d866 to 336de33 Compare August 16, 2026 19:27
@pragyash258 pragyash258 changed the title Redact sensitive headers in populateServerData (DATA-12974) DATA-12974: redact sensitive request headers before logging Aug 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant