Repository navigation
trustedcoin: keep the bitcoind RPC password out of the startup log - #193
Closed
ostermayer wants to merge 2 commits into
Closed
ostermayer wants to merge 2 commits into
ostermayer wants to merge 2 commits into
Conversation
When trustedcoin finds bitcoin-rpcuser and bitcoin-rpcpassword in the Core Lightning config, it logs both at startup together with the host and port. modules/clightning.nix always writes those two options, so with the plugin enabled the public RPC password ends up in the lightningd journal, which the operator account can read because it is in systemd-journal. The patch replaces the password in that one log line with <redacted> and drops the argument. No dependency changes, so vendorHash stays.
The trustedcoin test only checked that RPC works, so the password could come back into the startup line without anything failing. It now waits for the redacted settings line and then greps the clightning journal for the public RPC password, which must not be there.
Contributor
|
Please file an issue in the upstream repository. This bug should be fixed there. |
Collaborator
Author
|
Upstream PRs: nbd-wtf/trustedcoin#43 for this redaction, nbd-wtf/trustedcoin#44 for the restart race in #192. |
Contributor
|
closed in favor of upstream PR nbd-wtf/trustedcoin#43 |
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.
Fixes #191.
Trustedcoin 0.8.7 logs the bitcoind RPC settings at startup, password included (
main.go:192, same on master).modules/clightning.nixalways writesbitcoin-rpcuserandbitcoin-rpcpasswordinto the Core Lightning config, so with the plugin enabled thepublicRPC password lands in the lightningd journal. The operator account is insystemd-journal, so it can read that line, and so can anything that ships the journal elsewhere.This adds a one-line patch to
pkgs/trustedcointhat printspassword: <redacted>and drops the argument.go.modis untouched, sovendorHashstays. I'll send the same change upstream so the patch can go away later.Checks on the KVM host:
nix build .#trustedcoinbuilds.stringson the binary finds the redacted format string once and the oldpassword: %sstring not at all../test/run-tests.sh -s "{ imports = [ scenarios.trustedcoin ]; tests = mkForce { trustedcoin = true; }; }") it passes on this branch. The same test against the unpatched package fails, because the redacted line never appears while the clear text one does, so it does catch the leak.trustedcoinscenario is flaky on master and on this branch for a reason that has nothing to do with the patch: when clightning restarts during the run, trustedcoin answerstip: 0before its bitcoind check finishes, lightningd aborts withbitcoind has gone backwards from 70 to 0 blocks!, and the unit sits in its 10 minute start-post timeout before systemd retries. Master happened to recover on the retry, my two runs on this branch did not. That is trustedcoin: lightningd aborts with "bitcoind has gone backwards" when clightning starts right after bitcoind, and the unit then waits 10 minutes before systemd retries #192.Found by the review gate on the tree of #190 (Codex GPT-6 Astra, xhigh). Fable 5.1 made the patch. Codex GPT-5.6 Sol (xhigh) reviewed it, found no defect in the patch and asked for the test, which the second commit adds.
Review gate on a57d1a2 (GLM 5.3 max with the Codex GPT-6 Astra xhigh second opinion, report 2026-10-31-085605): 3 findings, none in
pkgs/trustedcoinortest/suite/regtest.py, all known. The DeepSeek V4.1 Flash 1017 (max) plus GLM 5.3 (max) run on the first commit 987f963 (report 2026-10-31-085155, Astra second opinion): 6 findings, none inpkgs/trustedcoin, all known issues or informational.