Repository navigation
HBASE-30578 Fix null-user ACL failures on master HBCK and Operation Details pages - #8936
Open
jackMintao wants to merge 1 commit into
Open
jackMintao wants to merge 1 commit into
jackMintao wants to merge 1 commit into
Conversation
…etails pages The master web UI JSPs invoke MasterRpcServices in-process through the short-circuit connection. Such calls have no RpcServer request user, so with hbase.security.authorization=true RSRpcServices.requirePermission sees a null user and denies the request: Insufficient permissions for user 'null' (global, action=ADMIN) This makes /hbck.jsp show errors for runHbckChore/runCatalogScan and makes /operationDetails.jsp return HTTP 500 for getLogEntries. Fix the two pages locally instead of widening RSRpcServices.requirePermission for every in-process ADMIN RPC: - operationDetails.jsp reads BalancerDecision/BalancerRejection directly from master.getNamedQueueRecorder(), like rsOperationDetails.jsp, instead of going through Admin#getLogEntries -> MasterRpcServices#getLogEntries. - hbck.jsp only calls HbckChore#runChore() and CatalogJanitor#scan() when InfoServer.canUserModifyUI() allows the request. Otherwise it shows the cached reports with an informational message. This prevents arbitrary or read-only UI visitors from triggering writes/metadata GC via a GET. RSRpcServices#requirePermission is deliberately unchanged so remote and in-process ADMIN RPC authorization is not broadened.
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.
JIRA: https://issues.apache.org/jira/browse/HBASE-30578
Problem
When
hbase.security.authorization=true, two master Web UI pages fail:/hbck.jsp(without?cache=true) showsInsufficient permissions for user 'null' (global, action=ADMIN)for bothrunHbckChoreandrunCatalogScan, and no new report is generated./operationDetails.jspreturns HTTP 500 with the sameAccessDeniedException.Both JSPs call master RPC services in-process.
master.getConnection()is ashort-circuit connection, so the JSP Jetty thread has no
RpcServer.CurCall;RSRpcServices.requirePermissiontherefore checks anulluser and denies.Fix
Keep
RSRpcServices.requirePermissionunchanged and fix the two pages at thepage boundary:
operationDetails.jspreadsBalancerDecision/BalancerRejectiondirectlyfrom
master.getNamedQueueRecorder(), matchingrsOperationDetails.jsp,instead of going through
Admin#getLogEntries -> MasterRpcServices#getLogEntries.hbck.jsponly callsHbckChore#runChore()andCatalogJanitor#scan()when
InfoServer.canUserModifyUI()allows the request. Otherwise it showsthe cached reports with an informational message. This prevents read-only or
unauthorized UI visitors from triggering writes/metadata GC via a plain GET.
A generic fallback in
RSRpcServices.requirePermissionwas deliberately notused: it would affect every in-process ADMIN-level RPC, not just these pages.
Tests
TestInfoServers#testHbckAndOperationDetailsReadOnly:read-only mode shows the informational message and
No Report created.(proves
runChorewas skipped), no error/ACL alert;/operationDetails.jsprenders.TestInfoServersACL#testHbckPagePermissions:with
hbase.security.authorization=true(MiniKdc/SPNEGO), the admin gets noread-only message, no error alert, no ACL error and a generated report; the
non-admin gets the read-only/cached-report message; the admin
/operationDetails.jspreturns HTTP 200 andOperations DetailswithoutACL errors. Before this fix it returned HTTP 500 in this environment.
mvn test-compile:BUILD SUCCESS.before, hbck had the two ACL errors and operationDetails was HTTP 500;
after, both pages are HTTP 200 with no ACL errors, read-only requests do not
change the CatalogJanitor report time, the authorized test path generates
reports, and a remote non-superuser is still denied for
catalogjanitor_run/get_balancer_decisions.Behavior note
InfoServer.canUserModifyUI()requireshbase.master.ui.readonly=false,Kerberos UI authentication,
hadoop.security.authorization=true, and a UIadministrator. In simple-auth clusters
/hbck.jspno longer auto-triggerschores; it shows cached reports and points admins to
hbck_chore_run/catalogjanitor_run. This matches the existingtable.jsp/snapshot.jspread-only behavior and avoids unauthenticated GET-triggered writes.
RSRpcServicesis untouched; remote RPC ACL behavior is unchanged.