Skip to content

HDDS-15462. Move ACL check in Volume requests to preExecute - #10328

Merged
ivandika3 merged 2 commits into
apache:masterfrom
ss77892:HDDS-13855-volume-acl-preexecute
Jun 3, 2026
Merged

HDDS-15462. Move ACL check in Volume requests to preExecute#10328
ivandika3 merged 2 commits into
apache:masterfrom
ss77892:HDDS-13855-volume-acl-preexecute

Conversation

@ss77892

@ss77892 ss77892 commented May 21, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

ACL authorization checks for volume operations were moved from validateAndUpdateCache to preExecute in the following request handlers:

• OMVolumeDeleteRequest — DELETE ACL check
• OMVolumeSetOwnerRequest — WRITE_ACL check
• OMVolumeSetQuotaRequest — WRITE check
• OMVolumeAclRequest / OMVolumeAddAclRequest / OMVolumeRemoveAclRequest / OMVolumeSetAclRequest

##What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-15462

##How was this patch tested?

• Existing unit tests for TestOMVolumeDeleteRequest, TestOMVolumeSetOwnerRequest, and TestOMVolumeSetQuotaRequest continue to pass.
• Additional integration test in #10331

Made with Cursor

@sarvekshayr sarvekshayr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks @ss77892 for the patch. LGTM.

@ivandika3 ivandika3 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks @ss77892 for the improvement, overall LGTM, left some comments.

@ChenSammi

ChenSammi commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

@ss77892 , there are three different patches for the same "HDDS-13855. Move ACL check in Volume requests to preExecute" JIRA, which is not a practice, we should create individual JIRA for each of them.

Move ACL authorization checks for volume operations (delete, set-owner,
set-quota) and volume ACL operations (add, remove, set ACL) from
validateAndUpdateCache to preExecute. This ensures ACL enforcement
happens before the Ratis log entry is written, so unauthorized requests
are rejected early on the OM leader without producing log entries.

Co-authored-by: Cursor <cursoragent@cursor.com>
@ss77892
ss77892 force-pushed the HDDS-13855-volume-acl-preexecute branch from 5af4761 to cdc81a8 Compare June 2, 2026 16:22
@ss77892 ss77892 changed the title HDDS-13855. Move ACL check in Volume requests to preExecute HDDS-15462. Move ACL check in Volume requests to preExecute Jun 2, 2026

@ivandika3 ivandika3 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the update. LGTM +1.

Comment on lines 65 to 67
OzoneManagerProtocolProtos.AddAclRequest.Builder addAclRequestBuilder =
getOmRequest().getAddAclRequest().toBuilder()
omRequest.getAddAclRequest().toBuilder()
.setModificationTime(modificationTime);

@ivandika3 ivandika3 Jun 3, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

In the future, we also might want to have OMRequest carries the modificationTime so that we are not rebuilding the OMRequest just to add a modificationTime.

@ivandika3
ivandika3 merged commit 7dd5999 into apache:master Jun 3, 2026
47 checks passed
@ivandika3

Copy link
Copy Markdown
Contributor

Thanks @ss77892 for the patch and @ChenSammi for noticing the ticket issue.

Comment on lines +67 to +69
checkAcls(ozoneManager, OzoneObj.ResourceType.VOLUME,
OzoneObj.StoreType.OZONE, IAccessAuthorizer.ACLType.WRITE_ACL,
volume, null, null);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Seems this is a regression, previously we don't always require WRITE_ACL, but not super.preExecute requires WRITE_ACL. Please check this and write a test for this in another ticket.

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.

4 participants