Tuesday, October 25, 2022

[FIXED] How to add a basic user/pass authentication for ElasticSearch

Issue

I deployed Elasticsearch with the following the page below to my Azure Kubernetes environment.

https://www.elastic.co/guide/en/cloud-on-k8s/master/k8s-deploy-elasticsearch.html

It works fine.

But I want to add a basic user/password authentication for Elasticsearch page. I really don't get it why it's so complicated and needs to Google it.

Then I checked this page;

https://www.elastic.co/guide/en/elasticsearch/reference/current/get-started-enable-security.html

I guess I need to add "xpack.security.enabled: true" to elasticsearch.yaml file, but to where? How can I do that? I c/p and put the yaml file and it didn't worked.

https://www.elastic.co/guide/en/elasticsearch/reference/current/get-started-enable-security.html

Then the documentation below mentioned about the creating passwords for built-in users, but they mentioned only manual installations, not sure how to do with Kubernetes?

`

https://www.elastic.co/guide/en/elasticsearch/reference/current/get-started-built-in-users.html

`

Is there any basic documentation available for creating authentication on Elasticsearch? How can I do that?

Regards.


Solution

You can do it by installing elasticsearch using helm chart and modifying values.yaml. It allows you to modify elasticsearch.yaml.

You can enable xpack.security.enabled: true with following configuration:

esConfig: {}
  elasticsearch.yml: |
    xpack.security.enabled: true


Answered By - kool
Answer Checked By - Cary Denson (PHPFixing Admin)

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.