cuprated: hide sensitive data in logs#644
Open
redsh4de wants to merge 2 commits into
Open
Conversation
fb44893 to
e1460be
Compare
39e78d6 to
a89e574
Compare
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.
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 Displayfor a redacted view andto_addr_string()for the unredacted string.Clearnet uses
safelog::Redactable(partial IP), Tor usessafelog::sensitive(full scrub).Drop the
Displaybound from the trait so an address can't be logged in the clear by accident - log sites now go through.as_log(), tx hashes throughsafelog::sensitive.Hand-written
Debugimpls forTorDaemonConfig,SocksClientConfigandInternalPeerIDkeep config dumps and debug logs from leaking onion inbound addresses and proxy credentials.Toggle via
tracing.redact(defaulttrue) or--no-log-redact.When off,
init_loggingcallssafelog::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.