Gabriel39 commented on code in PR #71205:
URL: https://github.com/apache/doris/pull/71205#discussion_r4782707489


##########
fe/fe-core/src/main/java/org/apache/doris/datasource/plugin/PluginDrivenExternalCatalog.java:
##########
@@ -484,6 +363,8 @@ private void checkHiveParquetTimeZone(CatalogProperty 
property) throws DdlExcept
 
     @Override
     public void checkWhenCreating() throws DdlException {
+        // Pre-validation may download drivers or open connections even when 
test_connection is false.
+        checkEndpointsAgainstSsrf(catalogProperty.getProperties());

Review Comment:
   Addressed in ed62825c9aa. CREATE now carries a create-only admission receipt 
into finishCatalogCreation. It deduplicates actual host/port pairs only within 
the same enabled checker identity and admits newly introduced peers. The 
receipt is consumed before pre-validation and is unavailable to later lazy or 
sibling access. Full factory-path recording tests cover successful and rejected 
peers, defaults and policy changes.
   
   Validation: 137 selected test classes / 2460 tests passed; FE Checkstyle and 
packaging checks passed. The SQL suite passed 376 expected policy refusals with 
positive CREATE/ALTER controls.



##########
fe/fe-core/src/main/java/org/apache/doris/connector/DefaultConnectorContext.java:
##########
@@ -211,9 +211,19 @@ public ConnectorHttpSecurityHook getHttpSecurityHook() {
 
     /** Constructs the root connector under the same ownership boundary used 
by its later siblings. */
     public Connector createCatalogConnector(String catalogType, Map<String, 
String> properties) {
+        return createCatalogConnector(catalogType, properties, true);
+    }
+
+    /** Replay must reconstruct metadata without probing the network; later 
user access is checked again. */
+    public Connector createCatalogConnector(String catalogType, Map<String, 
String> properties,
+            boolean checkEndpoints) {
         try {
-            return cacheOwner.create(() -> 
ConnectorFactory.createStandaloneCatalogConnector(
-                    catalogType, properties, this));
+            return cacheOwner.create(() -> {
+                if (checkEndpoints) {
+                    validateConnectorEndpoints(catalogType, properties);

Review Comment:
   Addressed in ed62825c9aa. ALTER and replay now acquire the catalog monitor 
before trying the manager lock and recheck catalog identity under both locks. 
Detached candidate validation runs outside mutation locks, and connector 
cleanup runs after unlocking. Concurrency tests exercise lazy initialization, 
normal ALTER, replay, replacement and removal so an unavailable old endpoint 
cannot hold the global lock while ALTER waits for the catalog monitor.
   
   Validation: 137 selected test classes / 2460 tests passed; FE Checkstyle and 
packaging checks passed. The SQL suite passed 376 expected policy refusals with 
positive CREATE/ALTER controls.



##########
fe/fe-connector/fe-connector-jdbc/src/main/java/org/apache/doris/connector/jdbc/JdbcConnectorProvider.java:
##########
@@ -56,6 +56,9 @@ public ConnectorSecuritySurface securitySurface() {
         // the engine's operator gate applies jdbc_driver_secure_path / the 
mandatory rule on CREATE + ALTER.
         // The engine masks passwords and complete JDBC connection URLs 
wherever it shows catalog properties.
         return ConnectorSecuritySurface.ofJdbcDriverUrls(null, "driver_url", 
"jdbc.driver_url")
-                .withSensitiveKeys(JdbcCatalogProperties.sensitiveKeys());
+                .withSensitiveKeys(JdbcCatalogProperties.sensitiveKeys())
+                // Admission sees the raw map before the property holder 
strips the documented prefix.
+                .withSsrfEndpoints(JdbcCatalogProperties.JDBC_URL,

Review Comment:
   Addressed in ed62825c9aa. Standalone JDBC now selects jdbc_url by 
canonical-key presence before jdbc.jdbc_url and shares the ASCII-space 
normalization used by its runtime URL consumer. Retired aliases are not 
admitted as active database routes; metastore JDBC consumers retain their raw 
grammar. Recording tests cover canonical replacement, blank canonical values 
and supported spaced ClickHouse URLs.
   
   Validation: 137 selected test classes / 2460 tests passed; FE Checkstyle and 
packaging checks passed. The SQL suite passed 376 expected policy refusals with 
positive CREATE/ALTER controls.



-- 
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]

Reply via email to