# Encrypt / secure Database password in logstash.conf file

**URL:** <https://discuss.elastic.co/t/encrypt-secure-database-password-in-logstash-conf-file/210137>\
**Category:** Logstash\
**Tags:** elastic-stack-security\
**Created:** [December 2, 2019, 8:30am UTC](https://discuss.elastic.co/t/encrypt-secure-database-password-in-logstash-conf-file/210137 "2019-12-02T08:30:07Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![sampath1](https://avatars.discourse-cdn.com/v4/letter/s/e480ec/32.png) [@sampath1](https://discuss.elastic.co/u/sampath1)\
**Post date:** [December 2, 2019, 11:02am UTC](https://discuss.elastic.co/t/encrypt-secure-database-password-in-logstash-conf-file/210137/6 "2019-12-02T11:02:39Z")

</div>

Hi all,

Still this feature under investigation?  
I have been seeing many links were users are asking for a long time.

> [@Jdbc\_password configuration for logstash](https://discuss.elastic.co/t/jdbc-password-configuration-for-logstash/35178):
>
> Is there a way to mask/hide the jdbc\_password parameter. Config File: input { jdbc { jdbc\_driver\_library =\> "C:\Program Files\DbVisualizer\jdbc\oracle\ojdbc6.jar" jdbc\_driver\_class =\> "Java::oracle.jdbc.driver.OracleDriver" jdbc\_connection\_string =\> "jdbc:oracle:thin:@TEST:1244:TESTDB" jdbc\_user =\> "user\_id" #jdbc\_password =\> "" jdbc\_validate\_connection =\> true jdbc\_fetch\_size =\> 1000 schedule =\> "\* \* \* \* \*" statement =\> "Select EMP\_ID from Employee\_data" } } output { elasticsear…

> [@JDBC\_password config for logstash?](https://discuss.elastic.co/t/jdbc-password-config-for-logstash/210153):
>
> Continuing the discussion from [Jdbc\_password configuration for logstash](https://discuss.elastic.co/t/jdbc-password-configuration-for-logstash/35178/2): Any update on this?

> <https://github.com/sampath-v/sam/issues/1>
>
> Hi,
> 
> I am new to this Logstash.
> I don't want to specify plain text "username"… and "password" in logstash.conf for the Database input plugin. Is there any way to do that?
> 
> Is there any possible way to encrypt or hide the DB "username" and "password." in log stash config code? 
> 
> Elastic Search Version 7.0.0
> Logstash version 7.0.0
> 
> logstash.conf file
> 
> input {
> jdbc {
> jdbc\_connection\_string =\> "jdbc:postgresql://DbIP:port/DatabaseName"
> jdbc\_user =\> "dbuser"
> jdbc\_password =\> "\*\*dbpassword\*\*"
> jdbc\_driver\_class =\> "org.postgresql.Driver"
> jdbc\_driver\_library =\> "/home/Downloads/postgresql-42.1.4.jar"
> jdbc\_validate\_connection =\> true
> statement =\> 'select \*from order\_tbl'
> use\_column\_value =\> true
> tracking\_column\_type =\>"numeric"
> tracking\_column =\> "ford\_id"
> clean\_run =\> true
> }
> }
> output {
> elasticsearch {
> user =\> ESUser
> password =\> ESPassword
> ssl =\> true
> sniffing =\> true
> index =\> "1\_999"
> document\_type =\> "1\_999"
> document\_id =\> "%{ford\_id}"
> hosts =\> \["https://ESIp:Port"\]
> }
> }

> [@Encrypt / secure Database password in logstash.conf file](https://discuss.elastic.co/t/encrypt-secure-database-password-in-logstash-conf-file/210137/2):
>
> hi, Yes, we explain how to do this in [https://www.elastic.co/guide/en/logstash/current/keystore.html](https://www.elastic.co/guide/en/logstash/current/keystore.html)

---

_[View the full topic](https://discuss.elastic.co/t/encrypt-secure-database-password-in-logstash-conf-file/210137)._
