# Multi-tenancy for different indices

**URL:** <https://forum.opensearch.org/t/multi-tenancy-for-different-indices/5008>\
**Category:** Open Source Elasticsearch and Kibana\
**Created:** [February 17, 2021, 2:40am UTC](https://forum.opensearch.org/t/multi-tenancy-for-different-indices/5008 "2021-02-17T02:40:14Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![blason](https://avatars.discourse-cdn.com/v4/letter/b/e68b1a/32.png) [@blason](https://forum.opensearch.org/u/blason)\
**Post date:** [February 17, 2021, 2:40am UTC](https://forum.opensearch.org/t/multi-tenancy-for-different-indices/5008/1 "2021-02-17T02:40:14Z")

</div>

Hi Team,

I am feeling clueless and would really appreciate advice here. I am setting up firewall logs indices into elastic search for different customers.  
lets say for customer one us-firewall-cust1-\* other is ny-firewall-cust2-\* third is uk-firewall-cust3.  
I need a complete multi-tenancy here so that cust1 logging in with his creds should not even able to see any logs for ny-firewall-cust2 or access to any of the dashboard.

Neither he should come to know the tenants created in Kibana.

Can someone please guide me any documentation here, pls?

TIA  
Blason R

---

<div class="post-metadata">

**Author:** ![mmamaenko](https://avatars.discourse-cdn.com/v4/letter/m/22d042/32.png) [@mmamaenko](https://forum.opensearch.org/u/mmamaenko)\
**Post date:** [February 17, 2021, 4:11am UTC](https://forum.opensearch.org/t/multi-tenancy-for-different-indices/5008/2 "2021-02-17T04:11:13Z")

</div>

here you go: [Kibana Multi-Tenancy - Open Distro Documentation](https://opendistro.github.io/for-elasticsearch-docs/docs/security/access-control/multi-tenancy/)

---

<div class="post-metadata">

**Author:** ![blason](https://avatars.discourse-cdn.com/v4/letter/b/e68b1a/32.png) [@blason](https://forum.opensearch.org/u/blason)\
**Post date:** [February 17, 2021, 5:05am UTC](https://forum.opensearch.org/t/multi-tenancy-for-different-indices/5008/3 "2021-02-17T05:05:10Z")

</div>

Correct - I went through this config however wondering if GUI options are possible instead of fiddling with config.yml

---

<div class="post-metadata">

**Author:** ![mmamaenko](https://avatars.discourse-cdn.com/v4/letter/m/22d042/32.png) [@mmamaenko](https://forum.opensearch.org/u/mmamaenko)\
**Post date:** [February 17, 2021, 5:56am UTC](https://forum.opensearch.org/t/multi-tenancy-for-different-indices/5008/4 "2021-02-17T05:56:01Z")

</div>

you may do the same using gui:

1. create tenant
2. Create internal user (if you are not using external authentication)
3. Switch to new tenant
4. Create index pattern us-firewall-cust1-\* in new tenant.
5. Create role, assign index permissions: .kibana\* - read, delete, index, manage ( to grant user kibana functions access), us-firewall-cust1-\* - search ( to grant user access to own indices for search). You d not need to assign any cluster permissions. Assign tenant permissions to correspondent tenant created in step 1.
6. Add user to the role in Mapped Users tab
7. Login as user and switch to new created tenant (by default user is logged in his own private tenant). Go to Discover and see logs from us-firewall-cust1-\* indexes

---

<div class="post-metadata">

**Author:** ![blason](https://avatars.discourse-cdn.com/v4/letter/b/e68b1a/32.png) [@blason](https://forum.opensearch.org/u/blason)\
**Post date:** [February 18, 2021, 9:55am UTC](https://forum.opensearch.org/t/multi-tenancy-for-different-indices/5008/5 "2021-02-18T09:55:57Z")

</div>

Awesome man!! and much much appreciated. Let me try doing that.

Thanks again.

---

<div class="post-metadata">

**Author:** ![blason](https://avatars.discourse-cdn.com/v4/letter/b/e68b1a/32.png) [@blason](https://forum.opensearch.org/u/blason)\
**Post date:** [February 19, 2021, 5:16am UTC](https://forum.opensearch.org/t/multi-tenancy-for-different-indices/5008/6 "2021-02-19T05:16:39Z")

</div>

Unfortunately this is I am getting. I followed the instructions.  
Am i missing anything?

## 

Application Not Found

No application was found at this URL. Try going back or choosing an app from the menu.

---

<div class="post-metadata">

**Author:** ![mmamaenko](https://avatars.discourse-cdn.com/v4/letter/m/22d042/32.png) [@mmamaenko](https://forum.opensearch.org/u/mmamaenko)\
**Post date:** [February 19, 2021, 5:43am UTC](https://forum.opensearch.org/t/multi-tenancy-for-different-indices/5008/7 "2021-02-19T05:43:45Z")

</div>

at what step did you get this error? what version are you running?

---

<div class="post-metadata">

**Author:** ![blason](https://avatars.discourse-cdn.com/v4/letter/b/e68b1a/32.png) [@blason](https://forum.opensearch.org/u/blason)\
**Post date:** [February 21, 2021, 3:45pm UTC](https://forum.opensearch.org/t/multi-tenancy-for-different-indices/5008/8 "2021-02-21T15:45:21Z")

</div>

Hi there,

Here are the steps I followed and then I get the error which I described below.  
Take example here- My data is coming in dmi-\*

I created user dmiuser internal user.  
Created dmitenant Tenant

 ![image](https://us1.discourse-cdn.com/flex019/uploads/mauve_hedgehog/original/2X/f/f60f6b5ad7fb217385f1c728f532a9ea9b58b241.png)

created role

 ![image](https://us1.discourse-cdn.com/flex019/uploads/mauve_hedgehog/original/2X/7/7485f120f5a0af1734b22037e0f7e8ec5ff20b84.png)

With appropriate Tenant permission

 ![image](https://us1.discourse-cdn.com/flex019/uploads/mauve_hedgehog/original/2X/0/002374a12a09eef71087cdc51b7e7b3a9240b673.png)

Then mapped user

 ![image](https://us1.discourse-cdn.com/flex019/uploads/mauve_hedgehog/original/2X/6/64296a0d89a517b1698ee7e21c305829edd2e38d.png)

Pumped test data and see the data is generated in dmi-\* index [This is done with admin user]  
I then created dmi-\* index with admin user. [Do I need to create index with admin user or dmiuser?]

 ![image](https://us1.discourse-cdn.com/flex019/uploads/mauve_hedgehog/original/2X/9/9ff7e56ea97907e65f1cd0370e29e0627b789996.png)

Now logged in with dmuser and opted for dmitenant

 ![image](https://us1.discourse-cdn.com/flex019/uploads/mauve_hedgehog/original/2X/b/b90ae99343d2739dba85fc0fbe7326ec51e035cb.png)  
Now here do I need to create index again? because nothing is appearing here.

This is with dmiuser

 ![image](https://us1.discourse-cdn.com/flex019/uploads/mauve_hedgehog/original/2X/7/7306a702e66a7c5d7ae8a2f8882750888e2d9f78.png)

And then this issue ☹

 ![image](https://us1.discourse-cdn.com/flex019/uploads/mauve_hedgehog/original/2X/3/385cba7e6e3d3d14874c8fb868916023b753e931.png)

Am I doing anything wrong? Please advise

TIA  
Blason R

---

<div class="post-metadata">

**Author:** ![mmamaenko](https://avatars.discourse-cdn.com/v4/letter/m/22d042/32.png) [@mmamaenko](https://forum.opensearch.org/u/mmamaenko)\
**Post date:** [February 21, 2021, 4:07pm UTC](https://forum.opensearch.org/t/multi-tenancy-for-different-indices/5008/9 "2021-02-21T16:07:25Z")

</div>

Try to use your admin account, switch to ‘dmitenant’ (as admin) and create index pattern. After that you will see it in dmitenant user. (If you followed my steps than your user only have rights to search your dmi\* indexes)

---

<div class="post-metadata">

**Author:** ![blason](https://avatars.discourse-cdn.com/v4/letter/b/e68b1a/32.png) [@blason](https://forum.opensearch.org/u/blason)\
**Post date:** [February 21, 2021, 4:32pm UTC](https://forum.opensearch.org/t/multi-tenancy-for-different-indices/5008/10 "2021-02-21T16:32:49Z")

</div>

I see so Indices has to be created using admin account by changing to dmitenant?

---

<div class="post-metadata">

**Author:** ![mmamaenko](https://avatars.discourse-cdn.com/v4/letter/m/22d042/32.png) [@mmamaenko](https://forum.opensearch.org/u/mmamaenko)\
**Post date:** [February 21, 2021, 4:54pm UTC](https://forum.opensearch.org/t/multi-tenancy-for-different-indices/5008/11 "2021-02-21T16:54:15Z")

</div>

permissions I mentioned earlier does not allow to create indices. You may adjust them but I don’t know what permissions needs to be added. Indices, visualization, query, dashboards etc are made per tenant. If you do not want to grant too much permissions to users - do it by yourself as admin

---

<div class="post-metadata">

**Author:** ![blason](https://avatars.discourse-cdn.com/v4/letter/b/e68b1a/32.png) [@blason](https://forum.opensearch.org/u/blason)\
**Post date:** [February 21, 2021, 5:15pm UTC](https://forum.opensearch.org/t/multi-tenancy-for-different-indices/5008/12 "2021-02-21T17:15:11Z")

</div>

Agree and that has resolved the issue!! Thanks for the help man.
