Skip to content

Commit

Permalink
Update to CredScan v2 (PowerShell#11765)
Browse files Browse the repository at this point in the history
  • Loading branch information
TravisEz13 committed Feb 4, 2020
1 parent 5ff8fad commit f3cc834
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions .vsts-ci/templates/credscan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
displayName: 'Scan for Secrets'
inputs:
suppressionsFile: tools/credScan/suppress.json
toolMajorVersion: V2
debugMode: false

- task: securedevelopmentteam.vss-secure-development-tools.build-task-publishsecurityanalysislogs.PublishSecurityAnalysisLogs@2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@ try {
}

It "Can set Password value at max 256" {
#[SuppressMessage("Microsoft.Security", "CS002:SecretInNextLine", Justification="Demo/doc/test secret.")]
$result = New-LocalUser TestUserNew1 -Password (ConvertTo-SecureString ("135@"+"A"*252) -AsPlainText -Force)

$result.Name | Should -BeExactly TestUserNew1
Expand Down Expand Up @@ -762,6 +763,7 @@ try {
}

It "Can set Password value at max 256" {
#[SuppressMessage("Microsoft.Security", "CS002:SecretInNextLine", Justification="Demo/doc/test secret.")]
Set-LocalUser -Name TestUserSet1 -Password (ConvertTo-SecureString ("123@"+"A"*252) -asplaintext -Force)
$result = Get-LocalUser -Name TestUserSet1

Expand Down
12 changes: 8 additions & 4 deletions tools/credScan/suppress.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@
"tool": "Credential Scanner",
"suppressions": [
{
"file": "\\test\\tools\\Modules\\WebListener\\ClientCert.pfx",
"file": "\\test\\tools\\Modules\\WebListener\\ClientCert.pfx",
"_justification": "Test certificate with private key"
},
{
"file": "\\test\\tools\\Modules\\WebListener\\ServerCert.pfx",
"file": "\\test\\tools\\Modules\\WebListener\\ServerCert.pfx",
"_justification": "Test certificate with private key"
}
]
},
{
"file": "\\test\\powershell\\Modules\\Microsoft.PowerShell.Security\\certificateCommon.psm1",
"_justification": "Test certificate with private key and inline suppression isn't working"
}
]
}

0 comments on commit f3cc834

Please sign in to comment.