You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ho...@apache.org on 2023/09/19 15:39:10 UTC

[lucene-solr] branch branch_8_11 updated: SOLR-16984: Add missing sysProps to redaction logic

This is an automated email from the ASF dual-hosted git repository.

houston pushed a commit to branch branch_8_11
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git


The following commit(s) were added to refs/heads/branch_8_11 by this push:
     new 43739e2fb72 SOLR-16984: Add missing sysProps to redaction logic
43739e2fb72 is described below

commit 43739e2fb726038d55f6fd21d81307188b62adc6
Author: Houston Putman <ho...@apache.org>
AuthorDate: Mon Sep 18 16:43:54 2023 -0400

    SOLR-16984: Add missing sysProps to redaction logic
---
 solr/CHANGES.txt                                                     | 2 ++
 solr/core/src/java/org/apache/solr/util/RedactionUtils.java          | 2 +-
 .../org/apache/solr/handler/admin/PropertiesRequestHandlerTest.java  | 5 ++++-
 3 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index fa9c129aa79..ac35342c18c 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -22,6 +22,8 @@ Bug Fixes
 
 * SOLR-13219: Fix NPE in FieldLengthFeature with non-stored/missing fields (Nick Veenhof, Tomasz Elendt)
 
+* SOLR-16984: Add missing sysProps to redaction logic (Houston Putman)
+
 Optimizations
 ---------------------
 * SOLR-16555: SolrIndexSearcher - FilterCache intersections/andNot should not clone bitsets repeatedly (Kevin Risden, David Smiley)
diff --git a/solr/core/src/java/org/apache/solr/util/RedactionUtils.java b/solr/core/src/java/org/apache/solr/util/RedactionUtils.java
index 56909f40706..427fe3fbf95 100644
--- a/solr/core/src/java/org/apache/solr/util/RedactionUtils.java
+++ b/solr/core/src/java/org/apache/solr/util/RedactionUtils.java
@@ -27,7 +27,7 @@ import java.util.regex.Pattern;
 
 public class RedactionUtils {
   public static final String SOLR_REDACTION_SYSTEM_PATTERN_PROP = "solr.redaction.system.pattern";
-  private static Pattern pattern = Pattern.compile(System.getProperty(SOLR_REDACTION_SYSTEM_PATTERN_PROP, ".*password.*"), Pattern.CASE_INSENSITIVE);
+  private static Pattern pattern = Pattern.compile(System.getProperty(SOLR_REDACTION_SYSTEM_PATTERN_PROP, ".*(password|secret|basicauth).*"), Pattern.CASE_INSENSITIVE);
   private static final String REDACT_STRING = "--REDACTED--";
   public static final String NODE_REDACTION_PREFIX = "N_";
   public static final String COLL_REDACTION_PREFIX = "COLL_";
diff --git a/solr/core/src/test/org/apache/solr/handler/admin/PropertiesRequestHandlerTest.java b/solr/core/src/test/org/apache/solr/handler/admin/PropertiesRequestHandlerTest.java
index bbbde8a6673..8f6628ff7f6 100644
--- a/solr/core/src/test/org/apache/solr/handler/admin/PropertiesRequestHandlerTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/admin/PropertiesRequestHandlerTest.java
@@ -41,7 +41,10 @@ public class PropertiesRequestHandlerTest extends SolrTestCaseJ4 {
   @Test
   public void testRedaction() throws Exception {
     RedactionUtils.setRedactSystemProperty(true);
-    for(String propName: new String[]{"some.password", "javax.net.ssl.trustStorePassword"}){
+    for (String propName :
+        new String[] {
+          "some.password", "javax.net.ssl.trustStorePassword", "basicauth", "some.Secret"
+        }) {
       System.setProperty(propName, PASSWORD);
       NamedList<NamedList<NamedList<Object>>> properties = readProperties();