From 03461a6dab6bc3555a941c5047e7d92c18d9e156 Mon Sep 17 00:00:00 2001 From: Tim Wright Date: Wed, 15 Jan 2025 20:37:35 +0000 Subject: [PATCH] create config path --- vhdbuilder/packer/configure-windows-vhd.ps1 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vhdbuilder/packer/configure-windows-vhd.ps1 b/vhdbuilder/packer/configure-windows-vhd.ps1 index 50a04c99622..ff79b058d4c 100644 --- a/vhdbuilder/packer/configure-windows-vhd.ps1 +++ b/vhdbuilder/packer/configure-windows-vhd.ps1 @@ -393,7 +393,9 @@ function Install-OpenSSH { # It’s by design that files within the C:\Windows\System32\ folder are not modifiable. # When the OpenSSH Server starts, it copies C:\windows\system32\openssh\sshd_config_default to C:\programdata\ssh\sshd_config, if the file does not already exist. $OriginalConfigPath = "C:\windows\system32\OpenSSH\sshd_config_default" - $ConfigPath = "C:\programdata\ssh\sshd_config" + $ConfigDirectory = "C:\programdata\ssh" + New-Item -ItemType Directory -Force -Path $ConfigDirectory + $ConfigPath = $ConfigDirectory + "\sshd_config" Write-Log "Updating $ConfigPath for CVE-2023-48795" $ModifiedConfigContents = Get-Content $OriginalConfigPath ` | %{$_ -replace "#RekeyLimit default none", "$&`r`n# Disable cipher to mitigate CVE-2023-48795`r`nCiphers -chacha20-poly1305@openssh.com`r`nMacs -*-etm@openssh.com`r`n"}