hello-stephen commented on code in PR #71205:
URL: https://github.com/apache/doris/pull/71205#discussion_r4771482964


##########
fe/fe-connector/fe-connector-iceberg/src/main/java/org/apache/doris/connector/iceberg/IcebergConnectorProvider.java:
##########
@@ -98,6 +99,97 @@ public ConnectorSecuritySurface securitySurface() {
                 // Protect inline SDK credentials even when the additional 
name-pattern rule is disabled.
                 .withSensitiveKeys(List.of("gcp.auth.credentials-json", 
"gcs.oauth2.token",
                         "gcs.encryption-key", "gcs.decryption-key"))
-                .withSsrfEndpoints("kms.endpoint");
+                .withSensitiveKeyPrefix("client.credentials-provider.",
+                        "credential", "password", "secret", "token", "key", 
"authorization", "header")
+                .withSsrfEndpoints("kms.endpoint", "iceberg.rest.uri", "uri",
+                        "hive.metastore.uris", "metastore.thrift.uris", 
"s3tables.endpoint", "iceberg.jdbc.uri",
+                        "dynamodb.endpoint",
+                        "http-client.proxy-endpoint", "signer.uri")
+                // Native GCS overrides its storage service host independently 
of the catalog's REST URI.
+                .withSsrfEndpoints("gcs.service.host")
+                .withSsrfEndpoints("glue.endpoint", "aws.endpoint", 
"aws.glue.endpoint",
+                        "dlf.endpoint", "dlf.catalog.endpoint");
+    }
+
+    @Override
+    public ConnectorSecuritySurface securitySurface(Map<String, String> 
properties) {
+        ConnectorSecuritySurface surface = securitySurface();
+        Map<String, String> endpointProperties = new HashMap<>(properties);

Review Comment:
   [P2] Validate Google credential token endpoints during admission
   
   With enforcement enabled, a REST catalog using 
`iceberg.rest.security.type=google`, an allowed REST URI and valid 
`service_account` JSON in `gcp.auth.credentials-json` can set 
`token_uri=http://127.0.0.1:9000/token`. This surface never extracts that 
destination, and shared storage inference does not inspect JSON, so CREATE with 
`test_connection=false` and ALTER accept it without probing the peer. 
`IcebergGoogleCredentialValidator` only checks field types; 
`IcebergCatalogFactory` forwards the JSON unchanged. [Iceberg's Google auth 
manager](https://github.com/apache/iceberg/blob/apache-iceberg-1.12.0/gcp/src/main/java/org/apache/iceberg/gcp/auth/GoogleAuthManager.java)
 loads it, and [Google's service-account 
client](https://github.com/googleapis/google-auth-library-java/blob/main/oauth2_http/java/com/google/auth/oauth2/ServiceAccountCredentials.java)
 uses `token_uri` for token POSTs. This concerns statement admission 
independently of runtime hooks. Derive the supported structured cr
 edential destinations, or reject unmodeled routes under enforcement, while 
keeping secret material opaque; add enabled-policy CREATE/ALTER rejection 
coverage and an allowed-token-endpoint control.



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