Skip to content

Commit

Permalink
(#948) Add user as sensitive argument
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
gep13 committed May 30, 2023
1 parent ebef819 commit 849d776
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/chocolatey/infrastructure.app/utility/ArgumentsUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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=")
;
}

Expand Down

0 comments on commit 849d776

Please sign in to comment.