From 5340b661f17fb1916aba11466c468958109e1776 Mon Sep 17 00:00:00 2001 From: Corey Christous Date: Thu, 24 Jul 2025 15:19:12 -0400 Subject: [PATCH 1/2] increase Windows password complexity --- packer/windows/scripts/start-agent.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packer/windows/scripts/start-agent.ps1 b/packer/windows/scripts/start-agent.ps1 index 2e4eae7..b142b1a 100644 --- a/packer/windows/scripts/start-agent.ps1 +++ b/packer/windows/scripts/start-agent.ps1 @@ -116,12 +116,12 @@ $agentParams = Retry-Command -ScriptBlock { # Create semaphore password and user # This is the user we will use to run the nssm service for the agent -Add-Type -AssemblyName 'System.Web' $UserName = "semaphore" -$Password = [System.Web.Security.Membership]::GeneratePassword(16, 0) +Log "Creating '$UserName' user..." +Add-Type -AssemblyName 'System.Web' +$Password = [System.Web.Security.Membership]::GeneratePassword(127, 1) $PasswordAsSecureString = $Password | ConvertTo-SecureString -AsPlainText -Force $Credentials = New-Object System.Management.Automation.PSCredential -ArgumentList ".\$UserName",$PasswordAsSecureString -Write-Output "Creating '$UserName' user..." New-LocalUser -Name $UserName -PasswordNeverExpires -Password $PasswordAsSecureString | out-null Add-LocalGroupMember -Group "Administrators" -Member $UserName | out-null From 8f958b4cf25ce5e56658c96a935c683260c47def Mon Sep 17 00:00:00 2001 From: Corey Christous Date: Tue, 12 Aug 2025 22:44:54 -0400 Subject: [PATCH 2/2] fix log --- packer/windows/scripts/start-agent.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packer/windows/scripts/start-agent.ps1 b/packer/windows/scripts/start-agent.ps1 index b142b1a..338c9e2 100644 --- a/packer/windows/scripts/start-agent.ps1 +++ b/packer/windows/scripts/start-agent.ps1 @@ -117,7 +117,7 @@ $agentParams = Retry-Command -ScriptBlock { # Create semaphore password and user # This is the user we will use to run the nssm service for the agent $UserName = "semaphore" -Log "Creating '$UserName' user..." +Write-Output "Creating '$UserName' user..." Add-Type -AssemblyName 'System.Web' $Password = [System.Web.Security.Membership]::GeneratePassword(127, 1) $PasswordAsSecureString = $Password | ConvertTo-SecureString -AsPlainText -Force