# How to hide the index for specific user

**URL:** <https://discuss.elastic.co/t/how-to-hide-the-index-for-specific-user/118262>\
**Category:** Elasticsearch\
**Created:** [February 2, 2018, 5:00pm UTC](https://discuss.elastic.co/t/how-to-hide-the-index-for-specific-user/118262 "2018-02-02T17:00:30Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![srinivas\_patlolla](https://avatars.discourse-cdn.com/v4/letter/s/ccd318/32.png) [@srinivas\_patlolla](https://discuss.elastic.co/u/srinivas_patlolla)\
**Post date:** [February 2, 2018, 5:00pm UTC](https://discuss.elastic.co/t/how-to-hide-the-index-for-specific-user/118262/1 "2018-02-02T17:00:30Z")

</div>

Hi,

I am using ES 5.4 and Kibana 5.4 with xpack. would like to know how i can hide the index to specific user?

Thank you.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [February 2, 2018, 5:33pm UTC](https://discuss.elastic.co/t/how-to-hide-the-index-for-specific-user/118262/2 "2018-02-02T17:33:48Z")

</div>

I think you are looking for [https://www.elastic.co/guide/en/x-pack/current/defining-roles.html#defining-roles](https://www.elastic.co/guide/en/x-pack/current/defining-roles.html#defining-roles)

Which is also available in [Kibana User Management](https://www.elastic.co/guide/en/x-pack/current/defining-roles.html#roles-management-ui) part.

---

<div class="post-metadata">

**Author:** ![srinivas\_patlolla](https://avatars.discourse-cdn.com/v4/letter/s/ccd318/32.png) [@srinivas\_patlolla](https://discuss.elastic.co/u/srinivas_patlolla)\
**Post date:** [February 5, 2018, 4:20pm UTC](https://discuss.elastic.co/t/how-to-hide-the-index-for-specific-user/118262/3 "2018-02-05T16:20:40Z")

</div>

Hi,

Thank you the quick response. I have gone thru the above link but i have come across anything that helps me in achieving my requirement - hiding index for specific user. I see privileges to read, write, delete, index, delete index and create index. do we have anything to deny access to certain index?

Thanks.

---

<div class="post-metadata">

**Author:** ![TimV](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timv/32/13162_2.png) [@TimV](https://discuss.elastic.co/u/TimV)\
**Post date:** [February 6, 2018, 4:06am UTC](https://discuss.elastic.co/t/how-to-hide-the-index-for-specific-user/118262/4 "2018-02-06T04:06:22Z")

</div>

> [@srinivas\_patlolla](#):
>
> do we have anything to deny access to certain index

Just don't grant them access.  
If you assign a user to a role that has "read" access to an index, then the user has access, otherwise they don't have access.  
It's up to you to construct your roles so that users aren't given access to something they shouldn't have.

---

<div class="post-metadata">

**Author:** ![srinivas\_patlolla](https://avatars.discourse-cdn.com/v4/letter/s/ccd318/32.png) [@srinivas\_patlolla](https://discuss.elastic.co/u/srinivas_patlolla)\
**Post date:** [February 6, 2018, 2:27pm UTC](https://discuss.elastic.co/t/how-to-hide-the-index-for-specific-user/118262/5 "2018-02-06T14:27:23Z")

</div>

Thanks Tim.  
I agree for the above statement but what am i looking for is to restrict some user to some indices.  
For Example:  
User1 should be able to see Index1 only and user2 , index2 only in the same instance.

---

<div class="post-metadata">

**Author:** ![TimV](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timv/32/13162_2.png) [@TimV](https://discuss.elastic.co/u/TimV)\
**Post date:** [February 6, 2018, 11:59pm UTC](https://discuss.elastic.co/t/how-to-hide-the-index-for-specific-user/118262/6 "2018-02-06T23:59:28Z")

</div>

I think I must be missing something about your question, because that looks like a straight forward use of roles.

You create:

- user: `"user1"` with roles `["read-index1"]`
- user: `"user2"` with roles `["read-index2"]`
- role: `"read-index1"` with index privileges: `{"names":["index1"], "privileges":["read"]}`
- role: `"read-index2"` with index privileges: `{"names":["index2"], "privileges":["read"]}`

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 6, 2018, 11:59pm UTC](https://discuss.elastic.co/t/how-to-hide-the-index-for-specific-user/118262/7 "2018-03-06T23:59:29Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
