Protecting data in transit: TLS/SSL for the HTTP and transport layers, certificate creation and renewal, configuring bind and publish addresses, firewalls, and network isolation in VPCs and security groups.

Episode 15 secured who is allowed in. Episode 16 secures the data itself as it travels across the network. Without encryption, everything sent — including passwords and API keys — can be intercepted mid-flight by anyone on the same network path.
Elasticsearch has two communication paths that must be secured: the HTTP layer (client interaction like curl, Kibana, applications) and the transport layer (inter-node communication inside the cluster). Episode 16 covers both, certificate creation and renewal, bind/publish address configuration, and network isolation at the firewall and cloud level.
TLS (Transport Layer Security) protects data in transit through encryption. It works with digital certificates: the server proves its identity (server authentication), and the client can verify that the connection really goes to the correct server. In Elasticsearch, there are three kinds of certificates:
The HTTP layer is the client gateway — Kibana, applications, curl. Everything must go through HTTPS. Configuration in elasticsearch.yml:
xpack.security.http.ssl.enabled: true
xpack.security.http.ssl.keystore.path: elastic-certificates.p12
xpack.security.http.ssl.keystore.password: change-meOnce enabled, all HTTP access requires https://:
curl -k -u elastic:password https://localhost:9200/_cluster/health-k disables certificate verification — only for quick tests. In real applications, you must use a CA trusted by the client so verification stays active.
The transport layer is the inter-node path. Without encryption here, an intruder node could join and steal data from the inside. Configuration in elasticsearch.yml:
xpack.security.transport.ssl.enabled: true
xpack.security.transport.ssl.verification_mode: certificate
xpack.security.transport.ssl.keystore.path: elastic-certificates.p12
xpack.security.transport.ssl.truststore.path: elastic-certificates.p12verification_mode: certificate verifies that the peer node holds a certificate signed by a trusted CA — without requiring hostname matching. This is mandatory to prevent man-in-the-middle attacks between nodes.
Important
Never enable HTTP TLS alone and leave transport without TLS. An open transport is a back door: unknown nodes can impersonate and read cluster traffic. Both must be enabled together.
The easiest way to manage certificates is with elasticsearch-certutil, the built-in tool:
bin/elasticsearch-certutil ca
bin/elasticsearch-certutil cert --ca elastic-stack-ca.p12 --pemThe first command creates a CA (elastic-stack-ca.p12); the second creates per-node certificates signed by that CA. Certificates are installed into the node keystore (a .p12 file), and the CA is distributed to all nodes as the truststore.
Certificates have a validity period (5 years by default). Renewal must be planned, not done after expiration — a cluster with expired certificates fails inter-node communication and disconnects all clients. The pattern:
elasticsearch-certutil.Schedule a reminder well before the validity period ends, and keep a renewal runbook — panicked renewal is a classic source of downtime.
These two settings often confuse people but determine who can reach a node:
network.host — the address the node binds to accept connections. 0.0.0.0 means all interfaces; 127.0.0.1 means only localhost.network.publish_host — the address published to other nodes so they can find it. Important in the cloud: bind to an internal IP, publish the IP other nodes can reach.network.host: 0.0.0.0
network.publish_host: 10.0.1.5
discovery.seed_hosts: ["10.0.1.5:9300", "10.0.1.6:9300"]If publish_host is wrong, other nodes can't find this node even though the bind is correct — a classic mistake when deploying to the cloud.
Encryption stops eavesdropping; network isolation stops access. The ideal firewall rules for Elasticsearch:
| Port | Protocol | Accessible by |
|---|---|---|
| 9200 | HTTP/HTTPS | Application clients, Kibana, admins (via VPN) |
| 9300 | Transport (TLS) | Only other Elasticsearch nodes |
| 5601 | HTTPS | Users allowed to access Kibana |
Example with UFW on Ubuntu:
sudo ufw default deny incoming
sudo ufw allow from 10.0.1.0/24 to any port 9300
sudo ufw allow from 10.0.1.0/24 to any port 9200
sudo ufw allow from 10.0.2.10 to any port 5601The main principle: deny by default. In the cloud, configure security groups with the same principle — port 9200 only opened to the application and admin subnets, port 9300 only between nodes, and everything inside a VPC not exposed to the internet.
Tip
Apply defense in depth: encryption + authentication + firewall + network isolation all at once. Encryption doesn't protect a publicly open port 9200 without authentication; a firewall doesn't protect against traffic already inside the network. Combine both, and don't forget to use a reverse proxy with HTTPS for Kibana in production.
Self-signed certificates without a truststore. Clients fail verification — install the CA into the client truststore.
Certificates expiring without planning. The cluster suddenly loses communication — schedule renewals and renewal drills.
Transport TLS disabled. Opens the cluster's back door — always enable both.
Wrong publish_host in the cloud. Nodes can't be found — check the IP peers can actually reach.
Port 9200 open to the internet. An invitation to attack — deny by default and only open what's needed.
In episode 16 you mastered network security and encryption: TLS for the HTTP and transport layers, creating CAs and certificates with elasticsearch-certutil, certificate renewal strategies with rolling restarts, bind vs publish host, and firewalls and network isolation at the port and VPC level.
Key takeaways:
elasticsearch-certutil and renewed before expiry.network.host for binding; network.publish_host for being found by other nodes.Now access is secure. But security also means being able to prove who accessed what. In episode 17 we'll cover audit logging and compliance: enabling audit logs, event types, file and index output formats, event filtering, and considerations for GDPR, data retention policies, and personal data handling. See you there!