Skip to content

Commit ca736c5

Browse files
authored
Merge pull request #42 from cybertec-postgresql/41-increase-password-complexity-by-default
[*] increase new patroni user password complexity by default, fixes #41
2 parents 16d3ef0 + b250b0f commit ca736c5

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/install.ps1

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@ $out = Get-LocalUser -Name $userName -ErrorAction SilentlyContinue
1919
if($null -eq $out)
2020
{
2121
Write-Host "--- Adding local user '$userName' for patroni service ---" -ForegroundColor blue
22-
$Password = -join ((65..90) + (97..122) | Get-Random -Count 8 | % {[char]$_})
22+
$Password = ("a".."z")+("A".."Z") | Get-Random -Count 4
23+
$Password += ("!"..".") | Get-Random -Count 2
24+
$Password += ("0".."9") | Get-Random -Count 2
25+
$Password = -join($Password)
26+
2327
$SecurePassword = ConvertTo-SecureString $Password -AsPlainText -Force
2428
New-LocalUser $userName -Password $SecurePassword -Description "Patroni service account"
2529
$ConfFile = 'patroni\patroni_service.xml'

0 commit comments

Comments
 (0)