# Kibana asking for Enrollment Token when xpack.security.enabled: false in Elasticsearch

**URL:** <https://discuss.elastic.co/t/kibana-asking-for-enrollment-token-when-xpack-security-enabled-false-in-elasticsearch/302118>\
**Category:** Kibana\
**Created:** [April 11, 2022, 2:47pm UTC](https://discuss.elastic.co/t/kibana-asking-for-enrollment-token-when-xpack-security-enabled-false-in-elasticsearch/302118 "2022-04-11T14:47:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![AdmiralGT](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/admiralgt/32/104244_2.png) [@AdmiralGT](https://discuss.elastic.co/u/AdmiralGT)\
**Post date:** [April 11, 2022, 2:47pm UTC](https://discuss.elastic.co/t/kibana-asking-for-enrollment-token-when-xpack-security-enabled-false-in-elasticsearch/302118/1 "2022-04-11T14:47:19Z")

</div>

I have Kibana and Elasticsearch running in a kubernetes cluster, both v8.1.2

In my Elasticsearch.yml I have  
` xpack.security.enabled: false`

This is confirmed by trying to create the enrollment token in Elasticsearch

```auto
sh-5.0$ bin/elasticsearch-create-enrollment-token -s kibana

ERROR: [xpack.security.enrollment.enabled] must be set to `true` to create an enrollment token

```

However, when I go to the Kibana GUI, it asks me to enter an enrollment token which I don't have and can't provide.

Looking through the docs, it suggests I don't need to do anything in Kibana to disable security but is there some configuration setting I'm missing to allow Kibana to connect without an enrollment token?

---

<div class="post-metadata">

**Author:** ![ikakavas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ikakavas/32/34430_2.png) [@ikakavas](https://discuss.elastic.co/u/ikakavas)\
**Post date:** [April 15, 2022, 4:12am UTC](https://discuss.elastic.co/t/kibana-asking-for-enrollment-token-when-xpack-security-enabled-false-in-elasticsearch/302118/2 "2022-04-15T04:12:13Z")

</div>

You have two options:

1. You click on "Configure manually" right below the input box for the enrollment token and you manually add the Elasticsearch HTTP address, such as `http://172.17.0.2:9200`

2. Start Kibana by passing in the ELASTICSEARCH\_HOSTS env variable, i,e, `-e "ELASTICSEARCH_HOSTS=http://es01-test:9200"`

In theory, you can always pass `-e "INTERACTIVESETUP_ENABLED=false"` to disable the interactive setup mode but in this case, if you don't configure anything else, kibana will try to connect to localhost to find Elasticsearch on 9200. When in k8s or docker, that `localhost` is the container where kibana runs so this will fail. It would work if both kibana and Elasticsearch run from archives on the same host.

HTH

---

<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:** [May 13, 2022, 4:12am UTC](https://discuss.elastic.co/t/kibana-asking-for-enrollment-token-when-xpack-security-enabled-false-in-elasticsearch/302118/3 "2022-05-13T04:12:19Z")

</div>

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