You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@polaris.apache.org by "snazy (via GitHub)" <gi...@apache.org> on 2025/05/06 12:14:34 UTC

[PR] Require explict user-consent to enable HadoopFileIO [polaris]

snazy opened a new pull request, #1532:
URL: https://github.com/apache/polaris/pull/1532

   Using `HadoopFileIO` in Polaris can enable "hidden features" that users are likely not aware of. This change requires users to manually update the configuration to be able to use `HadoopFileIO` in way that highlights the consequences of enabling it.
   
   This PR updates Polaris in multiple ways:
   * The default of `SUPPORTED_CATALOG_STORAGE_TYPES` is changed to not include the `FILE` storage type.
   * Respect the `ALLOW_SPECIFYING_FILE_IO_IMPL` configuration on namespaces, tables and views to prevent setting an `io-impl` value for anything but one of the configured, supported storage-types.
   * Unify validation code in a new class `IcebergPropertiesValidation`.
   * Using `FILE` or `HadoopFileIO` now _also_ requires the explicit configuration `ALLOW_INSECURE_STORAGE_TYPES_ACCEPTING_SECURITY_RISKS=true`.
   * Added production readiness checks that trigger when `ALLOW_INSECURE_STORAGE_TYPES_ACCEPTING_SECURITY_RISKS` is `true` or `SUPPORTED_CATALOG_STORAGE_TYPES` contains `FILE` (defaults and per-realm).
   * The two new readiness checks are considered _severe_. Severe readiness-errors prevent the server from starting up - unless the user explicitly configured `polaris.readiness.ignore-security-issues=true`.
   
   Log messages and configuration options explicitly use "clear" phrases highlighting the consequences.
   
   With these changes it is intentionally extremely difficult to start Polaris with HadoopFileIO. People who work around all these safety nets must have realized that what they are doing.
   
   A lot of the test code relies on `FILE`/`HadoopFileIO`, those tests got all the configurations to let those tests continue to work as they are, bypassing the added security safeguards.
   
   <!--
       Possible security vulnerabilities: STOP here and contact security@apache.org instead!
   
       Please update the title of the PR with a meaningful message - do not leave it "empty" or "generated"
       Please update this summary field:
   
       The summary should cover these topics, if applicable:
       * the motivation for the change
       * a description of the status quo, for example the current behavior
       * the desired behavior
       * etc
   
       PR checklist:
       - Do a self-review of your code before opening a pull request
       - Make sure that there's good test coverage for the changes included in this PR
       - Run tests locally before pushing a PR (./gradlew check)
       - Code should have comments where applicable. Particularly hard-to-understand
         areas deserve good in-line documentation.
       - Include changes and enhancements to the documentation (in site/content/in-dev/unreleased)
       - For Work In Progress Pull Requests, please use the Draft PR feature.
   
       Make sure to add the information BELOW this comment.
       Everything in this comment will NOT be added to the PR description.
   -->
   


-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Require explict user-consent to enable HadoopFileIO [polaris]

Posted by "eric-maynard (via GitHub)" <gi...@apache.org>.
eric-maynard commented on code in PR #1532:
URL: https://github.com/apache/polaris/pull/1532#discussion_r2082222977


##########
service/common/src/main/java/org/apache/polaris/service/catalog/validation/StorageTypeFileIO.java:
##########
@@ -0,0 +1,86 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.polaris.service.catalog.validation;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+import org.apache.polaris.core.storage.PolarisStorageConfigurationInfo;
+
+enum StorageTypeFileIO {
+  S3("org.apache.iceberg.aws.s3.S3FileIO", true),
+
+  GCS("org.apache.iceberg.gcp.gcs.GCSFileIO", true),
+
+  AZURE("org.apache.iceberg.azure.adlsv2.ADLSFileIO", true),
+
+  FILE("org.apache.iceberg.hadoop.HadoopFileIO", false),

Review Comment:
   We can't actually guarantee that the implementation found at this location by the classloader is the one you have in mind



-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Require explict user-consent to enable HadoopFileIO [polaris]

Posted by "eric-maynard (via GitHub)" <gi...@apache.org>.
eric-maynard commented on PR #1532:
URL: https://github.com/apache/polaris/pull/1532#issuecomment-2868619084

   > INITIALIZE_DEFAULT_CATALOG_FILEIO_FOR_TEST was already present, but I don’t think that justifies promoting it to a first-class config flag.
   
   +1, it was left out of the original `PolarisConfiguration` change for a reason and this is also what I am saying [here](https://github.com/apache/polaris/pull/1532#discussion_r2075949695)
   
   As for removing it, I don't really have an opinion. It's certainly not a change that seems necessary to fix any kind of bug.


-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Require explict user-consent to enable HadoopFileIO [polaris]

Posted by "eric-maynard (via GitHub)" <gi...@apache.org>.
eric-maynard commented on code in PR #1532:
URL: https://github.com/apache/polaris/pull/1532#discussion_r2078886209


##########
quarkus/service/src/main/java/org/apache/polaris/service/quarkus/config/ProductionReadinessChecks.java:
##########
@@ -55,26 +62,53 @@ public class ProductionReadinessChecks {
    */
   private static final String WARNING_SIGN_UTF_8 = "\u0000\u26A0\uFE0F";
 
+  private static final String SEVERE_SIGN_UTF_8 = "\u0000\uD83D\uDED1";

Review Comment:
   That may be so, but I don't think this change is necessary to `Require explict user-consent to enable HadoopFileIO`



-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Require explict user-consent to enable HadoopFileIO [polaris]

Posted by "dimas-b (via GitHub)" <gi...@apache.org>.
dimas-b commented on code in PR #1532:
URL: https://github.com/apache/polaris/pull/1532#discussion_r2080644065


##########
quarkus/service/src/test/java/org/apache/polaris/service/quarkus/admin/PolarisOverlappingTableTest.java:
##########
@@ -73,10 +74,25 @@ private int createTable(TestServices services, String location) {
 
   static Stream<Arguments> testTableLocationRestrictions() {
     Map<String, Object> laxServices =
-        Map.of("ALLOW_UNSTRUCTURED_TABLE_LOCATION", "true", "ALLOW_TABLE_LOCATION_OVERLAP", "true");
+        Map.of(
+            "ALLOW_UNSTRUCTURED_TABLE_LOCATION",
+            "true",
+            "ALLOW_TABLE_LOCATION_OVERLAP",
+            "true",
+            "ALLOW_INSECURE_STORAGE_TYPES_ACCEPTING_SECURITY_RISKS",

Review Comment:
   It is set in `application-it.properties`... could we also set it in `-test.properties` and avoid repeating here and in many other tests?



##########
polaris-core/src/main/java/org/apache/polaris/core/config/FeatureConfiguration.java:
##########
@@ -234,4 +233,38 @@ public static void enforceFeatureEnabledOrThrow(
           .description("If true, the policy-store endpoints are enabled")
           .defaultValue(true)
           .buildFeatureConfiguration();
+
+  public static final FeatureConfiguration<Boolean> ALLOW_SPECIFYING_FILE_IO_IMPL =
+      PolarisConfiguration.<Boolean>builder()
+          .key("ALLOW_SPECIFYING_FILE_IO_IMPL")
+          .description(
+              "Config key for whether to allow setting the FILE_IO_IMPL using catalog properties. "
+                  + "Must only be enabled in dev/test environments, never in production systems.")

Review Comment:
   IMHO, "never" is too strong. I do not think we should presume to know all factors Polaris admins have to consider. I'd change to `It should not normally be enabled in production systems.`



##########
service/common/src/main/java/org/apache/polaris/service/catalog/validation/IcebergPropertiesValidation.java:
##########
@@ -0,0 +1,95 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.polaris.service.catalog.validation;
+
+import static org.apache.polaris.core.config.FeatureConfiguration.ALLOW_INSECURE_STORAGE_TYPES_ACCEPTING_SECURITY_RISKS;
+import static org.apache.polaris.core.config.FeatureConfiguration.ALLOW_SPECIFYING_FILE_IO_IMPL;
+import static org.apache.polaris.core.config.FeatureConfiguration.SUPPORTED_CATALOG_STORAGE_TYPES;
+
+import jakarta.annotation.Nonnull;
+import jakarta.annotation.Nullable;
+import java.util.Map;
+import org.apache.iceberg.CatalogProperties;
+import org.apache.iceberg.exceptions.ValidationException;
+import org.apache.polaris.core.context.CallContext;
+import org.apache.polaris.core.storage.PolarisStorageConfigurationInfo;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class IcebergPropertiesValidation {
+  private static final Logger LOGGER = LoggerFactory.getLogger(IcebergPropertiesValidation.class);
+
+  public static void validateIcebergProperties(
+      @Nonnull CallContext callContext, @Nonnull Map<String, String> properties) {
+    validateIcebergProperties(callContext, properties, null);
+  }
+
+  public static String validateIcebergProperties(

Review Comment:
   Since the purpose of this method is to validate and return only the FileIO class name, how about `determineFileIoClassName(...)`



##########
service/common/src/main/java/org/apache/polaris/service/catalog/validation/IcebergPropertiesValidation.java:
##########
@@ -0,0 +1,95 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.polaris.service.catalog.validation;
+
+import static org.apache.polaris.core.config.FeatureConfiguration.ALLOW_INSECURE_STORAGE_TYPES_ACCEPTING_SECURITY_RISKS;
+import static org.apache.polaris.core.config.FeatureConfiguration.ALLOW_SPECIFYING_FILE_IO_IMPL;
+import static org.apache.polaris.core.config.FeatureConfiguration.SUPPORTED_CATALOG_STORAGE_TYPES;
+
+import jakarta.annotation.Nonnull;
+import jakarta.annotation.Nullable;
+import java.util.Map;
+import org.apache.iceberg.CatalogProperties;
+import org.apache.iceberg.exceptions.ValidationException;
+import org.apache.polaris.core.context.CallContext;
+import org.apache.polaris.core.storage.PolarisStorageConfigurationInfo;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class IcebergPropertiesValidation {
+  private static final Logger LOGGER = LoggerFactory.getLogger(IcebergPropertiesValidation.class);
+
+  public static void validateIcebergProperties(
+      @Nonnull CallContext callContext, @Nonnull Map<String, String> properties) {
+    validateIcebergProperties(callContext, properties, null);
+  }
+
+  public static String validateIcebergProperties(
+      @Nonnull CallContext callContext,
+      @Nonnull Map<String, String> properties,
+      @Nullable PolarisStorageConfigurationInfo storageConfigurationInfo) {
+    var ctx = callContext.getPolarisCallContext();
+    var configStore = ctx.getConfigurationStore();
+
+    var ioImpl = properties.get(CatalogProperties.FILE_IO_IMPL);
+    if (ioImpl != null) {
+      if (!configStore.getConfiguration(ctx, ALLOW_SPECIFYING_FILE_IO_IMPL)) {
+        throw new ValidationException(
+            "Cannot set property '%s' to '%s' for this catalog.",
+            CatalogProperties.FILE_IO_IMPL, ioImpl);
+      }
+      LOGGER.debug(
+          "Allowing overriding ioImplClassName to {} for storageConfiguration {}",
+          ioImpl,
+          storageConfigurationInfo);
+    } else if (storageConfigurationInfo != null) {
+      ioImpl = storageConfigurationInfo.getFileIoImplClassName();
+      LOGGER.debug(
+          "Resolved ioImplClassName {} from storageConfiguration {}",
+          ioImpl,
+          storageConfigurationInfo);
+    }
+
+    if (ioImpl != null) {
+      var storageType = StorageTypeFileIO.fromFileIoImplementation(ioImpl);
+      if (storageType.validateAllowedStorageType()
+          && !configStore
+              .getConfiguration(ctx, SUPPORTED_CATALOG_STORAGE_TYPES)
+              .contains(storageType.name())) {
+        throw new ValidationException(
+            "File IO implementation '%s', as storage type '%s' is not supported",
+            ioImpl, storageType);
+      }
+
+      if (!storageType.safe()
+          && !configStore.getConfiguration(
+              ctx, ALLOW_INSECURE_STORAGE_TYPES_ACCEPTING_SECURITY_RISKS)) {
+        throw new ValidationException(
+            "File IO implementation '%s' (storage type '%s') is considered insecure and must not be used",
+            ioImpl, storageType);
+      }
+    }
+
+    return ioImpl;
+  }
+
+  public static boolean safeStorageType(String name) {
+    return StorageTypeFileIO.valueOf(name).safe();

Review Comment:
   This is called from only one place and not in this file... Why not inline?



-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Require explict user-consent to enable HadoopFileIO [polaris]

Posted by "flyrain (via GitHub)" <gi...@apache.org>.
flyrain commented on PR #1532:
URL: https://github.com/apache/polaris/pull/1532#issuecomment-2859819947

   ```
     S3("org.apache.iceberg.aws.s3.S3FileIO", true),
     GCS("org.apache.iceberg.gcp.gcs.GCSFileIO", true),
     AZURE("org.apache.iceberg.azure.adlsv2.ADLSFileIO", true),
     FILE("org.apache.iceberg.hadoop.HadoopFileIO", false),
   ```
   Thanks for bring this up. It's a good point to clarify whether the HadoopFileIO is suitable for production. However, there is no guarantee any of above strings ensure a secure FileIO. They can be easily injected by any customized build or even completely different implementations with the same name. I believe it is ultimately Polaris admin's responsibility to make sure their Polaris deployment as secure as possible. We(Polaris developer/community) can provide suggestions to them for sure. With that, I'm +1 on well documented behavior on HadoopFileIO, but I don't think these checking and new configurations are necessary. `SUPPORTED_CATALOG_STORAGE_TYPES` should be good enough to let Polaris admin make the decision.
   


-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Require explicit user-consent to enable HadoopFileIO [polaris]

Posted by "dimas-b (via GitHub)" <gi...@apache.org>.
dimas-b commented on code in PR #1532:
URL: https://github.com/apache/polaris/pull/1532#discussion_r2086791902


##########
service/common/src/main/java/org/apache/polaris/service/catalog/validation/StorageTypeFileIO.java:
##########
@@ -0,0 +1,86 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.polaris.service.catalog.validation;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+import org.apache.polaris.core.storage.PolarisStorageConfigurationInfo;
+
+enum StorageTypeFileIO {
+  S3("org.apache.iceberg.aws.s3.S3FileIO", true),
+
+  GCS("org.apache.iceberg.gcp.gcs.GCSFileIO", true),
+
+  AZURE("org.apache.iceberg.azure.adlsv2.ADLSFileIO", true),
+
+  FILE("org.apache.iceberg.hadoop.HadoopFileIO", false),
+
+  // Iceberg tests
+  IN_MEMORY("org.apache.iceberg.inmemory.InMemoryFileIO", false, false),
+  ;
+
+  private final String fileIoImplementation;
+  private final boolean safe;
+  private final boolean validateAllowedStorageType;
+
+  StorageTypeFileIO(String fileIoImplementation, boolean safe) {
+    this(fileIoImplementation, safe, true);
+  }
+
+  StorageTypeFileIO(String fileIoImplementation, boolean safe, boolean validateAllowedStorageType) {
+    this.fileIoImplementation = fileIoImplementation;
+    this.safe = safe;
+    this.validateAllowedStorageType = validateAllowedStorageType;
+  }
+
+  boolean safe() {
+    return safe;
+  }
+
+  boolean validateAllowedStorageType() {
+    return validateAllowedStorageType;
+  }
+
+  static StorageTypeFileIO fromFileIoImplementation(String fileIoImplementation) {
+    var type = FILE_TO_TO_STORAGE_TYPE.get(fileIoImplementation);
+    if (type == null) {
+      throw new IllegalArgumentException("Unknown FileIO implementation: " + fileIoImplementation);

Review Comment:
   Good point. I guess this goes beyond the original intent behind this PR :thinking: 
   
   @snazy : WDYT about deferring the enforcement of the compile-time list of FileIO implementations?



-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Require explict user-consent to enable HadoopFileIO [polaris]

Posted by "flyrain (via GitHub)" <gi...@apache.org>.
flyrain commented on PR #1532:
URL: https://github.com/apache/polaris/pull/1532#issuecomment-2863897744

   > The default of SUPPORTED_CATALOG_STORAGE_TYPES is changed to not include the FILE storage type.
   
   Can we focus on this change? We can work on other changes in followup if necessary.


-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Require explicit user-consent to enable HadoopFileIO [polaris]

Posted by "flyrain (via GitHub)" <gi...@apache.org>.
flyrain commented on code in PR #1532:
URL: https://github.com/apache/polaris/pull/1532#discussion_r2100671076


##########
service/common/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergCatalog.java:
##########
@@ -2590,4 +2574,11 @@ private PageToken buildPageToken(@Nullable String tokenString, @Nullable Integer
       return PageToken.build(tokenString, pageSize);
     }
   }
+
+  static final FeatureConfiguration<Boolean> INITIALIZE_DEFAULT_CATALOG_FILEIO_FOR_TEST =
+      PolarisConfiguration.<Boolean>builder()
+          .key("INITIALIZE_DEFAULT_CATALOG_FILEIO_FOR_TEST")
+          .defaultValue(false)
+          .description("")
+          .buildFeatureConfiguration();

Review Comment:
   This change should have reverted. Why do you still do this, given that you are aware of PR https://github.com/apache/polaris/pull/1624, and reviewed it? 



-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Require explicit user-consent to enable HadoopFileIO [polaris]

Posted by "snazy (via GitHub)" <gi...@apache.org>.
snazy merged PR #1532:
URL: https://github.com/apache/polaris/pull/1532


-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Require explicit user-consent to enable HadoopFileIO [polaris]

Posted by "jbonofre (via GitHub)" <gi...@apache.org>.
jbonofre commented on code in PR #1532:
URL: https://github.com/apache/polaris/pull/1532#discussion_r2086123649


##########
quarkus/service/src/main/java/org/apache/polaris/service/quarkus/config/QuarkusReadinessConfiguration.java:
##########
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.polaris.service.quarkus.config;
+
+import io.quarkus.runtime.annotations.StaticInitSafe;
+import io.smallrye.config.ConfigMapping;
+import io.smallrye.config.WithDefault;
+
+@StaticInitSafe
+@ConfigMapping(prefix = "polaris.readiness")
+public interface QuarkusReadinessConfiguration {
+
+  /**
+   * Setting this to {@code true} means that Polaris will start up even if severe security risks
+   * have been detected, accepting the risk of denial-of-service, data-loss, corruption and other
+   * risks.
+   */
+  @WithDefault("false")
+  boolean ignoreSevereIssues();

Review Comment:
   If I generally agree with the last comments, specifically in this PR, I consider the changes "related": several/rendering messages is related to clearly inform the users about allowing insecure file types.
   So, it's fair to "group" related changes in one PR in this case.
   Another option would have been to just focus on "warning messages" (not rendered) when allowing insecure file types. As I'm sure that 90% of the users won't use insecure file types (and use the default configuration), a warning (not seen 90% of the time) would be sufficient.



##########
quarkus/service/src/main/java/org/apache/polaris/service/quarkus/config/ProductionReadinessChecks.java:
##########
@@ -55,26 +62,53 @@ public class ProductionReadinessChecks {
    */
   private static final String WARNING_SIGN_UTF_8 = "\u0000\u26A0\uFE0F";
 
+  private static final String SEVERE_SIGN_UTF_8 = "\u0000\uD83D\uDED1";

Review Comment:
   As I think the changes are "related", I think it's fair to do the changes in one PR (even if it's just "display/rendering" messages).



##########
polaris-core/src/main/java/org/apache/polaris/core/config/FeatureConfiguration.java:
##########
@@ -234,4 +233,36 @@ public static void enforceFeatureEnabledOrThrow(
           .description("If true, the policy-store endpoints are enabled")
           .defaultValue(true)
           .buildFeatureConfiguration();
+
+  public static final FeatureConfiguration<Boolean> ALLOW_SPECIFYING_FILE_IO_IMPL =
+      PolarisConfiguration.<Boolean>builder()
+          .key("ALLOW_SPECIFYING_FILE_IO_IMPL")
+          .description(
+              "Config key for whether to allow setting the FILE_IO_IMPL using catalog properties. "
+                  + "Must only be enabled in dev/test environments, should not be in production systems.")
+          .defaultValue(false)
+          .buildFeatureConfiguration();
+
+  public static final FeatureConfiguration<Boolean> ALLOW_INSECURE_STORAGE_TYPES =

Review Comment:
   As this is a user facing property, we need to be consistent (hard to change later).
   I think this property is good enough as it's generic to any storage type (not only `FILE`).



##########
quarkus/defaults/src/main/resources/application.properties:
##########
@@ -109,7 +109,7 @@ polaris.realm-context.header-name=Polaris-Realm
 polaris.realm-context.require-header=false
 
 polaris.features.defaults."ENFORCE_PRINCIPAL_CREDENTIAL_ROTATION_REQUIRED_CHECKING"=false
-polaris.features.defaults."SUPPORTED_CATALOG_STORAGE_TYPES"=["S3","GCS","AZURE","FILE"]
+polaris.features.defaults."SUPPORTED_CATALOG_STORAGE_TYPES"=["S3","GCS","AZURE"]

Review Comment:
   Nit: For clarify, I wonder if we should not add `polaris.features.defaults."ALLOW_INSECURE_STORAGE_TYPES"=false` here.



-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Require explicit user-consent to enable HadoopFileIO [polaris]

Posted by "snazy (via GitHub)" <gi...@apache.org>.
snazy commented on code in PR #1532:
URL: https://github.com/apache/polaris/pull/1532#discussion_r2095273961


##########
polaris-core/src/main/java/org/apache/polaris/core/config/FeatureConfiguration.java:
##########
@@ -234,4 +233,38 @@ public static void enforceFeatureEnabledOrThrow(
           .description("If true, the policy-store endpoints are enabled")
           .defaultValue(true)
           .buildFeatureConfiguration();
+
+  public static final FeatureConfiguration<Boolean> ALLOW_SPECIFYING_FILE_IO_IMPL =
+      PolarisConfiguration.<Boolean>builder()
+          .key("ALLOW_SPECIFYING_FILE_IO_IMPL")
+          .description(
+              "Config key for whether to allow setting the FILE_IO_IMPL using catalog properties. "
+                  + "Must only be enabled in dev/test environments, never in production systems.")
+          .defaultValue(false)
+          .buildFeatureConfiguration();
+
+  public static final FeatureConfiguration<Boolean>

Review Comment:
   Concrete suggestions for improvements are always welcome.



-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Require explicit user-consent to enable HadoopFileIO [polaris]

Posted by "flyrain (via GitHub)" <gi...@apache.org>.
flyrain commented on code in PR #1532:
URL: https://github.com/apache/polaris/pull/1532#discussion_r2098576602


##########
service/common/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergCatalog.java:
##########
@@ -2590,4 +2574,11 @@ private PageToken buildPageToken(@Nullable String tokenString, @Nullable Integer
       return PageToken.build(tokenString, pageSize);
     }
   }
+
+  static final FeatureConfiguration<Boolean> INITIALIZE_DEFAULT_CATALOG_FILEIO_FOR_TEST =
+      PolarisConfiguration.<Boolean>builder()
+          .key("INITIALIZE_DEFAULT_CATALOG_FILEIO_FOR_TEST")
+          .defaultValue(false)
+          .description("")
+          .buildFeatureConfiguration();

Review Comment:
   I thought this was reverted. Also https://github.com/apache/polaris/pull/1624 is going to remove it completely. These changes seems unnecessary. 



-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Require explict user-consent to enable HadoopFileIO [polaris]

Posted by "dimas-b (via GitHub)" <gi...@apache.org>.
dimas-b commented on code in PR #1532:
URL: https://github.com/apache/polaris/pull/1532#discussion_r2082354612


##########
service/common/src/main/java/org/apache/polaris/service/catalog/validation/StorageTypeFileIO.java:
##########
@@ -0,0 +1,86 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.polaris.service.catalog.validation;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+import org.apache.polaris.core.storage.PolarisStorageConfigurationInfo;
+
+enum StorageTypeFileIO {
+  S3("org.apache.iceberg.aws.s3.S3FileIO", true),
+
+  GCS("org.apache.iceberg.gcp.gcs.GCSFileIO", true),
+
+  AZURE("org.apache.iceberg.azure.adlsv2.ADLSFileIO", true),
+
+  FILE("org.apache.iceberg.hadoop.HadoopFileIO", false),

Review Comment:
   That is true, but again, I'd suggest improving the "precision" of checks later, after merging this PR.



-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Require explict user-consent to enable HadoopFileIO [polaris]

Posted by "pingtimeout (via GitHub)" <gi...@apache.org>.
pingtimeout commented on code in PR #1532:
URL: https://github.com/apache/polaris/pull/1532#discussion_r2084072441


##########
quarkus/service/src/main/java/org/apache/polaris/service/quarkus/config/QuarkusReadinessConfiguration.java:
##########
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.polaris.service.quarkus.config;
+
+import io.quarkus.runtime.annotations.StaticInitSafe;
+import io.smallrye.config.ConfigMapping;
+import io.smallrye.config.WithDefault;
+
+@StaticInitSafe
+@ConfigMapping(prefix = "polaris.readiness")
+public interface QuarkusReadinessConfiguration {
+
+  /**
+   * Setting this to {@code true} means that Polaris will start up even if severe security risks
+   * have been detected, accepting the risk of denial-of-service, data-loss, corruption and other
+   * risks.
+   */
+  @WithDefault("false")
+  boolean ignoreSevereIssues();

Review Comment:
   @eric-maynard "Severe" is a standard term to denote the most important information.  See [java.util.logging.Level](https://docs.oracle.com/javase/8/docs/api/java/util/logging/Level.html) for an example of how it is used in the context of logs.



-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Require explict user-consent to enable HadoopFileIO [polaris]

Posted by "eric-maynard (via GitHub)" <gi...@apache.org>.
eric-maynard commented on code in PR #1532:
URL: https://github.com/apache/polaris/pull/1532#discussion_r2083015871


##########
service/common/src/main/java/org/apache/polaris/service/catalog/validation/StorageTypeFileIO.java:
##########
@@ -0,0 +1,86 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.polaris.service.catalog.validation;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+import org.apache.polaris.core.storage.PolarisStorageConfigurationInfo;
+
+enum StorageTypeFileIO {
+  S3("org.apache.iceberg.aws.s3.S3FileIO", true),
+
+  GCS("org.apache.iceberg.gcp.gcs.GCSFileIO", true),
+
+  AZURE("org.apache.iceberg.azure.adlsv2.ADLSFileIO", true),
+
+  FILE("org.apache.iceberg.hadoop.HadoopFileIO", false),

Review Comment:
   Feature configs are forever -- if we won't ever be able to make the check precise, we shouldn't ever add a config that implies a precise check. I don't see how the check _can_ be made precise, so I am opposed to adding the config now.



-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Require explicit user-consent to enable HadoopFileIO [polaris]

Posted by "snazy (via GitHub)" <gi...@apache.org>.
snazy commented on PR #1532:
URL: https://github.com/apache/polaris/pull/1532#issuecomment-2896924244

   Merging this one based on approvals from @dimas-b and @jbonofre and the +0 from @flyrain.
   The underlying issue is, as some know, too serious to further delay this change.
   Improvements can always be made in follow-ups.


-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Require explict user-consent to enable HadoopFileIO [polaris]

Posted by "eric-maynard (via GitHub)" <gi...@apache.org>.
eric-maynard commented on code in PR #1532:
URL: https://github.com/apache/polaris/pull/1532#discussion_r2078886584


##########
polaris-core/src/main/java/org/apache/polaris/core/config/FeatureConfiguration.java:
##########
@@ -234,4 +233,38 @@ public static void enforceFeatureEnabledOrThrow(
           .description("If true, the policy-store endpoints are enabled")
           .defaultValue(true)
           .buildFeatureConfiguration();
+
+  public static final FeatureConfiguration<Boolean> ALLOW_SPECIFYING_FILE_IO_IMPL =
+      PolarisConfiguration.<Boolean>builder()
+          .key("ALLOW_SPECIFYING_FILE_IO_IMPL")
+          .description(
+              "Config key for whether to allow setting the FILE_IO_IMPL using catalog properties. "
+                  + "Must only be enabled in dev/test environments, never in production systems.")
+          .defaultValue(false)
+          .buildFeatureConfiguration();
+
+  public static final FeatureConfiguration<Boolean>

Review Comment:
   If you put `FILE` in `SUPPORTED_CATALOG_STORAGE_TYPES` that seems quite explicit no?



-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Require explict user-consent to enable HadoopFileIO [polaris]

Posted by "eric-maynard (via GitHub)" <gi...@apache.org>.
eric-maynard commented on code in PR #1532:
URL: https://github.com/apache/polaris/pull/1532#discussion_r2083015871


##########
service/common/src/main/java/org/apache/polaris/service/catalog/validation/StorageTypeFileIO.java:
##########
@@ -0,0 +1,86 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.polaris.service.catalog.validation;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+import org.apache.polaris.core.storage.PolarisStorageConfigurationInfo;
+
+enum StorageTypeFileIO {
+  S3("org.apache.iceberg.aws.s3.S3FileIO", true),
+
+  GCS("org.apache.iceberg.gcp.gcs.GCSFileIO", true),
+
+  AZURE("org.apache.iceberg.azure.adlsv2.ADLSFileIO", true),
+
+  FILE("org.apache.iceberg.hadoop.HadoopFileIO", false),

Review Comment:
   Feature configs are forever -- if we won't be able to make the check precise, we shouldn't add the config. I don't see how the check _can_ be made precise, so I am opposed to adding the config now.



-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Require explict user-consent to enable HadoopFileIO [polaris]

Posted by "eric-maynard (via GitHub)" <gi...@apache.org>.
eric-maynard commented on code in PR #1532:
URL: https://github.com/apache/polaris/pull/1532#discussion_r2083405406


##########
service/common/src/main/java/org/apache/polaris/service/catalog/validation/StorageTypeFileIO.java:
##########
@@ -0,0 +1,86 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.polaris.service.catalog.validation;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+import org.apache.polaris.core.storage.PolarisStorageConfigurationInfo;
+
+enum StorageTypeFileIO {
+  S3("org.apache.iceberg.aws.s3.S3FileIO", true),
+
+  GCS("org.apache.iceberg.gcp.gcs.GCSFileIO", true),
+
+  AZURE("org.apache.iceberg.azure.adlsv2.ADLSFileIO", true),
+
+  FILE("org.apache.iceberg.hadoop.HadoopFileIO", false),

Review Comment:
   Also, `HadoopFileIO` is used for more than just `FILE` -- it's the fallback defined [here](https://github.com/apache/iceberg/blob/97c0e136b8021058897cab7539e3ef89ce5a0341/core/src/main/java/org/apache/iceberg/io/ResolvingFileIO.java#L56). In the past we've seen it used for AZURE paths.



-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Require explicit user-consent to enable HadoopFileIO [polaris]

Posted by "eric-maynard (via GitHub)" <gi...@apache.org>.
eric-maynard commented on code in PR #1532:
URL: https://github.com/apache/polaris/pull/1532#discussion_r2086173064


##########
quarkus/service/src/main/java/org/apache/polaris/service/quarkus/config/ProductionReadinessChecks.java:
##########
@@ -55,26 +62,53 @@ public class ProductionReadinessChecks {
    */
   private static final String WARNING_SIGN_UTF_8 = "\u0000\u26A0\uFE0F";
 
+  private static final String SEVERE_SIGN_UTF_8 = "\u0000\uD83D\uDED1";

Review Comment:
   It's definitely fair, it's only a question of necessity. If there really is an urgent bugfix to be made, must we include these changes here?



-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Require explict user-consent to enable HadoopFileIO [polaris]

Posted by "dimas-b (via GitHub)" <gi...@apache.org>.
dimas-b commented on code in PR #1532:
URL: https://github.com/apache/polaris/pull/1532#discussion_r2082353136


##########
polaris-core/src/main/java/org/apache/polaris/core/config/FeatureConfiguration.java:
##########
@@ -234,4 +233,36 @@ public static void enforceFeatureEnabledOrThrow(
           .description("If true, the policy-store endpoints are enabled")
           .defaultValue(true)
           .buildFeatureConfiguration();
+
+  public static final FeatureConfiguration<Boolean> ALLOW_SPECIFYING_FILE_IO_IMPL =
+      PolarisConfiguration.<Boolean>builder()
+          .key("ALLOW_SPECIFYING_FILE_IO_IMPL")
+          .description(
+              "Config key for whether to allow setting the FILE_IO_IMPL using catalog properties. "
+                  + "Must only be enabled in dev/test environments, should not be in production systems.")
+          .defaultValue(false)
+          .buildFeatureConfiguration();
+
+  public static final FeatureConfiguration<Boolean> ALLOW_INSECURE_STORAGE_TYPES =

Review Comment:
   I believe we can probably improve the granularity of this check, but I'd suggest to do that in a follow-up PR.



-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Require explict user-consent to enable HadoopFileIO [polaris]

Posted by "flyrain (via GitHub)" <gi...@apache.org>.
flyrain commented on PR #1532:
URL: https://github.com/apache/polaris/pull/1532#issuecomment-2867243691

   I’m strongly against merging either of the two new feature flags introduced:
   
   1. ALLOW_INSECURE_STORAGE_TYPES
   It's redundant and risky. If we never want FILE/HDFS in production, don’t include them in SUPPORTED_CATALOG_STORAGE_TYPES. That single list is already the gate. Adding another checkbox doesn’t improve safety, it just adds complexity to Helm charts, docs, and support tooling.
   It's easy to misfire. The flag sits next to real config. If someone copies a dev application.properties to staging, they might enable insecure storage by accident. The existing readiness check already loudly fails if insecure storage is present, we don’t need a second mechanism.
   It introduces ongoing maintenance burden. Every config flag becomes a permanent obligation: docs, versioning, admin API, test coverage, support. This one delivers no meaningful return.
   
   2. INITIALIZE_DEFAULT_CATALOG_FILEIO_FOR_TEST
   It belongs in test code, not product config. This is a test scaffold to bootstrap a catalog for Quarkus/Spark ITs. It should live in a @TestProfile, JUnit utility, or -D flag, not the main config namespace.
   It adds noise to user-facing docs. By putting it in FeatureConfiguration, we surface it in generated reference docs and admin UIs. Operators will ask, “Do I need to set this?” The answer is always no, so let’s not confuse them.
   
   Also, it doesn't make sense to me to cleanup them up in followup PRs. 
   


-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Require explicit user-consent to enable HadoopFileIO [polaris]

Posted by "flyrain (via GitHub)" <gi...@apache.org>.
flyrain commented on code in PR #1532:
URL: https://github.com/apache/polaris/pull/1532#discussion_r2100895902


##########
service/common/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergCatalog.java:
##########
@@ -2590,4 +2574,11 @@ private PageToken buildPageToken(@Nullable String tokenString, @Nullable Integer
       return PageToken.build(tokenString, pageSize);
     }
   }
+
+  static final FeatureConfiguration<Boolean> INITIALIZE_DEFAULT_CATALOG_FILEIO_FOR_TEST =
+      PolarisConfiguration.<Boolean>builder()
+          .key("INITIALIZE_DEFAULT_CATALOG_FILEIO_FOR_TEST")
+          .defaultValue(false)
+          .description("")
+          .buildFeatureConfiguration();

Review Comment:
   Perfect, you didn't complain, but block every PRs you can.



-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Require explict user-consent to enable HadoopFileIO [polaris]

Posted by "pingtimeout (via GitHub)" <gi...@apache.org>.
pingtimeout commented on code in PR #1532:
URL: https://github.com/apache/polaris/pull/1532#discussion_r2084676604


##########
quarkus/service/src/main/java/org/apache/polaris/service/quarkus/config/QuarkusReadinessConfiguration.java:
##########
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.polaris.service.quarkus.config;
+
+import io.quarkus.runtime.annotations.StaticInitSafe;
+import io.smallrye.config.ConfigMapping;
+import io.smallrye.config.WithDefault;
+
+@StaticInitSafe
+@ConfigMapping(prefix = "polaris.readiness")
+public interface QuarkusReadinessConfiguration {
+
+  /**
+   * Setting this to {@code true} means that Polaris will start up even if severe security risks
+   * have been detected, accepting the risk of denial-of-service, data-loss, corruption and other
+   * risks.
+   */
+  @WithDefault("false")
+  boolean ignoreSevereIssues();

Review Comment:
   @eric-maynard I don't know how to answer your questions.  They seem related to a much bigger scope than the scope of this PR.  Especially the audit part.  We could extend the logic that in subsequent PRs, so that more cases are covered, if it is what you have in mind.
   
   I guess my question to you is : how can we move this PR forward?



-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Require explict user-consent to enable HadoopFileIO [polaris]

Posted by "eric-maynard (via GitHub)" <gi...@apache.org>.
eric-maynard commented on code in PR #1532:
URL: https://github.com/apache/polaris/pull/1532#discussion_r2083010624


##########
polaris-core/src/main/java/org/apache/polaris/core/config/FeatureConfiguration.java:
##########
@@ -234,4 +233,36 @@ public static void enforceFeatureEnabledOrThrow(
           .description("If true, the policy-store endpoints are enabled")
           .defaultValue(true)
           .buildFeatureConfiguration();
+
+  public static final FeatureConfiguration<Boolean> ALLOW_SPECIFYING_FILE_IO_IMPL =
+      PolarisConfiguration.<Boolean>builder()
+          .key("ALLOW_SPECIFYING_FILE_IO_IMPL")
+          .description(
+              "Config key for whether to allow setting the FILE_IO_IMPL using catalog properties. "
+                  + "Must only be enabled in dev/test environments, should not be in production systems.")
+          .defaultValue(false)
+          .buildFeatureConfiguration();
+
+  public static final FeatureConfiguration<Boolean> ALLOW_INSECURE_STORAGE_TYPES =

Review Comment:
   To me, `ALLOW_INSECURE_STORAGE_TYPES = false` seems to imply that Polaris is somehow guaranteeing that no insecure File IO implementations are allowed, which I don't think is something the service can guarantee after this change.



-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Require explict user-consent to enable HadoopFileIO [polaris]

Posted by "pingtimeout (via GitHub)" <gi...@apache.org>.
pingtimeout commented on code in PR #1532:
URL: https://github.com/apache/polaris/pull/1532#discussion_r2085201362


##########
quarkus/service/src/main/java/org/apache/polaris/service/quarkus/config/QuarkusReadinessConfiguration.java:
##########
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.polaris.service.quarkus.config;
+
+import io.quarkus.runtime.annotations.StaticInitSafe;
+import io.smallrye.config.ConfigMapping;
+import io.smallrye.config.WithDefault;
+
+@StaticInitSafe
+@ConfigMapping(prefix = "polaris.readiness")
+public interface QuarkusReadinessConfiguration {
+
+  /**
+   * Setting this to {@code true} means that Polaris will start up even if severe security risks
+   * have been detected, accepting the risk of denial-of-service, data-loss, corruption and other
+   * risks.
+   */
+  @WithDefault("false")
+  boolean ignoreSevereIssues();

Review Comment:
   I am not sure it lays out a path, that's the thing.  What value would be created out of splitting this PR into smaller PRs?
   
   It could also possibly be a topic for a ML discussion if there are PR guidelines that are not explicitly written in `CONTRIBUTING.md`.  Maybe I am missing something...?



-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Require explicit user-consent to enable HadoopFileIO [polaris]

Posted by "snazy (via GitHub)" <gi...@apache.org>.
snazy commented on code in PR #1532:
URL: https://github.com/apache/polaris/pull/1532#discussion_r2100837132


##########
service/common/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergCatalog.java:
##########
@@ -2590,4 +2574,11 @@ private PageToken buildPageToken(@Nullable String tokenString, @Nullable Integer
       return PageToken.build(tokenString, pageSize);
     }
   }
+
+  static final FeatureConfiguration<Boolean> INITIALIZE_DEFAULT_CATALOG_FILEIO_FOR_TEST =
+      PolarisConfiguration.<Boolean>builder()
+          .key("INITIALIZE_DEFAULT_CATALOG_FILEIO_FOR_TEST")
+          .defaultValue(false)
+          .description("")
+          .buildFeatureConfiguration();

Review Comment:
   Having no conflicts ever is a tough goal in an active project.
   I can't even count the number of rebase/merge conflicts I have to handle every day - did I complain?



-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Require explict user-consent to enable HadoopFileIO [polaris]

Posted by "eric-maynard (via GitHub)" <gi...@apache.org>.
eric-maynard commented on PR #1532:
URL: https://github.com/apache/polaris/pull/1532#issuecomment-2855342577

   This is not a bug.


-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Require explict user-consent to enable HadoopFileIO [polaris]

Posted by "snazy (via GitHub)" <gi...@apache.org>.
snazy commented on code in PR #1532:
URL: https://github.com/apache/polaris/pull/1532#discussion_r2077928383


##########
quarkus/service/src/main/java/org/apache/polaris/service/quarkus/config/ProductionReadinessChecks.java:
##########
@@ -55,26 +62,53 @@ public class ProductionReadinessChecks {
    */
   private static final String WARNING_SIGN_UTF_8 = "\u0000\u26A0\uFE0F";
 
+  private static final String SEVERE_SIGN_UTF_8 = "\u0000\uD83D\uDED1";

Review Comment:
   I do think that there are nuances in what's a warning and what's severe.



-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Require explict user-consent to enable HadoopFileIO [polaris]

Posted by "eric-maynard (via GitHub)" <gi...@apache.org>.
eric-maynard commented on code in PR #1532:
URL: https://github.com/apache/polaris/pull/1532#discussion_r2082218741


##########
polaris-core/src/main/java/org/apache/polaris/core/config/FeatureConfiguration.java:
##########
@@ -234,4 +233,38 @@ public static void enforceFeatureEnabledOrThrow(
           .description("If true, the policy-store endpoints are enabled")
           .defaultValue(true)
           .buildFeatureConfiguration();
+
+  public static final FeatureConfiguration<Boolean> ALLOW_SPECIFYING_FILE_IO_IMPL =
+      PolarisConfiguration.<Boolean>builder()
+          .key("ALLOW_SPECIFYING_FILE_IO_IMPL")
+          .description(
+              "Config key for whether to allow setting the FILE_IO_IMPL using catalog properties. "
+                  + "Must only be enabled in dev/test environments, never in production systems.")
+          .defaultValue(false)
+          .buildFeatureConfiguration();
+
+  public static final FeatureConfiguration<Boolean>
+      ALLOW_INSECURE_STORAGE_TYPES_ACCEPTING_SECURITY_RISKS =
+          PolarisConfiguration.<Boolean>builder()
+              .key("ALLOW_INSECURE_STORAGE_TYPES_ACCEPTING_SECURITY_RISKS")
+              .description(
+                  "Allow usage of FileIO implementations that are considered insecure. "
+                      + "Enabling this setting exposes the service to SEVERE security risks, including "
+                      + "denial of service, corruption, data loss and more!"
+                      + "This must NEVER be set to 'true' for anything except tests! ")
+              .defaultValue(false)
+              .buildFeatureConfiguration();
+
+  public static final FeatureConfiguration<Boolean> INITIALIZE_DEFAULT_CATALOG_FILEIO_FOR_TEST =
+      PolarisConfiguration.<Boolean>builder()
+          .key("INITIALIZE_DEFAULT_CATALOG_FILEIO_FOR_TEST")
+          .description(
+              "Config key for initializing a default \"catalogFileIO\" that is available either via "
+                  + "getIo() or for any TableOperations/ViewOperations instantiated, via ops.io() "
+                  + "before entity-specific FileIO initialization is triggered for any such operations. "
+                  + "Typically this should only be used in test scenarios where a PolarisIcebergCatalog "

Review Comment:
   Doesn't it work in main today without being a FeatureConfiguration?



-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Require explicit user-consent to enable HadoopFileIO [polaris]

Posted by "snazy (via GitHub)" <gi...@apache.org>.
snazy commented on code in PR #1532:
URL: https://github.com/apache/polaris/pull/1532#discussion_r2095275366


##########
polaris-core/src/main/java/org/apache/polaris/core/config/FeatureConfiguration.java:
##########
@@ -234,4 +233,38 @@ public static void enforceFeatureEnabledOrThrow(
           .description("If true, the policy-store endpoints are enabled")
           .defaultValue(true)
           .buildFeatureConfiguration();
+
+  public static final FeatureConfiguration<Boolean> ALLOW_SPECIFYING_FILE_IO_IMPL =
+      PolarisConfiguration.<Boolean>builder()
+          .key("ALLOW_SPECIFYING_FILE_IO_IMPL")
+          .description(
+              "Config key for whether to allow setting the FILE_IO_IMPL using catalog properties. "
+                  + "Must only be enabled in dev/test environments, never in production systems.")
+          .defaultValue(false)
+          .buildFeatureConfiguration();
+
+  public static final FeatureConfiguration<Boolean>

Review Comment:
   However, this PR addresses some issue that should really be mitigated quickly.



-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Require explicit user-consent to enable HadoopFileIO [polaris]

Posted by "flyrain (via GitHub)" <gi...@apache.org>.
flyrain commented on code in PR #1532:
URL: https://github.com/apache/polaris/pull/1532#discussion_r2100976580


##########
service/common/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergCatalog.java:
##########
@@ -2590,4 +2574,11 @@ private PageToken buildPageToken(@Nullable String tokenString, @Nullable Integer
       return PageToken.build(tokenString, pageSize);
     }
   }
+
+  static final FeatureConfiguration<Boolean> INITIALIZE_DEFAULT_CATALOG_FILEIO_FOR_TEST =
+      PolarisConfiguration.<Boolean>builder()
+          .key("INITIALIZE_DEFAULT_CATALOG_FILEIO_FOR_TEST")
+          .defaultValue(false)
+          .description("")
+          .buildFeatureConfiguration();

Review Comment:
   Deleted my last comment. The part of reason to remove my -1 on this PR is based on the reverting of INITIALIZE_DEFAULT_CATALOG_FILEIO_FOR_TEST related change in this PR, which @snazy agreed on in ML. Obviously, it was still here. Anyway, we can fix forward. I truly hope the community works as a team with good will and help each other.  



-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Require explicit user-consent to enable HadoopFileIO [polaris]

Posted by "snazy (via GitHub)" <gi...@apache.org>.
snazy commented on code in PR #1532:
URL: https://github.com/apache/polaris/pull/1532#discussion_r2100944839


##########
service/common/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergCatalog.java:
##########
@@ -2590,4 +2574,11 @@ private PageToken buildPageToken(@Nullable String tokenString, @Nullable Integer
       return PageToken.build(tokenString, pageSize);
     }
   }
+
+  static final FeatureConfiguration<Boolean> INITIALIZE_DEFAULT_CATALOG_FILEIO_FOR_TEST =
+      PolarisConfiguration.<Boolean>builder()
+          .key("INITIALIZE_DEFAULT_CATALOG_FILEIO_FOR_TEST")
+          .defaultValue(false)
+          .description("")
+          .buildFeatureConfiguration();

Review Comment:
   I take that as a personal offense. /cc @jbonofre



-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Require explicit user-consent to enable HadoopFileIO [polaris]

Posted by "snazy (via GitHub)" <gi...@apache.org>.
snazy commented on code in PR #1532:
URL: https://github.com/apache/polaris/pull/1532#discussion_r2100992299


##########
service/common/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergCatalog.java:
##########
@@ -2590,4 +2574,11 @@ private PageToken buildPageToken(@Nullable String tokenString, @Nullable Integer
       return PageToken.build(tokenString, pageSize);
     }
   }
+
+  static final FeatureConfiguration<Boolean> INITIALIZE_DEFAULT_CATALOG_FILEIO_FOR_TEST =
+      PolarisConfiguration.<Boolean>builder()
+          .key("INITIALIZE_DEFAULT_CATALOG_FILEIO_FOR_TEST")
+          .defaultValue(false)
+          .description("")
+          .buildFeatureConfiguration();

Review Comment:
   Deleting a comment is not the right way - it _completely_ changes the history of these messages!
   
   You asked to move it back out of `FeaturesConfiguration` into the class where it was before - and that is EXACTLY what happened. So I seriously ask you to not bring up wrong accusations & personal offenses!



-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Require explict user-consent to enable HadoopFileIO [polaris]

Posted by "snazy (via GitHub)" <gi...@apache.org>.
snazy commented on code in PR #1532:
URL: https://github.com/apache/polaris/pull/1532#discussion_r2077925077


##########
polaris-core/src/main/java/org/apache/polaris/core/config/FeatureConfiguration.java:
##########
@@ -234,4 +233,38 @@ public static void enforceFeatureEnabledOrThrow(
           .description("If true, the policy-store endpoints are enabled")
           .defaultValue(true)
           .buildFeatureConfiguration();
+
+  public static final FeatureConfiguration<Boolean> ALLOW_SPECIFYING_FILE_IO_IMPL =
+      PolarisConfiguration.<Boolean>builder()
+          .key("ALLOW_SPECIFYING_FILE_IO_IMPL")
+          .description(
+              "Config key for whether to allow setting the FILE_IO_IMPL using catalog properties. "
+                  + "Must only be enabled in dev/test environments, never in production systems.")
+          .defaultValue(false)
+          .buildFeatureConfiguration();
+
+  public static final FeatureConfiguration<Boolean>
+      ALLOW_INSECURE_STORAGE_TYPES_ACCEPTING_SECURITY_RISKS =
+          PolarisConfiguration.<Boolean>builder()
+              .key("ALLOW_INSECURE_STORAGE_TYPES_ACCEPTING_SECURITY_RISKS")
+              .description(
+                  "Allow usage of FileIO implementations that are considered insecure. "
+                      + "Enabling this setting exposes the service to SEVERE security risks, including "
+                      + "denial of service, corruption, data loss and more!"
+                      + "This must NEVER be set to 'true' for anything except tests! ")
+              .defaultValue(false)
+              .buildFeatureConfiguration();
+
+  public static final FeatureConfiguration<Boolean> INITIALIZE_DEFAULT_CATALOG_FILEIO_FOR_TEST =
+      PolarisConfiguration.<Boolean>builder()
+          .key("INITIALIZE_DEFAULT_CATALOG_FILEIO_FOR_TEST")
+          .description(
+              "Config key for initializing a default \"catalogFileIO\" that is available either via "
+                  + "getIo() or for any TableOperations/ViewOperations instantiated, via ops.io() "
+                  + "before entity-specific FileIO initialization is triggered for any such operations. "
+                  + "Typically this should only be used in test scenarios where a PolarisIcebergCatalog "

Review Comment:
   It's needed to _enable_ it _for_ tests.



-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Require explict user-consent to enable HadoopFileIO [polaris]

Posted by "snazy (via GitHub)" <gi...@apache.org>.
snazy commented on PR #1532:
URL: https://github.com/apache/polaris/pull/1532#issuecomment-2863996619

   > Can we focus on this change? We can work on other changes in followup if necessary.
   
   The underlying issue is way too serious, what you propose is by far not enough.


-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Require explict user-consent to enable HadoopFileIO [polaris]

Posted by "eric-maynard (via GitHub)" <gi...@apache.org>.
eric-maynard commented on code in PR #1532:
URL: https://github.com/apache/polaris/pull/1532#discussion_r2084060837


##########
service/common/src/main/java/org/apache/polaris/service/catalog/validation/IcebergPropertiesValidation.java:
##########
@@ -0,0 +1,95 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.polaris.service.catalog.validation;
+
+import static org.apache.polaris.core.config.FeatureConfiguration.ALLOW_INSECURE_STORAGE_TYPES_ACCEPTING_SECURITY_RISKS;
+import static org.apache.polaris.core.config.FeatureConfiguration.ALLOW_SPECIFYING_FILE_IO_IMPL;
+import static org.apache.polaris.core.config.FeatureConfiguration.SUPPORTED_CATALOG_STORAGE_TYPES;
+
+import jakarta.annotation.Nonnull;
+import jakarta.annotation.Nullable;
+import java.util.Map;
+import org.apache.iceberg.CatalogProperties;
+import org.apache.iceberg.exceptions.ValidationException;
+import org.apache.polaris.core.context.CallContext;
+import org.apache.polaris.core.storage.PolarisStorageConfigurationInfo;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class IcebergPropertiesValidation {
+  private static final Logger LOGGER = LoggerFactory.getLogger(IcebergPropertiesValidation.class);
+
+  public static void validateIcebergProperties(
+      @Nonnull CallContext callContext, @Nonnull Map<String, String> properties) {
+    validateIcebergProperties(callContext, properties, null);
+  }
+
+  public static String validateIcebergProperties(
+      @Nonnull CallContext callContext,
+      @Nonnull Map<String, String> properties,
+      @Nullable PolarisStorageConfigurationInfo storageConfigurationInfo) {
+    var ctx = callContext.getPolarisCallContext();
+    var configStore = ctx.getConfigurationStore();
+
+    var ioImpl = properties.get(CatalogProperties.FILE_IO_IMPL);
+    if (ioImpl != null) {
+      if (!configStore.getConfiguration(ctx, ALLOW_SPECIFYING_FILE_IO_IMPL)) {
+        throw new ValidationException(
+            "Cannot set property '%s' to '%s' for this catalog.",
+            CatalogProperties.FILE_IO_IMPL, ioImpl);
+      }
+      LOGGER.debug(
+          "Allowing overriding ioImplClassName to {} for storageConfiguration {}",
+          ioImpl,
+          storageConfigurationInfo);
+    } else if (storageConfigurationInfo != null) {
+      ioImpl = storageConfigurationInfo.getFileIoImplClassName();
+      LOGGER.debug(
+          "Resolved ioImplClassName {} from storageConfiguration {}",
+          ioImpl,
+          storageConfigurationInfo);
+    }
+
+    if (ioImpl != null) {
+      var storageType = StorageTypeFileIO.fromFileIoImplementation(ioImpl);
+      if (storageType.validateAllowedStorageType()
+          && !configStore
+              .getConfiguration(ctx, SUPPORTED_CATALOG_STORAGE_TYPES)
+              .contains(storageType.name())) {

Review Comment:
   There's one in the repo [here](https://github.com/apache/polaris/blob/d05ba7c572eb29191b5429137bcdb52c0670235f/service/common/src/main/java/org/apache/polaris/service/catalog/io/WasbTranslatingFileIO.java#L32). It uses Azure, but it's not represented in `StorageTypeFileIO`. How is that meant to behave?



-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Require explict user-consent to enable HadoopFileIO [polaris]

Posted by "RussellSpitzer (via GitHub)" <gi...@apache.org>.
RussellSpitzer commented on code in PR #1532:
URL: https://github.com/apache/polaris/pull/1532#discussion_r2085296325


##########
quarkus/service/src/main/java/org/apache/polaris/service/quarkus/config/QuarkusReadinessConfiguration.java:
##########
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.polaris.service.quarkus.config;
+
+import io.quarkus.runtime.annotations.StaticInitSafe;
+import io.smallrye.config.ConfigMapping;
+import io.smallrye.config.WithDefault;
+
+@StaticInitSafe
+@ConfigMapping(prefix = "polaris.readiness")
+public interface QuarkusReadinessConfiguration {
+
+  /**
+   * Setting this to {@code true} means that Polaris will start up even if severe security risks
+   * have been detected, accepting the risk of denial-of-service, data-loss, corruption and other
+   * risks.
+   */
+  @WithDefault("false")
+  boolean ignoreSevereIssues();

Review Comment:
   We should aim for small independent code changes whenever possible. Just because two things work well together doesn't mean they should be in the same Pull request. As a generic guide, 1 "feature" per PR, small is better than bigger, independent changes should stay independent. IMHO, if the title can't cover the scope of the changes then the PR should be broken up. I think we have several independent things here as noted in the PR description. Ideally for me even refactors go in separate pull-requests We've been a bit lax on this recently as we have adopted code from other projects but I don't think we should get in the habit.
   
   The general benefits of this approach are for downstream integrators which can cherry-pick changes easier, and reviewers since net small changes are much easier to understand and usually easier to come to agreement on. If they can only be understood of a larger context, then grouping them in a project is usually the right thing to do or explain the context in a doc.
   
   I think this pr itself does a great job of mapping out the independent changes in a bulleted list. IMHO, each of those points could probably approached independently since I think we already have consensus on at least some of the Items. 



-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Require explict user-consent to enable HadoopFileIO [polaris]

Posted by "dimas-b (via GitHub)" <gi...@apache.org>.
dimas-b commented on PR #1532:
URL: https://github.com/apache/polaris/pull/1532#issuecomment-2867657594

   > INITIALIZE_DEFAULT_CATALOG_FILEIO_FOR_TEST
   
   It was present before this PR, in `IcebergCatalog`
   


-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Require explict user-consent to enable HadoopFileIO [polaris]

Posted by "dimas-b (via GitHub)" <gi...@apache.org>.
dimas-b commented on code in PR #1532:
URL: https://github.com/apache/polaris/pull/1532#discussion_r2075426745


##########
quarkus/service/src/test/java/org/apache/polaris/service/quarkus/catalog/IcebergCatalogTest.java:
##########
@@ -161,10 +161,14 @@ public Map<String, String> getConfigOverrides() {
       return Map.of(
           "polaris.features.defaults.\"ALLOW_SPECIFYING_FILE_IO_IMPL\"",
           "true",
+          "polaris.features.defaults.\"ALLOW_INSECURE_STORAGE_TYPES_ACCEPTING_SECURITY_RISKS\"",
+          "true",
           "polaris.features.defaults.\"INITIALIZE_DEFAULT_CATALOG_FILEIO_FOR_TEST\"",
           "true",
           "polaris.features.defaults.\"SUPPORTED_CATALOG_STORAGE_TYPES\"",
-          "[\"FILE\"]");
+          "[\"FILE\",\"S3\"]",
+          "polaris.readiness.ignore-security-issues",

Review Comment:
   WDYT about putting this into a global quarkus test config profile?



-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Require explict user-consent to enable HadoopFileIO [polaris]

Posted by "eric-maynard (via GitHub)" <gi...@apache.org>.
eric-maynard commented on code in PR #1532:
URL: https://github.com/apache/polaris/pull/1532#discussion_r2078118808


##########
service/common/src/main/java/org/apache/polaris/service/catalog/validation/IcebergPropertiesValidation.java:
##########
@@ -0,0 +1,95 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.polaris.service.catalog.validation;
+
+import static org.apache.polaris.core.config.FeatureConfiguration.ALLOW_INSECURE_STORAGE_TYPES_ACCEPTING_SECURITY_RISKS;
+import static org.apache.polaris.core.config.FeatureConfiguration.ALLOW_SPECIFYING_FILE_IO_IMPL;
+import static org.apache.polaris.core.config.FeatureConfiguration.SUPPORTED_CATALOG_STORAGE_TYPES;
+
+import jakarta.annotation.Nonnull;
+import jakarta.annotation.Nullable;
+import java.util.Map;
+import org.apache.iceberg.CatalogProperties;
+import org.apache.iceberg.exceptions.ValidationException;
+import org.apache.polaris.core.context.CallContext;
+import org.apache.polaris.core.storage.PolarisStorageConfigurationInfo;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class IcebergPropertiesValidation {
+  private static final Logger LOGGER = LoggerFactory.getLogger(IcebergPropertiesValidation.class);
+
+  public static void validateIcebergProperties(
+      @Nonnull CallContext callContext, @Nonnull Map<String, String> properties) {
+    validateIcebergProperties(callContext, properties, null);
+  }
+
+  public static String validateIcebergProperties(
+      @Nonnull CallContext callContext,
+      @Nonnull Map<String, String> properties,
+      @Nullable PolarisStorageConfigurationInfo storageConfigurationInfo) {
+    var ctx = callContext.getPolarisCallContext();
+    var configStore = ctx.getConfigurationStore();
+
+    var ioImpl = properties.get(CatalogProperties.FILE_IO_IMPL);
+    if (ioImpl != null) {
+      if (!configStore.getConfiguration(ctx, ALLOW_SPECIFYING_FILE_IO_IMPL)) {
+        throw new ValidationException(
+            "Cannot set property '%s' to '%s' for this catalog.",
+            CatalogProperties.FILE_IO_IMPL, ioImpl);
+      }
+      LOGGER.debug(
+          "Allowing overriding ioImplClassName to {} for storageConfiguration {}",
+          ioImpl,
+          storageConfigurationInfo);
+    } else if (storageConfigurationInfo != null) {
+      ioImpl = storageConfigurationInfo.getFileIoImplClassName();
+      LOGGER.debug(
+          "Resolved ioImplClassName {} from storageConfiguration {}",
+          ioImpl,
+          storageConfigurationInfo);
+    }
+
+    if (ioImpl != null) {
+      var storageType = StorageTypeFileIO.fromFileIoImplementation(ioImpl);
+      if (storageType.validateAllowedStorageType()
+          && !configStore
+              .getConfiguration(ctx, SUPPORTED_CATALOG_STORAGE_TYPES)
+              .contains(storageType.name())) {
+        throw new ValidationException(
+            "File IO implementation '%s', as storage type '%s' is not supported",
+            ioImpl, storageType);
+      }
+
+      if (!storageType.safe()
+          && !configStore.getConfiguration(
+              ctx, ALLOW_INSECURE_STORAGE_TYPES_ACCEPTING_SECURITY_RISKS)) {
+        throw new ValidationException(
+            "File IO implementation '%s' (storage type '%s') is considered insecure and must not be used",

Review Comment:
   Nothing. That's why there's nothing in our current documentation or code that promises that it _is_ secure.



-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Require explict user-consent to enable HadoopFileIO [polaris]

Posted by "snazy (via GitHub)" <gi...@apache.org>.
snazy commented on PR #1532:
URL: https://github.com/apache/polaris/pull/1532#issuecomment-2859916204

   > whether the HadoopFileIO is suitable for production
   
   @flyrain you should really know why it's not


-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Require explict user-consent to enable HadoopFileIO [polaris]

Posted by "snazy (via GitHub)" <gi...@apache.org>.
snazy commented on PR #1532:
URL: https://github.com/apache/polaris/pull/1532#issuecomment-2859071453

   > This is not a bug.
   
   It is. And it is very severe.


-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Require explict user-consent to enable HadoopFileIO [polaris]

Posted by "RussellSpitzer (via GitHub)" <gi...@apache.org>.
RussellSpitzer commented on code in PR #1532:
URL: https://github.com/apache/polaris/pull/1532#discussion_r2085296325


##########
quarkus/service/src/main/java/org/apache/polaris/service/quarkus/config/QuarkusReadinessConfiguration.java:
##########
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.polaris.service.quarkus.config;
+
+import io.quarkus.runtime.annotations.StaticInitSafe;
+import io.smallrye.config.ConfigMapping;
+import io.smallrye.config.WithDefault;
+
+@StaticInitSafe
+@ConfigMapping(prefix = "polaris.readiness")
+public interface QuarkusReadinessConfiguration {
+
+  /**
+   * Setting this to {@code true} means that Polaris will start up even if severe security risks
+   * have been detected, accepting the risk of denial-of-service, data-loss, corruption and other
+   * risks.
+   */
+  @WithDefault("false")
+  boolean ignoreSevereIssues();

Review Comment:
   We should aim for small independent code changes whenever possible. Just because two things work well together doesn't mean they should be in the same Pull request. As a generic guide, 1 "feature" per PR, small is better than bigger, independent changes should stay independent. IMHO, if the title can't cover the scope of the changes then the PR should be broken up. I think we have several independent things here as noted in the PR description. Ideally for me even refactors go in separate pull-requests. We've been a bit lax on this recently as we have adopted code from other projects but I don't think we should get in the habit.
   
   The general benefits of this approach are for downstream integrators which can cherry-pick changes easier, and reviewers will have an easier time since net small changes are much easier to understand and usually easier to come to agreement on. (Bisecting also becomes much easier). If PR's can only be understood of a larger context, then grouping them in a project is usually the right thing to do or explaining the context in a design doc.
   
   I think this pr itself does a great job of mapping out the independent changes in a bulleted list. IMHO, each of those points could probably approached independently since I think we already have consensus on at least some of the Items. 



-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Require explict user-consent to enable HadoopFileIO [polaris]

Posted by "RussellSpitzer (via GitHub)" <gi...@apache.org>.
RussellSpitzer commented on code in PR #1532:
URL: https://github.com/apache/polaris/pull/1532#discussion_r2085296325


##########
quarkus/service/src/main/java/org/apache/polaris/service/quarkus/config/QuarkusReadinessConfiguration.java:
##########
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.polaris.service.quarkus.config;
+
+import io.quarkus.runtime.annotations.StaticInitSafe;
+import io.smallrye.config.ConfigMapping;
+import io.smallrye.config.WithDefault;
+
+@StaticInitSafe
+@ConfigMapping(prefix = "polaris.readiness")
+public interface QuarkusReadinessConfiguration {
+
+  /**
+   * Setting this to {@code true} means that Polaris will start up even if severe security risks
+   * have been detected, accepting the risk of denial-of-service, data-loss, corruption and other
+   * risks.
+   */
+  @WithDefault("false")
+  boolean ignoreSevereIssues();

Review Comment:
   We should aim for small independent code changes whenever possible. Just because two things work well together doesn't mean they should be in the same Pull request. As a generic guide, 1 "feature" per PR, small is better than bigger, independent changes should stay independent. IMHO, if the title can't cover the scope of the changes then the PR should be broken up. I think we have several independent things here as noted in the PR description. Ideally for me even refactors go in separate pull-requests. We've been a bit lax on this recently as we have adopted code from other projects but I don't think we should get in the habit.
   
   The general benefits of this approach are for downstream integrators which can cherry-pick changes easier, and reviewers since net small changes are much easier to understand and usually easier to come to agreement on. If they can only be understood of a larger context, then grouping them in a project is usually the right thing to do or explain the context in a doc.
   
   I think this pr itself does a great job of mapping out the independent changes in a bulleted list. IMHO, each of those points could probably approached independently since I think we already have consensus on at least some of the Items. 



-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Require explict user-consent to enable HadoopFileIO [polaris]

Posted by "adutra (via GitHub)" <gi...@apache.org>.
adutra commented on code in PR #1532:
URL: https://github.com/apache/polaris/pull/1532#discussion_r2085539503


##########
quarkus/service/src/main/java/org/apache/polaris/service/quarkus/config/ProductionReadinessChecks.java:
##########
@@ -176,4 +210,71 @@ public ProductionReadinessCheck checkPolarisEventListener(
   private static String authRealmSegment(String realm) {
     return realm.equals(QuarkusAuthenticationConfiguration.DEFAULT_REALM_KEY) ? "" : realm + ".";
   }
+
+  @Produces
+  public ProductionReadinessCheck checkInsecureStorageSettings(
+      FeaturesConfiguration featureConfiguration) {
+    var insecure = FeatureConfiguration.ALLOW_INSECURE_STORAGE_TYPES;
+
+    var errors = new ArrayList<Error>();
+    if (Boolean.parseBoolean(featureConfiguration.defaults().get(insecure.key))) {
+      errors.add(
+          Error.ofSevere(
+              "Must not enable a configuration that exposes known and severe security risks: "
+                  + insecure.description,
+              format("polaris.features.defaults.\"%s\"", insecure.key)));
+    }
+
+    featureConfiguration
+        .realmOverrides()
+        .forEach(
+            (realmId, overrides) -> {
+              if (Boolean.parseBoolean(overrides.overrides().get(insecure.key))) {
+                errors.add(
+                    Error.ofSevere(
+                        "Must not enable a configuration that exposes known and severe security risks: "
+                            + insecure.description,
+                        format(
+                            "polaris.features.realm-overrides.\"%s\".overrides.\"%s\"",
+                            realmId, insecure.key)));
+              }
+            });
+
+    var storageTypes = FeatureConfiguration.SUPPORTED_CATALOG_STORAGE_TYPES;
+    var mapper = new ObjectMapper();
+    var defaults = featureConfiguration.parseDefaults(mapper);
+    var realmOverrides = featureConfiguration.parseRealmOverrides(mapper);
+    @SuppressWarnings("unchecked")
+    var supported = (List<String>) defaults.getOrDefault(storageTypes.key, List.of());
+    supported.stream()
+        .filter(n -> !IcebergPropertiesValidation.safeStorageType(n))
+        .forEach(
+            t ->
+                errors.add(
+                    Error.ofSevere(
+                        format(
+                            "The storage type '%s' is considered insecure and to expose the service to severe security ricks!",
+                            t),
+                        format("polaris.features.defaults.\"%s\"", storageTypes.key))));
+    realmOverrides.forEach(
+        (realmId, overrides) -> {
+          @SuppressWarnings("unchecked")
+          var s = (List<String>) overrides.getOrDefault(storageTypes.key, List.of());
+          s.stream()
+              .filter(n -> !IcebergPropertiesValidation.safeStorageType(n))
+              .forEach(
+                  t ->
+                      errors.add(
+                          Error.ofSevere(
+                              format(
+                                  "The storage type '%s' is considered insecure and to expose the service to severe security ricks!",

Review Comment:
   ```suggestion
                                     "The storage type '%s' is considered insecure and exposes the service to severe security risks!",
   ```



##########
quarkus/service/src/main/java/org/apache/polaris/service/quarkus/config/ProductionReadinessChecks.java:
##########
@@ -176,4 +210,71 @@ public ProductionReadinessCheck checkPolarisEventListener(
   private static String authRealmSegment(String realm) {
     return realm.equals(QuarkusAuthenticationConfiguration.DEFAULT_REALM_KEY) ? "" : realm + ".";
   }
+
+  @Produces
+  public ProductionReadinessCheck checkInsecureStorageSettings(
+      FeaturesConfiguration featureConfiguration) {
+    var insecure = FeatureConfiguration.ALLOW_INSECURE_STORAGE_TYPES;
+
+    var errors = new ArrayList<Error>();
+    if (Boolean.parseBoolean(featureConfiguration.defaults().get(insecure.key))) {
+      errors.add(
+          Error.ofSevere(
+              "Must not enable a configuration that exposes known and severe security risks: "
+                  + insecure.description,
+              format("polaris.features.defaults.\"%s\"", insecure.key)));
+    }
+
+    featureConfiguration
+        .realmOverrides()
+        .forEach(
+            (realmId, overrides) -> {
+              if (Boolean.parseBoolean(overrides.overrides().get(insecure.key))) {
+                errors.add(
+                    Error.ofSevere(
+                        "Must not enable a configuration that exposes known and severe security risks: "
+                            + insecure.description,
+                        format(
+                            "polaris.features.realm-overrides.\"%s\".overrides.\"%s\"",
+                            realmId, insecure.key)));
+              }
+            });
+
+    var storageTypes = FeatureConfiguration.SUPPORTED_CATALOG_STORAGE_TYPES;
+    var mapper = new ObjectMapper();
+    var defaults = featureConfiguration.parseDefaults(mapper);
+    var realmOverrides = featureConfiguration.parseRealmOverrides(mapper);
+    @SuppressWarnings("unchecked")
+    var supported = (List<String>) defaults.getOrDefault(storageTypes.key, List.of());
+    supported.stream()
+        .filter(n -> !IcebergPropertiesValidation.safeStorageType(n))
+        .forEach(
+            t ->
+                errors.add(
+                    Error.ofSevere(
+                        format(
+                            "The storage type '%s' is considered insecure and to expose the service to severe security ricks!",

Review Comment:
   ```suggestion
                               "The storage type '%s' is considered insecure and exposes the service to severe security risks!",
   ```



-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Require explicit user-consent to enable HadoopFileIO [polaris]

Posted by "flyrain (via GitHub)" <gi...@apache.org>.
flyrain commented on PR #1532:
URL: https://github.com/apache/polaris/pull/1532#issuecomment-2888112228

   As I said in the email thread, I don't think `ALLOW_INSECURE_STORAGE_TYPES` is necessary, but I'm OK with it. With that, +0 on the PR.


-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Require explicit user-consent to enable HadoopFileIO [polaris]

Posted by "flyrain (via GitHub)" <gi...@apache.org>.
flyrain commented on code in PR #1532:
URL: https://github.com/apache/polaris/pull/1532#discussion_r2100733037


##########
service/common/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergCatalog.java:
##########
@@ -2590,4 +2574,11 @@ private PageToken buildPageToken(@Nullable String tokenString, @Nullable Integer
       return PageToken.build(tokenString, pageSize);
     }
   }
+
+  static final FeatureConfiguration<Boolean> INITIALIZE_DEFAULT_CATALOG_FILEIO_FOR_TEST =
+      PolarisConfiguration.<Boolean>builder()
+          .key("INITIALIZE_DEFAULT_CATALOG_FILEIO_FOR_TEST")
+          .defaultValue(false)
+          .description("")
+          .buildFeatureConfiguration();

Review Comment:
   This part of the change is completely unnecessary in this PR and makes more conflicts for follow-ups like #1624. 



-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Require explict user-consent to enable HadoopFileIO [polaris]

Posted by "eric-maynard (via GitHub)" <gi...@apache.org>.
eric-maynard commented on code in PR #1532:
URL: https://github.com/apache/polaris/pull/1532#discussion_r2082192362


##########
quarkus/service/src/main/java/org/apache/polaris/service/quarkus/config/ProductionReadinessChecks.java:
##########
@@ -55,26 +62,53 @@ public class ProductionReadinessChecks {
    */
   private static final String WARNING_SIGN_UTF_8 = "\u0000\u26A0\uFE0F";
 
+  private static final String SEVERE_SIGN_UTF_8 = "\u0000\uD83D\uDED1";

Review Comment:
   Sure, I think a separate PR for these changes could be a good idea. If this PR really is a bugfix, let's not couple unnecessary changes with it. 



-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Require explict user-consent to enable HadoopFileIO [polaris]

Posted by "pingtimeout (via GitHub)" <gi...@apache.org>.
pingtimeout commented on code in PR #1532:
URL: https://github.com/apache/polaris/pull/1532#discussion_r2084030683


##########
quarkus/service/src/main/java/org/apache/polaris/service/quarkus/config/ProductionReadinessChecks.java:
##########
@@ -55,26 +62,53 @@ public class ProductionReadinessChecks {
    */
   private static final String WARNING_SIGN_UTF_8 = "\u0000\u26A0\uFE0F";
 
+  private static final String SEVERE_SIGN_UTF_8 = "\u0000\uD83D\uDED1";

Review Comment:
   Let's be mindful on the overhead that too fine-grained PR would cause though...
   
   The changes in this PR are cohesive to one another.  And it is quite small.  So it makes sense to submit the changes in a single PR.  Splitting a PR into many tiny PRs would prevent reviewers from understanding the big picture and would not have any functional merit.
   
   



-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Require explict user-consent to enable HadoopFileIO [polaris]

Posted by "eric-maynard (via GitHub)" <gi...@apache.org>.
eric-maynard commented on code in PR #1532:
URL: https://github.com/apache/polaris/pull/1532#discussion_r2083010311


##########
polaris-core/src/main/java/org/apache/polaris/core/config/FeatureConfiguration.java:
##########
@@ -234,4 +233,38 @@ public static void enforceFeatureEnabledOrThrow(
           .description("If true, the policy-store endpoints are enabled")
           .defaultValue(true)
           .buildFeatureConfiguration();
+
+  public static final FeatureConfiguration<Boolean> ALLOW_SPECIFYING_FILE_IO_IMPL =
+      PolarisConfiguration.<Boolean>builder()
+          .key("ALLOW_SPECIFYING_FILE_IO_IMPL")
+          .description(
+              "Config key for whether to allow setting the FILE_IO_IMPL using catalog properties. "
+                  + "Must only be enabled in dev/test environments, never in production systems.")
+          .defaultValue(false)
+          .buildFeatureConfiguration();
+
+  public static final FeatureConfiguration<Boolean>

Review Comment:
   I have a hard time believing we can't incrementalize this change the evaluate the necessity of the individual components of it. We're going from this being in the default config for multiple releases to requiring multiple flags to enable it.



-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Require explicit user-consent to enable HadoopFileIO [polaris]

Posted by "eric-maynard (via GitHub)" <gi...@apache.org>.
eric-maynard commented on code in PR #1532:
URL: https://github.com/apache/polaris/pull/1532#discussion_r2086170234


##########
polaris-core/src/main/java/org/apache/polaris/core/config/FeatureConfiguration.java:
##########
@@ -234,4 +233,38 @@ public static void enforceFeatureEnabledOrThrow(
           .description("If true, the policy-store endpoints are enabled")
           .defaultValue(true)
           .buildFeatureConfiguration();
+
+  public static final FeatureConfiguration<Boolean> ALLOW_SPECIFYING_FILE_IO_IMPL =
+      PolarisConfiguration.<Boolean>builder()
+          .key("ALLOW_SPECIFYING_FILE_IO_IMPL")
+          .description(
+              "Config key for whether to allow setting the FILE_IO_IMPL using catalog properties. "
+                  + "Must only be enabled in dev/test environments, never in production systems.")
+          .defaultValue(false)
+          .buildFeatureConfiguration();
+
+  public static final FeatureConfiguration<Boolean>

Review Comment:
   I think you are (and maybe this PR is) conflating two things -- FILE storage type and HadoopFileIO. They are not always the same.
   
   `SUPPORTED_CATALOG_STORAGE_TYPES` is probably sufficient to disallow the FILE storage type. `FILE` shouldn't be in the default, but I think it's too great a leap to go from having it in the default to requiring multiple flags to enable it.
   
   For disallowing HadoopFileIO, we need a different approach than what's done in this PR.



-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Require explicit user-consent to enable HadoopFileIO [polaris]

Posted by "eric-maynard (via GitHub)" <gi...@apache.org>.
eric-maynard commented on code in PR #1532:
URL: https://github.com/apache/polaris/pull/1532#discussion_r2086173064


##########
quarkus/service/src/main/java/org/apache/polaris/service/quarkus/config/ProductionReadinessChecks.java:
##########
@@ -55,26 +62,53 @@ public class ProductionReadinessChecks {
    */
   private static final String WARNING_SIGN_UTF_8 = "\u0000\u26A0\uFE0F";
 
+  private static final String SEVERE_SIGN_UTF_8 = "\u0000\uD83D\uDED1";

Review Comment:
   It's definitely fair, it's only a question of necessity. If there really is an urgent 1.0-blocking bugfix to be made, must we include these changes here? Are these logging changes really 1.0-blocking?



-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Require explict user-consent to enable HadoopFileIO [polaris]

Posted by "eric-maynard (via GitHub)" <gi...@apache.org>.
eric-maynard commented on code in PR #1532:
URL: https://github.com/apache/polaris/pull/1532#discussion_r2084136420


##########
quarkus/service/src/main/java/org/apache/polaris/service/quarkus/config/QuarkusReadinessConfiguration.java:
##########
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.polaris.service.quarkus.config;
+
+import io.quarkus.runtime.annotations.StaticInitSafe;
+import io.smallrye.config.ConfigMapping;
+import io.smallrye.config.WithDefault;
+
+@StaticInitSafe
+@ConfigMapping(prefix = "polaris.readiness")
+public interface QuarkusReadinessConfiguration {
+
+  /**
+   * Setting this to {@code true} means that Polaris will start up even if severe security risks
+   * have been detected, accepting the risk of denial-of-service, data-loss, corruption and other
+   * risks.
+   */
+  @WithDefault("false")
+  boolean ignoreSevereIssues();

Review Comment:
   Having a log level of SEVERE and a config called "ignore severe issues" are completely different things. Is the implication that this config would disable failure in all cases where we use the SEVERE logging level?
   
   If that's the case, my questions stand. Does this config not apply to less-severe issues? What guidelines will qualify an issue as severe (necessitating a SEVERE log)? Have we gone back and audited all "issues" to verify none should be considered SEVERE? What even is an "issue"? 



-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Require explicit user-consent to enable HadoopFileIO [polaris]

Posted by "dimas-b (via GitHub)" <gi...@apache.org>.
dimas-b commented on code in PR #1532:
URL: https://github.com/apache/polaris/pull/1532#discussion_r2098292448


##########
service/common/src/main/java/org/apache/polaris/service/catalog/validation/IcebergPropertiesValidation.java:
##########
@@ -0,0 +1,95 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.polaris.service.catalog.validation;
+
+import static org.apache.polaris.core.config.FeatureConfiguration.ALLOW_INSECURE_STORAGE_TYPES_ACCEPTING_SECURITY_RISKS;
+import static org.apache.polaris.core.config.FeatureConfiguration.ALLOW_SPECIFYING_FILE_IO_IMPL;
+import static org.apache.polaris.core.config.FeatureConfiguration.SUPPORTED_CATALOG_STORAGE_TYPES;
+
+import jakarta.annotation.Nonnull;
+import jakarta.annotation.Nullable;
+import java.util.Map;
+import org.apache.iceberg.CatalogProperties;
+import org.apache.iceberg.exceptions.ValidationException;
+import org.apache.polaris.core.context.CallContext;
+import org.apache.polaris.core.storage.PolarisStorageConfigurationInfo;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class IcebergPropertiesValidation {
+  private static final Logger LOGGER = LoggerFactory.getLogger(IcebergPropertiesValidation.class);
+
+  public static void validateIcebergProperties(
+      @Nonnull CallContext callContext, @Nonnull Map<String, String> properties) {
+    validateIcebergProperties(callContext, properties, null);
+  }
+
+  public static String validateIcebergProperties(
+      @Nonnull CallContext callContext,
+      @Nonnull Map<String, String> properties,
+      @Nullable PolarisStorageConfigurationInfo storageConfigurationInfo) {
+    var ctx = callContext.getPolarisCallContext();
+    var configStore = ctx.getConfigurationStore();
+
+    var ioImpl = properties.get(CatalogProperties.FILE_IO_IMPL);
+    if (ioImpl != null) {
+      if (!configStore.getConfiguration(ctx, ALLOW_SPECIFYING_FILE_IO_IMPL)) {
+        throw new ValidationException(
+            "Cannot set property '%s' to '%s' for this catalog.",
+            CatalogProperties.FILE_IO_IMPL, ioImpl);
+      }
+      LOGGER.debug(
+          "Allowing overriding ioImplClassName to {} for storageConfiguration {}",
+          ioImpl,
+          storageConfigurationInfo);
+    } else if (storageConfigurationInfo != null) {
+      ioImpl = storageConfigurationInfo.getFileIoImplClassName();
+      LOGGER.debug(
+          "Resolved ioImplClassName {} from storageConfiguration {}",
+          ioImpl,
+          storageConfigurationInfo);
+    }
+
+    if (ioImpl != null) {
+      var storageType = StorageTypeFileIO.fromFileIoImplementation(ioImpl);
+      if (storageType.validateAllowedStorageType()
+          && !configStore
+              .getConfiguration(ctx, SUPPORTED_CATALOG_STORAGE_TYPES)
+              .contains(storageType.name())) {
+        throw new ValidationException(
+            "File IO implementation '%s', as storage type '%s' is not supported",
+            ioImpl, storageType);
+      }
+
+      if (!storageType.safe()
+          && !configStore.getConfiguration(
+              ctx, ALLOW_INSECURE_STORAGE_TYPES_ACCEPTING_SECURITY_RISKS)) {
+        throw new ValidationException(
+            "File IO implementation '%s' (storage type '%s') is considered insecure and must not be used",
+            ioImpl, storageType);
+      }
+    }
+
+    return ioImpl;
+  }
+
+  public static boolean safeStorageType(String name) {
+    return StorageTypeFileIO.valueOf(name).safe();

Review Comment:
   ping



##########
quarkus/service/src/main/java/org/apache/polaris/service/quarkus/config/ProductionReadinessChecks.java:
##########
@@ -57,26 +64,53 @@ public class ProductionReadinessChecks {
    */
   private static final String WARNING_SIGN_UTF_8 = "\u0000\u26A0\uFE0F";
 
+  private static final String SEVERE_SIGN_UTF_8 = "\u0000\uD83D\uDED1";
+
   /** A simple warning sign displayed when the character set is not UTF-8. */
   private static final String WARNING_SIGN_PLAIN = "!!!";
 
+  private static final String SEVERE_SIGN_PLAIN = "***STOP***";
+
   public void warnOnFailedChecks(
-      @Observes Startup event, Instance<ProductionReadinessCheck> checks) {
+      @Observes Startup event,
+      Instance<ProductionReadinessCheck> checks,
+      QuarkusReadinessConfiguration config) {
     List<Error> errors = checks.stream().flatMap(check -> check.getErrors().stream()).toList();
     if (!errors.isEmpty()) {
-      String warning =
-          Charset.defaultCharset().equals(StandardCharsets.UTF_8)
-              ? WARNING_SIGN_UTF_8
-              : WARNING_SIGN_PLAIN;
-      LOGGER.warn("{} Production readiness checks failed! Check the warnings below.", warning);
+      var utf8 = Charset.defaultCharset().equals(StandardCharsets.UTF_8);
+      var warning = utf8 ? WARNING_SIGN_UTF_8 : WARNING_SIGN_PLAIN;
+      var severe = utf8 ? SEVERE_SIGN_UTF_8 : SEVERE_SIGN_PLAIN;
+      var hasSevere = errors.stream().anyMatch(Error::severe);
+      LOGGER
+          .makeLoggingEventBuilder(hasSevere ? Level.ERROR : Level.WARN)
+          .log(
+              "{} Production readiness checks failed! Check the warnings below.",
+              hasSevere ? severe : warning);
       errors.forEach(
           error ->
-              LOGGER.warn(
-                  "- {} Offending configuration option: '{}'.",
-                  error.message(),
-                  error.offendingProperty()));
-      LOGGER.warn(
-          "Refer to https://polaris.apache.org/in-dev/unreleased/configuring-polaris-for-production for more information.");
+              LOGGER
+                  .makeLoggingEventBuilder(error.severe() ? Level.ERROR : Level.WARN)
+                  .log(
+                      "- {} {} Offending configuration option: '{}'.",
+                      error.severe() ? severe : warning,
+                      error.message(),
+                      error.offendingProperty()));
+      LOGGER
+          .makeLoggingEventBuilder(hasSevere ? Level.ERROR : Level.WARN)
+          .log(
+              "Refer to https://polaris.apache.org/in-dev/unreleased/configuring-polaris-for-production for more information.");
+
+      if (hasSevere) {
+        if (!config.ignoreSevereIssues()) {
+          throw new IllegalStateException(
+              "Severe production readiness issues detected, startup aborted!");
+        }
+        LOGGER.error(
+            "{} severe production readiness issues detected, but user explicitly requested startup by setting "

Review Comment:
   This feels like a WARN to me, specifically because it was acknowledged via config.



##########
service/common/src/main/java/org/apache/polaris/service/catalog/validation/IcebergPropertiesValidation.java:
##########
@@ -0,0 +1,93 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.polaris.service.catalog.validation;
+
+import static org.apache.polaris.core.config.FeatureConfiguration.ALLOW_INSECURE_STORAGE_TYPES;
+import static org.apache.polaris.core.config.FeatureConfiguration.ALLOW_SPECIFYING_FILE_IO_IMPL;
+import static org.apache.polaris.core.config.FeatureConfiguration.SUPPORTED_CATALOG_STORAGE_TYPES;
+
+import jakarta.annotation.Nonnull;
+import jakarta.annotation.Nullable;
+import java.util.Map;
+import org.apache.iceberg.CatalogProperties;
+import org.apache.iceberg.exceptions.ValidationException;
+import org.apache.polaris.core.context.CallContext;
+import org.apache.polaris.core.storage.PolarisStorageConfigurationInfo;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class IcebergPropertiesValidation {
+  private static final Logger LOGGER = LoggerFactory.getLogger(IcebergPropertiesValidation.class);
+
+  public static void validateIcebergProperties(
+      @Nonnull CallContext callContext, @Nonnull Map<String, String> properties) {
+    validateIcebergPropertiesForFileIo(callContext, properties, null);
+  }
+
+  public static String validateIcebergPropertiesForFileIo(

Review Comment:
   This method name still looks misleading to me. It returns a usable FileIO class name is addition to validating it. Validation is implied in the class name.... How about `determineFileIOClassName(...)`?



##########
quarkus/service/src/main/java/org/apache/polaris/service/quarkus/config/ProductionReadinessChecks.java:
##########
@@ -176,4 +210,71 @@ public ProductionReadinessCheck checkPolarisEventListener(
   private static String authRealmSegment(String realm) {
     return realm.equals(QuarkusAuthenticationConfiguration.DEFAULT_REALM_KEY) ? "" : realm + ".";
   }
+
+  @Produces
+  public ProductionReadinessCheck checkInsecureStorageSettings(
+      FeaturesConfiguration featureConfiguration) {
+    var insecure = FeatureConfiguration.ALLOW_INSECURE_STORAGE_TYPES;
+
+    var errors = new ArrayList<Error>();
+    if (Boolean.parseBoolean(featureConfiguration.defaults().get(insecure.key))) {
+      errors.add(
+          Error.ofSevere(
+              "Must not enable a configuration that exposes known and severe security risks: "
+                  + insecure.description,
+              format("polaris.features.defaults.\"%s\"", insecure.key)));
+    }
+
+    featureConfiguration
+        .realmOverrides()
+        .forEach(
+            (realmId, overrides) -> {
+              if (Boolean.parseBoolean(overrides.overrides().get(insecure.key))) {
+                errors.add(
+                    Error.ofSevere(
+                        "Must not enable a configuration that exposes known and severe security risks: "
+                            + insecure.description,
+                        format(
+                            "polaris.features.realm-overrides.\"%s\".overrides.\"%s\"",
+                            realmId, insecure.key)));
+              }
+            });
+
+    var storageTypes = FeatureConfiguration.SUPPORTED_CATALOG_STORAGE_TYPES;
+    var mapper = new ObjectMapper();
+    var defaults = featureConfiguration.parseDefaults(mapper);
+    var realmOverrides = featureConfiguration.parseRealmOverrides(mapper);
+    @SuppressWarnings("unchecked")
+    var supported = (List<String>) defaults.getOrDefault(storageTypes.key, List.of());
+    supported.stream()
+        .filter(n -> !IcebergPropertiesValidation.safeStorageType(n))
+        .forEach(
+            t ->
+                errors.add(
+                    Error.ofSevere(
+                        format(
+                            "The storage type '%s' is considered insecure and to expose the service to severe security ricks!",
+                            t),
+                        format("polaris.features.defaults.\"%s\"", storageTypes.key))));
+    realmOverrides.forEach(
+        (realmId, overrides) -> {
+          @SuppressWarnings("unchecked")
+          var s = (List<String>) overrides.getOrDefault(storageTypes.key, List.of());
+          s.stream()
+              .filter(n -> !IcebergPropertiesValidation.safeStorageType(n))
+              .forEach(
+                  t ->
+                      errors.add(
+                          Error.ofSevere(
+                              format(
+                                  "The storage type '%s' is considered insecure and to expose the service to severe security ricks!",

Review Comment:
   ping re: spelling here



-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Require explicit user-consent to enable HadoopFileIO [polaris]

Posted by "snazy (via GitHub)" <gi...@apache.org>.
snazy commented on code in PR #1532:
URL: https://github.com/apache/polaris/pull/1532#discussion_r2100687992


##########
service/common/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergCatalog.java:
##########
@@ -2590,4 +2574,11 @@ private PageToken buildPageToken(@Nullable String tokenString, @Nullable Integer
       return PageToken.build(tokenString, pageSize);
     }
   }
+
+  static final FeatureConfiguration<Boolean> INITIALIZE_DEFAULT_CATALOG_FILEIO_FOR_TEST =
+      PolarisConfiguration.<Boolean>builder()
+          .key("INITIALIZE_DEFAULT_CATALOG_FILEIO_FOR_TEST")
+          .defaultValue(false)
+          .description("")
+          .buildFeatureConfiguration();

Review Comment:
   Not sure what you're asking here?
   Inconvenience due to some merge conflict on a PR that's not yet ready to be merged?



-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Require explicit user-consent to enable HadoopFileIO [polaris]

Posted by "flyrain (via GitHub)" <gi...@apache.org>.
flyrain commented on code in PR #1532:
URL: https://github.com/apache/polaris/pull/1532#discussion_r2100895902


##########
service/common/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergCatalog.java:
##########
@@ -2590,4 +2574,11 @@ private PageToken buildPageToken(@Nullable String tokenString, @Nullable Integer
       return PageToken.build(tokenString, pageSize);
     }
   }
+
+  static final FeatureConfiguration<Boolean> INITIALIZE_DEFAULT_CATALOG_FILEIO_FOR_TEST =
+      PolarisConfiguration.<Boolean>builder()
+          .key("INITIALIZE_DEFAULT_CATALOG_FILEIO_FOR_TEST")
+          .defaultValue(false)
+          .description("")
+          .buildFeatureConfiguration();

Review Comment:
   Perfect, you didn't complain, but block every PRs you can.



-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Require explicit user-consent to enable HadoopFileIO [polaris]

Posted by "RussellSpitzer (via GitHub)" <gi...@apache.org>.
RussellSpitzer commented on code in PR #1532:
URL: https://github.com/apache/polaris/pull/1532#discussion_r2100951894


##########
service/common/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergCatalog.java:
##########
@@ -2590,4 +2574,11 @@ private PageToken buildPageToken(@Nullable String tokenString, @Nullable Integer
       return PageToken.build(tokenString, pageSize);
     }
   }
+
+  static final FeatureConfiguration<Boolean> INITIALIZE_DEFAULT_CATALOG_FILEIO_FOR_TEST =
+      PolarisConfiguration.<Boolean>builder()
+          .key("INITIALIZE_DEFAULT_CATALOG_FILEIO_FOR_TEST")
+          .defaultValue(false)
+          .description("")
+          .buildFeatureConfiguration();

Review Comment:
   Lets stop this thread here. Please no further responses. If necessary please escalate to the PPMC list



-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Require explict user-consent to enable HadoopFileIO [polaris]

Posted by "dimas-b (via GitHub)" <gi...@apache.org>.
dimas-b commented on code in PR #1532:
URL: https://github.com/apache/polaris/pull/1532#discussion_r2075596231


##########
quarkus/service/src/test/java/org/apache/polaris/service/quarkus/catalog/IcebergCatalogTest.java:
##########
@@ -161,10 +161,14 @@ public Map<String, String> getConfigOverrides() {
       return Map.of(
           "polaris.features.defaults.\"ALLOW_SPECIFYING_FILE_IO_IMPL\"",
           "true",
+          "polaris.features.defaults.\"ALLOW_INSECURE_STORAGE_TYPES_ACCEPTING_SECURITY_RISKS\"",
+          "true",
           "polaris.features.defaults.\"INITIALIZE_DEFAULT_CATALOG_FILEIO_FOR_TEST\"",
           "true",
           "polaris.features.defaults.\"SUPPORTED_CATALOG_STORAGE_TYPES\"",
-          "[\"FILE\"]");
+          "[\"FILE\",\"S3\"]",
+          "polaris.readiness.ignore-security-issues",

Review Comment:
   composition works by default... one can have `application.propertie` and profile classes at the same time and their properties are merged, right? 



##########
quarkus/service/src/test/java/org/apache/polaris/service/quarkus/catalog/IcebergCatalogTest.java:
##########
@@ -161,10 +161,14 @@ public Map<String, String> getConfigOverrides() {
       return Map.of(
           "polaris.features.defaults.\"ALLOW_SPECIFYING_FILE_IO_IMPL\"",
           "true",
+          "polaris.features.defaults.\"ALLOW_INSECURE_STORAGE_TYPES_ACCEPTING_SECURITY_RISKS\"",
+          "true",
           "polaris.features.defaults.\"INITIALIZE_DEFAULT_CATALOG_FILEIO_FOR_TEST\"",
           "true",
           "polaris.features.defaults.\"SUPPORTED_CATALOG_STORAGE_TYPES\"",
-          "[\"FILE\"]");
+          "[\"FILE\",\"S3\"]",
+          "polaris.readiness.ignore-security-issues",

Review Comment:
   composition works by default... one can have `application.properties` and profile classes at the same time and their properties are merged, right? 



-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Require explict user-consent to enable HadoopFileIO [polaris]

Posted by "eric-maynard (via GitHub)" <gi...@apache.org>.
eric-maynard commented on code in PR #1532:
URL: https://github.com/apache/polaris/pull/1532#discussion_r2075956137


##########
service/common/src/main/java/org/apache/polaris/service/catalog/validation/IcebergPropertiesValidation.java:
##########
@@ -0,0 +1,95 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.polaris.service.catalog.validation;
+
+import static org.apache.polaris.core.config.FeatureConfiguration.ALLOW_INSECURE_STORAGE_TYPES_ACCEPTING_SECURITY_RISKS;
+import static org.apache.polaris.core.config.FeatureConfiguration.ALLOW_SPECIFYING_FILE_IO_IMPL;
+import static org.apache.polaris.core.config.FeatureConfiguration.SUPPORTED_CATALOG_STORAGE_TYPES;
+
+import jakarta.annotation.Nonnull;
+import jakarta.annotation.Nullable;
+import java.util.Map;
+import org.apache.iceberg.CatalogProperties;
+import org.apache.iceberg.exceptions.ValidationException;
+import org.apache.polaris.core.context.CallContext;
+import org.apache.polaris.core.storage.PolarisStorageConfigurationInfo;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class IcebergPropertiesValidation {
+  private static final Logger LOGGER = LoggerFactory.getLogger(IcebergPropertiesValidation.class);
+
+  public static void validateIcebergProperties(
+      @Nonnull CallContext callContext, @Nonnull Map<String, String> properties) {
+    validateIcebergProperties(callContext, properties, null);
+  }
+
+  public static String validateIcebergProperties(
+      @Nonnull CallContext callContext,
+      @Nonnull Map<String, String> properties,
+      @Nullable PolarisStorageConfigurationInfo storageConfigurationInfo) {
+    var ctx = callContext.getPolarisCallContext();
+    var configStore = ctx.getConfigurationStore();
+
+    var ioImpl = properties.get(CatalogProperties.FILE_IO_IMPL);
+    if (ioImpl != null) {
+      if (!configStore.getConfiguration(ctx, ALLOW_SPECIFYING_FILE_IO_IMPL)) {
+        throw new ValidationException(
+            "Cannot set property '%s' to '%s' for this catalog.",
+            CatalogProperties.FILE_IO_IMPL, ioImpl);
+      }
+      LOGGER.debug(
+          "Allowing overriding ioImplClassName to {} for storageConfiguration {}",
+          ioImpl,
+          storageConfigurationInfo);
+    } else if (storageConfigurationInfo != null) {
+      ioImpl = storageConfigurationInfo.getFileIoImplClassName();
+      LOGGER.debug(
+          "Resolved ioImplClassName {} from storageConfiguration {}",
+          ioImpl,
+          storageConfigurationInfo);
+    }
+
+    if (ioImpl != null) {
+      var storageType = StorageTypeFileIO.fromFileIoImplementation(ioImpl);
+      if (storageType.validateAllowedStorageType()
+          && !configStore
+              .getConfiguration(ctx, SUPPORTED_CATALOG_STORAGE_TYPES)
+              .contains(storageType.name())) {

Review Comment:
   Storage types and File IO implementations are not necessarily the same thing; you could have any number of FileIO implementations that can talk to S3



##########
polaris-core/src/main/java/org/apache/polaris/core/config/FeatureConfiguration.java:
##########
@@ -234,4 +233,38 @@ public static void enforceFeatureEnabledOrThrow(
           .description("If true, the policy-store endpoints are enabled")
           .defaultValue(true)
           .buildFeatureConfiguration();
+
+  public static final FeatureConfiguration<Boolean> ALLOW_SPECIFYING_FILE_IO_IMPL =
+      PolarisConfiguration.<Boolean>builder()
+          .key("ALLOW_SPECIFYING_FILE_IO_IMPL")
+          .description(
+              "Config key for whether to allow setting the FILE_IO_IMPL using catalog properties. "
+                  + "Must only be enabled in dev/test environments, never in production systems.")
+          .defaultValue(false)
+          .buildFeatureConfiguration();
+
+  public static final FeatureConfiguration<Boolean>
+      ALLOW_INSECURE_STORAGE_TYPES_ACCEPTING_SECURITY_RISKS =
+          PolarisConfiguration.<Boolean>builder()
+              .key("ALLOW_INSECURE_STORAGE_TYPES_ACCEPTING_SECURITY_RISKS")
+              .description(
+                  "Allow usage of FileIO implementations that are considered insecure. "
+                      + "Enabling this setting exposes the service to SEVERE security risks, including "
+                      + "denial of service, corruption, data loss and more!"
+                      + "This must NEVER be set to 'true' for anything except tests! ")
+              .defaultValue(false)
+              .buildFeatureConfiguration();
+
+  public static final FeatureConfiguration<Boolean> INITIALIZE_DEFAULT_CATALOG_FILEIO_FOR_TEST =
+      PolarisConfiguration.<Boolean>builder()
+          .key("INITIALIZE_DEFAULT_CATALOG_FILEIO_FOR_TEST")
+          .description(
+              "Config key for initializing a default \"catalogFileIO\" that is available either via "
+                  + "getIo() or for any TableOperations/ViewOperations instantiated, via ops.io() "
+                  + "before entity-specific FileIO initialization is triggered for any such operations. "
+                  + "Typically this should only be used in test scenarios where a PolarisIcebergCatalog "

Review Comment:
   If this is for tests I don't think it should be a FeatureConfiguration



##########
quarkus/service/src/main/java/org/apache/polaris/service/quarkus/config/ProductionReadinessChecks.java:
##########
@@ -55,26 +62,53 @@ public class ProductionReadinessChecks {
    */
   private static final String WARNING_SIGN_UTF_8 = "\u0000\u26A0\uFE0F";
 
+  private static final String SEVERE_SIGN_UTF_8 = "\u0000\uD83D\uDED1";

Review Comment:
   These changes seem pretty unnecessary



##########
polaris-core/src/main/java/org/apache/polaris/core/config/FeatureConfiguration.java:
##########
@@ -234,4 +233,38 @@ public static void enforceFeatureEnabledOrThrow(
           .description("If true, the policy-store endpoints are enabled")
           .defaultValue(true)
           .buildFeatureConfiguration();
+
+  public static final FeatureConfiguration<Boolean> ALLOW_SPECIFYING_FILE_IO_IMPL =
+      PolarisConfiguration.<Boolean>builder()
+          .key("ALLOW_SPECIFYING_FILE_IO_IMPL")
+          .description(
+              "Config key for whether to allow setting the FILE_IO_IMPL using catalog properties. "
+                  + "Must only be enabled in dev/test environments, never in production systems.")
+          .defaultValue(false)
+          .buildFeatureConfiguration();
+
+  public static final FeatureConfiguration<Boolean>

Review Comment:
   I don't see how this isn't completely redundant with `SUPPORTED_CATALOG_STORAGE_TYPES`



##########
service/common/src/main/java/org/apache/polaris/service/catalog/validation/IcebergPropertiesValidation.java:
##########
@@ -0,0 +1,95 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.polaris.service.catalog.validation;
+
+import static org.apache.polaris.core.config.FeatureConfiguration.ALLOW_INSECURE_STORAGE_TYPES_ACCEPTING_SECURITY_RISKS;
+import static org.apache.polaris.core.config.FeatureConfiguration.ALLOW_SPECIFYING_FILE_IO_IMPL;
+import static org.apache.polaris.core.config.FeatureConfiguration.SUPPORTED_CATALOG_STORAGE_TYPES;
+
+import jakarta.annotation.Nonnull;
+import jakarta.annotation.Nullable;
+import java.util.Map;
+import org.apache.iceberg.CatalogProperties;
+import org.apache.iceberg.exceptions.ValidationException;
+import org.apache.polaris.core.context.CallContext;
+import org.apache.polaris.core.storage.PolarisStorageConfigurationInfo;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class IcebergPropertiesValidation {
+  private static final Logger LOGGER = LoggerFactory.getLogger(IcebergPropertiesValidation.class);
+
+  public static void validateIcebergProperties(
+      @Nonnull CallContext callContext, @Nonnull Map<String, String> properties) {
+    validateIcebergProperties(callContext, properties, null);
+  }
+
+  public static String validateIcebergProperties(
+      @Nonnull CallContext callContext,
+      @Nonnull Map<String, String> properties,
+      @Nullable PolarisStorageConfigurationInfo storageConfigurationInfo) {
+    var ctx = callContext.getPolarisCallContext();
+    var configStore = ctx.getConfigurationStore();
+
+    var ioImpl = properties.get(CatalogProperties.FILE_IO_IMPL);
+    if (ioImpl != null) {
+      if (!configStore.getConfiguration(ctx, ALLOW_SPECIFYING_FILE_IO_IMPL)) {
+        throw new ValidationException(
+            "Cannot set property '%s' to '%s' for this catalog.",
+            CatalogProperties.FILE_IO_IMPL, ioImpl);
+      }
+      LOGGER.debug(
+          "Allowing overriding ioImplClassName to {} for storageConfiguration {}",
+          ioImpl,
+          storageConfigurationInfo);
+    } else if (storageConfigurationInfo != null) {
+      ioImpl = storageConfigurationInfo.getFileIoImplClassName();
+      LOGGER.debug(
+          "Resolved ioImplClassName {} from storageConfiguration {}",
+          ioImpl,
+          storageConfigurationInfo);
+    }
+
+    if (ioImpl != null) {
+      var storageType = StorageTypeFileIO.fromFileIoImplementation(ioImpl);
+      if (storageType.validateAllowedStorageType()
+          && !configStore
+              .getConfiguration(ctx, SUPPORTED_CATALOG_STORAGE_TYPES)
+              .contains(storageType.name())) {
+        throw new ValidationException(
+            "File IO implementation '%s', as storage type '%s' is not supported",
+            ioImpl, storageType);
+      }
+
+      if (!storageType.safe()
+          && !configStore.getConfiguration(
+              ctx, ALLOW_INSECURE_STORAGE_TYPES_ACCEPTING_SECURITY_RISKS)) {
+        throw new ValidationException(
+            "File IO implementation '%s' (storage type '%s') is considered insecure and must not be used",

Review Comment:
   What makes a custom File IO insecure?



-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Require explict user-consent to enable HadoopFileIO [polaris]

Posted by "pingtimeout (via GitHub)" <gi...@apache.org>.
pingtimeout commented on code in PR #1532:
URL: https://github.com/apache/polaris/pull/1532#discussion_r2081324894


##########
quarkus/service/src/main/java/org/apache/polaris/service/quarkus/config/ProductionReadinessChecks.java:
##########
@@ -55,26 +62,53 @@ public class ProductionReadinessChecks {
    */
   private static final String WARNING_SIGN_UTF_8 = "\u0000\u26A0\uFE0F";
 
+  private static final String SEVERE_SIGN_UTF_8 = "\u0000\uD83D\uDED1";

Review Comment:
   @eric-maynard I am not sure what the ask is here.  Would you rather have the UTF-8 icon and/or the log message implemented in a separate PR?  Or do you mean that the PR title should be a bit more general?



-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Require explict user-consent to enable HadoopFileIO [polaris]

Posted by "snazy (via GitHub)" <gi...@apache.org>.
snazy commented on PR #1532:
URL: https://github.com/apache/polaris/pull/1532#issuecomment-2867279369

   >     1. ALLOW_INSECURE_STORAGE_TYPES
   >        It's redundant and risky. ... This one delivers no meaningful return.
   
   The opposite is actually true.
   
   >     2. INITIALIZE_DEFAULT_CATALOG_FILEIO_FOR_TEST
   >        It belongs in test code, not product config.
   
   Oh, absolutely! But then the production code should not depend on it either.
   


-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Require explict user-consent to enable HadoopFileIO [polaris]

Posted by "snazy (via GitHub)" <gi...@apache.org>.
snazy commented on code in PR #1532:
URL: https://github.com/apache/polaris/pull/1532#discussion_r2075679465


##########
quarkus/service/src/test/java/org/apache/polaris/service/quarkus/catalog/IcebergCatalogTest.java:
##########
@@ -161,10 +161,14 @@ public Map<String, String> getConfigOverrides() {
       return Map.of(
           "polaris.features.defaults.\"ALLOW_SPECIFYING_FILE_IO_IMPL\"",
           "true",
+          "polaris.features.defaults.\"ALLOW_INSECURE_STORAGE_TYPES_ACCEPTING_SECURITY_RISKS\"",
+          "true",
           "polaris.features.defaults.\"INITIALIZE_DEFAULT_CATALOG_FILEIO_FOR_TEST\"",
           "true",
           "polaris.features.defaults.\"SUPPORTED_CATALOG_STORAGE_TYPES\"",
-          "[\"FILE\"]");
+          "[\"FILE\",\"S3\"]",
+          "polaris.readiness.ignore-security-issues",

Review Comment:
   Yea - but let's defer to a separate PR to clean all those up.



-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Require explict user-consent to enable HadoopFileIO [polaris]

Posted by "snazy (via GitHub)" <gi...@apache.org>.
snazy commented on code in PR #1532:
URL: https://github.com/apache/polaris/pull/1532#discussion_r2077930755


##########
service/common/src/main/java/org/apache/polaris/service/catalog/validation/IcebergPropertiesValidation.java:
##########
@@ -0,0 +1,95 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.polaris.service.catalog.validation;
+
+import static org.apache.polaris.core.config.FeatureConfiguration.ALLOW_INSECURE_STORAGE_TYPES_ACCEPTING_SECURITY_RISKS;
+import static org.apache.polaris.core.config.FeatureConfiguration.ALLOW_SPECIFYING_FILE_IO_IMPL;
+import static org.apache.polaris.core.config.FeatureConfiguration.SUPPORTED_CATALOG_STORAGE_TYPES;
+
+import jakarta.annotation.Nonnull;
+import jakarta.annotation.Nullable;
+import java.util.Map;
+import org.apache.iceberg.CatalogProperties;
+import org.apache.iceberg.exceptions.ValidationException;
+import org.apache.polaris.core.context.CallContext;
+import org.apache.polaris.core.storage.PolarisStorageConfigurationInfo;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class IcebergPropertiesValidation {
+  private static final Logger LOGGER = LoggerFactory.getLogger(IcebergPropertiesValidation.class);
+
+  public static void validateIcebergProperties(
+      @Nonnull CallContext callContext, @Nonnull Map<String, String> properties) {
+    validateIcebergProperties(callContext, properties, null);
+  }
+
+  public static String validateIcebergProperties(
+      @Nonnull CallContext callContext,
+      @Nonnull Map<String, String> properties,
+      @Nullable PolarisStorageConfigurationInfo storageConfigurationInfo) {
+    var ctx = callContext.getPolarisCallContext();
+    var configStore = ctx.getConfigurationStore();
+
+    var ioImpl = properties.get(CatalogProperties.FILE_IO_IMPL);
+    if (ioImpl != null) {
+      if (!configStore.getConfiguration(ctx, ALLOW_SPECIFYING_FILE_IO_IMPL)) {
+        throw new ValidationException(
+            "Cannot set property '%s' to '%s' for this catalog.",
+            CatalogProperties.FILE_IO_IMPL, ioImpl);
+      }
+      LOGGER.debug(
+          "Allowing overriding ioImplClassName to {} for storageConfiguration {}",
+          ioImpl,
+          storageConfigurationInfo);
+    } else if (storageConfigurationInfo != null) {
+      ioImpl = storageConfigurationInfo.getFileIoImplClassName();
+      LOGGER.debug(
+          "Resolved ioImplClassName {} from storageConfiguration {}",
+          ioImpl,
+          storageConfigurationInfo);
+    }
+
+    if (ioImpl != null) {
+      var storageType = StorageTypeFileIO.fromFileIoImplementation(ioImpl);
+      if (storageType.validateAllowedStorageType()
+          && !configStore
+              .getConfiguration(ctx, SUPPORTED_CATALOG_STORAGE_TYPES)
+              .contains(storageType.name())) {

Review Comment:
   Yes? That's what `fromFileIoImplementation()` figures out, no?



-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Require explict user-consent to enable HadoopFileIO [polaris]

Posted by "snazy (via GitHub)" <gi...@apache.org>.
snazy commented on code in PR #1532:
URL: https://github.com/apache/polaris/pull/1532#discussion_r2077927417


##########
polaris-core/src/main/java/org/apache/polaris/core/config/FeatureConfiguration.java:
##########
@@ -234,4 +233,38 @@ public static void enforceFeatureEnabledOrThrow(
           .description("If true, the policy-store endpoints are enabled")
           .defaultValue(true)
           .buildFeatureConfiguration();
+
+  public static final FeatureConfiguration<Boolean> ALLOW_SPECIFYING_FILE_IO_IMPL =
+      PolarisConfiguration.<Boolean>builder()
+          .key("ALLOW_SPECIFYING_FILE_IO_IMPL")
+          .description(
+              "Config key for whether to allow setting the FILE_IO_IMPL using catalog properties. "
+                  + "Must only be enabled in dev/test environments, never in production systems.")
+          .defaultValue(false)
+          .buildFeatureConfiguration();
+
+  public static final FeatureConfiguration<Boolean>

Review Comment:
   It's there to make the fact mentioned in the description explicit.



-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Require explict user-consent to enable HadoopFileIO [polaris]

Posted by "dimas-b (via GitHub)" <gi...@apache.org>.
dimas-b commented on PR #1532:
URL: https://github.com/apache/polaris/pull/1532#issuecomment-2868261226

   > INITIALIZE_DEFAULT_CATALOG_FILEIO_FOR_TEST was already present, but I don’t think that justifies promoting it to a first-class config flag. In fact, we shouldn’t be exposing this at all, it’s a test-only utility and should be removed.
   
   Good points. 
   
   @dennishuo : is it removable now? IIRC it had some usecase before, but I'm not sure whether it is still needed :thinking: 


-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Require explict user-consent to enable HadoopFileIO [polaris]

Posted by "eric-maynard (via GitHub)" <gi...@apache.org>.
eric-maynard commented on code in PR #1532:
URL: https://github.com/apache/polaris/pull/1532#discussion_r2082220634


##########
polaris-core/src/main/java/org/apache/polaris/core/config/FeatureConfiguration.java:
##########
@@ -234,4 +233,36 @@ public static void enforceFeatureEnabledOrThrow(
           .description("If true, the policy-store endpoints are enabled")
           .defaultValue(true)
           .buildFeatureConfiguration();
+
+  public static final FeatureConfiguration<Boolean> ALLOW_SPECIFYING_FILE_IO_IMPL =
+      PolarisConfiguration.<Boolean>builder()
+          .key("ALLOW_SPECIFYING_FILE_IO_IMPL")
+          .description(
+              "Config key for whether to allow setting the FILE_IO_IMPL using catalog properties. "
+                  + "Must only be enabled in dev/test environments, should not be in production systems.")
+          .defaultValue(false)
+          .buildFeatureConfiguration();
+
+  public static final FeatureConfiguration<Boolean> ALLOW_INSECURE_STORAGE_TYPES =

Review Comment:
   Not sure when my comment got dropped but this still looks redundant with the existing config



-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Require explict user-consent to enable HadoopFileIO [polaris]

Posted by "pingtimeout (via GitHub)" <gi...@apache.org>.
pingtimeout commented on code in PR #1532:
URL: https://github.com/apache/polaris/pull/1532#discussion_r2081340225


##########
quarkus/service/src/main/java/org/apache/polaris/service/quarkus/config/ProductionReadinessChecks.java:
##########
@@ -57,26 +64,53 @@ public class ProductionReadinessChecks {
    */
   private static final String WARNING_SIGN_UTF_8 = "\u0000\u26A0\uFE0F";
 
+  private static final String SEVERE_SIGN_UTF_8 = "\u0000\uD83D\uDED1";
+
   /** A simple warning sign displayed when the character set is not UTF-8. */
   private static final String WARNING_SIGN_PLAIN = "!!!";
 
+  private static final String SEVERE_SIGN_PLAIN = "***STOP***";
+
   public void warnOnFailedChecks(
-      @Observes Startup event, Instance<ProductionReadinessCheck> checks) {
+      @Observes Startup event,
+      Instance<ProductionReadinessCheck> checks,
+      QuarkusReadinessConfiguration config) {
     List<Error> errors = checks.stream().flatMap(check -> check.getErrors().stream()).toList();
     if (!errors.isEmpty()) {
-      String warning =
-          Charset.defaultCharset().equals(StandardCharsets.UTF_8)
-              ? WARNING_SIGN_UTF_8
-              : WARNING_SIGN_PLAIN;
-      LOGGER.warn("{} Production readiness checks failed! Check the warnings below.", warning);
+      var utf8 = Charset.defaultCharset().equals(StandardCharsets.UTF_8);
+      var warning = utf8 ? WARNING_SIGN_UTF_8 : WARNING_SIGN_PLAIN;
+      var severe = utf8 ? SEVERE_SIGN_UTF_8 : SEVERE_SIGN_PLAIN;
+      var hasSevere = errors.stream().anyMatch(Error::severe);
+      LOGGER
+          .makeLoggingEventBuilder(hasSevere ? Level.ERROR : Level.WARN)
+          .log(
+              "{} Production readiness checks failed! Check the warnings below.",
+              hasSevere ? severe : warning);
       errors.forEach(
           error ->
-              LOGGER.warn(
-                  "- {} Offending configuration option: '{}'.",
-                  error.message(),
-                  error.offendingProperty()));
-      LOGGER.warn(
-          "Refer to https://polaris.apache.org/in-dev/unreleased/configuring-polaris-for-production for more information.");
+              LOGGER
+                  .makeLoggingEventBuilder(error.severe() ? Level.ERROR : Level.WARN)
+                  .log(
+                      "- {} {} Offending configuration option: '{}'.",
+                      error.severe() ? severe : warning,
+                      error.message(),
+                      error.offendingProperty()));
+      LOGGER
+          .makeLoggingEventBuilder(hasSevere ? Level.ERROR : Level.WARN)
+          .log(
+              "Refer to https://polaris.apache.org/in-dev/unreleased/configuring-polaris-for-production for more information.");
+
+      if (hasSevere) {
+        if (!config.ignoreSecurityIssues()) {
+          throw new IllegalStateException(

Review Comment:
   nit: the current method is named `warnOnFailedChecks`.  The name does not suggest that an ISE can be thrown, and there is no Javadoc that tells this either.  It could be preferable to have two methods:
   
   * `warnOnFailedChecks`
   * `maybeAbortStartupOnSecurityIssues`
   
   Maybe add a `TODO` comment so that this becomes an LHF for new contributors?



-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Require explict user-consent to enable HadoopFileIO [polaris]

Posted by "pingtimeout (via GitHub)" <gi...@apache.org>.
pingtimeout commented on code in PR #1532:
URL: https://github.com/apache/polaris/pull/1532#discussion_r2084020633


##########
polaris-core/src/main/java/org/apache/polaris/core/config/FeatureConfiguration.java:
##########
@@ -234,4 +233,38 @@ public static void enforceFeatureEnabledOrThrow(
           .description("If true, the policy-store endpoints are enabled")
           .defaultValue(true)
           .buildFeatureConfiguration();
+
+  public static final FeatureConfiguration<Boolean> ALLOW_SPECIFYING_FILE_IO_IMPL =
+      PolarisConfiguration.<Boolean>builder()
+          .key("ALLOW_SPECIFYING_FILE_IO_IMPL")
+          .description(
+              "Config key for whether to allow setting the FILE_IO_IMPL using catalog properties. "
+                  + "Must only be enabled in dev/test environments, never in production systems.")
+          .defaultValue(false)
+          .buildFeatureConfiguration();
+
+  public static final FeatureConfiguration<Boolean>

Review Comment:
   AFAICT, because HadoopFileIO is considered insecure, we want to _make it hard_ for users to do the wrong thing.  Hence the addition of multiple flags.  With the current way, it is trivial to accidentally overlook the activation of HadoopFileIO.
   
   There could be other proposals for this implementation.  But then they will be evaluated against this one goal: make it hard for users to do the wrong thing.



-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Require explict user-consent to enable HadoopFileIO [polaris]

Posted by "flyrain (via GitHub)" <gi...@apache.org>.
flyrain commented on PR #1532:
URL: https://github.com/apache/polaris/pull/1532#issuecomment-2868205342

   `INITIALIZE_DEFAULT_CATALOG_FILEIO_FOR_TEST` was already present, but I don’t think that justifies promoting it to a first-class config flag. In fact, we shouldn’t be exposing this at all, it’s a test-only utility and should be removed.
   That said, I don’t think this PR needs to handle the removal. A more reasonable approach would be to leave it as-is for now and clean it up in a follow-up PR.
   Let’s not legitimize it by formalizing it in the public config surface.


-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Require explicit user-consent to enable HadoopFileIO [polaris]

Posted by "snazy (via GitHub)" <gi...@apache.org>.
snazy commented on code in PR #1532:
URL: https://github.com/apache/polaris/pull/1532#discussion_r2095272403


##########
polaris-core/src/main/java/org/apache/polaris/core/config/FeatureConfiguration.java:
##########
@@ -234,4 +233,38 @@ public static void enforceFeatureEnabledOrThrow(
           .description("If true, the policy-store endpoints are enabled")
           .defaultValue(true)
           .buildFeatureConfiguration();
+
+  public static final FeatureConfiguration<Boolean> ALLOW_SPECIFYING_FILE_IO_IMPL =
+      PolarisConfiguration.<Boolean>builder()
+          .key("ALLOW_SPECIFYING_FILE_IO_IMPL")
+          .description(
+              "Config key for whether to allow setting the FILE_IO_IMPL using catalog properties. "
+                  + "Must only be enabled in dev/test environments, never in production systems.")
+          .defaultValue(false)
+          .buildFeatureConfiguration();
+
+  public static final FeatureConfiguration<Boolean>
+      ALLOW_INSECURE_STORAGE_TYPES_ACCEPTING_SECURITY_RISKS =
+          PolarisConfiguration.<Boolean>builder()
+              .key("ALLOW_INSECURE_STORAGE_TYPES_ACCEPTING_SECURITY_RISKS")
+              .description(
+                  "Allow usage of FileIO implementations that are considered insecure. "
+                      + "Enabling this setting exposes the service to SEVERE security risks, including "
+                      + "denial of service, corruption, data loss and more!"
+                      + "This must NEVER be set to 'true' for anything except tests! ")
+              .defaultValue(false)
+              .buildFeatureConfiguration();
+
+  public static final FeatureConfiguration<Boolean> INITIALIZE_DEFAULT_CATALOG_FILEIO_FOR_TEST =
+      PolarisConfiguration.<Boolean>builder()
+          .key("INITIALIZE_DEFAULT_CATALOG_FILEIO_FOR_TEST")
+          .description(
+              "Config key for initializing a default \"catalogFileIO\" that is available either via "
+                  + "getIo() or for any TableOperations/ViewOperations instantiated, via ops.io() "
+                  + "before entity-specific FileIO initialization is triggered for any such operations. "
+                  + "Typically this should only be used in test scenarios where a PolarisIcebergCatalog "

Review Comment:
   The comment's outdated now, resolving.



-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Require explict user-consent to enable HadoopFileIO [polaris]

Posted by "eric-maynard (via GitHub)" <gi...@apache.org>.
eric-maynard commented on code in PR #1532:
URL: https://github.com/apache/polaris/pull/1532#discussion_r2085104163


##########
quarkus/service/src/main/java/org/apache/polaris/service/quarkus/config/QuarkusReadinessConfiguration.java:
##########
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.polaris.service.quarkus.config;
+
+import io.quarkus.runtime.annotations.StaticInitSafe;
+import io.smallrye.config.ConfigMapping;
+import io.smallrye.config.WithDefault;
+
+@StaticInitSafe
+@ConfigMapping(prefix = "polaris.readiness")
+public interface QuarkusReadinessConfiguration {
+
+  /**
+   * Setting this to {@code true} means that Polaris will start up even if severe security risks
+   * have been detected, accepting the risk of denial-of-service, data-loss, corruption and other
+   * risks.
+   */
+  @WithDefault("false")
+  boolean ignoreSevereIssues();

Review Comment:
   I think my [comment](https://github.com/apache/polaris/pull/1532#pullrequestreview-2819099730) lays out a path:
   
   > it might be good to separate out some of these changes
   
   In the interest of moving things forward I linked some examples of what more incremental improvements might look like [below](https://github.com/apache/polaris/pull/1532#issuecomment-2871685572)



-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Require explict user-consent to enable HadoopFileIO [polaris]

Posted by "eric-maynard (via GitHub)" <gi...@apache.org>.
eric-maynard commented on code in PR #1532:
URL: https://github.com/apache/polaris/pull/1532#discussion_r2085655415


##########
quarkus/service/src/main/java/org/apache/polaris/service/quarkus/config/QuarkusReadinessConfiguration.java:
##########
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.polaris.service.quarkus.config;
+
+import io.quarkus.runtime.annotations.StaticInitSafe;
+import io.smallrye.config.ConfigMapping;
+import io.smallrye.config.WithDefault;
+
+@StaticInitSafe
+@ConfigMapping(prefix = "polaris.readiness")
+public interface QuarkusReadinessConfiguration {
+
+  /**
+   * Setting this to {@code true} means that Polaris will start up even if severe security risks
+   * have been detected, accepting the risk of denial-of-service, data-loss, corruption and other
+   * risks.
+   */
+  @WithDefault("false")
+  boolean ignoreSevereIssues();

Review Comment:
   It's not about PR guidelines -- there are a bunch of issues with the code changes proposed in this PR that I've highlighted in various comments. Even the questions asked in this thread are not resolved. I still don't know what a "severe issue" is.
   
   Breaking up the change could allow us to move forward with some of the less controversial aspects of the change, but if you're opposed to that I'm also happy to continue hashing out these issues here.



-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Require explict user-consent to enable HadoopFileIO [polaris]

Posted by "eric-maynard (via GitHub)" <gi...@apache.org>.
eric-maynard commented on PR #1532:
URL: https://github.com/apache/polaris/pull/1532#issuecomment-2871685572

   See #1566 for a simple implementation removing FILE from the storage types supported by default.
   
   See [this branch](https://github.com/eric-maynard/polaris/pull/4/files) for an example of a simple way to prohibit the default file IO from letting the service use a HadoopFileIO.


-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Require explicit user-consent to enable HadoopFileIO [polaris]

Posted by "eric-maynard (via GitHub)" <gi...@apache.org>.
eric-maynard commented on code in PR #1532:
URL: https://github.com/apache/polaris/pull/1532#discussion_r2086165007


##########
polaris-core/src/main/java/org/apache/polaris/core/config/FeatureConfiguration.java:
##########
@@ -234,4 +233,36 @@ public static void enforceFeatureEnabledOrThrow(
           .description("If true, the policy-store endpoints are enabled")
           .defaultValue(true)
           .buildFeatureConfiguration();
+
+  public static final FeatureConfiguration<Boolean> ALLOW_SPECIFYING_FILE_IO_IMPL =
+      PolarisConfiguration.<Boolean>builder()
+          .key("ALLOW_SPECIFYING_FILE_IO_IMPL")
+          .description(
+              "Config key for whether to allow setting the FILE_IO_IMPL using catalog properties. "
+                  + "Must only be enabled in dev/test environments, should not be in production systems.")
+          .defaultValue(false)
+          .buildFeatureConfiguration();
+
+  public static final FeatureConfiguration<Boolean> ALLOW_INSECURE_STORAGE_TYPES =

Review Comment:
   > I think this property is good enough as it's generic to any storage type (not only FILE).
   
   Is that true? What qualifies a storage type as insecure?
   
   If the answer is "the storage type can use HadoopFileIO", then all 4 storage types are insecure.



-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Require explicit user-consent to enable HadoopFileIO [polaris]

Posted by "keithgchapman (via GitHub)" <gi...@apache.org>.
keithgchapman commented on code in PR #1532:
URL: https://github.com/apache/polaris/pull/1532#discussion_r2101051457


##########
service/common/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergCatalog.java:
##########
@@ -2590,4 +2574,11 @@ private PageToken buildPageToken(@Nullable String tokenString, @Nullable Integer
       return PageToken.build(tokenString, pageSize);
     }
   }
+
+  static final FeatureConfiguration<Boolean> INITIALIZE_DEFAULT_CATALOG_FILEIO_FOR_TEST =
+      PolarisConfiguration.<Boolean>builder()
+          .key("INITIALIZE_DEFAULT_CATALOG_FILEIO_FOR_TEST")
+          .defaultValue(false)
+          .description("")
+          .buildFeatureConfiguration();

Review Comment:
   I agree. Let's please stop this thread. We are here to collaborate on the project and move it forward. 



-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Require explict user-consent to enable HadoopFileIO [polaris]

Posted by "eric-maynard (via GitHub)" <gi...@apache.org>.
eric-maynard commented on code in PR #1532:
URL: https://github.com/apache/polaris/pull/1532#discussion_r2078124369


##########
service/common/src/main/java/org/apache/polaris/service/catalog/validation/IcebergPropertiesValidation.java:
##########
@@ -0,0 +1,95 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.polaris.service.catalog.validation;
+
+import static org.apache.polaris.core.config.FeatureConfiguration.ALLOW_INSECURE_STORAGE_TYPES_ACCEPTING_SECURITY_RISKS;
+import static org.apache.polaris.core.config.FeatureConfiguration.ALLOW_SPECIFYING_FILE_IO_IMPL;
+import static org.apache.polaris.core.config.FeatureConfiguration.SUPPORTED_CATALOG_STORAGE_TYPES;
+
+import jakarta.annotation.Nonnull;
+import jakarta.annotation.Nullable;
+import java.util.Map;
+import org.apache.iceberg.CatalogProperties;
+import org.apache.iceberg.exceptions.ValidationException;
+import org.apache.polaris.core.context.CallContext;
+import org.apache.polaris.core.storage.PolarisStorageConfigurationInfo;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class IcebergPropertiesValidation {
+  private static final Logger LOGGER = LoggerFactory.getLogger(IcebergPropertiesValidation.class);
+
+  public static void validateIcebergProperties(
+      @Nonnull CallContext callContext, @Nonnull Map<String, String> properties) {
+    validateIcebergProperties(callContext, properties, null);
+  }
+
+  public static String validateIcebergProperties(
+      @Nonnull CallContext callContext,
+      @Nonnull Map<String, String> properties,
+      @Nullable PolarisStorageConfigurationInfo storageConfigurationInfo) {
+    var ctx = callContext.getPolarisCallContext();
+    var configStore = ctx.getConfigurationStore();
+
+    var ioImpl = properties.get(CatalogProperties.FILE_IO_IMPL);
+    if (ioImpl != null) {
+      if (!configStore.getConfiguration(ctx, ALLOW_SPECIFYING_FILE_IO_IMPL)) {
+        throw new ValidationException(
+            "Cannot set property '%s' to '%s' for this catalog.",
+            CatalogProperties.FILE_IO_IMPL, ioImpl);
+      }
+      LOGGER.debug(
+          "Allowing overriding ioImplClassName to {} for storageConfiguration {}",
+          ioImpl,
+          storageConfigurationInfo);
+    } else if (storageConfigurationInfo != null) {
+      ioImpl = storageConfigurationInfo.getFileIoImplClassName();
+      LOGGER.debug(
+          "Resolved ioImplClassName {} from storageConfiguration {}",
+          ioImpl,
+          storageConfigurationInfo);
+    }
+
+    if (ioImpl != null) {
+      var storageType = StorageTypeFileIO.fromFileIoImplementation(ioImpl);
+      if (storageType.validateAllowedStorageType()
+          && !configStore
+              .getConfiguration(ctx, SUPPORTED_CATALOG_STORAGE_TYPES)
+              .contains(storageType.name())) {

Review Comment:
   For the hard-coded FileIO implementations (assuming the implementation you have in mind is actually the one on the classpath), yes. For other implementations, no.



-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Require explict user-consent to enable HadoopFileIO [polaris]

Posted by "eric-maynard (via GitHub)" <gi...@apache.org>.
eric-maynard commented on code in PR #1532:
URL: https://github.com/apache/polaris/pull/1532#discussion_r2078116567


##########
polaris-core/src/main/java/org/apache/polaris/core/config/FeatureConfiguration.java:
##########
@@ -234,4 +233,38 @@ public static void enforceFeatureEnabledOrThrow(
           .description("If true, the policy-store endpoints are enabled")
           .defaultValue(true)
           .buildFeatureConfiguration();
+
+  public static final FeatureConfiguration<Boolean> ALLOW_SPECIFYING_FILE_IO_IMPL =
+      PolarisConfiguration.<Boolean>builder()
+          .key("ALLOW_SPECIFYING_FILE_IO_IMPL")
+          .description(
+              "Config key for whether to allow setting the FILE_IO_IMPL using catalog properties. "
+                  + "Must only be enabled in dev/test environments, never in production systems.")
+          .defaultValue(false)
+          .buildFeatureConfiguration();
+
+  public static final FeatureConfiguration<Boolean>
+      ALLOW_INSECURE_STORAGE_TYPES_ACCEPTING_SECURITY_RISKS =
+          PolarisConfiguration.<Boolean>builder()
+              .key("ALLOW_INSECURE_STORAGE_TYPES_ACCEPTING_SECURITY_RISKS")
+              .description(
+                  "Allow usage of FileIO implementations that are considered insecure. "
+                      + "Enabling this setting exposes the service to SEVERE security risks, including "
+                      + "denial of service, corruption, data loss and more!"
+                      + "This must NEVER be set to 'true' for anything except tests! ")
+              .defaultValue(false)
+              .buildFeatureConfiguration();
+
+  public static final FeatureConfiguration<Boolean> INITIALIZE_DEFAULT_CATALOG_FILEIO_FOR_TEST =
+      PolarisConfiguration.<Boolean>builder()
+          .key("INITIALIZE_DEFAULT_CATALOG_FILEIO_FOR_TEST")
+          .description(
+              "Config key for initializing a default \"catalogFileIO\" that is available either via "
+                  + "getIo() or for any TableOperations/ViewOperations instantiated, via ops.io() "
+                  + "before entity-specific FileIO initialization is triggered for any such operations. "
+                  + "Typically this should only be used in test scenarios where a PolarisIcebergCatalog "

Review Comment:
   Why does it need to be a FeatureConfiguration to enable it for tests?



-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Require explict user-consent to enable HadoopFileIO [polaris]

Posted by "eric-maynard (via GitHub)" <gi...@apache.org>.
eric-maynard commented on PR #1532:
URL: https://github.com/apache/polaris/pull/1532#issuecomment-2859439472

   How exactly is this a bug?


-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Require explict user-consent to enable HadoopFileIO [polaris]

Posted by "pingtimeout (via GitHub)" <gi...@apache.org>.
pingtimeout commented on code in PR #1532:
URL: https://github.com/apache/polaris/pull/1532#discussion_r2084047720


##########
service/common/src/main/java/org/apache/polaris/service/catalog/validation/IcebergPropertiesValidation.java:
##########
@@ -0,0 +1,95 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.polaris.service.catalog.validation;
+
+import static org.apache.polaris.core.config.FeatureConfiguration.ALLOW_INSECURE_STORAGE_TYPES_ACCEPTING_SECURITY_RISKS;
+import static org.apache.polaris.core.config.FeatureConfiguration.ALLOW_SPECIFYING_FILE_IO_IMPL;
+import static org.apache.polaris.core.config.FeatureConfiguration.SUPPORTED_CATALOG_STORAGE_TYPES;
+
+import jakarta.annotation.Nonnull;
+import jakarta.annotation.Nullable;
+import java.util.Map;
+import org.apache.iceberg.CatalogProperties;
+import org.apache.iceberg.exceptions.ValidationException;
+import org.apache.polaris.core.context.CallContext;
+import org.apache.polaris.core.storage.PolarisStorageConfigurationInfo;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class IcebergPropertiesValidation {
+  private static final Logger LOGGER = LoggerFactory.getLogger(IcebergPropertiesValidation.class);
+
+  public static void validateIcebergProperties(
+      @Nonnull CallContext callContext, @Nonnull Map<String, String> properties) {
+    validateIcebergProperties(callContext, properties, null);
+  }
+
+  public static String validateIcebergProperties(
+      @Nonnull CallContext callContext,
+      @Nonnull Map<String, String> properties,
+      @Nullable PolarisStorageConfigurationInfo storageConfigurationInfo) {
+    var ctx = callContext.getPolarisCallContext();
+    var configStore = ctx.getConfigurationStore();
+
+    var ioImpl = properties.get(CatalogProperties.FILE_IO_IMPL);
+    if (ioImpl != null) {
+      if (!configStore.getConfiguration(ctx, ALLOW_SPECIFYING_FILE_IO_IMPL)) {
+        throw new ValidationException(
+            "Cannot set property '%s' to '%s' for this catalog.",
+            CatalogProperties.FILE_IO_IMPL, ioImpl);
+      }
+      LOGGER.debug(
+          "Allowing overriding ioImplClassName to {} for storageConfiguration {}",
+          ioImpl,
+          storageConfigurationInfo);
+    } else if (storageConfigurationInfo != null) {
+      ioImpl = storageConfigurationInfo.getFileIoImplClassName();
+      LOGGER.debug(
+          "Resolved ioImplClassName {} from storageConfiguration {}",
+          ioImpl,
+          storageConfigurationInfo);
+    }
+
+    if (ioImpl != null) {
+      var storageType = StorageTypeFileIO.fromFileIoImplementation(ioImpl);
+      if (storageType.validateAllowedStorageType()
+          && !configStore
+              .getConfiguration(ctx, SUPPORTED_CATALOG_STORAGE_TYPES)
+              .contains(storageType.name())) {

Review Comment:
   @eric-maynard could you provide an example of what you mean?



-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Require explict user-consent to enable HadoopFileIO [polaris]

Posted by "eric-maynard (via GitHub)" <gi...@apache.org>.
eric-maynard commented on code in PR #1532:
URL: https://github.com/apache/polaris/pull/1532#discussion_r2084136420


##########
quarkus/service/src/main/java/org/apache/polaris/service/quarkus/config/QuarkusReadinessConfiguration.java:
##########
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.polaris.service.quarkus.config;
+
+import io.quarkus.runtime.annotations.StaticInitSafe;
+import io.smallrye.config.ConfigMapping;
+import io.smallrye.config.WithDefault;
+
+@StaticInitSafe
+@ConfigMapping(prefix = "polaris.readiness")
+public interface QuarkusReadinessConfiguration {
+
+  /**
+   * Setting this to {@code true} means that Polaris will start up even if severe security risks
+   * have been detected, accepting the risk of denial-of-service, data-loss, corruption and other
+   * risks.
+   */
+  @WithDefault("false")
+  boolean ignoreSevereIssues();

Review Comment:
   Having a log level of SEVERE and a config called "ignore severe issues" are completely different things. Is the implication that this config would disable failure in all cases where we use the SEVERE logging level?
   
   Even if that is the case, my questions stand. Does this config not apply to less-severe issues? What guidelines will qualify an issue as severe (necessitating a SEVERE log)? Have we gone back and audited all "issues" to verify none should be considered SEVERE? What even is an "issue"? 



-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Require explict user-consent to enable HadoopFileIO [polaris]

Posted by "snazy (via GitHub)" <gi...@apache.org>.
snazy commented on code in PR #1532:
URL: https://github.com/apache/polaris/pull/1532#discussion_r2075590768


##########
quarkus/service/src/test/java/org/apache/polaris/service/quarkus/catalog/IcebergCatalogTest.java:
##########
@@ -161,10 +161,14 @@ public Map<String, String> getConfigOverrides() {
       return Map.of(
           "polaris.features.defaults.\"ALLOW_SPECIFYING_FILE_IO_IMPL\"",
           "true",
+          "polaris.features.defaults.\"ALLOW_INSECURE_STORAGE_TYPES_ACCEPTING_SECURITY_RISKS\"",
+          "true",
           "polaris.features.defaults.\"INITIALIZE_DEFAULT_CATALOG_FILEIO_FOR_TEST\"",
           "true",
           "polaris.features.defaults.\"SUPPORTED_CATALOG_STORAGE_TYPES\"",
-          "[\"FILE\"]");
+          "[\"FILE\",\"S3\"]",
+          "polaris.readiness.ignore-security-issues",

Review Comment:
   Yea - but I guess all Quarkus profiles should either be special per-test or unified/composable or moved to a central place.



-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Require explict user-consent to enable HadoopFileIO [polaris]

Posted by "snazy (via GitHub)" <gi...@apache.org>.
snazy commented on code in PR #1532:
URL: https://github.com/apache/polaris/pull/1532#discussion_r2077931631


##########
service/common/src/main/java/org/apache/polaris/service/catalog/validation/IcebergPropertiesValidation.java:
##########
@@ -0,0 +1,95 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.polaris.service.catalog.validation;
+
+import static org.apache.polaris.core.config.FeatureConfiguration.ALLOW_INSECURE_STORAGE_TYPES_ACCEPTING_SECURITY_RISKS;
+import static org.apache.polaris.core.config.FeatureConfiguration.ALLOW_SPECIFYING_FILE_IO_IMPL;
+import static org.apache.polaris.core.config.FeatureConfiguration.SUPPORTED_CATALOG_STORAGE_TYPES;
+
+import jakarta.annotation.Nonnull;
+import jakarta.annotation.Nullable;
+import java.util.Map;
+import org.apache.iceberg.CatalogProperties;
+import org.apache.iceberg.exceptions.ValidationException;
+import org.apache.polaris.core.context.CallContext;
+import org.apache.polaris.core.storage.PolarisStorageConfigurationInfo;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class IcebergPropertiesValidation {
+  private static final Logger LOGGER = LoggerFactory.getLogger(IcebergPropertiesValidation.class);
+
+  public static void validateIcebergProperties(
+      @Nonnull CallContext callContext, @Nonnull Map<String, String> properties) {
+    validateIcebergProperties(callContext, properties, null);
+  }
+
+  public static String validateIcebergProperties(
+      @Nonnull CallContext callContext,
+      @Nonnull Map<String, String> properties,
+      @Nullable PolarisStorageConfigurationInfo storageConfigurationInfo) {
+    var ctx = callContext.getPolarisCallContext();
+    var configStore = ctx.getConfigurationStore();
+
+    var ioImpl = properties.get(CatalogProperties.FILE_IO_IMPL);
+    if (ioImpl != null) {
+      if (!configStore.getConfiguration(ctx, ALLOW_SPECIFYING_FILE_IO_IMPL)) {
+        throw new ValidationException(
+            "Cannot set property '%s' to '%s' for this catalog.",
+            CatalogProperties.FILE_IO_IMPL, ioImpl);
+      }
+      LOGGER.debug(
+          "Allowing overriding ioImplClassName to {} for storageConfiguration {}",
+          ioImpl,
+          storageConfigurationInfo);
+    } else if (storageConfigurationInfo != null) {
+      ioImpl = storageConfigurationInfo.getFileIoImplClassName();
+      LOGGER.debug(
+          "Resolved ioImplClassName {} from storageConfiguration {}",
+          ioImpl,
+          storageConfigurationInfo);
+    }
+
+    if (ioImpl != null) {
+      var storageType = StorageTypeFileIO.fromFileIoImplementation(ioImpl);
+      if (storageType.validateAllowedStorageType()
+          && !configStore
+              .getConfiguration(ctx, SUPPORTED_CATALOG_STORAGE_TYPES)
+              .contains(storageType.name())) {
+        throw new ValidationException(
+            "File IO implementation '%s', as storage type '%s' is not supported",
+            ioImpl, storageType);
+      }
+
+      if (!storageType.safe()
+          && !configStore.getConfiguration(
+              ctx, ALLOW_INSECURE_STORAGE_TYPES_ACCEPTING_SECURITY_RISKS)) {
+        throw new ValidationException(
+            "File IO implementation '%s' (storage type '%s') is considered insecure and must not be used",

Review Comment:
   What makes it secure?



-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Require explict user-consent to enable HadoopFileIO [polaris]

Posted by "dimas-b (via GitHub)" <gi...@apache.org>.
dimas-b commented on code in PR #1532:
URL: https://github.com/apache/polaris/pull/1532#discussion_r2082350936


##########
polaris-core/src/main/java/org/apache/polaris/core/config/FeatureConfiguration.java:
##########
@@ -234,4 +233,36 @@ public static void enforceFeatureEnabledOrThrow(
           .description("If true, the policy-store endpoints are enabled")
           .defaultValue(true)
           .buildFeatureConfiguration();
+
+  public static final FeatureConfiguration<Boolean> ALLOW_SPECIFYING_FILE_IO_IMPL =
+      PolarisConfiguration.<Boolean>builder()
+          .key("ALLOW_SPECIFYING_FILE_IO_IMPL")
+          .description(
+              "Config key for whether to allow setting the FILE_IO_IMPL using catalog properties. "
+                  + "Must only be enabled in dev/test environments, should not be in production systems.")
+          .defaultValue(false)
+          .buildFeatureConfiguration();
+
+  public static final FeatureConfiguration<Boolean> ALLOW_INSECURE_STORAGE_TYPES =

Review Comment:
   I informs users who may not be aware of code-level intricacies that certain storage types are considered insecure. Without it, a user may naively assume that adding something to the list of storage types at run time is "good enough". That may be true for some types, but not for others.



-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Require explict user-consent to enable HadoopFileIO [polaris]

Posted by "pingtimeout (via GitHub)" <gi...@apache.org>.
pingtimeout commented on code in PR #1532:
URL: https://github.com/apache/polaris/pull/1532#discussion_r2081295980


##########
polaris-core/src/main/java/org/apache/polaris/core/config/FeatureConfiguration.java:
##########
@@ -234,4 +233,38 @@ public static void enforceFeatureEnabledOrThrow(
           .description("If true, the policy-store endpoints are enabled")
           .defaultValue(true)
           .buildFeatureConfiguration();
+
+  public static final FeatureConfiguration<Boolean> ALLOW_SPECIFYING_FILE_IO_IMPL =
+      PolarisConfiguration.<Boolean>builder()
+          .key("ALLOW_SPECIFYING_FILE_IO_IMPL")
+          .description(
+              "Config key for whether to allow setting the FILE_IO_IMPL using catalog properties. "
+                  + "Must only be enabled in dev/test environments, never in production systems.")
+          .defaultValue(false)
+          .buildFeatureConfiguration();
+
+  public static final FeatureConfiguration<Boolean>

Review Comment:
   @eric-maynard You are correct in that this flag is redundant.  However, I believe the intent here is to make the consequences 100% explicit.
   
   I can see how some newcomers may overlook the `SUPPORTED_CATALOG_STORAGE_TYPES=[..., "FILE"]` during a configuration review and not realize the consequences it could have.  Whereas an environment variable that contains "insecure" and "security risks" will definitely raise eyebrows.
   
   Think about deleting a Github repository where you have to go to the `Danger Zone`, click "Delete, confirm, then confirm a second time, then type the repository name and confirm a third time".  Here, given the consequences, I think it is worth having a double-confirmation of the `FILE` storage type.



-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Require explict user-consent to enable HadoopFileIO [polaris]

Posted by "eric-maynard (via GitHub)" <gi...@apache.org>.
eric-maynard commented on code in PR #1532:
URL: https://github.com/apache/polaris/pull/1532#discussion_r2082226296


##########
service/common/src/main/java/org/apache/polaris/service/catalog/validation/StorageTypeFileIO.java:
##########
@@ -0,0 +1,86 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.polaris.service.catalog.validation;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+import org.apache.polaris.core.storage.PolarisStorageConfigurationInfo;
+
+enum StorageTypeFileIO {
+  S3("org.apache.iceberg.aws.s3.S3FileIO", true),
+
+  GCS("org.apache.iceberg.gcp.gcs.GCSFileIO", true),
+
+  AZURE("org.apache.iceberg.azure.adlsv2.ADLSFileIO", true),
+
+  FILE("org.apache.iceberg.hadoop.HadoopFileIO", false),
+
+  // Iceberg tests
+  IN_MEMORY("org.apache.iceberg.inmemory.InMemoryFileIO", false, false),
+  ;
+
+  private final String fileIoImplementation;
+  private final boolean safe;
+  private final boolean validateAllowedStorageType;
+
+  StorageTypeFileIO(String fileIoImplementation, boolean safe) {
+    this(fileIoImplementation, safe, true);
+  }
+
+  StorageTypeFileIO(String fileIoImplementation, boolean safe, boolean validateAllowedStorageType) {
+    this.fileIoImplementation = fileIoImplementation;
+    this.safe = safe;
+    this.validateAllowedStorageType = validateAllowedStorageType;
+  }
+
+  boolean safe() {
+    return safe;
+  }
+
+  boolean validateAllowedStorageType() {
+    return validateAllowedStorageType;
+  }
+
+  static StorageTypeFileIO fromFileIoImplementation(String fileIoImplementation) {
+    var type = FILE_TO_TO_STORAGE_TYPE.get(fileIoImplementation);
+    if (type == null) {
+      throw new IllegalArgumentException("Unknown FileIO implementation: " + fileIoImplementation);

Review Comment:
   Is this expected to throw for a custom fileIO?



-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Require explict user-consent to enable HadoopFileIO [polaris]

Posted by "eric-maynard (via GitHub)" <gi...@apache.org>.
eric-maynard commented on code in PR #1532:
URL: https://github.com/apache/polaris/pull/1532#discussion_r2083019729


##########
quarkus/service/src/main/java/org/apache/polaris/service/quarkus/config/QuarkusReadinessConfiguration.java:
##########
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.polaris.service.quarkus.config;
+
+import io.quarkus.runtime.annotations.StaticInitSafe;
+import io.smallrye.config.ConfigMapping;
+import io.smallrye.config.WithDefault;
+
+@StaticInitSafe
+@ConfigMapping(prefix = "polaris.readiness")
+public interface QuarkusReadinessConfiguration {
+
+  /**
+   * Setting this to {@code true} means that Polaris will start up even if severe security risks
+   * have been detected, accepting the risk of denial-of-service, data-loss, corruption and other
+   * risks.
+   */
+  @WithDefault("false")
+  boolean ignoreSevereIssues();

Review Comment:
   Besides what's already been pointed out about the validity of the FileIO check done here, this is not a good config name. What is a "severe issue"? Does it mean that we don't ignore mild issues? Are there super-severe issues?



-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org