Kibana fails to start

Elasticsearch version:
7.10.2
Server OS version:
Centos7
Kibana version (if relevant):
7.10.2

Describe the issue:
Kibana w/ Searchguard cannot find the configuration file
Every version until now we have always put the kibana.yml in /etc/kibana/kibana.yml

Steps to reproduce:
1.
2.
3.

Expected behavior:
Kibana should start with Searchguard installed with the config file located in the Linux standard location for config files - /etc/kibana/kibana.yml

Provide configuration:
elasticsearch/config/elasticsearch.yml
elasticsearch/plugins/search-guard-7/sgconfig/sg_config.yml
kibana/config/kibana.yml (if relevant)

Provide logs:
Elasticsearch
Kibana:

{“type”:“log”,"@timestamp":“2021-02-19T17:12:39Z”,“tags”:[“error”,“plugins”,“searchguard”,“searchguard”],“pid”:16,“message”:"{ Error: ENOENT: no such file or directory, open ‘/usr/share/kibana/config/kibana.yml’\n at Object.openSync (fs.js:443:3)\n at Object.readFileSync (fs.js:343:35)\n at readKibanaConfig (/usr/share/kibana/plugins/searchguard/server/applications/searchguard/read_kibana_config.js:223:31)\n at SearchGuard.setupSync (/usr/share/kibana/plugins/searchguard/server/applications/searchguard/searchguard.js:32:46)\n at ServerPlugin.setup (/usr/share/kibana/plugins/searchguard/server/serverPlugin.js:47:29)\n at PluginWrapper.setup (/usr/share/kibana/src/core/server/plugins/plugin.js:86:26)\n at PluginsSystem.setupPlugins (/usr/share/kibana/src/core/server/plugins/plugins_system.js:72:25)\n errno: -2,\n syscall: ‘open’,\n code: ‘ENOENT’,\n path: ‘/usr/share/kibana/config/kibana.yml’ }"}

After creating the /usr/share/kibana/config directory, mounting the kibana.yml to that directory.
Now getting:

{“type”:“log”,"@timestamp":“2021-02-19T18:20:26Z”,“tags”:[“fatal”,“root”],“pid”:15,“message”:“Error: X-Pack Security needs to be disabled for Search Guard to work properly. Please set “xpack.security.enabled” to false in your kibana.yml\n at checkXPackSecurityDisabled (/usr/share/kibana/plugins/searchguard/server/applications/searchguard/sanity_checks.js:28:11)\n at SearchGuard.setupSync (/usr/share/kibana/plugins/searchguard/server/applications/searchguard/searchguard.js:58:7)\n at ServerPlugin.setup (/usr/share/kibana/plugins/searchguard/server/serverPlugin.js:47:29)\n at PluginWrapper.setup (/usr/share/kibana/src/core/server/plugins/plugin.js:86:26)\n at PluginsSystem.setupPlugins (/usr/share/kibana/src/core/server/plugins/plugins_system.js:72:25)”}

However, I already have xpack.security.enabled: false in the kibana.yml

Next mounted the kibana.yml to both /usr/share/kibana/config and /etc/kibana/

Now this is working.

Why should I have to include the config file in 2 separate locations!!!

@lzukel do you use the KBN_PATH_CONF environment variable to set the path to the Kibana config? Now we have a bug that makes the Search Guard plugin ignore the variable. Do you use any other means to set a path to the Kibana config in your system?

The SG plugin reads the Kibana config from its parent config folder.

kibana/
├── config
│   └── kibana.yml
└── plugins
    └── searchguard