feat: privacy-preserving redaction pipeline for operational sinks - #1235
Merged
Mosas2000 merged 1 commit intoAug 30, 2026
Merged
Conversation
Contributor
|
A perfect one as this centralized redaction pipeline with deterministic pseudonymization is an outstanding approach to data privacy and compliance, seamlessly integrating it across all egress sinks ensures secrets never leak while preserving full auditability. Thank you. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a schema-aware redaction pipeline that classifies sensitive operational fields centrally and enforces sink-specific redaction before anything is persisted or transmitted. Sensitive material (Stellar/EVM addresses, transaction hashes, IPs, notes/evidence, endpoint details, secrets) is pseudonymized or redacted deterministically before reaching audit, webhook, export (PDF/CSV/JSON), websocket, and log sinks.
What changed
backend/src/privacy/:fieldRegistry.ts— central sensitivity classification with**/*path matching, rule fingerprinting, and a stable registry singleton.secretScanner.ts— detects Stellar ed25519 secrets, EVM private keys, BIP-39 mnemonics, JWTs, bearer tokens, and named secrets.pseudonymizer.ts— deterministic HMAC-SHA-256 pseudonyms (psn:prefixed), namespaced and irreversible.redaction.service.ts— engine applying per-sink policies (audit,webhook,export,websocket,log, ...); optional block-on-secret for irreversible sinks; re-walks stringified JSON bodies.redactionDecision.service.ts— best-effort, versioned decision recording (fingerprints and paths only, never original values).audit.service.tsredacts then computes checksum.webhook.service.ts+webhook.service.outbox.tsredact payloads in both single and batch paths.export.worker.tswraps the row stream through the export policy.websocket.ts(System A) andwebsocket.server.ts(System B) redact before delivery/Redis publish.logger.tsderives pino redact paths from the central registry.REDACTION_ENABLED, pseudonym salt/namespace, block-on-secret, and decision-log flags.redaction_decisionsaudit table for post-hoc decision review.tests/services/privacyRedaction.service.test.ts.Verification
tsc --noEmitclean for all touched files.vitest run tests/services/privacyRedaction.service.test.ts→ 31 passing.Notes
The webhook outbox path embeds
endpoint.secret/endpoint.urlintooutbox_events(pre-existing behavior). Payload redaction is applied, but the endpoint secret itself is intentionally left unchanged to avoid breaking the event dispatcher contract.Closes #1018