Handle multiple-spaces when redacting MQSC output

This commit is contained in:
Stephen Marshall
2019-04-09 15:06:25 +01:00
parent 44d0e0a432
commit 723fe2b998
2 changed files with 5 additions and 4 deletions

View File

@@ -134,11 +134,11 @@ func stopQueueManager(name string) error {
func formatMQSCOutput(out string) string {
// redact sensitive information
pattern, _ := regexp.Compile("(?i)LDAPPWD\\s?\\((.*?)\\)")
pattern, _ := regexp.Compile("(?i)LDAPPWD\\s*?\\((.*?)\\)")
out = pattern.ReplaceAllString(out, "LDAPPWD(*********)")
pattern, _ = regexp.Compile("(?i)PASSWORD\\s?\\((.*?)\\)")
pattern, _ = regexp.Compile("(?i)PASSWORD\\s*?\\((.*?)\\)")
out = pattern.ReplaceAllString(out, "PASSWORD(*********)")
pattern, _ = regexp.Compile("(?i)SSLCRYP\\s?\\((.*?)\\)")
pattern, _ = regexp.Compile("(?i)SSLCRYP\\s*?\\((.*?)\\)")
out = pattern.ReplaceAllString(out, "SSLCRYP(*********)")
// add tab characters to make it more readable as part of the log