# Metricbeat encrypt passwords in configuration file

**URL:** <https://discuss.elastic.co/t/metricbeat-encrypt-passwords-in-configuration-file/231889>\
**Category:** Elasticsearch\
**Tags:** beats-module\
**Created:** [May 10, 2020, 3:01pm UTC](https://discuss.elastic.co/t/metricbeat-encrypt-passwords-in-configuration-file/231889 "2020-05-10T15:01:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mctj](https://avatars.discourse-cdn.com/v4/letter/m/4491bb/32.png) [@mctj](https://discuss.elastic.co/u/mctj)\
**Post date:** [May 10, 2020, 3:01pm UTC](https://discuss.elastic.co/t/metricbeat-encrypt-passwords-in-configuration-file/231889/1 "2020-05-10T15:01:38Z")

</div>

Hey,  
I'm using the new sql module in version 7.6 and I need to assign the username and the password of the db in the yaml config in the hosts key([src](https://www.elastic.co/guide/en/beats/metricbeat/current/metricbeat-module-sql.html)).

If someone will read the yaml file or get it from anybody it means that our credentials are exposed. Is there any way to put an encrypted password there ? or load the password externally into the yaml configuration with a script or something ?

---

<div class="post-metadata">

**Author:** ![Luca\_Belluccini](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/luca_belluccini/32/33239_2.png) [@Luca\_Belluccini](https://discuss.elastic.co/u/Luca_Belluccini)\
**Post date:** [May 10, 2020, 11:02pm UTC](https://discuss.elastic.co/t/metricbeat-encrypt-passwords-in-configuration-file/231889/2 "2020-05-10T23:02:27Z")

</div>

Hello @mctj

Does the [Metricbeat keystore](https://www.elastic.co/guide/en/beats/metricbeat/current/keystore.html) fit your needs?

---

<div class="post-metadata">

**Author:** ![mctj](https://avatars.discourse-cdn.com/v4/letter/m/4491bb/32.png) [@mctj](https://discuss.elastic.co/u/mctj)\
**Post date:** [May 11, 2020, 8:16am UTC](https://discuss.elastic.co/t/metricbeat-encrypt-passwords-in-configuration-file/231889/3 "2020-05-11T08:16:57Z")

</div>

Yes , 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:** [June 8, 2020, 8:17am UTC](https://discuss.elastic.co/t/metricbeat-encrypt-passwords-in-configuration-file/231889/4 "2020-06-08T08:17:00Z")

</div>

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