I'm using x-pack to secure ELK stack , I don't want to specify plain text "username" and "password" in logstash.conf for elasticsearch output plugin. Is there any way to do that?
output {
elasticsearch {
hosts => "hostname"
user => "username"
password => "password"
ssl => true
ssl_certificate_verification => true
truststore => "keystore.jks"
truststore_password => changeme
index => "logstash-%{+YYYY.MM.dd}"
template => "log-template.json"
template_name => "logstash*"
template_overwrite => true
}
}
If anyone looking for answer of same question then elasticsearch x-pack supports PKI based authentication, you just need to enable PKI authentication on elasticsearch , using this link and then update elasticsearch's output in logstash.conf to use PKI authentication, using this link.You can do same for kibana also.