fix(observability): redact secret fields in Sentry field-only log summaries - #1661
fix(observability): redact secret fields in Sentry field-only log summaries#1661JSONbored wants to merge 1 commit into
Conversation
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
Closing as superseded by #1662. Both PRs target the same Sentry field-only summary leak, and #1662 covers the scalar case plus nested object/array redaction while preserving the title shape that omits secret-keyed top-level fields. Keeping both would duplicate and conflict in |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1661 +/- ##
=======================================
Coverage 95.52% 95.52%
=======================================
Files 204 204
Lines 22196 22199 +3
Branches 8025 8027 +2
=======================================
+ Hits 21202 21205 +3
Misses 415 415
Partials 579 579
🚀 New features to boost your workflow:
|
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review — held for maintainer review
⏸️ Held for maintainer review — Readiness score is below the configured threshold — Address the short explicit PR panel actions, then re-run the gate. Review summary Concerns raised — review before merging
Nits — 5 non-blocking
Review context
Contributor next steps
Signal definitions
Review detailsGenerated from public PR metadata and the diff. Advisory only; deterministic signals remain authoritative. This change correctly moves field-only Sentry title summarization through the same secret-key scrubber used for outbound Sentry event data. Top-level secret-like scalar keys are redacted before formatting, nested object values are cloned and scrubbed before stringification, and the regression test exercises both paths while preserving safe fields. The implementation is narrow and matches the existing privacy boundary. Nits (4)
🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
Motivation
Error.messagewithout applying the repository's secret-key redaction, which could expose short secrets (API keys, passwords, tokens) in issue titles/notifications.scrubEvent()scrubber only coveredrequest.headers,contexts, andextra, so the new summarization path duplicated unredacted scalar fields into the exception value and bypassed the privacy boundary.Description
summarizeLogFieldValue()helper that appliesSECRET_KEYchecks and redacts top-level secret-like keys before formatting.scrubEvent()on astructuredCloneof the value and thenJSON.stringify()the scrubbed result so nested secret keys are also redacted.Testing
npm run typecheck, which completed successfully with no type errors.npx vitest run test/unit/selfhost-sentry.test.ts, and the suite passed (27 testspassed).npm run test:coverageencountered a coverage-remapping provider error (TypeError: jsTokens is not a function) after tests completed, andnpm run test:ciwas blocked byactionlintsetup network/fallback issues in this environment, whilenpm audit --audit-level=moderatewas blocked by the registry audit endpoint returning403.Codex Task