Gabriel39 opened a new pull request, #71205: URL: https://github.com/apache/doris/pull/71205
### Background Catalog plugins configure metastore, storage and authentication connections. Providers declare endpoint properties so Doris can apply its optional operator-configured `SecurityChecker` before connecting. ### What problem does this PR solve? Issue Number: None Related PR: #71191 (independent driver-loading hardening) PR Type: Bugfix Problem Summary: REST, OAuth, token and storage aliases could escape the configured SSRF policy. CREATE could connect before admission; ALTER could activate stored addresses; indirect lake connectors bypassed the statement gate. This change centralizes admission and retains checking around supported Java SDK operations, including lazy scans and derived OAuth clients. ### Details - **Change map:** 929 production lines, 996 test lines, 6 recorded API signatures and 50 documentation lines changed. Provider/storage declarations cover the missing inputs; one shared validator replaces the old permissive parser; scoped hooks cover SDK execution and nesting; unit and SQL tests cover rejection, compatibility and deferred work. - **Frequency:** Deterministic when the optional policy is configured and one of the undeclared, activation or sibling paths is used. - **Root cause:** Providers omitted endpoint aliases, and the generic gate silently skipped formats it could not parse. Admission ran after pre-validation and relied on touched endpoint keys; runtime authentication wrappers also left independent or deferred operations outside the hook. - **Why existing tests missed it:** Provider tests pinned empty endpoint surfaces; `PluginDrivenExternalCatalogSsrfGateTest` used an HMS-only fake. Existing Hive HA SQL validation covered storage configuration and `test_connection=false`, without an SDK-independent policy rejection seam. There was no regression for returned lazy sources or failure before hook acquisition. - **Fix:** Validate root/sibling endpoints and complete ALTER candidates, then bracket Java SDK work independently of authentication. Share nested hook ownership and release only acquired scopes. - **Other paths and branches:** Covers shipped standalone catalog admission and inherited lake storage. Cached 4.0/4.1/4.2 refs have legacy REST paths requiring separate adaptation; latest branch heads and the first introducing PR were not established. Native/runtime boundaries are below. - **Configs and defaults:** `security_checker_class_name` remains empty by default. The configured SDK continues to own denied addresses and operator exceptions. Unknown scheme-less SDK/storage endpoints require an explicit URI scheme or port; unsupported opaque network formats fail closed only while the policy is enabled. - **Behavior change:** Configured enforcement now reaches previously unchecked inputs and revalidates stored endpoints on ALTER. Replay performs no endpoint probes; lazy access validates again. Connector plugin API advances to 40.0, so out-of-tree connector plugins must be rebuilt. ### Testing - Baseline engine regression: 47 tests, 3 expected failures for ordering, malformed endpoints and ALTER activation. - Baseline runtime/lazy tests reproduced missing hook coverage; two acquisition-failure tests reproduced premature outer-hook release. - Final unit tests: 98 selected classes, 808 tests, 0 failures/errors/skips, including all 38 SPI test classes. - Mandatory FE Checkstyle: passed; final post-review check passed. - Final-source FE build: passed. SQL regression: 1 suite passed, 21 CREATE and 2 ALTER rejections across all 11 standalone catalog types; HTTP authentication stayed enabled. The modified master FE used an unmodified, SHA512-verified official 4.1.5 BE for scalar setup. - The REST hook test uses the actual Iceberg HTTP client and a loopback server, including an OAuth-derived client on another thread. Rejection produces zero HTTP requests. ### Notes for Reviewers The optional security SDK was unavailable locally; recording policies and a fail-only debugpoint verify Doris routing. JNI networking, SDK-owned workers and server-discovered destinations still require native/SDK protection or host egress controls. Probes retain existing timeout/error semantics; full-candidate validation can add ALTER latency. The included guide explains these boundaries. ### Release note Configured SSRF checking now covers additional external catalog endpoints, aliases, indirect lake configuration and supported Java SDK calls. Ambiguous network addresses require an explicit scheme or port. Rebuild out-of-tree connector plugins against plugin API 40.0; the checker remains disabled unless configured by the operator. ### Check List (For Author) - Behavior changed: Yes (see Details) - Does this need documentation: Yes; guide included. Operator catalog docs should describe enforcement, endpoint formats and API migration. - Pre-submission status: Partially verified: local review, unit tests, FE Checkstyle, packaging and SQL regression passed; the optional security SDK was unavailable locally. ### AI Disclosure - Tool: OpenAI Codex (GPT-6) - Generated: Implementation, tests, developer documentation and this description. - Human review: No human code review has been recorded; the agent performed local self-review and corrected its findings. -- 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]
