From 849d77620656da72908a07a0fbeed2f86514159c Mon Sep 17 00:00:00 2001 From: Gary Ewan Park Date: Tue, 30 May 2023 14:18:43 +0100 Subject: [PATCH] (#948) Add user as sensitive argument Since user is one half of the information that is needed for a credential, let's treat the user as sensitive information, in the same way that we treat password. This commit adds the various forms that the user option can be passed to the Chocolatey CLI, to ensure that it is always caught. --- src/chocolatey/infrastructure.app/utility/ArgumentsUtility.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/chocolatey/infrastructure.app/utility/ArgumentsUtility.cs b/src/chocolatey/infrastructure.app/utility/ArgumentsUtility.cs index c4a1666733..e11df001ed 100644 --- a/src/chocolatey/infrastructure.app/utility/ArgumentsUtility.cs +++ b/src/chocolatey/infrastructure.app/utility/ArgumentsUtility.cs @@ -43,6 +43,10 @@ public static bool SensitiveArgumentsProvided(string commandArguments) || commandArguments.ContainsSafe("-key=") || commandArguments.ContainsSafe("-apikey") || commandArguments.ContainsSafe("-api-key") + || commandArguments.ContainsSafe("-u ") + || commandArguments.ContainsSafe("-u=") + || commandArguments.ContainsSafe("-user ") + || commandArguments.ContainsSafe("-user=") ; }