vishesh92 commented on code in PR #12028:
URL: https://github.com/apache/cloudstack/pull/12028#discussion_r2517549166


##########
utils/src/main/java/org/apache/cloudstack/utils/process/ProcessRunner.java:
##########
@@ -67,11 +67,13 @@ String removeCommandSensitiveInfoForLogging(String command) 
{
     public ProcessRunner(ExecutorService executor) {
         this.executor = executor;
         commandLogReplacements.add(new Ternary<>("ipmitool", "-P\\s+\\S+", "-P 
*****"));
+        commandLogReplacements.add(new Ternary<>("ipmitool", 
"(?i)(password)(\\s+)\\S+(\\s+)\\S+", "$1 ****$2****"));

Review Comment:
   ```suggestion
           commandLogReplacements.add(new Ternary<>("ipmitool", 
"(?i)password\\s+\\S+\\s+\\S+", "password **** ****"));
   ```
   @YLChen-007 Can you check if this simpler regex works? IMO, we don't need to 
extract and match groups here at all.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to