webserver in the default namespace. From inside that pod he calls Elasticsearch at the cluster address and receives a full, unauthenticated response containing the cluster details.


output configuration and finds the transport is plain HTTP, certificate verification is disabled, and no username is specified. In this example the password is kept in files for simplicity, but the transport and authentication are still insecure:
scheme is http, no credentials are required and ssl_verify is false, every log line crosses the network as readable text. Anyone on the path can see entries such as “USER5 failed to log in, account locked.” Logs are often a rich source of usernames and occasionally secrets — data that must be protected both at rest and in transit.
Never embed secrets directly in manifests or images. Use Kubernetes Secrets or a dedicated secret store, and grant access only to the service accounts that need them.

- Anyone can query Elasticsearch or Kibana and retrieve sensitive log data.
- Anyone with network visibility can read log traffic between Fluentd and Elasticsearch.

- Authentication and authorization at the application layer: enable Elasticsearch security (X-Pack Security) and require credentials for every request.
- Secret management: store passwords and certificates in Kubernetes Secrets (or a secret manager), not in plain manifests.
- Network segmentation: restrict which pods can talk to the Elastic Stack using Kubernetes NetworkPolicy.
- Encryption in transit: use TLS (and mTLS where appropriate) so log messages are encrypted between Fluentd and Elasticsearch.
- Least privilege for secrets: use RBAC to ensure only the relevant service accounts can read the Secrets.

webserver pod in default even be allowed to reach Elasticsearch? It has no business in the elastic-stack namespace. Kubernetes NetworkPolicy gives you a “guest list” for traffic: select which pods are protected, then explicitly enumerate which sources and destinations are allowed. For the Elastic Stack, define a NetworkPolicy that selects all pods in the elastic-stack namespace and permits ingress/egress only from that namespace (and any explicit, required sources).
NetworkPolicy rules are only effective if your cluster’s CNI/network plugin enforces them. Confirm your CNI supports NetworkPolicy (for example, Calico, Cilium, or Canal) before relying on policy to isolate traffic.


- Password (X-Pack Security + Secrets)
- NetworkPolicy (guest list)
- TLS/mTLS (encrypted envelope)
- RBAC (limit who can read Secrets)

Links and references
- Elasticsearch security (X-Pack Security): https://www.elastic.co/guide/en/elasticsearch/reference/current/security-settings.html
- Kibana authentication: https://www.elastic.co/guide/en/kibana/current/security.html
- Kubernetes Secrets: https://kubernetes.io/docs/concepts/configuration/secret/
- Kubernetes NetworkPolicy: https://kubernetes.io/docs/concepts/services-networking/network-policies/
- Kubernetes RBAC: https://kubernetes.io/docs/reference/access-authn-authz/rbac/
- TLS and mutual TLS overview: https://en.wikipedia.org/wiki/Transport_Layer_Security and consider cert-manager (https://cert-manager.io/)
- enabling Elasticsearch users,
- a Kubernetes Secret and the minimal RBAC Role/RoleBinding for Fluentd,
- a NetworkPolicy selector for the
elastic-stacknamespace, - Fluentd output configuration using
httpswith TLS client certs.