Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -542,16 +542,18 @@ static class RecursiveWildcardResourceMatcher extends AbstractPathResourceMatche
boolean isMatch(String resourceValue, Map<String, Object> evalContext) {
LOG.debug("==> RecursiveWildcardResourceMatcher.isMatch(resourceValue={}, evalContext={})", resourceValue, evalContext);

String expandedValue;
String expandedValue;
String[] pathElements;

if (getNeedsDynamicEval()) {
expandedValue = getExpandedValue(evalContext);
wildcardPathElements = StringUtils.split(expandedValue, pathSeparatorChar);
expandedValue = getExpandedValue(evalContext);
pathElements = StringUtils.split(expandedValue, pathSeparatorChar);
} else {
expandedValue = value;
pathElements = wildcardPathElements;
}

boolean ret = function.apply(resourceValue, expandedValue, pathSeparatorChar, ioCase, wildcardPathElements);
boolean ret = function.apply(resourceValue, expandedValue, pathSeparatorChar, ioCase, pathElements);

LOG.debug("<== RecursiveWildcardResourceMatcher.isMatch(resourceValue={}, expandedValue={}) : result:[{}]", resourceValue, expandedValue, ret);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"tags": {
"1": {
"type": "EXPIRES_ON",
"attributes": { "expiry_date": "2026/06/15" },
"attributes": { "expiry_date": "2099/12/31" },
"id": 1,
"guid": "tag-expires-on-1-guid"
},
Expand All @@ -61,19 +61,19 @@
},
"4": {
"type": "RESTRICTED-FINAL",
"attributes": { "activation_date": "2026/06/15" },
"attributes": { "activation_date": "2099/12/31" },
"id": 4,
"guid": "tag-restricted-final-4-guid"
},
"5": {
"type": "PII",
"attributes": { "expiry": "2026/06/15" },
"attributes": { "expiry": "2099/12/31" },
"id": 5,
"guid": "tag-pii-5-guid"
},
"6": {
"type": "PII-FINAL",
"attributes": { "expiry": "2026/06/15" },
"attributes": { "expiry": "2099/12/31" },
"id": 6,
"guid": "tag-pii-final-6-guid"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"tags": {
"1": {
"type": "PII",
"attributes": { "expiry": "2026/06/15" },
"attributes": { "expiry": "2099/12/31" },
"id": 1,
"guid": "tag-pii-1-guid"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"tags": {
"1": {
"type": "EXPIRES_ON",
"attributes": { "expiry_date": "2026/06/15" },
"attributes": { "expiry_date": "2099/12/31" },
"id": 1,
"guid": "tag-expires-on-1-guid"
},
Expand All @@ -55,19 +55,19 @@
},
"4": {
"type": "RESTRICTED-FINAL",
"attributes": { "activation_date": "2026/06/15" },
"attributes": { "activation_date": "2099/12/31" },
"id": 4,
"guid": "tag-restricted-final-4-guid"
},
"5": {
"type": "PII",
"attributes": { "expiry": "2026/06/15" },
"attributes": { "expiry": "2099/12/31" },
"id": 5,
"guid": "tag-pii-5-guid"
},
"6": {
"type": "PII-FINAL",
"attributes": { "expiry": "2026/06/15" },
"attributes": { "expiry": "2099/12/31" },
"id": 6,
"guid": "tag-pii-final-6-guid"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"tags": {
"1": {
"type": "EXPIRES_ON",
"attributes": { "expiry_date": "2026/06/15" },
"attributes": { "expiry_date": "2099/12/31" },
"id": 1,
"guid": "tag-expires-on-1-guid"
},
Expand All @@ -55,19 +55,19 @@
},
"4": {
"type": "RESTRICTED-FINAL",
"attributes": { "activation_date": "2026/06/15" },
"attributes": { "activation_date": "2099/12/31" },
"id": 4,
"guid": "tag-restricted-final-4-guid"
},
"5": {
"type": "PII",
"attributes": { "expiry": "2026/06/15" },
"attributes": { "expiry": "2099/12/31" },
"id": 5,
"guid": "tag-pii-5-guid"
},
"6": {
"type": "PII-FINAL",
"attributes": { "expiry": "2026/06/15" },
"attributes": { "expiry": "2099/12/31" },
"id": 6,
"guid": "tag-pii-final-6-guid"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@
"request":{
"resource":{"elements":{"database":"default", "table":"table2"}},
"accessType":"","user":"denieduser","userGroups":[],"requestData":"desc default.table2;' for denieduser",
"context": {"TAGS":"[{\"type\":\"PII-FINAL\", \"attributes\":{\"expiry\":\"2026/06/15\"}}]"}
"context": {"TAGS":"[{\"type\":\"PII-FINAL\", \"attributes\":{\"expiry\":\"2099/12/31\"}}]"}
},
"result":{"isAudited":true,"isAllowed":false,"policyId":103}
},
Expand Down Expand Up @@ -292,15 +292,15 @@
"request":{
"resource":{"elements":{"database":"employee", "table":"personal", "column":"ssn"}},
"accessType":"select","user":"user1","userGroups":[],"requestData":"select ssn from employee.personal;' for user1",
"context": {"TAGS":"[{\"type\":\"RESTRICTED\", \"attributes\":{\"expiry\":\"2026/06/15\"}}]"}
"context": {"TAGS":"[{\"type\":\"RESTRICTED\", \"attributes\":{\"expiry\":\"2099/12/31\"}}]"}
},
"result":{"isAudited":true,"isAllowed":true,"policyId":1}
},
{"name":"DENY 'select ssn from employee.personal;' for user2",
"request":{
"resource":{"elements":{"database":"employee", "table":"personal", "column":"ssn"}},
"accessType":"select","user":"user2","userGroups":[],"requestData":"select ssn from employee.personal;' for user2",
"context": {"TAGS":"[{\"type\":\"RESTRICTED-FINAL\", \"attributes\":{\"expiry\":\"2026/06/15\"}}]"}
"context": {"TAGS":"[{\"type\":\"RESTRICTED-FINAL\", \"attributes\":{\"expiry\":\"2099/12/31\"}}]"}
},
"result":{"isAudited":true,"isAllowed":false,"policyId":4}
},
Expand All @@ -325,55 +325,55 @@
"request":{
"resource":{"elements":{"database":"default", "table":"table1", "column":"name"}},
"accessType":"select","user":"hive","userGroups":[],"requestData":"select name from default.table1;' for hive",
"context": {"TAGS":"[{\"type\":\"PII\", \"attributes\":{\"expiry\":\"2026/06/15\"}}]"}
"context": {"TAGS":"[{\"type\":\"PII\", \"attributes\":{\"expiry\":\"2099/12/31\"}}]"}
},
"result":{"isAudited":true,"isAllowed":true,"policyId":2}
},
{"name":"ALLOW 'desc default.table1;' for hive",
"request":{
"resource":{"elements":{"database":"default", "table":"table1"}},
"accessType":"","user":"hive","userGroups":[],"requestData":"desc default.table1;' for hive",
"context": {"TAGS":"[{\"type\":\"PII\", \"attributes\":{\"expiry\":\"2026/06/15\"}}]"}
"context": {"TAGS":"[{\"type\":\"PII\", \"attributes\":{\"expiry\":\"2099/12/31\"}}]"}
},
"result":{"isAudited":true,"isAllowed":true,"policyId":2}
},
{"name":"DENY 'desc default.table1;' for user1",
"request":{
"resource":{"elements":{"database":"default", "table":"table1"}},
"accessType":"","user":"user1","userGroups":[],"requestData":"desc default.table1;' for user1",
"context": {"TAGS":"[{\"type\":\"PII-FINAL\", \"attributes\":{\"expiry\":\"2026/06/15\"}}]"}
"context": {"TAGS":"[{\"type\":\"PII-FINAL\", \"attributes\":{\"expiry\":\"2099/12/31\"}}]"}
},
"result":{"isAudited":true,"isAllowed":false,"policyId":3}
},
{"name":"DENY 'desc default.table1;' for testuser",
"request":{
"resource":{"elements":{"database":"default", "table":"table1"}},
"accessType":"","user":"testuser","userGroups":[],"requestData":"desc default.table1;' for testuser",
"context": {"TAGS":"[{\"type\":\"PII-FINAL\", \"attributes\":{\"expiry\":\"2026/06/15\"}}]"}
"context": {"TAGS":"[{\"type\":\"PII-FINAL\", \"attributes\":{\"expiry\":\"2099/12/31\"}}]"}
},
"result":{"isAudited":true,"isAllowed":false,"policyId":-1}
},
{"name":"ALLOW 'use default;' for hive",
"request":{
"resource":{"elements":{"database":"default"}},
"accessType":"","user":"hive","userGroups":[],"requestData":"use default",
"context": {"TAGS":"[{\"type\":\"PII-FINAL\", \"attributes\":{\"expiry\":\"2026/06/15\"}}]"}
"context": {"TAGS":"[{\"type\":\"PII-FINAL\", \"attributes\":{\"expiry\":\"2099/12/31\"}}]"}
},
"result":{"isAudited":true,"isAllowed":true,"policyId":101}
},
{"name":"DENY 'use default;' for user1",
"request":{
"resource":{"elements":{"database":"default"}},
"accessType":"","user":"user1","userGroups":[],"requestData":"use default for user1",
"context": {"TAGS":"[{\"type\":\"PII-FINAL\", \"attributes\":{\"expiry\":\"2026/06/15\"}}]"}
"context": {"TAGS":"[{\"type\":\"PII-FINAL\", \"attributes\":{\"expiry\":\"2099/12/31\"}}]"}
},
"result":{"isAudited":true,"isAllowed":false,"policyId":3}
},
{"name":"ALLOW 'select * from default.table1;' for hive",
"request":{
"resource":{"elements":{"database":"default", "table":"table1", "column":"name"}},
"accessType":"select","user":"hive","userGroups":[],"requestData":"select * from default.table1",
"context": {"TAGS":"[{\"type\":\"PII\", \"attributes\":{\"expiry\":\"2026/06/15\"}}]"}
"context": {"TAGS":"[{\"type\":\"PII\", \"attributes\":{\"expiry\":\"2099/12/31\"}}]"}
},
"result":{"isAudited":true,"isAllowed":true,"policyId":2}
},
Expand Down