Skip to content

Commit

Permalink
add PSMHardening task (aws)
Browse files Browse the repository at this point in the history
  • Loading branch information
pelegor committed Jan 29, 2025
1 parent 50415b0 commit 095bd2c
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
14 changes: 13 additions & 1 deletion aws/Full-PAS-Deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1202,7 +1202,19 @@ Resources:
3-PSMserviceConfig:
command: sc config "CyberArk Privileged Session Manager" start=auto
waitAfterCompletion: 0
4-ChangeHostname:
4-PSMHardening:
command: !Sub >
Set-Location "C:\Cyberark\PSM\InstallationAutomation"
$Action = .\Execute-Stage.ps1 "Hardening\HardeningConfig.xml"
$Action | Out-File -FilePath "psm_hardening_log.log"
$Result = Get-Content "psm_hardening_log.log" -Raw | ConvertFrom-Json
if ($Result.isSucceeded -eq 0) {
exit 0
} else {
exit 1
}
waitAfterCompletion: 0
5-ChangeHostname:
command: !Sub >
powershell.exe -Command Rename-Computer -NewName ${PSMHostname} -Force -Restart
waitAfterCompletion: forever
Expand Down
14 changes: 13 additions & 1 deletion aws/PAS-Component-Single-Deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -736,7 +736,19 @@ Resources:
3-PSMserviceConfig:
command: sc config "CyberArk Privileged Session Manager" start=auto
waitAfterCompletion: 0
4-ChangeHostname:
4-PSMHardening:
command: !Sub >
Set-Location "C:\Cyberark\PSM\InstallationAutomation"
$Action = .\Execute-Stage.ps1 "Hardening\HardeningConfig.xml"
$Action | Out-File -FilePath "psm_hardening_log.log"
$Result = Get-Content "psm_hardening_log.log" -Raw | ConvertFrom-Json
if ($Result.isSucceeded -eq 0) {
exit 0
} else {
exit 1
}
waitAfterCompletion: 0
5-ChangeHostname:
command: !Sub >
powershell.exe -Command Rename-Computer -NewName
${ComponentHostname} -Force -Restart
Expand Down

0 comments on commit 095bd2c

Please sign in to comment.