Re: Review Request 72696: RANGER-2919 : Source policies gets deleted after importing policy with deleteifexists parameter

2020-07-22 Thread Dineshkumar Yadav


> On July 21, 2020, 11:26 p.m., Abhay Kulkarni wrote:
> > security-admin/src/main/java/org/apache/ranger/rest/ServiceREST.java
> > Lines 2320 (patched)
> > 
> >
> > line #2325 is called with policies that belong to services that are in 
> > the destinationServices (the policies that are added to 
> > existingTargetPolicies in line #2320).

changed the approach.


- Dineshkumar


---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/72696/#review221301
---


On July 23, 2020, 6:47 a.m., Dineshkumar Yadav wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/72696/
> ---
> 
> (Updated July 23, 2020, 6:47 a.m.)
> 
> 
> Review request for ranger, Ankita Sinha, Gautam Borad, Kishor Gollapalliwar, 
> Abhay Kulkarni, Madhan Neethiraj, Mehul Parikh, Pradeep Agrawal, and 
> Velmurugan Periasamy.
> 
> 
> Repository: ranger
> 
> 
> Description
> ---
> 
> source policy is getting deleted while importing policy with deleteifexists 
> parameter
> 
> 
> Diffs
> -
> 
>   security-admin/src/main/java/org/apache/ranger/rest/ServiceREST.java 
> 18abc2958 
> 
> 
> Diff: https://reviews.apache.org/r/72696/diff/4/
> 
> 
> Testing
> ---
> 
> Steps to Reproduce: 
> 1. Create 2 Hbase service i.e. hbase1 and hbase2, 
> 2. Create some policies in service - hbase1
> 3. perform policy import from source service - hbase1 to target service - 
> hbase2
> 4. Policies from service - hbase1 gets successfully imported to service - 
> hbase2 as per deleteifexist parameter feature
> 5. After import, Policies from source service - hbase1 also gets deleted
> 
> After patch source service is not getting deleted.
> 
> testing is in progress.
> 
> 
> Thanks,
> 
> Dineshkumar Yadav
> 
>



Re: Review Request 72696: RANGER-2919 : Source policies gets deleted after importing policy with deleteifexists parameter

2020-07-22 Thread Dineshkumar Yadav

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/72696/
---

(Updated July 23, 2020, 6:47 a.m.)


Review request for ranger, Ankita Sinha, Gautam Borad, Kishor Gollapalliwar, 
Abhay Kulkarni, Madhan Neethiraj, Mehul Parikh, Pradeep Agrawal, and Velmurugan 
Periasamy.


Changes
---

change the param name  PARAM_IMPORT_IN_PROGRESS = "importInProgress";


Repository: ranger


Description
---

source policy is getting deleted while importing policy with deleteifexists 
parameter


Diffs (updated)
-

  security-admin/src/main/java/org/apache/ranger/rest/ServiceREST.java 
18abc2958 


Diff: https://reviews.apache.org/r/72696/diff/4/

Changes: https://reviews.apache.org/r/72696/diff/3-4/


Testing
---

Steps to Reproduce: 
1. Create 2 Hbase service i.e. hbase1 and hbase2, 
2. Create some policies in service - hbase1
3. perform policy import from source service - hbase1 to target service - hbase2
4. Policies from service - hbase1 gets successfully imported to service - 
hbase2 as per deleteifexist parameter feature
5. After import, Policies from source service - hbase1 also gets deleted

After patch source service is not getting deleted.

testing is in progress.


Thanks,

Dineshkumar Yadav



Re: Review Request 72696: RANGER-2919 : Source policies gets deleted after importing policy with deleteifexists parameter

2020-07-22 Thread Pradeep Agrawal

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/72696/#review221320
---




security-admin/src/main/java/org/apache/ranger/rest/ServiceREST.java
Lines 1666 (patched)


i think you can just make use of deleteifexists parameter only, pass it as 
false or remove that parameter from import policy call. no need to use another 
parameter. if you have any specific use case then please share. also update the 
problem statement with an example.


- Pradeep Agrawal


On July 22, 2020, 3:06 p.m., Dineshkumar Yadav wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/72696/
> ---
> 
> (Updated July 22, 2020, 3:06 p.m.)
> 
> 
> Review request for ranger, Ankita Sinha, Gautam Borad, Kishor Gollapalliwar, 
> Abhay Kulkarni, Madhan Neethiraj, Mehul Parikh, Pradeep Agrawal, and 
> Velmurugan Periasamy.
> 
> 
> Repository: ranger
> 
> 
> Description
> ---
> 
> source policy is getting deleted while importing policy with deleteifexists 
> parameter
> 
> 
> Diffs
> -
> 
>   security-admin/src/main/java/org/apache/ranger/rest/ServiceREST.java 
> 18abc2958 
> 
> 
> Diff: https://reviews.apache.org/r/72696/diff/3/
> 
> 
> Testing
> ---
> 
> Steps to Reproduce: 
> 1. Create 2 Hbase service i.e. hbase1 and hbase2, 
> 2. Create some policies in service - hbase1
> 3. perform policy import from source service - hbase1 to target service - 
> hbase2
> 4. Policies from service - hbase1 gets successfully imported to service - 
> hbase2 as per deleteifexist parameter feature
> 5. After import, Policies from source service - hbase1 also gets deleted
> 
> After patch source service is not getting deleted.
> 
> testing is in progress.
> 
> 
> Thanks,
> 
> Dineshkumar Yadav
> 
>



Re: Review Request 72696: RANGER-2919 : Source policies gets deleted after importing policy with deleteifexists parameter

2020-07-22 Thread Dineshkumar Yadav


> On July 22, 2020, 3:22 p.m., Madhan Neethiraj wrote:
> > security-admin/src/main/java/org/apache/ranger/rest/ServiceREST.java
> > Lines 2351 (patched)
> > 
> >
> > - what is the service name in 'policies'? Wouldn't it be the name of 
> > the source-service name? If yes, wouldn't 
> > deleteExactMatchPolicyForResource() will delete the matching policies in 
> > source-service?
> > - instead of introducing a new parameter, PARAM_POLICIES_DELETED, 
> > wouldn't it be simpler to reset PARAM_DELETE_IF_EXISTS?

1. at line #1351 the service name in policies is target service name. which is 
got set at line #2344 policiesMap = svcStore.createPolicyMap()
2. PARAM_DELETE_IF_EXISTS is request parameter which is used in method 
createPolicesBasedOnPolicyMap() for further processing which is called at 
#2356, resetting it may impact the functionality.
3. It won't be allowed easily to modify request parameter values once the 
request has begun processing.


- Dineshkumar


---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/72696/#review221313
---


On July 22, 2020, 3:06 p.m., Dineshkumar Yadav wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/72696/
> ---
> 
> (Updated July 22, 2020, 3:06 p.m.)
> 
> 
> Review request for ranger, Ankita Sinha, Gautam Borad, Kishor Gollapalliwar, 
> Abhay Kulkarni, Madhan Neethiraj, Mehul Parikh, Pradeep Agrawal, and 
> Velmurugan Periasamy.
> 
> 
> Repository: ranger
> 
> 
> Description
> ---
> 
> source policy is getting deleted while importing policy with deleteifexists 
> parameter
> 
> 
> Diffs
> -
> 
>   security-admin/src/main/java/org/apache/ranger/rest/ServiceREST.java 
> 18abc2958 
> 
> 
> Diff: https://reviews.apache.org/r/72696/diff/3/
> 
> 
> Testing
> ---
> 
> Steps to Reproduce: 
> 1. Create 2 Hbase service i.e. hbase1 and hbase2, 
> 2. Create some policies in service - hbase1
> 3. perform policy import from source service - hbase1 to target service - 
> hbase2
> 4. Policies from service - hbase1 gets successfully imported to service - 
> hbase2 as per deleteifexist parameter feature
> 5. After import, Policies from source service - hbase1 also gets deleted
> 
> After patch source service is not getting deleted.
> 
> testing is in progress.
> 
> 
> Thanks,
> 
> Dineshkumar Yadav
> 
>



Re: Review Request 72696: RANGER-2919 : Source policies gets deleted after importing policy with deleteifexists parameter

2020-07-22 Thread Madhan Neethiraj

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/72696/#review221313
---




security-admin/src/main/java/org/apache/ranger/rest/ServiceREST.java
Lines 2351 (patched)


- what is the service name in 'policies'? Wouldn't it be the name of the 
source-service name? If yes, wouldn't deleteExactMatchPolicyForResource() will 
delete the matching policies in source-service?
- instead of introducing a new parameter, PARAM_POLICIES_DELETED, wouldn't 
it be simpler to reset PARAM_DELETE_IF_EXISTS?


- Madhan Neethiraj


On July 22, 2020, 3:06 p.m., Dineshkumar Yadav wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/72696/
> ---
> 
> (Updated July 22, 2020, 3:06 p.m.)
> 
> 
> Review request for ranger, Ankita Sinha, Gautam Borad, Kishor Gollapalliwar, 
> Abhay Kulkarni, Madhan Neethiraj, Mehul Parikh, Pradeep Agrawal, and 
> Velmurugan Periasamy.
> 
> 
> Repository: ranger
> 
> 
> Description
> ---
> 
> source policy is getting deleted while importing policy with deleteifexists 
> parameter
> 
> 
> Diffs
> -
> 
>   security-admin/src/main/java/org/apache/ranger/rest/ServiceREST.java 
> 18abc2958 
> 
> 
> Diff: https://reviews.apache.org/r/72696/diff/3/
> 
> 
> Testing
> ---
> 
> Steps to Reproduce: 
> 1. Create 2 Hbase service i.e. hbase1 and hbase2, 
> 2. Create some policies in service - hbase1
> 3. perform policy import from source service - hbase1 to target service - 
> hbase2
> 4. Policies from service - hbase1 gets successfully imported to service - 
> hbase2 as per deleteifexist parameter feature
> 5. After import, Policies from source service - hbase1 also gets deleted
> 
> After patch source service is not getting deleted.
> 
> testing is in progress.
> 
> 
> Thanks,
> 
> Dineshkumar Yadav
> 
>



Re: Review Request 72696: RANGER-2919 : Source policies gets deleted after importing policy with deleteifexists parameter

2020-07-22 Thread Dineshkumar Yadav

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/72696/
---

(Updated July 22, 2020, 3:06 p.m.)


Review request for ranger, Ankita Sinha, Gautam Borad, Kishor Gollapalliwar, 
Abhay Kulkarni, Madhan Neethiraj, Mehul Parikh, Pradeep Agrawal, and Velmurugan 
Periasamy.


Changes
---

handled scenario for null object


Repository: ranger


Description
---

source policy is getting deleted while importing policy with deleteifexists 
parameter


Diffs (updated)
-

  security-admin/src/main/java/org/apache/ranger/rest/ServiceREST.java 
18abc2958 


Diff: https://reviews.apache.org/r/72696/diff/3/

Changes: https://reviews.apache.org/r/72696/diff/2-3/


Testing
---

Steps to Reproduce: 
1. Create 2 Hbase service i.e. hbase1 and hbase2, 
2. Create some policies in service - hbase1
3. perform policy import from source service - hbase1 to target service - hbase2
4. Policies from service - hbase1 gets successfully imported to service - 
hbase2 as per deleteifexist parameter feature
5. After import, Policies from source service - hbase1 also gets deleted

After patch source service is not getting deleted.

testing is in progress.


Thanks,

Dineshkumar Yadav



Re: Review Request 72696: RANGER-2919 : Source policies gets deleted after importing policy with deleteifexists parameter

2020-07-22 Thread Dineshkumar Yadav


> On July 21, 2020, 11:26 p.m., Abhay Kulkarni wrote:
> > security-admin/src/main/java/org/apache/ranger/rest/ServiceREST.java
> > Lines 2325 (patched)
> > 
> >
> > Problem: if deleteIfExists parameter is set to 'true' then the policies 
> > selected for copying over to destination service are deleted from source 
> > service.

changed the code


- Dineshkumar


---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/72696/#review221301
---


On July 22, 2020, 1:14 p.m., Dineshkumar Yadav wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/72696/
> ---
> 
> (Updated July 22, 2020, 1:14 p.m.)
> 
> 
> Review request for ranger, Ankita Sinha, Gautam Borad, Kishor Gollapalliwar, 
> Abhay Kulkarni, Madhan Neethiraj, Mehul Parikh, Pradeep Agrawal, and 
> Velmurugan Periasamy.
> 
> 
> Repository: ranger
> 
> 
> Description
> ---
> 
> source policy is getting deleted while importing policy with deleteifexists 
> parameter
> 
> 
> Diffs
> -
> 
>   security-admin/src/main/java/org/apache/ranger/rest/ServiceREST.java 
> 18abc2958 
> 
> 
> Diff: https://reviews.apache.org/r/72696/diff/2/
> 
> 
> Testing
> ---
> 
> Steps to Reproduce: 
> 1. Create 2 Hbase service i.e. hbase1 and hbase2, 
> 2. Create some policies in service - hbase1
> 3. perform policy import from source service - hbase1 to target service - 
> hbase2
> 4. Policies from service - hbase1 gets successfully imported to service - 
> hbase2 as per deleteifexist parameter feature
> 5. After import, Policies from source service - hbase1 also gets deleted
> 
> After patch source service is not getting deleted.
> 
> testing is in progress.
> 
> 
> Thanks,
> 
> Dineshkumar Yadav
> 
>



Re: Review Request 72696: RANGER-2919 : Source policies gets deleted after importing policy with deleteifexists parameter

2020-07-22 Thread Dineshkumar Yadav


> On July 21, 2020, 4:21 p.m., Madhan Neethiraj wrote:
> > security-admin/src/main/java/org/apache/ranger/rest/ServiceREST.java
> > Lines 2320 (patched)
> > 
> >
> > What is the serviceName in rangerPolicy? Wouldn't it be same as the 
> > source-serviceName? If yes, how does #2325 avoid deleting the policies 
> > (that match the resource) in the source-service?
> > 
> > I suggest to send servicesMappingMap as an argument to 
> > deleteExactMatchPolicyForResource() (like #2328), and update 
> > deleteExactMatchPolicyForResource() to look for matching policies in the 
> > target-service name i.e. ignore the service-name given in policies.

Changed the code, There is already code at #2344 svcStore.createPolicyMap(), 
which is changing the policy service name and zone name to targeted service 
name and zone name. I have called the deleteExactMatchPolicyForResource() 
method after that.


- Dineshkumar


---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/72696/#review221288
---


On July 22, 2020, 1:14 p.m., Dineshkumar Yadav wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/72696/
> ---
> 
> (Updated July 22, 2020, 1:14 p.m.)
> 
> 
> Review request for ranger, Ankita Sinha, Gautam Borad, Kishor Gollapalliwar, 
> Abhay Kulkarni, Madhan Neethiraj, Mehul Parikh, Pradeep Agrawal, and 
> Velmurugan Periasamy.
> 
> 
> Repository: ranger
> 
> 
> Description
> ---
> 
> source policy is getting deleted while importing policy with deleteifexists 
> parameter
> 
> 
> Diffs
> -
> 
>   security-admin/src/main/java/org/apache/ranger/rest/ServiceREST.java 
> 18abc2958 
> 
> 
> Diff: https://reviews.apache.org/r/72696/diff/2/
> 
> 
> Testing
> ---
> 
> Steps to Reproduce: 
> 1. Create 2 Hbase service i.e. hbase1 and hbase2, 
> 2. Create some policies in service - hbase1
> 3. perform policy import from source service - hbase1 to target service - 
> hbase2
> 4. Policies from service - hbase1 gets successfully imported to service - 
> hbase2 as per deleteifexist parameter feature
> 5. After import, Policies from source service - hbase1 also gets deleted
> 
> After patch source service is not getting deleted.
> 
> testing is in progress.
> 
> 
> Thanks,
> 
> Dineshkumar Yadav
> 
>



Re: Review Request 72696: RANGER-2919 : Source policies gets deleted after importing policy with deleteifexists parameter

2020-07-22 Thread Dineshkumar Yadav


> On July 22, 2020, 9:12 a.m., Pradeep Agrawal wrote:
> > security-admin/src/main/java/org/apache/ranger/rest/ServiceREST.java
> > Lines 2325 (patched)
> > 
> >
> > @Dinesh:
> > 
> > After understanding the problem now and comments from Abhay and Madhan. 
> > I have attached a patch in the Jira please try that and optimize if 
> > possible. 
> > 
> > Also test below use cases:
> > 
> > 1) what if a single policy json has mapping like this:
> > service1(source) is mapped to service2(target)
> > service2(source) is mapped to service1(target)
> > 
> > 2) what if policy json is updated first with target service name by 
> > someone manually and then imported.

Thanks Pradeep, There is already code at #2344 svcStore.createPolicyMap(), 
which is changing the policy service name and zone name to targeted service 
name and zone name.


- Dineshkumar


---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/72696/#review221309
---


On July 22, 2020, 1:14 p.m., Dineshkumar Yadav wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/72696/
> ---
> 
> (Updated July 22, 2020, 1:14 p.m.)
> 
> 
> Review request for ranger, Ankita Sinha, Gautam Borad, Kishor Gollapalliwar, 
> Abhay Kulkarni, Madhan Neethiraj, Mehul Parikh, Pradeep Agrawal, and 
> Velmurugan Periasamy.
> 
> 
> Repository: ranger
> 
> 
> Description
> ---
> 
> source policy is getting deleted while importing policy with deleteifexists 
> parameter
> 
> 
> Diffs
> -
> 
>   security-admin/src/main/java/org/apache/ranger/rest/ServiceREST.java 
> 18abc2958 
> 
> 
> Diff: https://reviews.apache.org/r/72696/diff/2/
> 
> 
> Testing
> ---
> 
> Steps to Reproduce: 
> 1. Create 2 Hbase service i.e. hbase1 and hbase2, 
> 2. Create some policies in service - hbase1
> 3. perform policy import from source service - hbase1 to target service - 
> hbase2
> 4. Policies from service - hbase1 gets successfully imported to service - 
> hbase2 as per deleteifexist parameter feature
> 5. After import, Policies from source service - hbase1 also gets deleted
> 
> After patch source service is not getting deleted.
> 
> testing is in progress.
> 
> 
> Thanks,
> 
> Dineshkumar Yadav
> 
>



Re: Review Request 72696: RANGER-2919 : Source policies gets deleted after importing policy with deleteifexists parameter

2020-07-22 Thread Dineshkumar Yadav

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/72696/
---

(Updated July 22, 2020, 1:14 p.m.)


Review request for ranger, Ankita Sinha, Gautam Borad, Kishor Gollapalliwar, 
Abhay Kulkarni, Madhan Neethiraj, Mehul Parikh, Pradeep Agrawal, and Velmurugan 
Periasamy.


Changes
---

changes approach for deleting target source if deleteIfExists present


Repository: ranger


Description
---

source policy is getting deleted while importing policy with deleteifexists 
parameter


Diffs (updated)
-

  security-admin/src/main/java/org/apache/ranger/rest/ServiceREST.java 
18abc2958 


Diff: https://reviews.apache.org/r/72696/diff/2/

Changes: https://reviews.apache.org/r/72696/diff/1-2/


Testing (updated)
---

Steps to Reproduce: 
1. Create 2 Hbase service i.e. hbase1 and hbase2, 
2. Create some policies in service - hbase1
3. perform policy import from source service - hbase1 to target service - hbase2
4. Policies from service - hbase1 gets successfully imported to service - 
hbase2 as per deleteifexist parameter feature
5. After import, Policies from source service - hbase1 also gets deleted

After patch source service is not getting deleted.

testing is in progress.


Thanks,

Dineshkumar Yadav



Review Request 72701: RANGER-2917: Avoid recursive audit log in ES Plugin by user elasticsearch when plugin is enabled for ranger_audits index

2020-07-22 Thread Pradeep Agrawal

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/72701/
---

Review request for ranger.


Bugs: RANGER-2917
https://issues.apache.org/jira/browse/RANGER-2917


Repository: ranger


Description
---

**Problem Statement:** When Elasticsearch Plugin in enabled in the index 
"ranger_audits" ( ranger's audit log index), there will be recursive audit log 
getting generated for audits logs that are getting in this collection.


**Proposed Solution:** [Solution is inspired from RANGER-2564 which has similar 
implementation for solr]

1) Avoid recursive audit log done by service user "elasticsearch" in the 
ranger_audit index.

2) Introduce a optional configuration parameter to add service users to exclude 
from audit log for "ranger_audit" index. This is in case if customer users are 
used as service user in Elasticsearch process.


Diffs
-

  
plugin-elasticsearch/src/main/java/org/apache/ranger/authorization/elasticsearch/authorizer/RangerElasticsearchAuditHandler.java
 PRE-CREATION 
  
plugin-elasticsearch/src/main/java/org/apache/ranger/authorization/elasticsearch/authorizer/RangerElasticsearchAuthorizer.java
 e72a15858 


Diff: https://reviews.apache.org/r/72701/diff/1/


Testing
---

Testing done enabling the Elastic search Plugin in ranger_audits index.


Thanks,

Pradeep Agrawal



[jira] [Updated] (RANGER-2917) Avoid recursive audit log in ES Plugin by user elasticsearch when plugin is enabled for ranger_audits index

2020-07-22 Thread Pradeep Agrawal (Jira)


 [ 
https://issues.apache.org/jira/browse/RANGER-2917?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Pradeep Agrawal updated RANGER-2917:

Description: 
Avoid recursive audit log in Elasticsearch Plugin by user "elasticsearch" when 
plugin is enabled for ranger_audit index.

When Elasticsearch Plugin in enabled in the index "ranger_audits" ( ranger's 
audit log index), there will be recursive audit log getting generated for 
audits logs that are getting in this collection.

This JIRA will address 

1) recursive audit log done by service user "elasticsearch" in the ranger_audit 
index.

2) provide a configuration parameter to add service users to exclude from audit 
log for "ranger_audit" index. This is in case if customer users are used as 
service user in Elasticsearch process.

> Avoid recursive audit log in ES Plugin by user elasticsearch when plugin is 
> enabled for ranger_audits index
> ---
>
> Key: RANGER-2917
> URL: https://issues.apache.org/jira/browse/RANGER-2917
> Project: Ranger
>  Issue Type: Bug
>  Components: Ranger
>Reporter: Pradeep Agrawal
>Assignee: Pradeep Agrawal
>Priority: Major
> Fix For: 2.1.0
>
> Attachments: 
> 0001-RANGER-2917-Avoid-recursive-audit-log-in-ES-Plugin-b.patch
>
>
> Avoid recursive audit log in Elasticsearch Plugin by user "elasticsearch" 
> when plugin is enabled for ranger_audit index.
> When Elasticsearch Plugin in enabled in the index "ranger_audits" ( ranger's 
> audit log index), there will be recursive audit log getting generated for 
> audits logs that are getting in this collection.
> This JIRA will address 
> 1) recursive audit log done by service user "elasticsearch" in the 
> ranger_audit index.
> 2) provide a configuration parameter to add service users to exclude from 
> audit log for "ranger_audit" index. This is in case if customer users are 
> used as service user in Elasticsearch process.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (RANGER-2917) Avoid recursive audit log in ES Plugin by user elasticsearch when plugin is enabled for ranger_audits index

2020-07-22 Thread Pradeep Agrawal (Jira)


 [ 
https://issues.apache.org/jira/browse/RANGER-2917?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Pradeep Agrawal updated RANGER-2917:

Attachment: 0001-RANGER-2917-Avoid-recursive-audit-log-in-ES-Plugin-b.patch

> Avoid recursive audit log in ES Plugin by user elasticsearch when plugin is 
> enabled for ranger_audits index
> ---
>
> Key: RANGER-2917
> URL: https://issues.apache.org/jira/browse/RANGER-2917
> Project: Ranger
>  Issue Type: Bug
>  Components: Ranger
>Reporter: Pradeep Agrawal
>Assignee: Pradeep Agrawal
>Priority: Major
> Attachments: 
> 0001-RANGER-2917-Avoid-recursive-audit-log-in-ES-Plugin-b.patch
>
>




--
This message was sent by Atlassian Jira
(v8.3.4#803005)


Re: Review Request 72696: RANGER-2919 : Source policies gets deleted after importing policy with deleteifexists parameter

2020-07-22 Thread Pradeep Agrawal

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/72696/#review221309
---




security-admin/src/main/java/org/apache/ranger/rest/ServiceREST.java
Lines 2325 (patched)


@Dinesh:

After understanding the problem now and comments from Abhay and Madhan. I 
have attached a patch in the Jira please try that and optimize if possible. 

Also test below use cases:

1) what if a single policy json has mapping like this:
service1(source) is mapped to service2(target)
service2(source) is mapped to service1(target)

2) what if policy json is updated first with target service name by someone 
manually and then imported.


- Pradeep Agrawal


On July 21, 2020, 1:28 p.m., Dineshkumar Yadav wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/72696/
> ---
> 
> (Updated July 21, 2020, 1:28 p.m.)
> 
> 
> Review request for ranger, Ankita Sinha, Gautam Borad, Kishor Gollapalliwar, 
> Abhay Kulkarni, Madhan Neethiraj, Mehul Parikh, Pradeep Agrawal, and 
> Velmurugan Periasamy.
> 
> 
> Repository: ranger
> 
> 
> Description
> ---
> 
> source policy is getting deleted while importing policy with deleteifexists 
> parameter
> 
> 
> Diffs
> -
> 
>   security-admin/src/main/java/org/apache/ranger/rest/ServiceREST.java 
> c795525f2 
> 
> 
> Diff: https://reviews.apache.org/r/72696/diff/1/
> 
> 
> Testing
> ---
> 
> Steps to Reproduce: 
> 1. Create 2 Hbase service i.e. hbase1 and hbase2, 
> 2. Create some policies in service - hbase1
> 3. perform policy import from source service - hbase1 to target service - 
> hbase2
> 4. Policies from service - hbase1 gets successfully imported to service - 
> hbase2 as per deleteifexist parameter feature
> 5. After import, Policies from source service - hbase1 also gets deleted
> 
> After patch source service is not getting deleted.
> 
> 
> Thanks,
> 
> Dineshkumar Yadav
> 
>



[jira] [Updated] (RANGER-2919) Source policies gets deleted after importing policy with deleteifexists parameter

2020-07-22 Thread Pradeep Agrawal (Jira)


 [ 
https://issues.apache.org/jira/browse/RANGER-2919?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Pradeep Agrawal updated RANGER-2919:

Attachment: 0001-RANGER-2919.patch

> Source policies gets deleted after importing policy with deleteifexists 
> parameter
> -
>
> Key: RANGER-2919
> URL: https://issues.apache.org/jira/browse/RANGER-2919
> Project: Ranger
>  Issue Type: Bug
>  Components: Ranger
>Reporter: Dineshkumar Yadav
>Assignee: Dineshkumar Yadav
>Priority: Major
> Attachments: 0001-RANGER-2919.patch
>
>
> Steps to Reproduce: 
> 1. Create 2 Hbase service i.e. hbase1 and hbase2, 
> 2. Create some policies in service - hbase1
> 3. perform policy import from source service - hbase1 to target service - 
> hbase2
> 4. Policies from service - hbase1 gets successfully imported to service - 
> hbase2 as per deleteifexist parameter feature
> 5. After import, Policies from source service - hbase1 also gets deleted



--
This message was sent by Atlassian Jira
(v8.3.4#803005)