Skip to content

fix(sentry): harden operational error privacy filters - #736

Merged
unjica merged 2 commits into
developfrom
fix/sentry-privacy-hardening
Oct 5, 2026
Merged

unjica merged 2 commits into
developfrom
fix/sentry-privacy-hardening

Conversation

@unjica

@unjica unjica commented Oct 5, 2026

Copy link
Copy Markdown
Collaborator

Summary

Hardens Hosted Cloud operational Sentry error reporting (not customer telemetry ingest):

  • Shared sanitizeSentryEvent / safeSanitizeSentryEvent for API (@sentry/node) and dashboard (@sentry/nextjs) that strips auth/API-key/session/cookie headers, request bodies, cookies, query strings, Sentry user, and tt_live_* keys while retaining exception type/message/stack, method, path/host, and non-sensitive headers.
  • sendDefaultPii: false, includeLocalVariables: false, tracesSampleRate: 0.
  • Incoming request-body buffering disabled via httpIntegration({ maxIncomingRequestBodySize: "none" }) (dashboard also keeps Next’s disableIncomingRequestSpans: true).
  • beforeSend uses fail-closed try/catch: if the sanitizer walk throws (throwing getters / hostile Proxy), high-risk fields are removed with per-field guards and the event is still returned (never null).
  • /privacy describes Sentry as operational monitoring with EU ingest host ingest.de.sentry.io, explicitly not zero-PII or full EU residency.
  • Browser Sentry remains gated on existing NEXT_PUBLIC_SENTRY_DSN (unchanged).

Guarantees

Guarantee Status
Error reporting continues; beforeSend never returns null Yes (safe wrapper)
Auth headers / bodies / user / query stripped Yes
Customer ingest / billing / browser enablement untouched Yes
Privacy copy distinguishes EU ingest vs residency Yes

Tests

apps/api:    vitest sentry-privacy (+equivalence) + observability-sentry → 11 passed
apps/dashboard: vitest sentry-privacy + sentry → 16 passed
api tsc -p tsconfig.build.json --noEmit → pass
dashboard eslint → pass
scoped eslint on changed files → pass

Notes

  • Not deployed; post-deploy live Sentry event check pending (confirm headers/body/user/query stripped and EU ingest).
  • Equivalence test keeps API/dashboard sanitizer copies in sync (sibling-path comment only).
  • Branched from main @ v1.17.26; targets develop per repo convention.

unjica added 2 commits October 5, 2026 17:56
Add shared beforeSend sanitizers for API and dashboard that strip auth
headers, cookies, query strings, request bodies, Sentry user fields, and
tt_live_* keys. Disable default PII and local variables, set
tracesSampleRate to 0, and disable incoming request-body buffering.

Wrap sanitization in fail-closed try/catch so pathological events cannot
drop error reporting. Update /privacy to describe Sentry as Hosted Cloud
operational monitoring with EU ingest (not zero-PII or full residency).

Not deployed; post-deploy live Sentry event check pending.
@unjica
unjica merged commit 1bcff4d into develop Oct 5, 2026
9 of 12 checks passed
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