[jira] [Created] (RANGER-3418) Rotated Ranger admin access logs aren't getting removed

2021-09-15 Thread Vishal Suvagia (Jira)
Vishal Suvagia created RANGER-3418:
--

 Summary: Rotated Ranger admin access logs aren't getting removed
 Key: RANGER-3418
 URL: https://issues.apache.org/jira/browse/RANGER-3418
 Project: Ranger
  Issue Type: Improvement
  Components: admin, Ranger
Affects Versions: 3.0.0, 2.1.1
Reporter: Vishal Suvagia
Assignee: Vishal Suvagia


{color:#172b4d}Ranger admin access logs in the configured log directory aren't 
removed and keeps up utilizing unused space. Need to have access logs 
configurable to have older logs purged.
{color}



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


[jira] [Closed] (RANGER-3412) PolicyRefresher does not work

2021-09-15 Thread lwyang (Jira)


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

lwyang closed RANGER-3412.
--

> PolicyRefresher does not work
> -
>
> Key: RANGER-3412
> URL: https://issues.apache.org/jira/browse/RANGER-3412
> Project: Ranger
>  Issue Type: Bug
>  Components: plugins
>Affects Versions: 2.1.0
>Reporter: lwyang
>Priority: Critical
>
> When {{PolicyRefresher.run()}} method throws an exception, PolicyRefresher 
> does not work
>  
> {{PolicyRefresher.run }}throws an SocketException, then the PolicyRefresher 
> thread exit,  policy will not be updated anymore
>  
> 2021-09-13,15:58:57,137 ERROR org.apache.ranger.plugin.util.PolicyRefresher: 
> PolicyRefresher(serviceName=misql-chnbj): failed to refresh policies. Will 
> continue to use last known version of policies (61944) 
> submarine_spark_ranger_project.com.sun.jersey.api.client.ClientHandlerException:
>  java.net.SocketException: Connection reset  at 
> submarine_spark_ranger_project.com.sun.jersey.api.client.ClientResponse.getEntity(ClientResponse.java:644)
>   at 
> submarine_spark_ranger_project.com.sun.jersey.api.client.ClientResponse.getEntity(ClientResponse.java:586)
>   at 
> org.apache.ranger.admin.client.RangerAdminRESTClient.getServicePoliciesIfUpdated(RangerAdminRESTClient.java:191)
>   at 
> org.apache.ranger.plugin.util.PolicyRefresher.loadPolicyfromPolicyAdmin(PolicyRefresher.java:306)
>   at 
> org.apache.ranger.plugin.util.PolicyRefresher.loadPolicy(PolicyRefresher.java:246)
>   at 
> org.apache.ranger.plugin.util.PolicyRefresher.run(PolicyRefresher.java:208) 
> Caused by: java.net.SocketException: Connection reset  at 
> java.net.SocketInputStream.read(SocketInputStream.java:210)  at 
> java.net.SocketInputStream.read(SocketInputStream.java:141)  at 
> java.io.BufferedInputStream.fill(BufferedInputStream.java:246)  at 
> java.io.BufferedInputStream.read1(BufferedInputStream.java:286)  at 
> java.io.BufferedInputStream.read(BufferedInputStream.java:345)  at 
> sun.net.www.http.ChunkedInputStream.fastRead(ChunkedInputStream.java:244)  at 
> sun.net.www.http.ChunkedInputStream.read(ChunkedInputStream.java:689)  at 
> java.io.FilterInputStream.read(FilterInputStream.java:133)  at 
> sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(HttpURLConnection.java:3444)



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


[jira] [Resolved] (RANGER-3412) PolicyRefresher does not work

2021-09-15 Thread lwyang (Jira)


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

lwyang resolved RANGER-3412.

Resolution: Not A Problem

> PolicyRefresher does not work
> -
>
> Key: RANGER-3412
> URL: https://issues.apache.org/jira/browse/RANGER-3412
> Project: Ranger
>  Issue Type: Bug
>  Components: plugins
>Affects Versions: 2.1.0
>Reporter: lwyang
>Priority: Critical
>
> When {{PolicyRefresher.run()}} method throws an exception, PolicyRefresher 
> does not work
>  
> {{PolicyRefresher.run }}throws an SocketException, then the PolicyRefresher 
> thread exit,  policy will not be updated anymore
>  
> 2021-09-13,15:58:57,137 ERROR org.apache.ranger.plugin.util.PolicyRefresher: 
> PolicyRefresher(serviceName=misql-chnbj): failed to refresh policies. Will 
> continue to use last known version of policies (61944) 
> submarine_spark_ranger_project.com.sun.jersey.api.client.ClientHandlerException:
>  java.net.SocketException: Connection reset  at 
> submarine_spark_ranger_project.com.sun.jersey.api.client.ClientResponse.getEntity(ClientResponse.java:644)
>   at 
> submarine_spark_ranger_project.com.sun.jersey.api.client.ClientResponse.getEntity(ClientResponse.java:586)
>   at 
> org.apache.ranger.admin.client.RangerAdminRESTClient.getServicePoliciesIfUpdated(RangerAdminRESTClient.java:191)
>   at 
> org.apache.ranger.plugin.util.PolicyRefresher.loadPolicyfromPolicyAdmin(PolicyRefresher.java:306)
>   at 
> org.apache.ranger.plugin.util.PolicyRefresher.loadPolicy(PolicyRefresher.java:246)
>   at 
> org.apache.ranger.plugin.util.PolicyRefresher.run(PolicyRefresher.java:208) 
> Caused by: java.net.SocketException: Connection reset  at 
> java.net.SocketInputStream.read(SocketInputStream.java:210)  at 
> java.net.SocketInputStream.read(SocketInputStream.java:141)  at 
> java.io.BufferedInputStream.fill(BufferedInputStream.java:246)  at 
> java.io.BufferedInputStream.read1(BufferedInputStream.java:286)  at 
> java.io.BufferedInputStream.read(BufferedInputStream.java:345)  at 
> sun.net.www.http.ChunkedInputStream.fastRead(ChunkedInputStream.java:244)  at 
> sun.net.www.http.ChunkedInputStream.read(ChunkedInputStream.java:689)  at 
> java.io.FilterInputStream.read(FilterInputStream.java:133)  at 
> sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(HttpURLConnection.java:3444)



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


Re: Review Request 73545: RANGER-3371: Addendum patch to add serviceType in policy json

2021-09-15 Thread Pradeep Agrawal


> On Sept. 15, 2021, 2:51 p.m., Madhan Neethiraj wrote:
> > security-admin/src/main/java/org/apache/ranger/service/RangerPolicyServiceBase.java
> > Lines 105 (patched)
> > 
> >
> > To avoid retrieval of entire XXServiceDef object for each policy, 
> > consider getting serviceType with the following call:
> >   String serviceType = 
> > daoMgr.getXXServiceDef().findServiceDefTypeByServiceId(xService.getId());
> > 
> > 
> > Alternately, consider adding method 
> > XXServiceDefDao.findServiceDefTypeByServiceDefId(), and use it here:
> >   String serviceType = 
> > daoMgr.getXXServiceDef().findServiceDefTypeByServiceDefId(xService.getType());

Thanks for the review. As the proposed patch is already committed i will 
address your suggestion in a separate jira.


- Pradeep


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


On Sept. 14, 2021, 4:37 p.m., Pradeep Agrawal wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/73545/
> ---
> 
> (Updated Sept. 14, 2021, 4:37 p.m.)
> 
> 
> Review request for ranger and Abhay Kulkarni.
> 
> 
> Bugs: RANGER-3371
> https://issues.apache.org/jira/browse/RANGER-3371
> 
> 
> Repository: ranger
> 
> 
> Description
> ---
> 
> **Problem Statement:** While saving policy object to json string, serviceType 
> is not being stored with policy json.
> Due to this delta policies validation(RangerPolicyDeltaUtil.isValidDeltas()) 
> fails and delta policies are not returned, Since delta policy result is empty 
> ranger is fetching all ranger policies.
> 
> **Proposed Solution:** Before converting policy object to json string, 
> serviceType field of the policy object can be updated, so that during the 
> object to json conversion serviceType field value is also added in policy 
> json.
> 
> 
> Diffs
> -
> 
>   security-admin/src/main/java/org/apache/ranger/db/XXPolicyChangeLogDao.java 
> 16aaf306c 
>   
> security-admin/src/main/java/org/apache/ranger/service/RangerPolicyServiceBase.java
>  7ee829276 
>   
> security-admin/src/test/java/org/apache/ranger/service/TestRangerPolicyServiceBase.java
>  ff8e90825 
> 
> 
> Diff: https://reviews.apache.org/r/73545/diff/3/
> 
> 
> Testing
> ---
> 
> With patch, tested policy creation and serviceType field and its value is 
> added in the policy text for the respective policy.
> Further checked the delta policy and validation is passing.
> 
> 
> Thanks,
> 
> Pradeep Agrawal
> 
>



Re: Review Request 73545: RANGER-3371: Addendum patch to add serviceType in policy json

2021-09-15 Thread Madhan Neethiraj

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




security-admin/src/main/java/org/apache/ranger/service/RangerPolicyServiceBase.java
Lines 105 (patched)


To avoid retrieval of entire XXServiceDef object for each policy, consider 
getting serviceType with the following call:
  String serviceType = 
daoMgr.getXXServiceDef().findServiceDefTypeByServiceId(xService.getId());

Alternately, consider adding method 
XXServiceDefDao.findServiceDefTypeByServiceDefId(), and use it here:
  String serviceType = 
daoMgr.getXXServiceDef().findServiceDefTypeByServiceDefId(xService.getType());


- Madhan Neethiraj


On Sept. 14, 2021, 4:37 p.m., Pradeep Agrawal wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/73545/
> ---
> 
> (Updated Sept. 14, 2021, 4:37 p.m.)
> 
> 
> Review request for ranger and Abhay Kulkarni.
> 
> 
> Bugs: RANGER-3371
> https://issues.apache.org/jira/browse/RANGER-3371
> 
> 
> Repository: ranger
> 
> 
> Description
> ---
> 
> **Problem Statement:** While saving policy object to json string, serviceType 
> is not being stored with policy json.
> Due to this delta policies validation(RangerPolicyDeltaUtil.isValidDeltas()) 
> fails and delta policies are not returned, Since delta policy result is empty 
> ranger is fetching all ranger policies.
> 
> **Proposed Solution:** Before converting policy object to json string, 
> serviceType field of the policy object can be updated, so that during the 
> object to json conversion serviceType field value is also added in policy 
> json.
> 
> 
> Diffs
> -
> 
>   security-admin/src/main/java/org/apache/ranger/db/XXPolicyChangeLogDao.java 
> 16aaf306c 
>   
> security-admin/src/main/java/org/apache/ranger/service/RangerPolicyServiceBase.java
>  7ee829276 
>   
> security-admin/src/test/java/org/apache/ranger/service/TestRangerPolicyServiceBase.java
>  ff8e90825 
> 
> 
> Diff: https://reviews.apache.org/r/73545/diff/3/
> 
> 
> Testing
> ---
> 
> With patch, tested policy creation and serviceType field and its value is 
> added in the policy text for the respective policy.
> Further checked the delta policy and validation is passing.
> 
> 
> Thanks,
> 
> Pradeep Agrawal
> 
>