Secure the network

Secure the network

Decide which of a node's ports clients may reach, keep the rest private, and turn on TLS.

A Nova node listens on several ports, and only one of them is meant for clients. The others carry the cluster's own calls, the metadata store's replication, and metrics, which have no authentication. This page says which port to open to whom, how the fleet listener keeps the cluster's calls apart from client traffic, and how to encrypt the traffic with TLS.

Closing the private ports changes nothing for clients, as long as the client port stays open to them. Turning on TLS does: every node and every client switches at once, so plan it as a short outage. A client that reaches a TLS port without TLS fails to connect. Under --auth jwt or basic, a client that reaches the fleet port is refused.

Ports

PortSet byWho connectsOpen it to
7780--listen (default :7780)SDKs, the nova CLI, the GatewayYour clients
Any, off by default--http-listenHTTP callers of the data bridgeYour clients, if you turn it on
7790 in these guides, off by default--fleet-listenOther nodes, their auditors, a Gateway given --fleet-addrThe other nodes and the Gateway only
6660 to 6664--oxia-server-port and the four after itThe other nodes' metadata storeThe other nodes only
9090 in these guides, off by default--metrics-listenPrometheus, health probes, operatorsYour monitoring network only
8080novagateway --listenBrowsers and clients outside your networkThe internet, if you run a Gateway

--auth and --tls-cert protect 7780, the data bridge and 7790 alike. The other two node ports protect nothing:

  • The metadata store's ports have no TLS and no authentication. A peer uses all five, and a member only the last two:

    PortOpen onCarries
    6660metadata peersraft between the peers; the address in --oxia-server-peers
    6661metadata peersthe coordinator's admin service. Every node dials it to register its data server, and a node relays nova oxia to it.
    6662metadata peersthe coordinator's internal service
    6663every nodethe data server's public service, which every node's metadata client uses
    6664every nodethe data server's internal service: replication between data servers

    They bind on the node's own host, so --advertise (or a specific --listen host) must name an address the other nodes can reach.

  • The metrics listener is plain HTTP and asks for no credential. Besides /metrics, /healthz and /readyz, it serves Go's /debug/pprof/ profiles and, with --admin-ui (on by default), the admin dashboard at /admin/. With --admin-ui-reader (also on by default), that dashboard can show record bodies.

Keep the metadata and metrics ports private

Anyone who reaches a node's ports 6660 to 6664 can read and change the metadata store. Anyone who reaches its metrics port can read the admin dashboard, record bodies included. Put both behind a firewall or on a private network.

The fleet listener

With --fleet-listen, a node serves the cluster's own calls on a second port: calls from other nodes, from auditors, and from a Gateway that relays with --fleet-addr. It serves the same services as 7780, but it admits only callers that show a fleet credential. Under --auth jwt that is a token carrying nova:node, nova:admin or nova:gateway. Under --auth basic it is the operator login. Under mtls and off the transport vouches for every caller, so only the network keeps the port private.

A client that dials it with an ordinary token is refused:

novactl: client: unauthenticated: auth: the fleet listener admits only the constellation's own processes; dial the client listener

Splitting the traffic lets a node cap client connections without starving its peers. Once a node has a fleet listener, the client listeners take these caps, and the startup table shows them as connection-caps client 4096, 512 an address; fleet 2048, 256 unproven, 8 an address:

--max-client-connectionsDefault4096
Connections the client listeners hold at once; a new one past it is closed at accept. 0 turns the cap off.
--max-client-connections-per-addressDefault512
Connections one source address holds on the client listeners.
--max-fleet-connectionsDefault2048
Connections the fleet listener holds at once, as a backstop.
--max-fleet-unproven-connectionsDefault256
Fleet connections that have not shown a credential yet; past it, a new one closes the oldest unproven connection of the busiest source.
--max-fleet-unproven-per-addressDefault8
Unproven fleet connections one source address may hold.

Other nodes dial a node's fleet listener at its advertised host and the fleet port. Set --fleet-advertise when that host does not reach the fleet listener, for example when it is bound to a private address. Clients are never redirected to a fleet address.

A node in a cluster without --fleet-listen serves everyone on 7780 with no caps, and says so once at boot:

[WARN] novad: no fleet listener: the cluster's own calls share the client listener, which therefore takes no connection caps listen=:7780

Turn on TLS

One certificate covers the node's client and cluster listeners: 7780, the data bridge and 7790. The metrics listener stays plain HTTP. Nodes dial each other, so each node also needs the CA that signed the others' certificates.

A node started with --tls-cert or --tls-ca dials the other nodes over TLS, and a node started without them dials in plaintext. A cluster with some nodes on TLS and some not cannot talk to itself, so do not roll TLS one node at a time. Stop every node, then start them all with TLS, and give clients the CA at the same time.

Issue a certificate

Issue one certificate, or one per node, whose names cover every address clients and nodes dial: each node's advertised name (nova-1, nova-2, nova-3), and its --fleet-advertise host if that differs. The Gateway has a certificate of its own. Give it both the serverAuth and the clientAuth usage if you plan to use --auth mtls.

Start the nodes with it

Stop every node. Add the pair and the CA to each node's flags, then start them all:

novad … --tls-cert /etc/nova/tls/server.pem --tls-key /etc/nova/tls/server.key \
        --tls-ca /etc/nova/tls/ca.pem

The startup table shows tls on. Without --tls-ca, a node trusts the system's roots, which is right when a public CA signed the certificates.

Connect with TLS

Clients name the CA with --tls-ca (or NOVA_TLS_CA):

nova --addr nova-1:7780 --tls-ca /etc/nova/tls/ca.pem health
SERVING  node=01a2047e-3bea-78eb-8836-38ec749af4dd zone=az-1 version=… leading=0

A client that connects without TLS fails before any call:

novactl: rpc error: code = Unavailable desc = connection error: desc = "error reading server preface: EOF"

To make the certificate the client's credential as well, use --auth mtls with --tls-client-ca; see Turn on authentication. The Gateway takes its own pair, and names the nodes' CA with --cluster-tls-ca; see Run the Gateway.

JWT and basic credentials also work over plaintext, so a proxy can terminate TLS in front of a node. A node that does this on an address other than loopback logs novad: credentials over plaintext once at boot.

On Kubernetes

The controller renders both listeners on every node: 7780 for clients and 7790 for the fleet. It sizes both caps from the node's memory limit. The caps may use 5% of the memory ceiling, which is three quarters of the limit, at 96 KiB a connection, split two to one between client and fleet. The client cap stays between 1,024 and 4,096 and the fleet cap between 512 and 2,048, so a node with an 8 GiB limit gets 2,184 and 1,092. serving.connections overrides either one:

serving:
  connections: { client: 4096, fleet: 2048 }   # 0 turns a cap off

Two NetworkPolicies keep the fleet port and the metadata ports to the constellation's own pods and the controller: <name>-stars for the nodes and <name>-oxia for an external metadata store. The client port and the metrics port stay open to any source. The policies take effect only where the cluster's network plugin enforces NetworkPolicy. On EKS that is the VPC CNI's network policy agent, which the Pulumi reference deployment turns on with vpcCniNetworkPolicy. spec.networkPolicies: Disabled removes both. A kubectl port-forward reaches every port whatever the policies say.

Under auth: jwt, the controller also mints each Gateway's fleet credential and keeps it in the Secret <gateway>-fleet-credential; see Gateway and ingress.

If it goes wrong

SymptomLikely causeWhat to do
error reading server preface: EOFThe client dials a TLS port without TLSPass --tls-ca, or NOVA_TLS_CA
the fleet listener admits only the constellation's own processesA client dialed 7790Dial 7780
novad: no fleet listener at bootA clustered node has no --fleet-listenAdd --fleet-listen :7790 to every node
A node boots but never joins, logging initialising metadataThe metadata ports are blocked between nodesOpen 6660 to 6664 between nodes
Clients see connections closed at once under loadThe client connection cap is reachedRaise --max-client-connections, or add nodes

See also

On this page