This pass focuses on a quiet but important hardening point in Mediabot v3:
Secrets may be needed at runtime, but they do not belong in logs.
After the recent DCC and Partyline work, two sensitive values were still at risk of appearing in logs or console output:
DCC passive CHAT tokens
IRC channel keys used by JOIN
Both are now protected.
Passive DCC CHAT needs a token so the client can connect back correctly.
That token must still be sent through the DCC protocol, but it should not be written into:
mediabot.log
Partyline .console output
debug traces
old archived logs
The fix keeps the real token for protocol use, but only logs a short redacted hint.
Instead of logging the raw token, Mediabot now uses a helper like:
_dcc_token_hint($token)
So logs can still be useful for debugging without exposing the full secret.
This was an important distinction.
Bad fix:
redact the token everywhere
break DCC
Correct fix:
send real token to the DCC protocol
log only a redacted hint
The CTCP/DCC path still receives the real token.
Only logs and Partyline console output are sanitized.
The second issue was channel keys.
A channel key is effectively a password for joining a protected IRC channel.
Previously, logs or Partyline output could show things like:
Trying to join #secret with key myrealkey
Partyline: nick requested JOIN #secret (key: myrealkey)
Joining #secret with key myrealkey...
That is not something we want sitting forever in logs.
Now the bot still uses the real key for IRC JOIN, but logs and Partyline output show:
[key redacted]
or:
with key [redacted]
The operator gets useful feedback without exposing the secret.
Two regression tests protect this behavior:
345_dcc_passive_token_redacted.t
346_join_channel_key_redacted.t
They verify that:
DCC passive logs use a token hint
raw DCC tokens are not passed to log formatters
Partyline passive DCC logs do not interpolate token=$token
channel JOIN still receives the real key
channel JOIN logs redact the key
Partyline .join redacts the key
That last point matters: the tests make sure we did not break the actual protocol behavior while cleaning the logs.
These are not flashy features.
But they are exactly the kind of small hardening fixes that make a long-running bot safer over time.
Logs get copied.
Logs get archived.
Logs get sent around while debugging.
Logs outlive the moment that created them.
So they should not contain reusable secrets.
This patch improves secret hygiene without touching the database schema:
DCC passive tokens are redacted in logs
channel JOIN keys are redacted in logs and Partyline output
real runtime values are still used where the protocol requires them
tests protect both behaviors
no schema change
Secretum Custodia!
The secrets still work.
They just no longer shout their names in the logbook.
Mischief managed β quietly, properly, and without breaking DCC. ππͺ
You must be logged in to reply.