-
Notifications
You must be signed in to change notification settings - Fork 32
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
Restricting Indices Access to Kibana Users #61
Comments
Whitelisting an IP means any request originating from that particular IP will bypass authentication checks. How I use it with my work is to not whitelist Kibana IPs, but have the authentication for a user inside the kibana config: Perhaps there is a way to have the Kibana auth plugin do dynamic users, I am not familiar with the Kibana plugin ecosystem, I would suggest making a feature request there if the feature is needed. |
Hi Ryan, Thanks for your quick response. I have now modified it in the way you said in my kibana.yml config file. so rather than whitelisting, my kibana is connecting to ES through this root:rootpassword credential. But still the user1 can still see [INDEX_NAME_2] and user2 can see [INDEX_NAME_1] This gives me the doubt about the usage of indices in the user management console of elasticfence for different users really work ? I mean does it really restrict the indices view for various kibana users. I created a user with indices such that the index does not exist in ES. Then tried to login, it logged in fine and could still see all the available indices in ES. When i delete the user, i could not login. Am i doing anything wrong here ? Not sure whether it is related to this #2 where _msearch got implemented. Thanks for your time and I salute for your inputs. thanks. |
Its possible that its related to that issue, but I am not 100% at this point. From what I can see, the code does some blanket checks for Kibana requests, so it might be that something there is not working as intended and the code thinking it is a generic Kibana request. The evaluation of permissions in particular is done in the following chunk of code: https://github.com/elasticfence/elasticsearch-http-user-auth/blob/5.1.2/src/main/java/org/elasticsearch/plugin/elasticfence/UserAuthenticator.java#L38
|
Hi, Thanks for your inputs. My answers are below. Thanks for your time !
ES 2.4.2 and Kibana 4.4.2 I had a look at the same java file mentioned by you in 2.4.2 but could not see any difference between the two.
I am accessing kibana using my internal kibana URL setup by me XXX.XX.XX.XX:5601 It displays the kibana-auth login page perfectly fine and the login process works fine too. My ES contains two indices - customers and orders Coming to users, I have 3 users namelu admin, user1 and user2. All created using the elasticfence user management console. admin has the filter setting - /customers,/_*,/.kibana,/orders Now all three users are able to login fine. But user1 can still see customers index in the kibana page (left side top) and able to click to see the data. Same things happens for user2 who can see the orders data.
It is in dev stage only. You can see below. [
As seen above, I am not using any wildcards here ! Thats why I am confused :-) |
Are you running Kibana on the same box as any Elasticsearch node in your cluster? I did a quick smoke test on my 5.1.1 branch and cluster using your users and index names and have noticed that I experience your issue if I run Kibana locally with an ES node. However, if I connect Kibana to a remote cluster, it works as intended: For user1, I cannot query customers via the dev tools, and I cannot define an index pattern for customers to view its mapping. I was also able to dig up an old 2.3.5 configuration I had and ran a quick test locally and notice the same issue. I am able to add new index patterns and view their fields via Kibana. The only real change that happened between 2.x and 5.x is how the plugin is registered with Elasticsearch and how the filters are put into Elasticsearch's pipeline. Because the authentication and index filter validation were not touched, I have reason to believe the same issue is present for 2.x. Very odd, because it seems like Kibana is not going trough the filters this plugin sets up when it is running locally. I will look into this more as I am able. |
Hi Ryan,
Yes I am running kibana in the same machine as ES. I can configure kibana
in another machine to give it a try as you said. will update you.
Thanks
Sent from mobile
On 27 Jan 2017 1:10 a.m., "Ryan" <[email protected]> wrote:
Are you running Kibana on the same box as any Elasticsearch node in your
cluster? I did a quick smoke test using your users and index names and have
noticed that I experience your issue if I run Kibana locally with an ES
node. However, if I connect Kibana to a remote cluster, it works as
intended.
Very odd, because it seems like Kibana is not going trough the filters this
plugin sets up when it is running locally.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#61 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AI7vAdt9zboMz1PksnTZputIyY749tbNks5rWNN4gaJpZM4LsIAr>
.
|
I was so eager to test kibana in a different VM and then connecting to ES cluster. I just tried this with the same result. Not sure whether you used 4.4 or the newer 5.1 though. I tried 5.1 but complained saying incompatible with ES 2.4.2 and hence used 4.4 |
I think I might have reproduced what you were talking about. In my Kibana config: However, when I attempt to visualize data or refresh the fields, I get an authorization error, as expected. I can still see the fields for orders on user 2 though. Is this the issue you are talking about? |
Hi Ryan, You said "In my Kibana config: I first set it to use user 1" - a bit confusing for me. So before i comment, I want to know whether you are adding anything in the kibana config file i.e kibana.yml file for all the users created using the elasticfence plugin as I am not adding anything to that config file except for the elasticsearch.url pointing to the ES cluster with the root password. If so, can you please give me the snippet of your kibana.yml file. Another thing I wanna say is that you are trying to create an index pattern after creating users while I have the index pattern created before implementing this elasticfence. It was like we need something and i started pumping data from various apps to elastic and started using kibana dashboards. All good until now. But we have two different audiences here now and one should not see other. This is where i got stuck ! Thanks for your time and patience. |
By "I first set it to user 1", I mean I set the When I switch the Essentially what it looks like the issue is, is that there are pre-existing index patterns and one Kibana instance is meant to be shared between multiple users. What I've observed is that everything Kibana manages is within the I am not 100% sure this will work, but you could try to run two separate Kibana instances to keep everything separated. Create another copy of Kibana somewhere on the machine and alter the
And specify the |
I had a bit of time to mess with my approach. All requests coming from the second instance of Kibana were blocked. The check for Kibana requests has a hard-coded If you want to try this approach to see if it fits your needs, I have a JAR here: A new config option needs to be added to the For reference, these were the options I had specified in the kibana configs:
and
|
@ryanlutgen thanks for getting to the bottom of the problem, I am away for a few more days but it seems you got this better than I would have for sure! let me know if there's anything i can help with |
@ryanlutgen sorry for the delayed reply. I was bit off and back now. I can see that you are using two different instances of kibana running in two different ports to make it work. There is a bottleneck i am noticing here. Actually we planned to dump data into elastic for every project we do and this means we will have different audiences for different project. Going by this way, we have to create multiple instances of kibana to make it work. Say 5 projects, 5 different audeinces and 5 different instances. Do you think it is elegant ? it can be used as a stop gap approach for now but in the longer run, it may be not be the elegant option. What do you think ? Thanks for your time. |
I think if you want to scope what users have access to what visualizations/dashboards, you will need seperate instances, since everything is stored in a
So I don't think it is as elegant as it could be, but for your case, I presently don't see another way around it. Since each user would have its own |
@ryanlutgen Thanks for your inputs. Appreciated. I will be pondering on this during the week and update you how it goes. |
Hi,
I have created 3 kibana users namely admin, user1 and user2. while admin will have access to all indices in ES, user1 / user2 will have access to specific indices only.
I have whitelisted the IP address so that kibana can communicate with the ES without any issues and it is working fine. I can pump data in ES and read without any issues.
Now coming to Kibana UI, I can login as admin and see data belonging to all the indices. perfect. But when i login as user1 /user2, it is not restricting the data according to the indices. I have specified the indices using the user management console at _plugin/elasticfence/ for the users like
/[INDEX_NAME_1],/.kibana for user1
/[INDEX_NAME_2],/.kibana for user2
In this case, i expect user1 not to see the data in [INDEX_NAME_2] and user2 not to see the data in [INDEX_NAME_1]
Am i doing something wrong here ? or do i have to specify the index filter somewhere in the config file ?
Any inputs on this is greatly appreciated.
Thanks.
The text was updated successfully, but these errors were encountered: