RANGER-5362:Restrict security zone visibility to its owner. #759
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
This PR implements enhanced Security Zone visibility and access restrictions in Apache Ranger. The main goal is to ensure that a security zone is visible only to users who are authorized to administer or audit that zone.
Key changes introduced:
Restricted Zone Visibility
A security zone is now visible only to:
Zone Admin users / groups / roles
Zone Auditor users / groups / roles
Super Admin users (global ADMIN)
All other users cannot see non-public zones.
Updated Access Logic
Zone Admins: Can view the zone and fully manage it (create/edit/delete policies).
Zone Auditors: Can view the zone and access its audit logs only. Cannot modify zone/policies.
Unauthorized users: Cannot view the zone, its policies, or its audits.
Public zones continue to be visible to all.
Backend Enforcement
Visibility and filtering logic added/updated in:
PublicAPIsv2 (all zone-fetching API endpoints)
SecurityZoneREST
SecurityZoneDBStore (core business logic)
DAO layer (XXSecurityZoneDao, XXUserDao, RangerDaoManagerBase)
JPA named queries (jpa_named_queries.xml)
UI Data Filtering
Updated zone filtering for:
Security Zone homepage (getAllZones)
Main homepage header zone info (getSecurityZoneHeaderInfoList)
Service homepage (getSecurityZoneHeaderInfoListByServiceId)
How was this patch tested?
I have verified the changes locally by running mvn clean compile package install and then bringing up the Ranger environment to ensure that the updated security-zone visibility logic works correctly during development testing.