-
Notifications
You must be signed in to change notification settings - Fork 978
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RANGER-4977: Fix hbase scan authorization by using ignoreDescendantDe…
…ny=false
- Loading branch information
Showing
4 changed files
with
70 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
...e-agent/src/test/resources/policyengine/test_policyengine_hbase_ignoreDenyDescendant.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
{ | ||
"serviceName":"hbasedev", | ||
|
||
"serviceDef":{ | ||
"name":"hbase", | ||
"id":2, | ||
"resources":[ | ||
{"name":"table","level":1,"parent":"","mandatory":true,"lookupSupported":true,"matcher":"org.apache.ranger.plugin.resourcematcher.RangerDefaultResourceMatcher","matcherOptions":{"wildCard":true, "ignoreCase":true},"label":"HBase Table","description":"HBase Table"}, | ||
{"name":"column-family","level":2,"parent":"table","mandatory":true,"lookupSupported":true,"matcher":"org.apache.ranger.plugin.resourcematcher.RangerDefaultResourceMatcher","matcherOptions":{"wildCard":true, "ignoreCase":true},"label":"HBase Column-Family","description":"HBase Column-Family"}, | ||
{"name":"column","level":3,"parent":"column-family","mandatory":true,"lookupSupported":true,"matcher":"org.apache.ranger.plugin.resourcematcher.RangerDefaultResourceMatcher","matcherOptions":{"wildCard":true, "ignoreCase":true},"label":"HBase Column","description":"HBase Column"} | ||
], | ||
"accessTypes":[ | ||
{"name":"read","label":"Read"}, | ||
{"name":"write","label":"Write"}, | ||
{"name":"create","label":"Create"}, | ||
{"name":"admin","label":"Admin","impliedGrants":["read","write","create"]} | ||
] | ||
}, | ||
|
||
"policies":[ | ||
{"id":1,"name":"table=finance; column-family=restricted, column=restricted_column","isEnabled":true,"isAuditEnabled":true, | ||
"resources":{"table":{"values":["finance"]},"column-family":{"values":["restricted_cf"]}, "column":{"values":["restricted_column"]}}, | ||
"denyPolicyItems":[ | ||
{"accesses":[{"type":"read","isAllowed":true}],"users":["user1"],"groups":[],"delegateAdmin":false} | ||
] | ||
} | ||
, | ||
{"id":2,"name":"table=finance; column-family=restricted,column=*","isEnabled":true,"isAuditEnabled":true, | ||
"resources":{"table":{"values":["finance"]},"column-family":{"values":["restricted_cf"]}, "column":{"values":["*"]}}, | ||
"policyItems":[ | ||
{"accesses":[{"type":"read","isAllowed":true}],"users":["user1"],"groups":[],"delegateAdmin":false} | ||
] | ||
} | ||
], | ||
|
||
"tests":[ | ||
{"name":"TEST!!! DENY 'get' for restricted column family when isDescendantDenyIgnored=false", | ||
"request":{ | ||
"resource":{"elements":{"table":"finance","column-family":"restricted_cf"}}, | ||
"resourceMatchingScope": "SELF_OR_DESCENDANTS","isDescendantDenyIgnored": "false", | ||
"accessType":"read","user":"user1","requestData":"deny get as there is a restricted column. Expected behavior for scan" | ||
}, | ||
"result":{"isAudited":true,"isAllowed":false,"policyId":1} | ||
}, | ||
{"name":"TEST!!! Allow 'get' for restricted column family when isDescendantDenyIgnored=true", | ||
"request":{ | ||
"resource":{"elements":{"table":"finance","column-family":"restricted_cf"}}, | ||
"resourceMatchingScope": "SELF_OR_DESCENDANTS", | ||
"accessType":"read","user":"user1","requestData":"allow get as restricted column policy not considered. Not expected behavior" | ||
}, | ||
"result":{"isAudited":true,"isAllowed":true,"policyId":2} | ||
} | ||
|
||
] | ||
} |