link: redact credentials from debug logs, default to info
Some checks failed
CI / check (push) Failing after 2m22s

The link layer debug-logged every raw line, so a user's 'PRIVMSG NickServ
:identify <password>' and SASL payloads landed in plaintext in the log — and the
default log filter was echo=debug. Default to echo=info (production no longer
logs raw lines at all), and add link::redact so that even at debug the NickServ
identify/register/set-password arguments and SASL payloads are masked.
This commit is contained in:
Jean Chevronnet 2026-07-16 17:03:32 +00:00
parent 34bc7d69f0
commit fd455922a5
No known key found for this signature in database
2 changed files with 101 additions and 3 deletions

View file

@ -37,7 +37,11 @@ async fn main() -> Result<()> {
tracing_subscriber::fmt()
.with_env_filter(
tracing_subscriber::EnvFilter::try_from_default_env()
.unwrap_or_else(|_| "echo=debug".into()),
// info by default: the link layer debug-logs every raw line, which
// includes users' identify/register passwords and SASL payloads.
// Opt into debug explicitly (RUST_LOG=echo=debug) only when needed;
// even then, credentials are redacted (see link::redact).
.unwrap_or_else(|_| "echo=info".into()),
)
.init();