[ISSUE #11178] Refuse to start when authorization is enabled without authentication - #11179
R0CKing666 wants to merge 1 commit into
Conversation
|
Verified the claims against the codebase (base is newer than this clone's ReviewOverall the fix is correct in intent and minimal. 1. Guard runs too late in broker startup —
|
5671490 to
58c8620
Compare
RockteMQ-AI
left a comment
There was a problem hiding this comment.
Summary
This PR contains 412 lines of changes. A detailed code review is recommended.
Automated review by github-manager-bot
RockteMQ-AI
left a comment
There was a problem hiding this comment.
Summary
Security fix that prevents enabling authorization without authentication. The AuthConfig.validate() method enforces this invariant at startup (called from BrokerController.initialize() and proxy AuthorizationPipeline constructors), blocking the misconfiguration before any vulnerable code path can be reached.
The reproduction test (AccessKeySpoofingReproTest) is excellent — it characterizes the vulnerability in the unguarded lower layers while making clear that the fix is the startup guard. The validation tests cover all four combinations of auth flags.
Well-documented, well-tested, addresses a real identity spoofing risk.
LGTM.
Automated review by github-manager-bot
…thout authentication The Remoting authorization pipeline derives the caller identity from the client-supplied AccessKey without any signature verification. Enabling authorization without authentication therefore allows any client to impersonate a known user (including a SUPER user). Reject this configuration in a fail-closed manner: - broker: validate at the top of BrokerController.initialize() before the expensive message store load; - proxy: validate in the AuthorizationPipeline constructors wired for both the gRPC and Remoting protocol servers. Adds unit tests for AuthConfig.validate() and for the pipeline guard, plus a characterization test of the unguarded authorization context builder.
58c8620 to
ceb7c77
Compare
Which Issue(s) This PR Fixes
Brief Description
The Remoting (TCP) authorization path derives the caller identity from the client-supplied
AccessKeyin the request extFields without any signature verification.authorizationEnabledandauthenticationEnabledare independent switches, so a broker/proxy started with authorization on but authentication off would let any client impersonate a known user (including a SUPER user) simply by claiming its AccessKey.This change makes startup fail-closed and covers every component that wires an authorization pipeline:
AuthConfig#validate()rejectsauthorizationEnabled && !authenticationEnabled.BrokerController.initialize()validates before the expensive message store load.AuthorizationPipelineconstructors for both the gRPC and Remoting protocol servers validate on construction.This mirrors the existing fail-closed guards in
ProxyAdminAuthInterceptorfor the gRPC admin surface.Note: this is a config-level (defense-in-depth) guard. A request whose RPC is in the authentication whitelist still skips authentication while authorization derives the subject from the raw
AccessKey; a durable fix at the authorization layer (derive the subject only from a verified authentication result) is tracked as a follow-up.How Did You Test This Change?
AuthConfigTest(6 tests): valid/invalid enable combinations.AuthorizationPipelineTestfor gRPC and Remoting (6 tests): the pipeline constructor rejectsauthorizationEnabledwithoutauthenticationEnabled, and existing authorization behavior is unchanged.AccessKeySpoofingReproTest(3 tests): characterization test of the unguarded lower layers (forged AccessKey is authorized when authentication is disabled; unknown AccessKey is denied; enabling authentication rejects the unsigned request).mvn -pl proxy -am install -DskipTests.