# How to secure elasticsearch on kubernetes

**URL:** <https://discuss.elastic.co/t/how-to-secure-elasticsearch-on-kubernetes/306570>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-security\
**Created:** [June 7, 2022, 1:13pm UTC](https://discuss.elastic.co/t/how-to-secure-elasticsearch-on-kubernetes/306570 "2022-06-07T13:13:05Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jessewhite](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jessewhite/32/106727_2.png) [@jessewhite](https://discuss.elastic.co/u/jessewhite)\
**Post date:** [June 7, 2022, 1:13pm UTC](https://discuss.elastic.co/t/how-to-secure-elasticsearch-on-kubernetes/306570/1 "2022-06-07T13:13:05Z")

</div>

Hello, i have ELK deployed on a k8s cluster with helm charts. i wanted to add security to Elasticsearch so i can add users and control the access. but since i'm new to ELK i didn't know how or i found a good solution for it.

i added these lines in Elasticsearch values.yml file :

```auto
esConfig: 
  elasticsearch.yml: |
    xpack.security.enabled: true
    xpack.security.transport.ssl.enabled: true
    xpack.security.transport.ssl.verification_mode: full
    xpack.security.transport.ssl.keystore.path: /usr/share/elasticsearch/config/certs-gen/keystore.p12
    xpack.security.transport.ssl.truststore.path: /usr/share/elasticsearch/config/certs-gen/keystore.p12

```

i know adding these lines alone isn't enough, but what am i supposed to add after this.

any help on this ? thanks for reading

---

<div class="post-metadata">

**Author:** ![legoguy1000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/legoguy1000/32/54301_2.png) [@legoguy1000](https://discuss.elastic.co/u/legoguy1000)\
**Post date:** [June 9, 2022, 2:46am UTC](https://discuss.elastic.co/t/how-to-secure-elasticsearch-on-kubernetes/306570/2 "2022-06-09T02:46:17Z")

</div>

Have u looked at [Elastic Cloud on Kubernetes [2.2] | Elastic](https://www.elastic.co/guide/en/cloud-on-k8s/current/index.html) at all? It handles security fo u.

---

<div class="post-metadata">

**Author:** ![legoguy1000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/legoguy1000/32/54301_2.png) [@legoguy1000](https://discuss.elastic.co/u/legoguy1000)\
**Post date:** [June 15, 2022, 2:23am UTC](https://discuss.elastic.co/t/how-to-secure-elasticsearch-on-kubernetes/306570/5 "2022-06-15T02:23:19Z")

</div>

With ECK, u really don't need any additional settings as ECK will setup all the certificates and stuff for u. I'd just do exactly what the docs walk u through and then u can start to make config changes once ur up and running.

---

<div class="post-metadata">

**Author:** ![jessewhite](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jessewhite/32/106727_2.png) [@jessewhite](https://discuss.elastic.co/u/jessewhite)\
**Post date:** [June 22, 2022, 4:09pm UTC](https://discuss.elastic.co/t/how-to-secure-elasticsearch-on-kubernetes/306570/7 "2022-06-22T16:09:20Z")

</div>

hello @legoguy1000 i actually installed ECK and it worked like a charm didn't need to configure security and it's very flexible to use thank you

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 20, 2022, 4:09pm UTC](https://discuss.elastic.co/t/how-to-secure-elasticsearch-on-kubernetes/306570/8 "2022-07-20T16:09:48Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
