blob: f42df3eab95e061882089202906fd23265c49d29 [file] [log] [blame]
{
"serviceName":"hivedev",
"serviceDef":{
"name":"hive",
"id":3,
"resources":[
{"name":"database","level":1,"mandatory":true,"lookupSupported":true,"matcher":"org.apache.ranger.plugin.resourcematcher.RangerDefaultResourceMatcher","matcherOptions":{"wildCard":true, "ignoreCase":true},"label":"Hive Database","description":"Hive Database"},
{"name":"table","level":2,"parent":"database","mandatory":true,"lookupSupported":true,"matcher":"org.apache.ranger.plugin.resourcematcher.RangerDefaultResourceMatcher","matcherOptions":{"wildCard":true, "ignoreCase":true},"label":"Hive Table","description":"Hive Table"},
{"name":"udf","level":2,"parent":"database","mandatory":true,"lookupSupported":true,"matcher":"org.apache.ranger.plugin.resourcematcher.RangerDefaultResourceMatcher","matcherOptions":{"wildCard":true, "ignoreCase":true},"label":"Hive UDF","description":"Hive UDF"},
{"name":"column","level":3,"parent":"table","mandatory":true,"lookupSupported":true,"matcher":"org.apache.ranger.plugin.resourcematcher.RangerDefaultResourceMatcher","matcherOptions":{"wildCard":true, "ignoreCase":true},"label":"Hive Column","description":"Hive Column"}
],
"accessTypes":[
{"name":"select","label":"Select"},
{"name":"update","label":"Update"},
{"name":"create","label":"Create"},
{"name":"grant","label":"Grant"},
{"name":"drop","label":"Drop"},
{"name":"alter","label":"Alter"},
{"name":"index","label":"Index"},
{"name":"lock","label":"Lock"},
{"name":"all","label":"All",
"impliedGrants": [
"select",
"update",
"create",
"grant",
"drop",
"alter",
"index",
"lock"
]
}
]
},
"policies":[
{"id":101,"name":"db=*: audit-all-access","isEnabled":true,"isAuditEnabled":true,
"resources":{"database":{"values":["*"]},"table":{"values":["*"]},"column":{"values":["*"]}},
"policyItems":[
{"accesses":[{"type":"all","isAllowed":true}],"users":["hive", "user1", "user2"],"groups":["public"],"delegateAdmin":false}
]
},
{"id":102,"name":"db=*, udf=*: audit-all-access","isEnabled":true,"isAuditEnabled":true,
"resources":{"database":{"values":["*"]},"udf":{"values":["*"]}},
"policyItems":[
{"accesses":[{"type":"all","isAllowed":true}],"users":["hive", "user1", "user2"],"groups":["public"],"delegateAdmin":false}
]
}
],
"tagPolicyInfo": {
"serviceName":"tagdev",
"serviceDef": {
"name": "tag",
"id": 100,
"resources": [
{
"itemId": 1,
"name": "tag",
"type": "string",
"level": 1,
"parent": "",
"mandatory": true,
"lookupSupported": true,
"recursiveSupported": false,
"excludesSupported": false,
"matcher": "org.apache.ranger.plugin.resourcematcher.RangerDefaultResourceMatcher",
"matcherOptions": {
"wildCard": true,
"ignoreCase": false
},
"validationRegEx": "",
"validationMessage": "",
"uiHint": "",
"label": "TAG",
"description": "TAG"
}
],
"accessTypes": [
{
"itemId": 1,
"name": "hive:select",
"label": "hive:select"
},
{
"itemId": 2,
"name": "hive:update",
"label": "hive:update"
},
{
"itemId": 3,
"name": "hive:create",
"label": "hive:create"
}
,
{
"itemId": 4,
"name": "hive:grant",
"label": "hive:grant"
}
,
{
"itemId": 5,
"name": "hive:drop",
"label": "hive:drop"
}
,
{
"itemId": 6,
"name": "hive:alter",
"label": "hive:alter"
},
{
"itemId": 7,
"name": "hive:index",
"label": "hive:index"
},
{
"itemId": 8,
"name": "hive:lock",
"label": "hive:lock"
},
{
"itemId": 9,
"name": "hive:all",
"label": "hive:all",
"impliedGrants":
[
"hive:select",
"hive:update",
"hive:create",
"hive:grant",
"hive:drop",
"hive:alter",
"hive:index",
"hive:lock"
]
}
],
"contextEnrichers": [
{
"itemId": 1,
"name" : "TagEnricher",
"enricher" : "org.apache.ranger.plugin.contextenricher.RangerTagEnricher",
"enricherOptions" : {"tagRetrieverClassName":"org.apache.ranger.plugin.contextenricher.RangerFileBasedTagRetriever", "tagRefresherPollingInterval":60000, "serviceTagsFileName":"/policyengine/resourceTags_for_show_databases.json"}
}
],
"policyConditions": [
{
"itemId":1,
"name":"enforce-expiry",
"evaluator": "org.apache.ranger.plugin.conditionevaluator.RangerScriptTemplateConditionEvaluator",
"evaluatorOptions" : { "scriptTemplate":"ctx.isAccessedAfter('expiry_date');" },
"label":"Deny access after expiry_date?",
"description": "Deny access after expiry_date? (yes/no)"
}
]
},
"tagPolicies":[
{"id":1,"name":"EXPIRES_ON","isEnabled":true,"isAuditEnabled":true,
"resources":{"tag":{"values":["EXPIRES_ON"],"isRecursive":false}},
"denyPolicyItems":[
{"accesses":[{"type":"hive:all","isAllowed":true}],"users":[],"groups":["public"],"delegateAdmin":false,
"conditions":[{"type":"enforce-expiry","values":["yes"]}]
}
]
,
"denyExceptions":[
{"accesses":[{"type":"hive:select","isAllowed":true}],"users":["dataloader"],"groups":[],"delegateAdmin":false}
]
}
]
},
"tests":[
{"name":"ALLOW 'show databases;' for hive",
"request":{
"resource":{"elements":{}},
"accessType":"","user":"hive","userGroups":["public"],"requestData":"show databases for hive"
},
"result":{"isAudited":true,"isAllowed":true,"policyId":101}
}
,
{"name":"ALLOW 'use default;' for hive",
"request":{
"resource":{"elements":{"database":"default"}},
"accessType":"","user":"hive","userGroups":["public"],"requestData":"use default for hive"
},
"result":{"isAudited":true,"isAllowed":true,"policyId":101}
}
,
{"name":"ALLOW 'use employee;' for hive",
"request":{
"resource":{"elements":{"database":"employee"}},
"accessType":"","user":"hive","userGroups":["public"],"requestData":"use employee for hive"
},
"result":{"isAudited":true,"isAllowed":true,"policyId":101}
}
,
{"name":"DENY 'select ssn from employee.personal;' for hive",
"request":{
"resource":{"elements":{"database":"employee", "table":"personal", "column":"ssn"}},
"accessType":"select","user":"hive","userGroups":["public"],"requestData":"select ssn from employee.personal for hive"
},
"result":{"isAudited":true,"isAllowed":false,"policyId":1}
}
,
{"name":"DENY 'use vendors;' for hive",
"request":{
"resource":{"elements":{"database":"vendors"}},
"accessType":"","user":"hive","userGroups":["public"],"requestData":"use vendors; for hive"
},
"result":{"isAudited":true,"isAllowed":false,"policyId":1}
}
]
}