Skip to content

Conversation

@rishikeshdadam136
Copy link
Contributor

@rishikeshdadam136 rishikeshdadam136 commented Feb 2, 2026

Summary
This PR introduces @bitgo/logger, a new centralized logging utility with environment-aware sensitive data sanitization to prevent accidental exposure of credentials and private keys in logs.

Motivation
Currently, console statements across the codebase can inadvertently log sensitive information like private keys, passwords, and tokens. This creates security risks, especially in test and staging environments where logs may be more widely accessible.

Changes
New Package: @bitgo/logger

  • Created a new logger module with automatic sanitization capabilities
  • Sanitization is environment-aware: only active in test and staging, disabled in production to avoid performance overhead
  • Recursive sanitization with circular reference protection

Sanitizes the following sensitive keys:

  1. token, bearer
  2. prv, xprv, privateKey
  3. password, otp
  4. passphrase, walletPassphrase
  5. Integration
    Ticket: WP-7503

@rishikeshdadam136 rishikeshdadam136 force-pushed the WP-7503 branch 2 times, most recently from 1d621dc to 5ea4778 Compare February 5, 2026 12:37
Created @bitgo/logger package that automatically sanitizes sensitive data
(tokens, private keys, passwords) in test/staging environments.

Changes:
- Added logger to 5 modules: express, sdk-coin-apt, sdk-coin-sol, sdk-coin-vet, blockapis
- Replaced 17 console.error/log statements with logger calls
- Sanitizes keys: token, bearer, prv, xprv, privateKey, password, otp
- Works recursively on nested objects/arrays

TICKET: WP-7503
@rishikeshdadam136
Copy link
Contributor Author

Docker Build issue resolved.

Copy link
Contributor

@kaustubhbitgo kaustubhbitgo left a comment

Choose a reason for hiding this comment

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

Nice work

@rishikeshdadam136 rishikeshdadam136 merged commit 875e727 into master Feb 10, 2026
20 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.

4 participants