Skip to content

Commit ee80997

Browse files
committed
Merged PR 12442400: Remove the plaintext value of $certPwd for fix the Credential Scanner issue
## Pull Request Checklist ### General - [ ] Are all regression test passed? - [ ] Are there any test cases that will expose unfixed TDIs or Windows bugs? ### New Test Case - [ ] Have Design Spec and User Guide been updated? - [ ] Can all the test cases be loaded and executed by PTM & PTMCli? - [ ] Can the related changes support multiple platform(Windows, Linux, MacOS)? ### SDK Changes - [ ] Are all related test suites Regression passed? ---- #### AI description (iteration 1) #### PR Classification Bug fix to address Credential Scanner issue by removing plaintext password. #### PR Summary This pull request removes the hardcoded plaintext password `$certPwd` and retrieves it from a configuration file instead. - `Config-DriverComputer.ps1`: Removed hardcoded `$certPwd` and added retrieval from configuration file. - `Config-LinuxDriverComputer.ps1`: Removed hardcoded `$certPwd` and added retrieval from configuration file. - `Config-DriverComputer.ps1` (Server): Removed hardcoded `$certPwd` and added retrieval from configuration file. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
2 parents 9f3ccd3 + eb38daf commit ee80997

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

TestSuites/FileServer/docs/FileServerUserGuide.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -707,6 +707,7 @@ To enable the Signing feature on the SUT (**Node01**) computer, perform the step
707707

708708
* If you disabled **SigningRequired** on the SUT computer, set the value of the **IsRequireMessageSigning** property to `false` in the specified ptfconfig file.
709709

710+
710711
###### <a name="5.1.2.2.3.7"/> 5.1.2.2.3.7 Create an SMB Compressed Share
711712

712713
This configuration is used to test the **Compression** feature of an **MS-SMB2** protocol implementation. If **Compression** is not supported in your implementation, please ignore this section.
@@ -750,7 +751,7 @@ To configure SMB over QUIC, perform the steps that follow:
750751
```
751752
4. Export the certificate to a PFX file and import it to the trusted root store:
752753
```
753-
Copy$pfxPwd = ConvertTo-SecureString -String "Password01!" -Force -AsPlainText
754+
$pfxPwd = Read-Host -AsSecureString "Enter the PFX password:"
754755
Export-PfxCertificate -Cert $currCert -FilePath "QUICCert.pfx" -Password $pfxPwd
755756
Import-PfxCertificate -FilePath "QUICCert.pfx" -CertStoreLocation Cert:\LocalMachine\Root -Password $pfxPwd
756757
```
@@ -775,6 +776,7 @@ The same certificate must be trusted on both the SUT and the Driver computers fo
775776
776777
777778
779+
778780
##### <a name="5.1.2.3"/> 5.1.2.3 Setup to test DFSC
779781
780782
This configuration is used to test an implementation of the [**MS-DFSC**] protocol. If the distributed file system (**DFS**) is not supported, please ignore this section.

TestSuites/RDP/Client/Setup/Scripts/Config-DriverComputer.ps1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ if(Test-Path -Path $settingFile)
3636
$agentPort = .\Get-Parameter.ps1 $settingFile agentPort
3737
$agentRemoteClient = .\Get-Parameter.ps1 $settingFile agentRemoteClient
3838
$compressionInTC = .\Get-Parameter.ps1 $settingFile compressionInTC
39+
$certPwd = .\Get-Parameter.ps1 $settingFile userPwdInTC
3940
.\Set-Parameter.ps1 $settingFile LogFile $logFile "If no log file path specified, this value should be used."
4041
}
4142
else
@@ -170,7 +171,7 @@ else
170171
{
171172
$certCN = $driverComputerName
172173
}
173-
$certPwd = "Password01!"
174+
174175
$certFileName = $driverComputerName
175176

176177
if (Test-Path -Path "$env:HOMEDRIVE\$certFileName.cer")

TestSuites/RDP/Client/Setup/Scripts/Config-LinuxDriverComputer.ps1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ if(Test-Path -Path $settingFile)
3636
$agentPort = ./Get-Parameter.ps1 $settingFile agentPort
3737
$agentRemoteClient = ./Get-Parameter.ps1 $settingFile agentRemoteClient
3838
$compressionInTC = ./Get-Parameter.ps1 $settingFile compressionInTC
39+
$certPwd = ./Get-Parameter.ps1 $settingFile userPwdInTC
3940
./Set-Parameter.ps1 $settingFile LogFile $logFile "If no log file path specified, this value should be used."
4041
}
4142

@@ -168,7 +169,7 @@ else
168169
{
169170
$certCN = $driverComputerName
170171
}
171-
$certPwd = "Password01!"
172+
172173
$certFileName = $driverComputerName
173174

174175
if (Test-Path -Path "$env:HOMEDRIVE/$certFileName.cer")

TestSuites/RDP/Server/Setup/Scripts/Config-DriverComputer.ps1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ if(Test-Path -Path $settingFile)
3636
$agentPort = .\Get-Parameter.ps1 $settingFile agentPort
3737
$agentRemoteClient = .\Get-Parameter.ps1 $settingFile agentRemoteClient
3838
$compressionInTC = .\Get-Parameter.ps1 $settingFile compressionInTC
39+
$certPwd = .\Get-Parameter.ps1 $settingFile userPwdInTC
3940
.\Set-Parameter.ps1 $settingFile LogFile $logFile "If no log file path specified, this value should be used."
4041
}
4142
else
@@ -186,7 +187,7 @@ else
186187
{
187188
$certCN = $driverComputerName
188189
}
189-
$certPwd = "Password01!"
190+
190191
$certFileName = $driverComputerName
191192

192193
if (Test-Path -Path "$env:HOMEDRIVE\$certFileName.cer")

0 commit comments

Comments
 (0)