Skip to content

fix(observability): Redact sign-in codes from Sentry and OpenTelemetry - #1875

Open
yahyafakhroji wants to merge 1 commit into
mainfrom
fix/redact-sign-in-codes
Open

yahyafakhroji wants to merge 1 commit into
mainfrom
fix/redact-sign-in-codes

Conversation

@yahyafakhroji

@yahyafakhroji yahyafakhroji commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

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_state and 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 as X-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

@yahyafakhroji
yahyafakhroji requested a review from a team as a code owner November 30, 2026 12:25
@yahyafakhroji yahyafakhroji added the bug Something isn't working label Nov 30, 2026

@scotwells scotwells left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@github-actions

Copy link
Copy Markdown

🧪 Test Summary

Job Status
E2E Regression (0) ✅ success
E2E Regression (1) ✅ success
E2E Regression (2) ✅ success
E2E Regression (3) ✅ success
E2E Smoke ✅ success
Unit Tests ✅ success
Vitest Unit Tests ✅ success

View workflow run

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.
@yahyafakhroji
yahyafakhroji force-pushed the fix/redact-sign-in-codes branch from 5b9ad87 to e2aef7d Compare November 30, 2026 12:43

@scotwells scotwells left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@github-actions

Copy link
Copy Markdown

🧪 Test Summary

Job Status
E2E Regression (0) ✅ success
E2E Regression (1) ✅ success
E2E Regression (2) ✅ success
E2E Regression (3) ✅ success
E2E Smoke ✅ success
Unit Tests ✅ success
Vitest Unit Tests ✅ success

View workflow run

Need another run? Use Re-run failed jobs: one shard costs a few minutes, the whole workflow about 26.

@yahyafakhroji

Copy link
Copy Markdown
Contributor Author

@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 code and X-Amz-Signature are redacted while lang stays visible. Mind taking another look?

@yahyafakhroji yahyafakhroji self-assigned this Nov 30, 2026
@yahyafakhroji
yahyafakhroji requested a review from a team November 30, 2026 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cloud portal logs sign-in codes

2 participants