Firewall & Network Hardening

Which Logship ports to expose, which to keep private, and firewall rules for public-facing servers.

Firewall & Network Hardening

Logship binds several sockets. Only the HTTP API and (optionally) the frontend host should ever be reachable from the public internet. The cluster RPC and metrics ports carry unauthenticated, unencrypted node-to-node traffic and must stay on a trusted network.

Start from a default-deny inbound policy and open only the ports below.

Ports

PortProtoComponentDefault bindPublic exposure
5000TCP + UDPBackend HTTP API & Web UIall interfacesYes — behind a TLS reverse proxy
8000TCPFrontend SPA host (fe-react)all interfacesOnly if serving the SPA directly
6000TCPDatabase cluster RPC (worker)all interfacesNo — private network / peers only
6002TCPBackend cluster RPC (worker)all interfacesNo — private network / peers only
6000/6002TCPCluster RPC (master)loopbackNo — loopback only, never off-host
49999UDPInternal metricsoutbound (egress)No — not an inbound listener

The API port serves HTTP/1.1, HTTP/2, and HTTP/3. HTTP/3 runs over QUIC, so 5000 must be opened for both TCP and UDP if you expose it directly or advertise HTTP/3 through the proxy.

Changing the ports

Every port above is configurable. Override the key in the referenced config section rather than assuming the default.

PortConfig keyReference
5000backend.listenPortDatabase → backend
8000Kestrel.Endpoints.Http.UrlFrontend → Http
6000database.endpoints.worker / database.endpoints.masterDatabase → endpoints
6002backend.endpoints.worker / backend.endpoints.masterDatabase → endpoints
49999agent.udpMetricsEndpointDatabase → agent

The cluster RPC endpoints (6000, 6002) take the bind address as well as the port: change the 0.0.0.0 in the worker endpoint to a private interface to stop binding on all interfaces.

Allow

  • TLS ingress (443/tcp, and 443/udp for HTTP/3). Terminate TLS at a reverse proxy and forward to the backend on 5000. Do not expose 5000 in plaintext to the internet.
  • 8000/tcp — only when the frontend host is served directly. Prefer fronting it with the same TLS proxy on 443.

Disallow

🚫 Never expose cluster RPC port

The worker endpoints (6000, 6002) bind to 0.0.0.0 by default and the transport is plaintext with no authentication. Anyone who can reach them can read and write cluster data. Restrict them to peer node addresses on a private subnet, or bind them to a private interface in configuration.

  • 6000/tcp, 6002/tcp — block from the public internet. Allow only from known cluster peer IPs. Single-node deployments should block them entirely.
  • 49999/udp — the metrics socket is outbound only; nothing needs to reach it from outside the host. Block inbound.
  • Everything else — drop by default.

Reverse proxy pattern

For a public server, expose only the proxy and keep the backend on loopback or a private interface:

internet ──443/tcp+udp──▶ reverse proxy (TLS) ──▶ 127.0.0.1:5000 backend

Gate load-balancer health checks on GET /health/ready, which is anonymous — see Install → Health checks.

Example rules

Open the TLS port, keep cluster and metrics ports closed, and default-deny the rest.

ufw default deny incoming
ufw default allow outgoing
ufw allow 443/tcp
ufw allow 443/udp
ufw enable
💡 Restrict cluster ports to peer

When running a multi-node cluster, add explicit allow rules for peer addresses rather than opening the ports globally, e.g. ufw allow from 10.0.0.0/24 to any port 6000 proto tcp.