github-actions[bot] commented on code in PR #62988:
URL: https://github.com/apache/doris/pull/62988#discussion_r4663717205
##########
fe/fe-connector/fe-connector-iceberg/src/main/java/org/apache/doris/connector/iceberg/IcebergCatalogFactory.java:
##########
@@ -570,10 +595,20 @@ public static void appendRestProperties(Map<String,
String> opts, IcebergRestMet
// Timeouts: legacy fields default non-blank, so they are effectively
always emitted.
opts.put(REST_CONNECTION_TIMEOUT_MS_KEY,
rest.getConnectionTimeoutMs());
opts.put(REST_SOCKET_TIMEOUT_MS_KEY, rest.getSocketTimeoutMs());
+ putIfNotBlank(opts, CatalogProperties.FILE_IO_IMPL, rest.getIoImpl());
+ putIfNotBlank(opts, REST_GOOGLE_USER_PROJECT_HEADER,
rest.getGoogleUserProject());
appendRestOAuth2Properties(opts, rest);
+ appendRestGoogleProperties(opts, rest);
appendRestSigningProperties(opts, rest, props, chosenS3);
}
+ private static void appendRestGoogleProperties(Map<String, String> opts,
IcebergRestMetaStoreProperties rest) {
+ if (!SECURITY_TYPE_GOOGLE.equalsIgnoreCase(rest.getSecurityType())) {
+ return;
+ }
+ opts.put(AuthProperties.AUTH_TYPE,
AuthProperties.AUTH_MANAGER_IMPL_GOOGLE);
Review Comment:
[P1] Declare the Google/GCS endpoint properties in the connector SSRF surface
The new GoogleAuthManager/GCSFileIO path is now loadable and raw Iceberg
properties pass through, but `IcebergConnectorProvider.securitySurface()` still
declares only `kms.endpoint`. With `security_checker_class_name` configured,
the CREATE/ALTER gate therefore never probes user-controlled destinations such
as `gcs.service.host` and `gcs.oauth2.refresh-credentials-endpoint`, even
though the FE/BE clients connect to them. A non-SUPER user who can create or
alter a catalog can consequently steer these requests to an internal host.
Declare every Google/GCS endpoint key through
`ConnectorSecuritySurface.ofSsrfEndpoints(...)` and cover the gate with a
provider test.
##########
fe/fe-connector/fe-connector-iceberg/src/main/java/org/apache/doris/connector/iceberg/IcebergCatalogFactory.java:
##########
@@ -480,18 +496,27 @@ public static Map<String, String>
buildCatalogProperties(IcebergCatalogPropertie
opts.put(GcpCredential.CREDENTIAL_PROVIDER_TYPE,
credential.getCredentialProviderType().name());
putIfNotBlank(opts,
GcpCredential.IMPERSONATION_SERVICE_ACCOUNT,
credential.getImpersonationServiceAccount());
- // Keep explicit FileIO choices. By default, S3 aliases use
the GCP client factory,
- // while gs/HDFS paths use HadoopFileIO with the native
fs.gs.* configuration
- // (the plugin does not bundle iceberg-gcp's GCSFileIO).
- opts.putIfAbsent(CatalogProperties.FILE_IO_IMPL,
"org.apache.iceberg.io.ResolvingFileIO");
+ // S3 aliases use the GCP client factory; gs/HDFS stay on
HadoopFileIO (pinned above)
+ // with the native fs.gs.* configuration emitted here.
opts.put(S3FileIOProperties.CLIENT_FACTORY,
GcpS3FileIOAwsClientFactory.class.getName());
});
}));
+ if (IcebergCatalogProperties.TYPE_REST.equals(flavor) &&
hasRawGcsHadoopProperties(props)) {
Review Comment:
[P2] Preserve the Hadoop fallback for opaque REST catalogs using raw
fs.s3a.* settings
This guard only recognizes `fs.gs.*`. For an opaque REST catalog with
`warehouse=analytics` and raw `fs.s3a.impl`,
`fs.s3a.endpoint=https://storage.googleapis.com`, `fs.s3a.access.key` and
`fs.s3a.secret.key`, `GcsAuthResolver.guessIsGcs()` leaves `chosenS3` empty, so
no `NativeGcsResolvingFileIO` pin is emitted. Because this PR adds
`iceberg-gcp`, `ResolvingFileIO` now resolves a `gs://` metadata location to
`GCSFileIO`, which ignores those `fs.s3a.*` HMAC settings; existing
metadata/manifest reads then lose their configured credentials. Extend the REST
fallback to cover this Hadoop dialect (while preserving explicit `io-impl`
precedence) and add a regression test. This is separate from the fixed raw
`fs.gs.*` case.
--
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]