Skip to content

cuprated: hide sensitive data in logs#644

Open
redsh4de wants to merge 2 commits into
Cuprate:mainfrom
redsh4de:feat/redact-logs
Open

cuprated: hide sensitive data in logs#644
redsh4de wants to merge 2 commits into
Cuprate:mainfrom
redsh4de:feat/redact-logs

Conversation

@redsh4de

@redsh4de redsh4de commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

What

Redacts sensitive data (transaction hashes, peer + onion addresses, Tor/SOCKS proxy auth) from logs, on by default.

Closes #540

Why

Prevent log files from being a target

Where

cuprated, p2p

How

Add NetZoneAddress::as_log() -> impl Display for a redacted view and to_addr_string() for the unredacted string.

Clearnet uses safelog::Redactable (partial IP), Tor uses safelog::sensitive (full scrub).

Drop the Display bound from the trait so an address can't be logged in the clear by accident - log sites now go through .as_log(), tx hashes through safelog::sensitive.

Hand-written Debug impls for TorDaemonConfig, SocksClientConfig and InternalPeerID keep config dumps and debug logs from leaking onion inbound addresses and proxy credentials.

Toggle via tracing.redact (default true) or --no-log-redact.
When off, init_logging calls safelog::disable_safe_logging().

As a guardrail, cuprated refuses to start if redaction is disabled while RPC binds a non-local address, unless i_know_what_im_doing_allow_unredacted_public_logs = true.

@github-actions github-actions Bot added A-p2p Area: Related to P2P. A-test-utils Area: Related to test-utils. A-dependency Area: Related to dependencies, or changes to a Cargo.{toml,lock} file. A-workspace Area: Changes to a root workspace file or general repo file. A-rpc Area: Related to RPC. A-binaries Area: Related to binaries. labels Jun 14, 2026
@redsh4de redsh4de marked this pull request as ready for review June 14, 2026 10:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-binaries Area: Related to binaries. A-dependency Area: Related to dependencies, or changes to a Cargo.{toml,lock} file. A-p2p Area: Related to P2P. A-rpc Area: Related to RPC. A-test-utils Area: Related to test-utils. A-workspace Area: Changes to a root workspace file or general repo file.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hide certain data in logs

1 participant