gianm commented on a change in pull request #10677:
URL: https://github.com/apache/druid/pull/10677#discussion_r546172186



##########
File path: docs/configuration/index.md
##########
@@ -1358,8 +1358,8 @@ You can optionally configure following additional configs 
to restrict druid inge
  
 |Property|Possible Values|Description|Default|
 |--------|---------------|-----------|-------|
-|`druid.ingestion.http.allowListDomains`|List of domains|Allowed domains from 
which ingestion will be allowed. Only one of allowList or denyList can be 
set.|empty list|
-|`druid.ingestion.http.denyListDomains`|List of domains|Blacklisted domains 
from which ingestion will NOT be allowed. Only one of allowList or denyList can 
be set. |empty list|
+|`druid.ingestion.uri.allowPrefixList`|List of URIs|Allowed uris from which 
ingestion will be allowed. Only one of allowPrefixList or denyPrefixList can be 
set.|empty list|

Review comment:
       I think we should list out which input sources this applies to, and make 
sure each one has a test.

##########
File path: 
core/src/main/java/org/apache/druid/data/input/impl/InputSourceSecurityConfig.java
##########
@@ -0,0 +1,168 @@
+/*
+ * 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.druid.data.input.impl;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.google.common.base.Preconditions;
+import org.apache.druid.java.util.common.StringUtils;
+
+import javax.annotation.Nullable;
+import java.io.File;
+import java.net.URI;
+import java.util.Collection;
+import java.util.List;
+import java.util.Objects;
+
+public class InputSourceSecurityConfig
+{
+
+  public static InputSourceSecurityConfig ALLOW_ALL = new 
InputSourceSecurityConfig(null, null);

Review comment:
       `final`?

##########
File path: docs/configuration/index.md
##########
@@ -1358,8 +1358,8 @@ You can optionally configure following additional configs 
to restrict druid inge
  
 |Property|Possible Values|Description|Default|
 |--------|---------------|-----------|-------|
-|`druid.ingestion.http.allowListDomains`|List of domains|Allowed domains from 
which ingestion will be allowed. Only one of allowList or denyList can be 
set.|empty list|

Review comment:
       Why remove the domain flavors?
   
   Also, did we ever ship them? If so, we'll need to handle that somehow in the 
docs or the code itself.

##########
File path: docs/configuration/index.md
##########
@@ -1358,8 +1358,8 @@ You can optionally configure following additional configs 
to restrict druid inge
  
 |Property|Possible Values|Description|Default|
 |--------|---------------|-----------|-------|
-|`druid.ingestion.http.allowListDomains`|List of domains|Allowed domains from 
which ingestion will be allowed. Only one of allowList or denyList can be 
set.|empty list|
-|`druid.ingestion.http.denyListDomains`|List of domains|Blacklisted domains 
from which ingestion will NOT be allowed. Only one of allowList or denyList can 
be set. |empty list|
+|`druid.ingestion.uri.allowPrefixList`|List of URIs|Allowed uris from which 
ingestion will be allowed. Only one of allowPrefixList or denyPrefixList can be 
set.|empty list|

Review comment:
       I'd also add some text to the docs explaining two points:
   
   - How does the prefix checking work? (Does it happen on path boundaries? 
Like will a prefix of `http://example.com/f` match `http://example.com/foo` or 
`http://example.com/f/b` or both?)
   - Pointing out that using "allow" is a much safer method than "deny"




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

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



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@druid.apache.org
For additional commands, e-mail: commits-h...@druid.apache.org

Reply via email to