From 0e35a8a01b124dbdce22a0c54467f1e8a65e37f0 Mon Sep 17 00:00:00 2001 From: James Truher Date: Tue, 2 Apr 2019 15:06:20 -0700 Subject: [PATCH] Add suppression of warning for MS policy Because we are using a direct invocation of ConvertTo-SecureString it triggers a warning by MS tools that secrets are not allowed to be checked in to our repository. This suppresses this warning. --- Tests/Rules/AvoidConvertToSecureStringWithPlainText.ps1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Tests/Rules/AvoidConvertToSecureStringWithPlainText.ps1 b/Tests/Rules/AvoidConvertToSecureStringWithPlainText.ps1 index c599f44de..e904c4569 100644 --- a/Tests/Rules/AvoidConvertToSecureStringWithPlainText.ps1 +++ b/Tests/Rules/AvoidConvertToSecureStringWithPlainText.ps1 @@ -1,5 +1,6 @@ +#[SuppressMessage("Microsoft.Security", "CS002:SecretInNextLine", Justification="Test/NotASecret.")] $supersecure = convertto-securestring "sdfdsfd" -asplaintext -force New-Object System.Management.Automation.PSCredential -ArgumentList "username", (ConvertTo-SecureString "really secure" -AsPlainText -Force) -$sneaky = ctss "sneaky convert" -asplainText -force \ No newline at end of file +$sneaky = ctss "sneaky convert" -asplainText -force