Gabriel39 opened a new pull request, #71173: URL: https://github.com/apache/doris/pull/71173
### Background FE validates SQL and catalog properties before sending executable plans or JDBC connection tests to BE. JDBC drivers run inside the BE JVM, and the internal RPC surface has traditionally relied on network isolation. ### What problem does this PR solve? Issue Number: None Related PR: None PR Type: Enhancement Problem Summary: BE currently accepts executable frontend payloads without a request credential, including driver descriptors in connection tests and query plans. Require short-lived, method-bound HMAC credentials before queueing these payloads, and make connection tests execute a database-specific constant. Authentication is enabled by default; mixed-version upgrades and native remote-Doris execution require the migration steps below. ### Details - **Change map:** 359 production lines, 481 test lines, 10 protocol lines and 41 documentation/config-comment lines changed. Shared signing/verification covers dispatch and BE entry points; tests cover boundary inputs and queue admission; heartbeat publication prevents reading an uninitialized token. - **Before and after:** Unsigned connection tests and executable plans previously entered the work pools. They now return NOT_AUTHORIZED; changing the method, payload, interpretation metadata or timestamp also invalidates the credential. Execute, prepare, start and the nested executable group-commit plan are covered. The JDBC tester ignores caller SQL and uses the existing database-specific validation statement. - **Configs and defaults:** BE enable_frontend_request_auth defaults to true and requires restart to change. Explicit false retains the original internal-network trust behavior; there is no automatic fallback for invalid authentication. - **Impact on existing users:** Upgraded FEs sign at dispatch, including cached plans and retries. Old BEs ignore the optional fields. Old FEs are rejected by enforcing BEs: upgrade FEs first, or explicitly disable the option on upgraded BEs until all FEs are upgraded, then restore it. Native remote-Doris plans cannot use a local cluster's credential; use Arrow Flight or explicitly disable enforcement on the receiving cluster. - **Behavior change:** Yes; default request authentication and fixed connection-test SQL, as described above. ### Testing - Local FE tests: 33 passed across FrontendRequestAuthTest, BackendServiceProxyTest and the two pipeline execution task suites. - Local JDBC tests: 8 passed. The fixed-query test first failed on the baseline because caller SQL reached prepareStatement; it now checks independent expected statements for five database types. - Local ASAN BE tests: 14 passed, covering authentication boundaries, pre-queue rejection, explicit legacy mode, malformed query IDs and failed-heartbeat publication. clang-tidy and clang-format 16 passed on all affected C++ files; header hygiene passed. - FE Checkstyle passed. Optional protobuf field IDs were checked against the current master, 4.2, 4.1, 4.0 and 3.1 tips. - External database integration and a mixed-version cluster were not run locally. ### Notes for Reviewers The existing cluster token is the trust root; trusted BEs also know it. Credentials last five minutes with 30 seconds of future clock skew. They limit credential lifetime rather than enforcing single use. Administrator-selected driver code remains trusted and runs in process; the internal-network trust model still applies to other RPCs. Signing hashes existing plan buffers without another full-plan copy. ### Release note BE authenticates frontend execution payloads by default. Follow the FE-first or explicit compatibility-mode upgrade procedure above. Connection tests use a fixed validation query selected for the database type. ### Check List (For Author) - Behavior changed: Yes (see Details) - Does this need documentation: Yes (update the upgrade/security guide with the BE option, rollout procedure and native remote-catalog limitation; in-tree config and threat-model notes are included) - Pre-submission status: Ready ### AI Disclosure - Tool: Codex - Generated: Implementation, tests and this description - Human review: No human review has been reported; automated local self-review completed before submission - Prompts: Harden JDBC connection testing and normal query execution on master. Complete local review and fix all findings before opening the pull request. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
