Sensitive information is logged in splunk -- add comments
@@ -36,11 +36,11 @@ public class HerdStringUtils
private static final String CSV_INJECTION_REGEX = "^[+=@-].*";
// Hidden text content
public static final String HIDDEN_TEXT = "hidden";
- // Regex to check json password pattern
+ // Regex to check json password pattern, password wrapped in " or "\", like "jdbc.password":"password1"
private static Pattern REGEX_JSON_PASSWORD = Pattern.compile("(\\\\?\".*?password\\\\?\":\\\\?\")[\\w\\p{Punct}&&[^&]]*?(\\\\?\")");
- // Regex to check json password pattern
+ // Regex to check json password pattern, like "name": "password", "value": "password1"
private static Pattern REGEX_JSON_PASSWORD2 = Pattern.compile("(\"name\": \".*?password\", \"value\": \")[\\w\\p{Punct}&&[^&]]*?\"");
- // Regex to check xml password pattern
+ // Regex to check xml password pattern, like "<password>password1</password>
private static Pattern REGEX_XML_PASSWORD = Pattern.compile("(<.*?password>)[\\w\\p{Punct}&&[^&]]*?<");
/**
