It is pretty akward to be honest. I've downloaded a brand new version of Kibana and Elastic (7.5.1), added
xpack.security.enabled: true
xpack.security.transport.ssl.enabled: true
In the elasticsearch.yml
and
elasticsearch.username: "elastic"
elasticsearch.password: "my_pw"
In the kibana.yml
.
Launched ES and Kibana, created a testing_space
and get the kibana_sample_data_ecommerce
data and visualizations/dashboards in it.
Then create a test_role
role as follows:
And when I try the GET _security/role/test_role
call from Dev Tools it returns:
{
"test_role" : {
"cluster" : [ ],
"indices" : [
{
"names" : [
"kibana*"
],
"privileges" : [
"all"
],
"allow_restricted_indices" : false
}
],
"applications" : [
{
"application" : "kibana-.kibana",
"privileges" : [
"space_all"
],
"resources" : [
"space:testing_space"
]
}
],
"run_as" : [ ],
"metadata" : { },
"transient_metadata" : {
"enabled" : true
}
}
}
Finally I created a test_user
user and assigned it that role.
It works perfectly and when I log in with that user I can only see the testing_space
space.
You sure you are not logged in with the superuser in another browser tab?
Cause if you open a tab and log in with the test_user
and then open another tab and log in with the admin
user, then going back to the previous tab a clicking on the spaces in the top left corner, it shows you the whole list, as if you were logged with the admin
(which you are, in fact, but in another tab). In that case try refreshing the page and see if the user you're logged in with changes.