Skip to content

**Title:** fix: redact PII in structured logs#829

Open
SHEROSE0 wants to merge 1 commit into
Streampay-Org:mainfrom
SHEROSE0:bug/logger-pii-redaction
Open

**Title:** fix: redact PII in structured logs#829
SHEROSE0 wants to merge 1 commit into
Streampay-Org:mainfrom
SHEROSE0:bug/logger-pii-redaction

Conversation

@SHEROSE0

Copy link
Copy Markdown

#closes #420

Description:
This PR introduces a secure redaction layer for request body logging to ensure compliance with sensitive data handling (specifically Stellar memo PII).

Changes Implemented:

  • app/lib/privacy.ts: Created a centralized utility module containing regex-based masking for emails, phone numbers, and base32 strings.
  • app/lib/logger.ts: Integrated the redactPII utility into the serialization pipeline, ensuring request payloads are sanitized before logging.

Acceptance Criteria Checklist:

  • PII Masked: Emails, phone numbers, and long base32 strings are masked according to requirements.
  • Secure Patterns: Implementation uses a focused regex approach to avoid performance degradation.
  • Clean Integration: Redaction is handled during serialization, ensuring minimal impact on log flow.
  • Documentation: Added clear comments for maintainability.

Testing Notes:

  • Verified redaction logic via unit-style pattern matching.
  • Ensured no regression in standard log formatting.

#closes

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.

Add structured logging redaction for PII in app/lib/logger.ts

2 participants