Repository navigation
fix(roxwarp): make the cluster transport fail-closed (R-54, S-36) - #34
Merged
Merged
Conversation
With --cluster, the cluster port (default 7443) served plain WebSocket with no peer auth when no certificates were given, and also when the mTLS config failed to build (only an error line). Outbound peers fell back to ws:// the same way, and /roxwarp on the REST port was always mounted without auth, so even with mTLS a peer could bypass it there. New roxwarp::transport decides per side (listener, outbound): - cert, key and CA set and the rustls config builds: mTLS; - no mTLS path and --cluster-insecure: plain WS (warn: no peer auth); - no mTLS path and no flag: off (warn naming the flags to pass); - broken or incomplete mTLS config: off (error), never plain WS. main.rs builds the listener from it; ClusterManager::run builds the outbound side from it and, when off, starts no peer connections and no mDNS and registers no peers (the local feed still runs). /roxwarp on the REST port is mounted only in plain mode (plain_ws_allowed, same rule). ClusterConfig.allow_plain is serde(skip): only the CLI flag sets it, the cluster JSON file cannot. Routes/auth: /roxwarp on the REST port stays outside the auth layer but exists only with --cluster-insecure. /api/cluster/status (public) and /api/cluster/query (bearer) are unchanged. Wire protocol: unchanged. Affected clients: roxWarp peers. A peer that used plain WS without --cluster-insecure can no longer connect. Behavior change: the packaged unit runs --cluster with no certificates and an empty peer list, so after deploy port 7443 is no longer listening (log: "no mTLS configured, cluster listener disabled"). Also: the plain-mode serve error is now logged; the startup field "mtls" is renamed "mtls_paths" (it reports configured paths, not a working TLS). Tests: transport decision (no certs, flag, broken and missing files, partial config, plain_ws_allowed matches the plain arm); /roxwarp on the REST port mounted only in plain mode (failed on the old code); run() registers no peers when off; config file cannot set allow_plain; CLI flag parse. gates: 2908 passed / 0 failed; simulator-hal check OK. Local E2E with the real binary in the three modes: port, /roxwarp and log lines as above. Not covered: the mTLS success path with real certificates (needs rcgen or test certificates). Docs: OVERVIEW, HARDCODED_LIMITS, DEPLOYMENT_CHECKLIST (verify step), research/16 status, HowToUses/06, README. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QKRNiek8qYRoRt7dcrDDVC
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.
Summary
ws://;/roxwarpon the REST port was always mounted without auth (mTLS bypass).roxwarp::transportdecides per side: mTLS when cert/key/CA build; plain WS only with the new--cluster-insecureflag and no mTLS paths; otherwise off with a WARN/ERROR line. A broken or incomplete mTLS setup never falls back to plain WS./roxwarpon the REST port is mounted only in plain mode. When off, no peer connections, no mDNS, no peers registered; the local feed and/api/cluster/statuskeep running.ClusterConfig.allow_plainisserde(skip): CLI only.Routes / auth / wire
/api/cluster/status(public) and/api/cluster/query(bearer) unchanged. Wire format unchanged; peers relying on plain WS without the flag can no longer connect.Behavior change
The packaged unit runs
--clusterwith no certificates and no peers, so after deploy 7443 is no longer listening.Test plan
/roxwarpon REST port mounted only in plain mode (fails on old code);run()registers no peers when off; config file cannot setallow_plainbash tools/gates.sh: 2908 passed / 0 failed;simulator-halcheck OK--cluster,--cluster-insecure, broken certs)security-reviewer(no significant findings),silent-failure-hunter(log/diagnostic findings fixed)rcgenor test certs; open)🤖 Generated with Claude Code
https://claude.ai/code/session_01QKRNiek8qYRoRt7dcrDDVC