Hi Rakesh,
I’m not 100% sure if I understand your wording correctly, what exactly do you mean by “application” and “tenant”? But let me give it a try:
I assume that you have one index which contains documents from Application A, Application B etc. Some users should get access to documents from Applcation A, others to documents from Application B, and others should get access to both, correct? I’m also assuming that you do not use the document type feature of ES to distinguish between those data, but instead you have some field in your documents which defines to which application it belongs.
For this scenario, you need to set up different roles and apply a DLS query which grants access to only certain documents. So, let’s say your index is called “applicationdata”, and you have a field called “application” in each document, which can contain either applicationA or applicationB, you would set up the roles like this:
roleA:
…
indices:
‘applicationdata’:
‘*’:
- CRUD
dls: ‘{ “bool”: { “must”: { “match”: { “application”: “applicationA” }}}}’
``
roleB:
…
indices:
‘applicationdata’:
‘*’:
- CRUD
dls: ‘{ “bool”: { “must”: { “match”: { “application”: “applicationB” }}}}’
``
Users in roleA only see documents where the “application” field equals applicationA. Users in roleB only see documents where the “application” field equals applicationB. Users in both roleA and roleB see both.
There’s also a blog post about DLS/FLS with some examples:
https://floragunn.com/document-field-level-security-search-guard/
And of course also read the DLS/FLS docs:
https://github.com/floragunncom/search-guard-docs/blob/master/dlsfls.md
···
On Thursday, May 25, 2017 at 11:53:57 PM UTC+2, Rakesh wrote:
Hi,
We have multiple users in each tenant. Each user belongs one or more applications. Each application has unique application ID which is available in logs. We want to present the users the application data they belong to.
For example:
User 1 is part of application A in Developer tenant. User 1 should be able to see only Application A data.
User 2 is part of application B in Developer tenant. User 2 should be able to see only Application B data.
User 3 is part of application A and B in Developer tenant. User 3 should be able to see data for both Application A and Application B.
Is it possible with SearchGuard DLSFLS. It would be great if you can provide example.
Thanks,
Rakesh