You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ranger.apache.org by Abhay Kulkarni <ak...@hortonworks.com> on 2024/11/08 22:02:16 UTC

Review Request 75264: RANGER-4990: Rationalize processing of match-types for policy and tag evaluation

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

Review request for ranger, Fateh Singh, madhan, Madhan Neethiraj, Pradeep Agrawal, Ramesh Mani, Sailaja Polavarapu, and Velmurugan Periasamy.


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


Repository: ranger


Description
-------

Policies/tags are selected for processing based on how the they match the accessed resource. The logic for the selection of policies/tags depends on 

resourceMatchingScope specified in the access request, and
if the type of access desired is of type 'any'.
The logic for the selection is inconsistent and hard to reason about. Additionally, code referencing the resourceMatchingScope does not check for null-ness. This may cause NullPointerExceptions.


Diffs
-----

  agents-common/src/main/java/org/apache/ranger/plugin/contextenricher/RangerTagEnricher.java c9ca7d822 
  agents-common/src/main/java/org/apache/ranger/plugin/policyengine/gds/GdsSharedResourceEvaluator.java 6e36c00cc 
  agents-common/src/main/java/org/apache/ranger/plugin/policyevaluator/RangerAbstractPolicyEvaluator.java 006ceefc3 
  agents-common/src/main/java/org/apache/ranger/plugin/policyevaluator/RangerAuditPolicyEvaluator.java 96610e2eb 
  agents-common/src/main/java/org/apache/ranger/plugin/policyevaluator/RangerDefaultPolicyEvaluator.java 621b65137 
  agents-common/src/main/java/org/apache/ranger/plugin/util/CachedResourceEvaluators.java ff2d04376 
  agents-common/src/test/resources/policyengine/test_policyengine_hive.json 8e34aa174 
  agents-common/src/test/resources/policyengine/test_policyengine_marker_access_types.json a18523b60 


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


Testing
-------

Compiled clean and passed all unit tests.


Thanks,

Abhay Kulkarni


Re: Review Request 75264: RANGER-4990: Rationalize processing of match-types for policy and tag evaluation

Posted by Madhan Neethiraj <ma...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/75264/#review227045
-----------------------------------------------------------




agents-common/src/main/java/org/apache/ranger/plugin/policyevaluator/RangerAbstractPolicyEvaluator.java
Line 312 (original), 314 (patched)
<https://reviews.apache.org/r/75264/#comment315336>

    Shouldn't line #314 be:
      matchType == SELF || matchType == SELF_AND_ALL_DESCENDANTS || matchType == DESCENDANTS;


- Madhan Neethiraj


On Nov. 8, 2024, 10:02 p.m., Abhay Kulkarni wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/75264/
> -----------------------------------------------------------
> 
> (Updated Nov. 8, 2024, 10:02 p.m.)
> 
> 
> Review request for ranger, Fateh Singh, madhan, Madhan Neethiraj, Pradeep Agrawal, Ramesh Mani, Sailaja Polavarapu, and Velmurugan Periasamy.
> 
> 
> Bugs: RANGER-4990
>     https://issues.apache.org/jira/browse/RANGER-4990
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> Policies/tags are selected for processing based on how the they match the accessed resource. The logic for the selection of policies/tags depends on 
> 
> resourceMatchingScope specified in the access request, and
> if the type of access desired is of type 'any'.
> The logic for the selection is inconsistent and hard to reason about. Additionally, code referencing the resourceMatchingScope does not check for null-ness. This may cause NullPointerExceptions.
> 
> 
> Diffs
> -----
> 
>   agents-common/src/main/java/org/apache/ranger/plugin/contextenricher/RangerTagEnricher.java c9ca7d822 
>   agents-common/src/main/java/org/apache/ranger/plugin/policyengine/gds/GdsSharedResourceEvaluator.java 6e36c00cc 
>   agents-common/src/main/java/org/apache/ranger/plugin/policyevaluator/RangerAbstractPolicyEvaluator.java 006ceefc3 
>   agents-common/src/main/java/org/apache/ranger/plugin/policyevaluator/RangerAuditPolicyEvaluator.java 96610e2eb 
>   agents-common/src/main/java/org/apache/ranger/plugin/policyevaluator/RangerDefaultPolicyEvaluator.java 621b65137 
>   agents-common/src/main/java/org/apache/ranger/plugin/util/CachedResourceEvaluators.java ff2d04376 
>   agents-common/src/test/resources/policyengine/test_policyengine_hive.json 8e34aa174 
>   agents-common/src/test/resources/policyengine/test_policyengine_marker_access_types.json a18523b60 
> 
> 
> Diff: https://reviews.apache.org/r/75264/diff/1/
> 
> 
> Testing
> -------
> 
> Compiled clean and passed all unit tests.
> 
> 
> Thanks,
> 
> Abhay Kulkarni
> 
>


Re: Review Request 75264: RANGER-4990: Rationalize processing of match-types for policy and tag evaluation

Posted by Madhan Neethiraj <ma...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/75264/#review227046
-----------------------------------------------------------


Ship it!




Ship It!

- Madhan Neethiraj


On Nov. 9, 2024, 12:55 a.m., Abhay Kulkarni wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/75264/
> -----------------------------------------------------------
> 
> (Updated Nov. 9, 2024, 12:55 a.m.)
> 
> 
> Review request for ranger, Fateh Singh, madhan, Madhan Neethiraj, Pradeep Agrawal, Ramesh Mani, Sailaja Polavarapu, and Velmurugan Periasamy.
> 
> 
> Bugs: RANGER-4990
>     https://issues.apache.org/jira/browse/RANGER-4990
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> Policies/tags are selected for processing based on how the they match the accessed resource. The logic for the selection of policies/tags depends on 
> 
> resourceMatchingScope specified in the access request, and
> if the type of access desired is of type 'any'.
> The logic for the selection is inconsistent and hard to reason about. Additionally, code referencing the resourceMatchingScope does not check for null-ness. This may cause NullPointerExceptions.
> 
> 
> Diffs
> -----
> 
>   agents-common/src/main/java/org/apache/ranger/plugin/contextenricher/RangerTagEnricher.java c9ca7d822 
>   agents-common/src/main/java/org/apache/ranger/plugin/policyengine/gds/GdsSharedResourceEvaluator.java 6e36c00cc 
>   agents-common/src/main/java/org/apache/ranger/plugin/policyevaluator/RangerAbstractPolicyEvaluator.java 006ceefc3 
>   agents-common/src/main/java/org/apache/ranger/plugin/policyevaluator/RangerAuditPolicyEvaluator.java 96610e2eb 
>   agents-common/src/main/java/org/apache/ranger/plugin/policyevaluator/RangerDefaultPolicyEvaluator.java 621b65137 
>   agents-common/src/main/java/org/apache/ranger/plugin/util/CachedResourceEvaluators.java ff2d04376 
>   agents-common/src/test/resources/policyengine/test_policyengine_hive.json 8e34aa174 
>   agents-common/src/test/resources/policyengine/test_policyengine_marker_access_types.json a18523b60 
> 
> 
> Diff: https://reviews.apache.org/r/75264/diff/2/
> 
> 
> Testing
> -------
> 
> Compiled clean and passed all unit tests.
> 
> 
> Thanks,
> 
> Abhay Kulkarni
> 
>


Re: Review Request 75264: RANGER-4990: Rationalize processing of match-types for policy and tag evaluation

Posted by Abhay Kulkarni <ak...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/75264/
-----------------------------------------------------------

(Updated Nov. 9, 2024, 12:55 a.m.)


Review request for ranger, Fateh Singh, madhan, Madhan Neethiraj, Pradeep Agrawal, Ramesh Mani, Sailaja Polavarapu, and Velmurugan Periasamy.


Changes
-------

Addressed review comment


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


Repository: ranger


Description
-------

Policies/tags are selected for processing based on how the they match the accessed resource. The logic for the selection of policies/tags depends on 

resourceMatchingScope specified in the access request, and
if the type of access desired is of type 'any'.
The logic for the selection is inconsistent and hard to reason about. Additionally, code referencing the resourceMatchingScope does not check for null-ness. This may cause NullPointerExceptions.


Diffs (updated)
-----

  agents-common/src/main/java/org/apache/ranger/plugin/contextenricher/RangerTagEnricher.java c9ca7d822 
  agents-common/src/main/java/org/apache/ranger/plugin/policyengine/gds/GdsSharedResourceEvaluator.java 6e36c00cc 
  agents-common/src/main/java/org/apache/ranger/plugin/policyevaluator/RangerAbstractPolicyEvaluator.java 006ceefc3 
  agents-common/src/main/java/org/apache/ranger/plugin/policyevaluator/RangerAuditPolicyEvaluator.java 96610e2eb 
  agents-common/src/main/java/org/apache/ranger/plugin/policyevaluator/RangerDefaultPolicyEvaluator.java 621b65137 
  agents-common/src/main/java/org/apache/ranger/plugin/util/CachedResourceEvaluators.java ff2d04376 
  agents-common/src/test/resources/policyengine/test_policyengine_hive.json 8e34aa174 
  agents-common/src/test/resources/policyengine/test_policyengine_marker_access_types.json a18523b60 


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

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


Testing
-------

Compiled clean and passed all unit tests.


Thanks,

Abhay Kulkarni