You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ranger.apache.org by GitBox <gi...@apache.org> on 2022/10/05 20:00:48 UTC

[GitHub] [ranger] sumannewton opened a new pull request, #177: RANGER-3938: Fix for ranger audits in case of an alias

sumannewton opened a new pull request, #177:
URL: https://github.com/apache/ranger/pull/177

   Lets say for ranger audit, we configure an elasticsearch alias(rollover alias). And if there are 2 or more indices for an alias then audit API doesn't work. Because while fetching the records, ranger uses multi get request on an alias. 
   It results in below error:
   ```
   Alias [alias-name] has more than one indices associated with it [[index-000002, index-000001]], can't execute a single index op
   ```
   
   [Code snippet](https://github.com/apache/ranger/blob/6c8a142881896f2c6d1696bcee02c401867a45f9/security-admin/src/main/java/org/apache/ranger/elasticsearch/ElasticSearchUtil.java#L175-L180):
   ```
           MultiGetRequest multiGetRequest = new MultiGetRequest();
           for (SearchHit hit : hits) {
               MultiGetRequest.Item item = new MultiGetRequest.Item(index, null, hit.getId());
               item.fetchSourceContext(FetchSourceContext.FETCH_SOURCE);
               multiGetRequest.add(item);
           }
   ```
   
   So there can be 2 possible approaches to resolve this:
   
   - #### Approach 1(Quick and fast) [THIS MERGE REQUEST HAS THIS FIX]:
   Use hit.getIndex() instead of index(in this case its has alias) for a MultiGetRequest.Item object.
   So that all the documents can be get by id with its index only instead of alias.
   
   - #### Approach 2(Change the MultiGet to search) [NOT PART OF THIS MERGE REQUEST]:
   ```
   POST /_search
   {
       "query": {
           "ids" : {
               "values" : ["id1", "id2"]
           }
       }
   }
   ```
   
   Please review.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@ranger.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [ranger] mneethiraj commented on pull request #177: RANGER-3938: Fix for ranger audits in case of an alias

Posted by GitBox <gi...@apache.org>.
mneethiraj commented on PR #177:
URL: https://github.com/apache/ranger/pull/177#issuecomment-1274972132

   @acharneski - will you be able to review this fix in Elasticsearch audit module?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@ranger.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [ranger] sumannewton commented on pull request #177: RANGER-3938: Fix for ranger audits in case of an alias

Posted by GitBox <gi...@apache.org>.
sumannewton commented on PR #177:
URL: https://github.com/apache/ranger/pull/177#issuecomment-1265089344

   @mneethiraj @pradeepagrawal8184 Please review.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@ranger.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [ranger] sumannewton closed pull request #177: RANGER-3938: Fix for ranger audits in case of an alias

Posted by GitBox <gi...@apache.org>.
sumannewton closed pull request #177: RANGER-3938: Fix for ranger audits in case of an alias
URL: https://github.com/apache/ranger/pull/177


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@ranger.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org