Skip to content

ATLAS-5380 : Authorize bulk entity headers before returning classifica… - #734

Open
VinayakMarraiya230920 wants to merge 1 commit into
apache:masterfrom
VinayakMarraiya230920:ATLAS-5380
Open

ATLAS-5380 : Authorize bulk entity headers before returning classifica…#734
VinayakMarraiya230920 wants to merge 1 commit into
apache:masterfrom
VinayakMarraiya230920:ATLAS-5380

Conversation

@VinayakMarraiya230920

@VinayakMarraiya230920 VinayakMarraiya230920 commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

tions

Apply per-entity ENTITY_READ checks in ClassificationAssociator.Retriever when building bulk headers response, matching getHeaderById behavior.

What changes were proposed in this pull request?

The bulk entity headers API (GET /api/atlas/v2/entity/bulk/headers?tagUpdateStartTime=...) returned entity headers including classifications without checking ENTITY_READ per entity.

The single-header API (GET /api/atlas/v2/entity/guid/{guid}/header) already enforces ENTITY_READ and returns 403 when access is denied.

So a user blocked from reading an entity via the single API could still see that entity’s metadata (and classifications) through the bulk API — an authorization bypass / information disclosure.

Fix

Updated ClassificationAssociator.Retriever in ClassificationAssociator.java to:

  1. Keep AtlasTypeRegistry on the retriever.
  2. After loading each entity header, check:
    AtlasAuthorizationUtils.isAccessAllowed(
    new AtlasEntityAccessRequest(typeRegistry, AtlasPrivilege.ENTITY_READ, entityHeader))
  3. Skip unauthorized entities in the bulk response (omit from the result map).
  4. Leave test-only constructors unchanged (typeRegistry == null → no auth check, existing unit tests still pass).

Behavior after fix

API | Unauthorized user -- | -- GET .../guid/{guid}/header | 403 (unchanged) GET .../bulk/headers?... | Entity omitted from response (no leak)

Authorized users are unaffected — they still get full bulk results.

Scope: 1 file changed, no REST contract change, no UI changes.

How was this patch tested?

With authorization enabled and two users (User A with access, User B without ENTITY_READ on a target entity):

User A creates an entity and adds a classification.
User B calls GET .../guid/{guid}/header → 403 ✓
User B calls GET .../bulk/headers?tagUpdateStartTime={beforeChange} → GUID not in response ✓
User A calls same bulk API → entity returned with classifications ✓ (no regression)
Unit tests
mvn -pl repository -Dtest=ClassificationAssociatorTest test
mvn -pl webapp -Dtest=EntityRESTTest#testGetEntityHeaders_InvalidTime_ThrowsException test
All existing tests pass.

Build
mvn -pl repository -am compile -DskipTests
Compiles successfully.

@VinayakMarraiya230920
VinayakMarraiya230920 marked this pull request as ready for review August 20, 2026 12:08
…tions

Apply per-entity ENTITY_READ checks in ClassificationAssociator.Retriever
when building bulk headers response, matching getHeaderById behavior.

private boolean isEntityReadAllowed(AtlasEntityHeader entityHeader) {
if (typeRegistry == null) {
return true;

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.

if typeRegistry is null, entity access should be true/false ? please review

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