Verify the cluster identity
A quick check against the Elasticsearch HTTP endpoint returns its identity:Enable security and node-to-node TLS
Bob edits the Elasticsearch StatefulSet to enable X-Pack security and transport TLS. In production you would normally provide these viaelasticsearch.yml or mapped environment variables, and you must supply certificates/keys for transport TLS.
Update the Elasticsearch container environment with these values:
Create a user and verify authentication
There isn’t a user yet, so Bob creates one using the bundledelasticsearch-users tool inside the Elasticsearch pod:
Update Kibana to authenticate to Elasticsearch
Kibana becomes unable to connect because it is another client and needs credentials configured.

elastic_user. From the terminal he can also verify Kibana’s status API with the same credentials:
The example shows the password directly in YAML so you can follow the flow. In production, store credentials in a Kubernetes Secret and reference them from manifests instead of embedding plaintext values.
Authentication is not network isolation
Elasticsearch is locked — but is it safe? Bob tests access from the wrong place. From a web server pod in thedefault namespace he calls the in-cluster Elasticsearch service with the username and password, and Elasticsearch answers:
efk-stack-policy in the elastic-stack namespace. It restricts both ingress and egress to peers within the same labeled namespace:
default namespace to elastic-stack.

Update Fluentd to authenticate and enable TLS verification
Now there’s a casualty: Fluentd, sitting between the app and Elasticsearch, is suddenly stuck. Its logs show the output failures:<match> section) to enable SSL verification and provide the Elasticsearch user and password.
Example Fluentd output configuration:
USER1 in Kibana and the log line appears — with a timestamp and the message. This confirms logs are preserved and readable; Fluentd also creates a new index each day and none have been deleted.

Quick reference: primary steps and checks
Links and references
- Elasticsearch Security | Elastic
- Kibana configuration | Elastic
- Kubernetes NetworkPolicy
- Fluentd Elasticsearch plugin