Skip to content

ATLAS-5326: Enforce Atlas authorization on AdminResource REST endpoints - #675

Merged
rkundam merged 2 commits into
masterfrom
atlas-5326-master
Jul 28, 2026
Merged

ATLAS-5326: Enforce Atlas authorization on AdminResource REST endpoints#675
rkundam merged 2 commits into
masterfrom
atlas-5326-master

Conversation

@rkundam

@rkundam rkundam commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

  • Add AtlasAuthorizationUtils.verifyAccess() to sensitive AdminResource REST endpoints that previously lacked Atlas-level authorization checks.
  • Leave operational and UI-facing endpoints (/version, /status, /metrics, /metricsstats*, /liveness, /readiness) accessible to any authenticated user without an additional Atlas privilege check.

Changes

  • AdminResource.java: Enforce authorization on 15 endpoint groups using existing privileges (ADMIN_EXPORT, ADMIN_IMPORT, ADMIN_PURGE, ADMIN_AUDITS, ENTITY_READ).
  • AdminResourceTest.java: Add withAuthorizationBypass / withAuthorizationBypassCallable test helpers and update unit tests for protected vs. open endpoints.

Protected endpoints

Endpoint Privilege
GET /stack ADMIN_EXPORT
GET /session ENTITY_READ
GET/DELETE /activeSearches ADMIN_EXPORT
GET /server/{serverName} ADMIN_EXPORT
GET /expimp/audit ADMIN_EXPORT
POST /checkstate ENTITY_READ
GET /patches ADMIN_IMPORT
GET /audit/{auditGuid}/details ADMIN_AUDITS
GET/DELETE /tasks ADMIN_PURGE
GET /debug/metrics ADMIN_EXPORT
DELETE /async/import/{importId} ADMIN_IMPORT
GET /async/import/status* ADMIN_IMPORT

Intentionally unprotected (authentication only)

  • GET /version, /status, /metrics
  • GET /metricsstats, /metricsstat/{collectionTime}, /metricsstats/range, /metricsstats/charts
  • GET /liveness, /readiness

How was this patch tested?

Manual testing

@nixonrodrigues nixonrodrigues left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.

public Response getUserProfile(@Context HttpServletRequest request) throws AtlasBaseException {
LOG.debug("==> AdminResource.getUserProfile()");

AtlasAuthorizationUtils.verifyAccess(new AtlasEntityAccessRequest(typeRegistry, AtlasPrivilege.ENTITY_READ), "session");

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove this authz check, because this endpoint only outputs only authenticated user's information and not entity or type related information.

@Produces(Servlets.JSON_MEDIA_TYPE)
public Set<String> getActiveSearches() {
public Set<String> getActiveSearches() throws AtlasBaseException {
AtlasAuthorizationUtils.verifyAccess(new AtlasAdminAccessRequest(AtlasPrivilege.ADMIN_EXPORT), "active searches");

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove this authz, this returns only authenticated user's search Ids( threadId's) and do not expose other information.

@Produces(Servlets.JSON_MEDIA_TYPE)
public boolean terminateActiveSearch(@PathParam("id") String searchId) {
public boolean terminateActiveSearch(@PathParam("id") String searchId) throws AtlasBaseException {
AtlasAuthorizationUtils.verifyAccess(new AtlasAdminAccessRequest(AtlasPrivilege.ADMIN_EXPORT), "terminate active search");

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove this authz. Search do not have authz. if authz added here. The user can make search calls but not able to terminate the search Rest.

@nixonrodrigues nixonrodrigues left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, changes looks good.

@rkundam Please merge if nothing is pending.

@rkundam
rkundam merged commit 53af3d8 into master Jul 28, 2026
4 of 6 checks passed
@rkundam
rkundam deleted the atlas-5326-master branch July 28, 2026 16:59
asf-gitbox-commits pushed a commit that referenced this pull request Jul 28, 2026
…ts (#675)

* ATLAS-5326: Enforce Atlas authorization on AdminResource REST endpoints

(cherry picked from commit 53af3d8)
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.

2 participants