ATLAS-5380 : Authorize bulk entity headers before returning classifica… - #734
Merged
Merged
Conversation
VinayakMarraiya230920
marked this pull request as ready for review
August 20, 2026 12:08
VinayakMarraiya230920
force-pushed
the
ATLAS-5380
branch
from
August 21, 2026 06:53
b5842e6 to
9b304b8
Compare
…tions Apply per-entity ENTITY_READ checks in ClassificationAssociator.Retriever when building bulk headers response, matching getHeaderById behavior.
VinayakMarraiya230920
force-pushed
the
ATLAS-5380
branch
from
September 8, 2026 10:49
9b304b8 to
a97e7ac
Compare
nixonrodrigues
approved these changes
Sep 8, 2026
pareshddevalia
approved these changes
Sep 8, 2026
asf-gitbox-commits
pushed a commit
that referenced
this pull request
Sep 8, 2026
…tions (#734) Apply per-entity ENTITY_READ checks in ClassificationAssociator.Retriever when building bulk headers response, matching getHeaderById behavior.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
tions
The bulk entity headers API (
GET /api/atlas/v2/entity/bulk/headers?tagUpdateStartTime=...) returned entity headers including classifications without checkingENTITY_READper entity.The single-header API (
GET /api/atlas/v2/entity/guid/{guid}/header) already enforcesENTITY_READand 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
Per review feedback (@mneethiraj), the per-entity read check is centralized in
EntityGraphRetrieverinstead of holdingAtlasTypeRegistryin the retriever:EntityGraphRetriever.isEntityReadAllowed(AtlasEntityHeader), which performs:ClassificationAssociator.Retrieverto callentityRetriever.isEntityReadAllowed(entityHeader)after loading each header, and skip unauthorized entities (omit from the result map).AtlasTypeRegistrymember and the localisEntityReadAllowed(...)helper (with itstypeRegistry == nullbypass) fromRetriever; cleaned up the now-unused constructor and imports.Behavior after fix
Authorized users are unaffected — they still get full bulk results.
Scope: 2 main files changed (
ClassificationAssociator.java,EntityGraphRetriever.java) + test; no REST contract change, no UI changes.How was this patch tested?
Unit tests —
ClassificationAssociatorTest(7/7 pass), including a new case asserting the fix:auditScanYieldsOneEntity_ButNotAuthorized_EntityFilteredOut→ entity is omitted whenisEntityReadAllowedreturns false.auditScanYieldsOneEntity_EntityHeadersHasOneElementWithClassification→ entity still returned when authorized (no regression).Reporter's PoC re-run against the patched build (
atlas-repository-3.0.0-SNAPSHOT):Manual, with authorization enabled (User A with access, User B without
ENTITY_READon a target entity):GET .../guid/{guid}/header→ 403 ✓GET .../bulk/headers?tagUpdateStartTime={beforeChange}→ GUID not in response ✓Build
Compiles successfully.