Skip to content

feat!: bind embedded proxy and sidecar listener to loopback by default - #423

Merged
sakthivelmanii merged 4 commits into
mainfrom
fix/loopback-default-bind
Nov 20, 2026
Merged

sakthivelmanii merged 4 commits into
mainfrom
fix/loopback-default-bind

Conversation

@sakthivelmanii

@sakthivelmanii sakthivelmanii commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

In-process CqlSession instances and standalone sidecar deployments now bind their unauthenticated Cassandra protocol listener and health check server to the loopback interface (127.0.0.1 / InetAddress.getLoopbackAddress()) instead of all network interfaces (0.0.0.0) by default, preventing unintended network exposure of the application Spanner credentials.

  • In-process SpannerCqlSessionBuilder now binds its embedded proxy to loopback on an OS-assigned ephemeral port (port 0) by default, registers the actual bound loopback socket address with the driver contact points automatically, and rejects non-loopback or unresolved contact points with an IllegalArgumentException.
  • Standalone Launcher and YAML/system-property configurations now default host to 127.0.0.1 instead of 0.0.0.0 and log a security warning when an explicit non-loopback bind address is configured for either the proxy listener or the health check server.

Behavior Changes

  1. Sidecar / Launcher default bind address (0.0.0.0 -> 127.0.0.1): Standalone Launcher listeners and the optional health check server (-DhealthCheckPort / healthCheckEndpoint) now bind to 127.0.0.1 by default instead of 0.0.0.0. Sidecar deployments that accept connections from other hosts/containers—or Kubernetes deployments where kubelet readiness/liveness probes target the Pod IP via -DhealthCheckPort—must explicitly set -Dhost=0.0.0.0 (or host: 0.0.0.0 / healthCheckEndpoint: 0.0.0.0:<port> in config.yaml).
  2. In-process SpannerCqlSessionBuilder default port (9042 -> ephemeral port 0): When no contact point is configured, the embedded in-process adapter now binds to an OS-assigned ephemeral loopback port (0) instead of 9042 so multiple sessions in the same JVM do not collide. External tools or tests expecting a fixed local port must explicitly configure .addContactPoint(new InetSocketAddress(InetAddress.getLoopbackAddress(), 9042)).
  3. In-process contact-point restriction: SpannerCqlSessionBuilder now rejects non-loopback or unresolved contact points (via programmatic methods or DriverConfigLoader) with an IllegalArgumentException. Remote clients must connect to a standalone Launcher sidecar rather than an in-process session.

BREAKING CHANGE: Standalone Launcher listeners and health checks now bind to 127.0.0.1 instead of 0.0.0.0 by default, and in-process SpannerCqlSessionBuilder now binds to an ephemeral loopback port (0) by default and rejects non-loopback contact points.

@sakthivelmanii sakthivelmanii self-assigned this Nov 17, 2026
@sakthivelmanii sakthivelmanii changed the title fix: bind embedded proxy and sidecar listener to loopback by default fix!: bind embedded proxy and sidecar listener to loopback by default Nov 20, 2026
@sakthivelmanii
sakthivelmanii force-pushed the fix/loopback-default-bind branch from 21e7d04 to 933f367 Compare November 20, 2026 09:48
@sakthivelmanii
sakthivelmanii merged commit 320e1b2 into main Nov 20, 2026
21 checks passed
@sakthivelmanii sakthivelmanii changed the title fix!: bind embedded proxy and sidecar listener to loopback by default feat!: bind embedded proxy and sidecar listener to loopback by default Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants