Hi,
I'm using X-Pack to secure ELK-Stack.I don't want to put plain text "username" and "password" in kibana.yml file. So I choose PKI(Public Key Infrastructure) based authentication.Getting some error while trying to established connection
kibana output-
log [08:26:38.869] [info][status][plugin:kibana@6.0.0] Status changed from uninitialized to green - Ready
log [08:26:38.942] [info][status][plugin:elasticsearch@6.0.0] Status changed from uninitialized to yellow - Waiting for Elasticsearch
log [08:26:38.968] [info][status][plugin:xpack_main@6.0.0] Status changed from uninitialized to yellow - Waiting for Elasticsearch
log [08:26:39.298] [info][status][plugin:graph@6.0.0] Status changed from uninitialized to yellow - Waiting for Elasticsearch
log [08:26:39.311] [info][status][plugin:monitoring@6.0.0] Status changed from uninitialized to green - Ready
log [08:26:41.089] [warning][reporting] Generating a random key for xpack.reporting.encryptionKey. To prevent pending reports from failing on restart, please set xpack.reporting.encryptionKey in kibana.yml
log [08:26:41.096] [info][status][plugin:reporting@6.0.0] Status changed from uninitialized to yellow - Waiting for Elasticsearch
log [08:26:41.159] [info][status][plugin:security@6.0.0] Status changed from uninitialized to yellow - Waiting for Elasticsearch
log [08:26:41.161] [warning][security] Generating a random key for xpack.security.encryptionKey. To prevent sessions from being invalidated on restart, please set xpack.security.encryptionKey in kibana.yml
log [08:26:41.233] [error][status][plugin:xpack_main@6.0.0] Status changed from yellow to red - Authentication Exception
log [08:26:41.234] [error][status][plugin:graph@6.0.0] Status changed from yellow to red - Authentication Exception
log [08:26:41.235] [error][status][plugin:reporting@6.0.0] Status changed from yellow to red - Authentication Exception
log [08:26:41.236] [error][status][plugin:security@6.0.0] Status changed from yellow to red - Authentication Exception
log [08:26:41.238] [error][status][plugin:elasticsearch@6.0.0] Status changed from yellow to red - Authentication Exception
log [08:26:41.251] [error][status][plugin:searchprofiler@6.0.0] Status changed from uninitialized to red - Authentication Exception
log [08:26:41.270] [error][status][plugin:ml@6.0.0] Status changed from uninitialized to red - Authentication Exception
log [08:26:41.348] [info][status][plugin:ml@6.0.0] Status changed from red to yellow - Waiting for Elasticsearch
log [08:26:41.373] [error][status][plugin:tilemap@6.0.0] Status changed from uninitialized to red - Authentication Exception
log [08:26:41.426] [error][status][plugin:ml@6.0.0] Status changed from yellow to red - Authentication Exception
log [08:26:41.444] [error][status][plugin:watcher@6.0.0] Status changed from uninitialized to red - Authentication Exception
log [08:26:41.497] [info][status][plugin:grokdebugger@6.0.0] Status changed from uninitialized to green - Ready
log [08:26:41.511] [info][status][plugin:dashboard_mode@6.0.0] Status changed from uninitialized to green - Ready
log [08:26:41.518] [error][status][plugin:logstash@6.0.0] Status changed from uninitialized to red - Authentication Exception
log [08:26:41.559] [info][status][plugin:console@6.0.0] Status changed from uninitialized to green - Ready
log [08:26:41.576] [info][status][plugin:metrics@6.0.0] Status changed from uninitialized to green - Ready
log [08:26:41.821] [info][status][plugin:timelion@6.0.0] Status changed from uninitialized to green - Ready
log [08:26:41.825] [info][listening] Server running at https://localhost:5601
log [08:26:41.827] [error][status][ui settings] Status changed from uninitialized to red - Elasticsearch plugin is red
elasticsearch.yml -
xpack.ssl.key: "CN=elastic,OU=IT,DC=mydomain,DC=com/CN=elastic,OU=IT,DC=mydomain,DC=com.key"
xpack.ssl.certificate: "CN=elastic,OU=IT,DC=mydomain,DC=com/CN=elastic,OU=IT,DC=mydomain,DC=com.crt"
xpack.ssl.certificate_authorities:
- "ca/ca.crt"
xpack.security.transport.ssl.enabled: true
xpack.security.http.ssl.enabled: true
xpack.monitoring.enabled: true
xpack.security.transport.ssl.client_authentication: "optional"
xpack.ssl.verification_mode: "certificate"
xpack.security.transport.ssl.verification_mode: "certificate"
xpack.security.authc.realms:
pki:
type: pki
order: 0
certificate_authorities:
- "ca/ca.crt"
native:
type: native
order: 1
kibana.yml -
elasticsearch.url: "https://localhost:9200"
server.ssl.enabled: true
server.ssl.certificate: "/opt/elasticsearch-6.0.0/config/CN=elastic,OU=IT,DC=mydomain,DC=com/CN=elastic,OU=IT,DC=mydomain,DC=com.crt"
server.ssl.key: "/opt/elasticsearch-6.0.0/config/CN=elastic,OU=IT,DC=mydomain,DC=com/CN=elastic,OU=IT,DC=mydomain,DC=com.key"
elasticsearch.ssl.certificate: "/opt/elasticsearch-6.0.0/config/CN=elastic,OU=IT,DC=mydomain,DC=com/CN=elastic,OU=IT,DC=mydomain,DC=com.crt"
elasticsearch.ssl.key: "/opt/elasticsearch-6.0.0/config/CN=elastic,OU=IT,DC=mydomain,DC=com/CN=elastic,OU=IT,DC=mydomain,DC=com.key"
My default x-pack username is "elastic" and that is same as CN of certificate.
I used following configuration to generate certificate from certgen -
certgen.yml -
instances:
- name: "CN=elastic,OU=IT,DC=mydomain,DC=com"
ip:
- "127.0.0.1"
dns:
- "localhost"