Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]
Created on 10-13-2016 09:03 PM - edited 08-19-2019 02:32 AM
I have a Hive policy which specifies Masking and Row Filtering criteria. Here is a screenshot:
When I use the Ranger REST API to get the policy details the Mask and/or Filtering details are missing:
curl -s -XGET -u admin:admin http://localhost:6080/service/public/api/policy/14 {"id":14,"createDate":"2016-08-29T08:19:48Z","updateDate":"2016-09-15T19:23:51Z","owner":"Admin","updatedBy":"Admin","policyName":"filter_ww_customers_table","resourceName":"/hortoniabank/ww_customers/","description":"","repositoryName":"secgov_cl1_hive","repositoryType":"hive","permMapList":[],"tables":"ww_customers","databases":"hortoniabank","tableType":"Inclusion","isEnabled":true,"isRecursive":false,"isAuditEnabled":true,"version":"3","replacePerm":false}
This appears to be a problem with the newer "Allow" and "Deny" rules as well.
curl -s -XGET -u admin:admin http://localhost:6080/service/public/api/policy/16 {"id":16,"createDate":"2016-09-19T20:16:01Z","updateDate":"2016-09-21T09:26:11Z","owner":"Admin","updatedBy":"Admin","policyName":"prohibit_zipcode_mrn_bloodtype","resourceName":"/hortoniabank/ww_customers/zipcode","description":"","repositoryName":"secgov_cl1_hive","repositoryType":"hive","permMapList":[],"tables":"ww_customers","columns":"zipcode","databases":"hortoniabank","tableType":"Inclusion","columnType":"Inclusion","isEnabled":true,"isRecursive":false,"isAuditEnabled":true,"version":"4","replacePerm":false}
Is there a different API call to get these details?
Created 10-14-2016 03:47 AM
The REST endpoint you used is for the older version of Ranger, which does not handle recent additions like row-filter/column masking policies. Please use REST endpoint at service/public/v2/api/policy (note "/v2" in the path). For more details on the API, please see wiki at https://cwiki.apache.org/confluence/display/RANGER/REST+APIs+for+Service+Definition%2C+Service+and+P...
If it helps to look at the Java source for the REST API - it is available is at https://github.com/apache/incubator-ranger/blob/master/security-admin/src/main/java/org/apache/range....
Created 10-14-2016 03:47 AM
The REST endpoint you used is for the older version of Ranger, which does not handle recent additions like row-filter/column masking policies. Please use REST endpoint at service/public/v2/api/policy (note "/v2" in the path). For more details on the API, please see wiki at https://cwiki.apache.org/confluence/display/RANGER/REST+APIs+for+Service+Definition%2C+Service+and+P...
If it helps to look at the Java source for the REST API - it is available is at https://github.com/apache/incubator-ranger/blob/master/security-admin/src/main/java/org/apache/range....
Created 10-14-2016 03:16 PM
Thank you for your response. That was the problem. I was using the Hortonworks documentation which does not show the version part of the URL: