Skip to content

RANGER-5797: Improve policy evaluation logic for _any access type and priority handling - #1234

Open
maheshbandal15 wants to merge 1 commit into
masterfrom
mb-ranger-5797
Open

maheshbandal15 wants to merge 1 commit into
masterfrom
mb-ranger-5797

Conversation

@maheshbandal15

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Fix 1 - Deny wins at equal priority
Replaced the _any-specific evaluation logic that used getPolicyPriority() >= oldPriority with a simpler rule: only a strictly higher-priority policy can override an existing deny.

Fix 2 - Break only when allow is actually stored
The _any loop now breaks only if the allow was written into accessTypeResults

Test changes
New test resource: agents-common/src/test/resources/policyengine/test_policyengine_hive_any_access_priority.json
Four Hive scenarios with deny/allow policy pairs at different priorities
_any requests for USE caseN_db by user hrt15
New test method: testPolicyEngine_hive_any_access_priority() in TestPolicyEngine.java

How was this patch tested?

mvn clean install
manual tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant