Skip to content

HDDS-16963. Require SCM admin access for secret key rotation - #11811

Open
andyhuangdev wants to merge 1 commit into
apache:masterfrom
andyhuangdev:HDDS-16963
Open

andyhuangdev wants to merge 1 commit into
apache:masterfrom
andyhuangdev:HDDS-16963

Conversation

@andyhuangdev

@andyhuangdev andyhuangdev commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Add an SCM admin access check to SCMSecurityProtocolServer.checkAndRotate before validating secret key status or performing rotation. This prevents authenticated non-admin users from triggering secret key rotation and follows the authorization pattern used by other SCM administrative operations.

What is the link to the Apache JIRA

HDDS-16963

How was this patch tested?

Added regression coverage to TestSecureOzoneCluster verifying that non-admin users are denied for both values of force, the current key remains unchanged after denial, and an SCM admin can successfully force rotation. The regression test failed before the fix.

TestSecureOzoneCluster and TestBlockTokensCLI passed all 12 tests. The checkstyle script and git diff --check also passed.

https://github.com/andyhuangdev/ozone/actions/runs/40639047599

Test plan: TestSecureOzoneCluster and TestBlockTokensCLI (12 tests passed); checkstyle passed.

Copilot AI 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.

🟢 Approval recommended

There are no active review issues with the change restricting secret key rotation to SCM administrators.

No open issues 🎉

What changed in this PR

This PR restricts secret key rotation to SCM administrators, following the authorization pattern used by other SCM administrative operations.

Changes:

  • Checks SCM admin access before validating secret key status or performing rotation.
  • Adds regression coverage for non-admin denial with both force values, unchanged keys after denial, and successful forced rotation by an SCM admin.
File Description
hadoop-ozone/​integration-test/​src/​test/​java/​org/​apache/​hadoop/​ozone/​TestSecureOzoneCluster.java Adds secret key rotation authorization coverage using authenticated RPC clients.
hadoop-hdds/​server-scm/​src/​main/​java/​org/​apache/​hadoop/​hdds/​scm/​server/​SCMSecurityProtocolServer.java Enforces SCM admin access in checkAndRotate and allows authorization failures to propagate as IOException.

Review effort: Balanced

@jojochuang
jojochuang marked this pull request as ready for review October 28, 2026 05:59
@github-actions github-actions Bot added the scm label Oct 28, 2026

@priyeshkaratha priyeshkaratha left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Changes LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants