-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Setting elasticsearch.sniff* settings in Kibana.yml causes authentication issues #42224
Comments
Pinging @elastic/kibana-operations |
@elastic/kibana-operations I've tagged you on this issue since you implemented this feature in #21928, but let me know if the issue is related to the authentication itself that Security Team should normally handle. |
I can also confirm that i've reproduced this on version With
|
@jbudz do you have some cycles to look into this? |
Yeah, I'll have to take a closer look at client lib but this came up in testing. The sniff settings will pull cluster information from elasticsearch, but it isn't necessarily the same endpoints and information kibana uses to connect (proxies and so on). I didn't find it very useful in practice, but there's room for improvement with auth here. |
Reproduced on version 7.5. When I change elasticsearch.sniffOnStart to true, I get 401 error trying to get license information on startup. |
We have the same issue in 7.4.2 |
same issue in 7.6.2 |
@elastic/kibana-platform do we know if this problem also exists with the new client? |
@delvedor ^ Maybe you will be able to answer this one? |
i get the same error on newer version 7.9.3 and 7.10.0 |
@pgayvallet sorry for the delay. This should not happen with the client, as the sniff logic is using the same code that every other request uses, so the authentication should work as well. |
I also got same issue in kibana-7.9.3 after adds below 3lines. elasticsearch.sniffInterval: 300000 |
@jbudz I know it's been a while now, but did you get to investigate further? |
It's still an issue, possibly pending the full migration via #83910. Same authorization failure - nodes are added to the cluster list but requests don't pass kibana.yml credentials. Errors manifest as Kibana loading but anything hitting es fails to load due to the license check failing. |
One parameter is enought - elasticsearch.sniffInterval After that time: |
Oh I see, that's what is happening here. Nodes are added, but the way we're adding auth is not propagated, which makes sense, in a way, as for the legacy client we were adding auth to the individual nodes. kibana/src/core/server/elasticsearch/legacy/elasticsearch_client_config.ts Lines 129 to 131 in 4584a8b
It should be fixed when completing the migration to the new client then, as we are defining the auth in a more global way kibana/src/core/server/elasticsearch/client/client_config.ts Lines 77 to 82 in 4584a8b
@delvedor does that sound correct? The nodes added by sniffing requests are correctly using the top-level defined auth ( Do you know if, for the legacy client, using |
Fixed starting in versions |
Kibana version:
7.2.0
Elasticsearch version:
7.2.0
Server OS version:
Centos 7.x
Browser version:
Chrome Version 75.0.3770.142 (Official Build) (64-bit)
Browser OS version:
Mac Mojave
Original install method (e.g. download page, yum, from source, etc.):
Yum from our repo
Describe the bug:
When setting the following keys in the
kibana.yml
configuration file;... to anything other than false, the
elasticsearch.username
andelasticsearch.password
seem to be ignored and revert to anonymous connections;I also found that putting a typo in the
elasticsearch.password
to force a 403 would fail as expected however.Steps to reproduce:
xpack.security.enabled: true
on Elasticsearch, run setup passwordskibana.yml
to use thekibana
user credentials in theelasticsearch.username
andelasticsearch.password
settingselasticsearch.sniffInterval: 3000
,elasticsearch.sniffOnConnectionFault: true
andelasticsearch.sniffOnStart: true
missing authentication credentials
Work around
Do not use these settings, either drop them from the configuration or set all 3 to
false
.The text was updated successfully, but these errors were encountered: