Skip to content

fix: redact secret property values in SessionContext Debug - #2960

Open
plusplusjiajia wants to merge 1 commit into
apache:mainfrom
plusplusjiajia:fix/session-context-debug-redaction
Open

fix: redact secret property values in SessionContext Debug#2960
plusplusjiajia wants to merge 1 commit into
apache:mainfrom
plusplusjiajia:fix/session-context-debug-redaction

Conversation

@plusplusjiajia

@plusplusjiajia plusplusjiajia commented Aug 5, 2026

Copy link
Copy Markdown
Member

What changes are included in this PR?

SessionContext's derived Debug printed properties verbatim, while session properties routinely carry secrets. Redaction now happens on two levels:

  • By key: values of sensitive keys are redacted, matched case-insensitively and separator-agnostically (token, s3.secret-access-key, AWS_SECRET_ACCESS_KEY, clientSecret, Authorization, Cookie, ...) since property keys carry no casing contract.
  • By value: values that are themselves credential-bearing are redacted even under innocuous keys — URIs with userinfo (e.g. the SQL catalog's uri holding postgres://user:pass@host/db) and signed URLs (X-Amz-Signature=, SAS sig=).

Plain values (warehouse names, credential-free URIs) stay visible, so Credential's redaction isn't undone by the map next to it. Same approach as the REST catalog config redaction in #2838.

Are these changes tested?

Table-driven tests pin both matchers (key casings/separators, URI/signed-URL values, plus negative cases), and a Debug formatting test asserts secret values are redacted while plain values remain visible.

@plusplusjiajia
plusplusjiajia marked this pull request as ready for review August 5, 2026 09:14
@plusplusjiajia
plusplusjiajia force-pushed the fix/session-context-debug-redaction branch 10 times, most recently from 767c783 to 36f0722 Compare August 6, 2026 01:43
@plusplusjiajia
plusplusjiajia force-pushed the fix/session-context-debug-redaction branch from 36f0722 to f7ceb7e Compare August 6, 2026 01:48
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