Gabriel39 commented on code in PR #71205:
URL: https://github.com/apache/doris/pull/71205#discussion_r4785467857
##########
fe/fe-connector/fe-connector-fluss/src/main/java/org/apache/doris/connector/fluss/FlussConnectorProvider.java:
##########
@@ -51,16 +56,92 @@ public Connector create(Map<String, String> properties,
ConnectorContext context
}
/**
- * The fluss client's SASL credentials, a small and stable set of keys,
and the lake options under
- * {@link FlussCatalogProperties#LAKE_OPTION_PREFIX}: those are open-ended
(new paimon / filesystem
+ * The fluss client's SASL and direct gateway REST credentials use stable
keys. Lake options under
+ * {@link FlussCatalogProperties#LAKE_OPTION_PREFIX} are open-ended (new
paimon / filesystem
* credential names may arrive without a Doris release), so a lake option
is a secret when its name
* carries a credential-like word, and endpoints and other operational
settings stay visible.
*/
@Override
public ConnectorSecuritySurface securitySurface() {
+ return
baseSecuritySurface().withSsrfEndpointPrefixes(FlussCatalogProperties.LAKE_OPTION_PREFIX);
+ }
+
+ private static ConnectorSecuritySurface baseSecuritySurface() {
return
ConnectorSecuritySurface.ofSensitiveKeys("fluss.client.security.sasl.username",
"fluss.client.security.sasl.password",
"fluss.client.security.sasl.jaas.config")
+ // Direct gateway REST options reach the sibling through a
separate namespace on first lake access.
+ .withSsrfEndpointPrefixes("paimon.rest.")
+ .withSensitiveKeys("paimon.rest.token",
"paimon.rest.dlf.access-key-id",
+ "paimon.rest.dlf.access-key-secret")
+ .withSsrfEndpoints(FlussCatalogProperties.BOOTSTRAP_SERVERS)
+ .withSsrfEndpoints(FlussCatalogProperties.LAKE_OPTION_PREFIX +
"hive.metastore.uris",
+ FlussCatalogProperties.LAKE_OPTION_PREFIX +
"metastore.thrift.uris")
.withSensitiveKeyPrefix(FlussCatalogProperties.LAKE_OPTION_PREFIX,
"key", "secret", "password", "token", "credential");
}
+
+ @Override
+ public ConnectorSecuritySurface securitySurface(Map<String, String>
properties) {
+ ConnectorSecuritySurface base = baseSecuritySurface();
+ ConnectorSecuritySurface surface = base;
+ Map<String, String> lake =
FlussCatalogProperties.extractLakeOverrides(properties);
+ Map<String, String> context = new HashMap<>(properties);
+ // The storage sibling binds canonical names after translating Hadoop
lake aliases.
+ Map<String, String> storage =
LakeStorageOptions.toStorageProperties(lake);
+ // Connector storage is published as defaults: even a blank direct key
remains authoritative.
+ storage.forEach(context::putIfAbsent);
+ // Unmapped sibling aliases cannot replace either direct properties or
translated storage defaults.
+ lake.forEach(context::putIfAbsent);
Review Comment:
Addressed in f28602a481e. Fluss no longer restores translated lake storage
options through the raw fallback map. Its canonical direct properties,
including blank values, remain authoritative; only unmapped sibling options are
retained as fallbacks. A recording case denies the retired nested OSS host
while observing the direct region-derived peer, and existing
translated/default/HA tests remain covered.
Validation: 140 selected test classes / 2502 tests passed; FE Checkstyle and
packaging checks passed. The SQL suite passed 386 expected policy refusals with
positive CREATE/ALTER controls.
##########
fe/fe-connector/fe-connector-paimon/src/main/java/org/apache/doris/connector/paimon/PaimonConnectorProvider.java:
##########
@@ -106,7 +110,69 @@ public ConnectorSecuritySurface securitySurface() {
// The secrets are those of every metastore flavor: the engine masks
by key name alone.
return ConnectorSecuritySurface.ofJdbcDriverUrls(
"paimon.catalog.type", "paimon.jdbc.driver_url",
"jdbc.driver_url")
- .withSensitiveKeys(MetaStoreProviders.sensitivePropertyKeys());
+ .withSensitiveKeys(MetaStoreProviders.sensitivePropertyKeys())
+
.withSensitiveKeys(JdbcTlsStoreUrlSecurity.sensitivePropertyKeys("jdbc."))
+
.withSensitiveKeys(JdbcTlsStoreUrlSecurity.sensitivePropertyKeys("paimon.jdbc."))
+ // The pass-through bearer token is opaque even when its bytes
look like an HTTP URL.
+ .withSensitiveKeys("paimon.rest.token")
+ // REST token providers also perform HTTP calls; checking only
the catalog URI misses them.
+ .withSsrfEndpoints("paimon.rest.uri", "uri",
"paimon.rest.dlf.token-ecs-metadata-url",
+ "hive.metastore.uris", "metastore.thrift.uris",
"paimon.jdbc.uri")
+ .withSsrfEndpoints("paimon.rest.dlf.oss-endpoint")
+ // DLF's scheme-less metadata aliases retain the HTTPS default
of the shared HMS path.
+ .withSsrfEndpoints(443, "dlf.endpoint", "dlf.catalog.endpoint")
+ .withSsrfEndpointPrefixes("paimon.rest.");
}
+ @Override
+ public ConnectorSecuritySurface securitySurface(Map<String, String>
properties) {
+ ConnectorSecuritySurface surface = securitySurface();
+ String flavor = properties.getOrDefault("paimon.catalog.type",
"filesystem").trim();
+ String metastore = properties.get("hive.metastore.uris");
+ boolean canonicalHmsUri = !"jdbc".equalsIgnoreCase(flavor) &&
!"rest".equalsIgnoreCase(flavor)
+ && metastore != null && !metastore.isBlank();
+ // A complete ALTER can switch either URI alias or driver and activate
stored native options.
+ boolean mariaDb =
JdbcTlsStoreUrlSecurity.mayUseMariaDb(properties.get("uri"),
+ properties.get("paimon.jdbc.driver_class"))
+ ||
JdbcTlsStoreUrlSecurity.mayUseMariaDb(properties.get("paimon.jdbc.uri"),
+ properties.get("jdbc.driver_class"));
+ boolean connectorJ = JdbcTlsStoreUrlSecurity.mayUseConnectorJ(
+ properties.get("uri"), properties.get("paimon.jdbc.uri"));
+ List<String> suppliedPorts = new ArrayList<>();
+ for (Map.Entry<String, String> entry :
PaimonCatalogFactory.jdbcDriverOptionKeys(properties).entrySet()) {
+ String key = entry.getValue();
+ String option = entry.getKey();
+ String value = properties.get(key);
+ if (option.startsWith("jdbc.") &&
option.substring(5).equalsIgnoreCase("port")) {
+ suppliedPorts.add(value);
+ }
+ if (option.startsWith("jdbc.") &&
(JdbcTlsStoreUrlSecurity.isStoreUrlProperty(option.substring(5))
+ || (mariaDb &&
JdbcTlsStoreUrlSecurity.isMariaDbStoreUrlProperty(option.substring(5))))) {
+ // ALTER resolves the complete candidate again, including a
newly activated stored fallback.
+ surface = surface.withSsrfEndpointValues(key,
+ JdbcTlsStoreUrlSecurity.storePropertyEndpointValues(
+ option.substring(5), value, connectorJ,
mariaDb).toArray(new String[0]));
+ }
+ if (option.startsWith("jdbc.")) {
+ // Common aliases can independently select proxy/discovery
routes absent from the URL.
+ List<String> proxy =
JdbcProxyPropertySecurity.driverPropertyEndpointValues(
+ option.substring(5), value);
+ if (!proxy.isEmpty()) {
+ surface = surface.withSsrfEndpointValues(key,
proxy.toArray(new String[0]));
+ }
+ }
+ }
+ if (!suppliedPorts.isEmpty()) {
+ for (String uriKey : new String[] {"uri", "paimon.jdbc.uri"}) {
+ if (properties.containsKey(uriKey)) {
+ surface = surface.withSsrfEndpointValues(uriKey,
+
JdbcProxyPropertySecurity.mysqlPortEndpointValues(properties.get(uriKey),
suppliedPorts)
+ .toArray(new String[0]));
+ }
+ }
+ }
+ // The canonical HMS alias retires uri only for metadata, including
after JDBC option projection.
+ // Shared storage admission independently keeps the raw URI's
filesystem role.
+ return canonicalHmsUri ? surface.withSsrfEndpointValues("uri") :
surface;
Review Comment:
Addressed in f28602a481e. Filesystem-flavored Paimon now suppresses the raw
URI metadata interpretation, including omitted and blank flavor values. The
shared storage gate still checks the bound resource URI independently.
Recording cases cover explicit/implicit filesystem flavor and actual normalized
S3 peers; SQL retains both permitted and rejected physical HDFS inheritance
controls.
Validation: 140 selected test classes / 2502 tests passed; FE Checkstyle and
packaging checks passed. The SQL suite passed 386 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]