# How to secure Beat communication to Elasticsearch

**URL:** <https://discuss.elastic.co/t/how-to-secure-beat-communication-to-elasticsearch/306538>\
**Category:** Beats\
**Tags:** filebeat, winlogbeat\
**Created:** [June 7, 2022, 8:19am UTC](https://discuss.elastic.co/t/how-to-secure-beat-communication-to-elasticsearch/306538 "2022-06-07T08:19:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Moritz\_Kiesewetter](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/moritz_kiesewetter/32/51243_2.png) [@Moritz\_Kiesewetter](https://discuss.elastic.co/u/Moritz_Kiesewetter)\
**Post date:** [June 7, 2022, 8:19am UTC](https://discuss.elastic.co/t/how-to-secure-beat-communication-to-elasticsearch/306538/1 "2022-06-07T08:19:32Z")

</div>

Hello everyone,

i've got the following Setup:  
3 Node Cluster  
OS: RedHat 8.6  
Kibana: 7.17  
Elasticsearch: 7.17  
Winlogbeat/Filebeat: 7.17

So i've followed the "Secure your Cluster"-Guides provided:  
Minimal:

> **[Set up minimal security for Elasticsearch | Elasticsearch Guide \[7.17\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/7.17/security-minimal-setup.html)**

Basic:

> **[Set up basic security for the Elastic Stack | Elasticsearch Guide \[7.17\] |...](https://www.elastic.co/guide/en/elasticsearch/reference/7.17/security-basic-setup.html)**

Secure + HTTPs:

> **[Set up basic security for the Elastic Stack plus secured HTTPS traffic |...](https://www.elastic.co/guide/en/elasticsearch/reference/7.17/security-basic-setup-https.html)**

It all worked fine and my Cluster is ready to gain some data.

I've looked around a bit - but did not find what i was looking for:

If i want my Filebeat and my winlogbeat-Agents to use encrypted channels to send data - the guide tells me to use the following:

```auto
output.elasticsearch:
  hosts: ["https://myEShost:9200"]
  ssl.certificate_authorities: 
    - /etc/pki/my_root_ca.pem
    - /etc/pki/my_other_ca.pem
  ssl.certificate: "/etc/pki/client.pem" 
  ssl.key: "/etc/pki/key.pem" 

```

Do i simply use the elastic-stack-ca.p12 created in one of those guides to create a .pem Cert + Key via opensll-Command? Or am i missing a point here?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [June 8, 2022, 3:30am UTC](https://discuss.elastic.co/t/how-to-secure-beat-communication-to-elasticsearch/306538/2 "2022-06-08T03:30:59Z")

</div>

You should be able to just use the ca you created for kibana during the "Secure + HTTPs:" step

```auto
/kibana
|_ README.txt
|_ elasticsearch-ca.pem <!--- This One
|_ sample-kibana.yml

```

Its actuall near the bottom of the same page you linked to [here](https://www.elastic.co/guide/en/elasticsearch/reference/7.17/security-basic-setup-https.html#configure-metricbeat-tls)

```auto
output.elasticsearch:
 hosts: ["<your_elasticsearch_host>:9200"]
 protocol: "https"
 username: "metricbeat_writer"
 password: "<password>"
 ssl:
   certificate_authorities: ["elasticsearch-ca.pem"]
   verification_mode: "certificate"

```

BTW it changes slightly in 8.x if you do the Auto Security Setup

```auto
  username: "elastic"
  password: "password "
  ssl.certificate_authorities : ["path_to_certs/config/certs/http_ca.crt"] <!---- Generated at setup time. 

```

---

<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 6, 2022, 5:31am UTC](https://discuss.elastic.co/t/how-to-secure-beat-communication-to-elasticsearch/306538/3 "2022-07-06T05:31:45Z")

</div>

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