# Unable to configure elasticsearch security

**URL:** <https://discuss.elastic.co/t/unable-to-configure-elasticsearch-security/228752>\
**Category:** Elasticsearch\
**Created:** [April 19, 2020, 6:42pm UTC](https://discuss.elastic.co/t/unable-to-configure-elasticsearch-security/228752 "2020-04-19T18:42:28Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Blason](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/blason/32/42284_2.png) [@Blason](https://discuss.elastic.co/u/Blason)\
**Post date:** [April 19, 2020, 6:42pm UTC](https://discuss.elastic.co/t/unable-to-configure-elasticsearch-security/228752/1 "2020-04-19T18:42:28Z")

</div>

Hi Folks,

I am trying to build security between elasticsearch and kibana to make SIEM detection work. However been struggling for so long. I followed lot of tutorials and generated p12 file. Here is my config file

```auto
#action.destructive_requires_name: true
# This turns on SSL for the HTTP (Rest) interface
xpack.security.http.ssl.enabled: true

# This configures the keystore to use for SSL on HTTP
xpack.security.http.ssl.keystore.path: "http.p12"

```

Then followed README for kibana. however I am unable to start elasticsearch service and here are my errors. Per error it seel http.p12 file does not exist. But when I see the file is there under /etc/elasticsearch

```auto
ls -l /etc/elasticsearch/http.p12
-rw------- 1 root root 10602 Apr 19 23:49 /etc/elasticsearch/http.p12

```

And error is as below

```auto
Caused by: org.elasticsearch.ElasticsearchException: failed to create trust manager
        at org.elasticsearch.xpack.core.ssl.TrustConfig$CombiningTrustConfig.createTrustManager(TrustConfig.java:172) ~[?:?]
        at org.elasticsearch.xpack.core.ssl.SSLService.createSslContext(SSLService.java:427) ~[?:?]
        at java.util.HashMap.computeIfAbsent(HashMap.java:1138) ~[?:?]
        at org.elasticsearch.xpack.core.ssl.SSLService.loadConfiguration(SSLService.java:521) ~[?:?]
        ... 26 more
Caused by: org.elasticsearch.ElasticsearchException: failed to initialize SSL TrustManager - keystore file [/etc/elasticsearch/http.p12] does not exist
        at org.elasticsearch.xpack.core.ssl.TrustConfig.missingTrustConfigFile(TrustConfig.java:113) ~[?:?]

```

Any clue folks?

---

<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 17, 2020, 6:42pm UTC](https://discuss.elastic.co/t/unable-to-configure-elasticsearch-security/228752/2 "2020-05-17T18:42:48Z")

</div>

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

---

<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 17, 2020, 6:42pm UTC](https://discuss.elastic.co/t/unable-to-configure-elasticsearch-security/228752/3 "2020-05-17T18:42:49Z")

</div>



---

<div class="post-metadata">

**Author:** ![KoettingSimon](https://avatars.discourse-cdn.com/v4/letter/k/ba9def/32.png) [@KoettingSimon](https://discuss.elastic.co/u/KoettingSimon)\
**Post date:** [May 17, 2020, 7:03pm UTC](https://discuss.elastic.co/t/unable-to-configure-elasticsearch-security/228752/4 "2020-05-17T19:03:28Z")

</div>

Hi,  
per default elasticsearch runs with his own user also called elasticsearch.

> [@Blason](#):
>
> ls -l /etc/elasticsearch/http.p12 -rw------- 1 root root 10602 Apr 19 23:49 /etc/elasticsearch/http.p12

As i can see only the owner is allowed to read this file, in this case the owner is root. This means the elasticsearch user is not permitted to read. Please try to change the owner to the elasticsearch user.

---

<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:** [November 4, 2022, 7:54am UTC](https://discuss.elastic.co/t/unable-to-configure-elasticsearch-security/228752/5 "2022-11-04T07:54:33Z")

</div>


