Repository navigation
fix(observability): Redact sign-in codes from Sentry and OpenTelemetry - #1875
yahyafakhroji wants to merge 1 commit into
Conversation
scotwells
left a comment
There was a problem hiding this comment.
Please add the sign-in parameters to OpenTelemetry’s existing redaction list rather than replacing it. The pinned HTTP instrumentation uses its defaults only when redactedQueryParamsServer is unset. With this change, server traces can start recording cloud-storage signatures and session tokens that were previously hidden. Please add a regression test showing that a sign-in code and a signed-storage parameter are both redacted while an ordinary parameter stays visible.
🧪 Test Summary
Need another run? Use Re-run failed jobs: one shard costs a few minutes, the whole workflow about 26. |
The sign-in callback URL carries the one-time OIDC authorization code and state in its query string. The Sentry tracing span, Sentry request data and OpenTelemetry HTTP server spans all recorded that URL as is. Redact the values of code, state and token-style query parameters before they leave the portal, and keep other parameters for debugging. OpenTelemetry keeps its default signed-storage redactions as well.
5b9ad87 to
e2aef7d
Compare
scotwells
left a comment
There was a problem hiding this comment.
The OpenTelemetry change addresses my earlier concern. One gap remains in the Sentry path: redactQuerySecrets matches raw parameter names, but URL parsers decode percent-encoded names. A callback can therefore be recognized by the app while its sign-in code is still recorded in Sentry. Please compare decoded parameter names before logging and add a regression test covering an encoded name in both the request URL and raw query string.
🧪 Test Summary
Need another run? Use Re-run failed jobs: one shard costs a few minutes, the whole workflow about 26. |
|
@scotwells Thanks for catching that! OTel now keeps its default redaction list and adds the sign-in params on top. I also added a test that checks |
Problem
The sign-in callback URL carries the one-time OpenID Connect (OIDC) authorization code and state in its query string. Sentry events, Sentry spans and OpenTelemetry HTTP server spans recorded that URL with the code in it, so anyone who could read traces could see it. The portal's own access log records only the path and was already safe.
Solution
A shared helper replaces the values of
code,state,session_stateand the token parameters with[REDACTED]and keeps other parameters for debugging. The Sentry tracing middleware and the existing Sentry scrub hook use it. The OpenTelemetry HTTP instrumentation redacts the same names on server spans and keeps its default signed-storage list, such asX-Amz-Signature. A test runs a real instrumented server span and checks that a sign-in code and a signed-storage parameter are redacted while an ordinary parameter stays visible.The Envoy gateway access log in the infra repo also records the full path and needs a separate fix there.
Closes #1853