indices rule - Index not found scenario
Examples:
Let's assume that our ES cluster has 2 indices:
index_a
andindex_b
. At the same time we have two users:userA
anduserB
. We'd like to giveuserA
access to indexindex_a
, anduserB
toindex_b
.userA
should not see or be even aware ofindex_b
and vice versa. We'd like to give each of them a feeling that they are alone on the cluster.ROR
readonlyrest.yml
configuration may look like this:We can test if
userA
is able to reachindex_a
:It looks like he is. So far, so good. Let's try to access nonexistent index (we know, that index with name
nonexistent
for sure doesn't exist on our cluster):The response is pretty straight forward - the index doesn't exist. But, let's see what happens, when the same user,
userA
, will try to getindex_b
:As we can see
userA
is not able to getindex_b
. But the response is HTTP 404 Not Found - it means that the index doesn't exist.So, the response is the same as we get if the called index really doesn't exist. Thanks to the described behaviour,
userA
is not aware that on the cluster there are any other indices but the ones he was given access to.note:
Careful reader may notice that, in example above,
userA
was gettingindex_b
, but the response says that there is noindex_b_ROR_QcskliAl8Aindex_b_ROR_QcskliAl8A
index. It's the trick ROR does to fool ES and be sure that asking index, which the user should not be allowed to see, won't be reached by him.But we should also consider the other case - using an index name with wildcard. So,
userA
will try to get all indices which names matchindex*
pattern:Response is exactly like we'd expect - only
index_a
was returned. But what if nothing matches our index name pattern?Response is empty list. Now, let's see what happens when an index name pattern matches an index which is not authorized for a user who asks about it.
As we see, response is the same as we have experienced when there was really no index matching the pattern. Also here a user has a feeling that only his indices are present on a cluster.
Last updated