This is the problem: I need Kibana and the ES client to work on python at the same time.
At the same time, all security settings are enabled:
xpack.security.enabled: true
xpack.security.enrollment.enabled: true
xpack.security.http.ssl:
enabled: true
xpack.security.transport.ssl:
enabled: true
1. Standard Authentication
I tried to do it the usual way, through authentication:
aioes = AsyncElasticsearch(
hosts='http://localhost:9200',
basic_auth=("user", "password")
)
But the client cannot reach the host. Disconnect is happening.
The 2nd security parameter is responsible for this. When it is disabled, the ES client works, but the kibana crashes. And vice versa
2. Generate Api Key
I tried to solve this problem through the api key.
In kibana, I made such a request:
POST _security/api_key
{
"name": "ES_client",
"role_descriptors": {
"es_python_client": {
"cluster": ["all"],
"index": [
{
"names": ["index_timestamp", "dish_info_index", "test-index"],
"privileges": ["all"]
}
]
}
}
}
After receiving the api, I went to add it to the elastic. I typed in this command:
root: elasticsearch-8.15.4
$ ./bin/elasticsearch-keystore add es_client.python.api_key
The key has been added
After receiving the api, I went to add it to the elastic. I typed in this command:
The key has been added
3. Delete api key from keystore
But after that, my elasticsearch didn't start at all.
Therefore, I was forced to delete the api key. I typed in this command:
./bin/elasticsearch-keystore remove es_client.python.api_key
The Elatsik is working
I do not know what I did wrong. I will be very glad if someone shows me a way to solve my problem
The main thing is that:
- Аuthorization on kibanа remains
- At the same time, it was possible to work with both Kibana and the ES python client
Thanks!