Repository navigation
fix(cluster): bind embedded NATS client to loopback and require route auth/TLS - #91
Merged
olucasandrade merged 4 commits intoSep 25, 2026
Conversation
… auth/TLS
Prevent unauthenticated exposure of the CDC JetStream stream by always
binding the embedded NATS client listener to 127.0.0.1 and requiring
${VAR} route credentials plus TLS cert/key whenever --cluster-peers is set.
Introduced-by: 4598d0e
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Deploying kaptanto with
|
| Latest commit: |
8d26fa2
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://b2b8b14a.kaptanto.pages.dev |
| Branch Preview URL: | https://fix-cluster-nats-auth-tls-bi.kaptanto.pages.dev |
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.
Plan
.claude/fix-plans/cluster-nats-auth-tls-bind-20260924-212132.mdProblem
--clusterstarted the embedded NATS server with noHost(default0.0.0.0), no route authorization, and no route TLS. JetStream holds the full CDC stream, so any reachable host could subscribe or join the route mesh, bypassing the SSE/gRPC bearer-token/TLS data plane.Introduced by
4598d0e
Implementation
127.0.0.1(in-process viaClientURL; external NATS clients out of scope).--cluster-peersis set, require--nats-cluster-user/--nats-cluster-passwordas STRICT${VAR}refs and--nats-cluster-tls-cert/--nats-cluster-tls-key; fail startup otherwise (no silent open mesh).config.Mergeandroot.go; document in README cluster section.Validation
CGO_ENABLED=0 go test ./internal/eventlog/ ./internal/cmd/ ./internal/config/ -count=1— passResidual risk
Breaking change for existing
--clusterusers with peers: deployments must supply shared${VAR}route credentials and TLS cert/key (peer hostnames must match cert SAN/CN) before rolling out. Incorrect TLS setup can partition the mesh. The cluster route port remains peer-reachable (not loopback) and should stay firewalled.