From 25cca30c1898a2b71b647fc5f508eea76f4bc36a Mon Sep 17 00:00:00 2001 From: ekiemiesz Date: Mon, 1 Jul 2024 16:05:59 +0200 Subject: [PATCH] Upload ansible roles ver14.2 --- Jenkinsfile | 63 ------ README.md | 3 +- defaults/main.yml | 5 +- files/aws/AWS.EC2.Windows.CloudWatch.json | 108 +++++++++++ files/aws/CloudWatch.ps1 | 195 +++++++++++++++++++ files/aws/Common.ps1 | 194 +++++++++++++++++++ files/aws/PVWAConfiguration.ps1 | 217 +++++++++++++++++++++ files/aws/PVWARegistration.ps1 | 208 ++++++++++++++++++++ files/aws/Set-LocalService.ps1 | 210 ++++++++++++++++++++ files/azure/CreateSelfCertAndBind.ps1 | 225 ++++++++++++++++++++++ files/azure/Set-LocalAccountPassword.ps1 | 187 ++++++++++++++++++ files/azure/Set-ServiceLogon.ps1 | 183 ++++++++++++++++++ meta/main.yml | 8 +- tasks/main.yml | 14 +- tasks/pvwa_clean.yml | 98 +++++----- tasks/pvwa_extract.yml | 20 +- tasks/pvwa_hardening.yml | 27 +-- tasks/pvwa_install.yml | 29 +-- tasks/pvwa_prerequisites.yml | 68 +++++-- tasks/pvwa_registration.yml | 67 ++++--- tasks/pvwa_validateparameters.yml | 29 +-- tests/default.yml | 30 +-- tests/group_vars/pvwa.yml | 2 +- vars/main.yml | 1 - 24 files changed, 1948 insertions(+), 243 deletions(-) delete mode 100644 Jenkinsfile create mode 100644 files/aws/AWS.EC2.Windows.CloudWatch.json create mode 100644 files/aws/CloudWatch.ps1 create mode 100644 files/aws/Common.ps1 create mode 100644 files/aws/PVWAConfiguration.ps1 create mode 100644 files/aws/PVWARegistration.ps1 create mode 100644 files/aws/Set-LocalService.ps1 create mode 100644 files/azure/CreateSelfCertAndBind.ps1 create mode 100644 files/azure/Set-LocalAccountPassword.ps1 create mode 100644 files/azure/Set-ServiceLogon.ps1 diff --git a/Jenkinsfile b/Jenkinsfile deleted file mode 100644 index 3d55339..0000000 --- a/Jenkinsfile +++ /dev/null @@ -1,63 +0,0 @@ -pipeline { - agent { - node { - label 'ansible' - } - } - environment { - AWS_REGION = sh(script: 'curl -s http://169.254.169.254/latest/dynamic/instance-identity/document | python3 -c "import json,sys;obj=json.load(sys.stdin);print (obj[\'region\'])"', returnStdout: true).trim() - shortCommit = sh(script: "git log -n 1 --pretty=format:'%h'", returnStdout: true).trim() - } - stages { - stage('Install virtual environment') { - steps { - sh ''' - python3 -m pip install --user virtualenv - python3 -m virtualenv .testenv - source .testenv/bin/activate - pip install -r tests/requirements.txt - ''' - } - } - stage('yamllint validation') { - steps { - sh ''' - source .testenv/bin/activate - yamllint . - ''' - } - } - stage('Provision testing environment') { - steps { - sh ''' - export PATH="$HOME/.rbenv/bin:$PATH" - eval "$(rbenv init -)" - rbenv global 2.5.1 - kitchen create - ''' - - } - } - stage('Run playbook on windows machine') { - steps { - sh ''' - export PATH="$HOME/.rbenv/bin:$PATH" - eval "$(rbenv init -)" - rbenv global 2.5.1 - source .testenv/bin/activate - kitchen converge - ''' - } - } - } - post { - always { - sh ''' - export PATH="$HOME/.rbenv/bin:$PATH" - eval "$(rbenv init -)" - rbenv global 2.5.1 - kitchen destroy - ''' - } - } -} diff --git a/README.md b/README.md index a59f53a..15d79de 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,7 @@ pvwa_install | no | false pvwa_hardening | no | false | Apply PVWA hardening pvwa_registration | no | false | Connect PVWA to the Vault pvwa_clean | no | false | N/A +platform | no | aws | Deployed platform (aws/azure) ### Deployment Variables Variable | Required | Default | Comments @@ -76,7 +77,7 @@ to call the PVWA role with several parameters: ``` --- -- include_role: +- ansible.builtin.include_role: name: pvwa vars: pvwa_install: true diff --git a/defaults/main.yml b/defaults/main.yml index 13381f2..f801ac5 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -9,11 +9,11 @@ pvwa_registration_configure_vault: false pvwa_registration_register_instance: false pvwa_clean: false pvwa_extract: false -pvwa_ignore_checksum: false pvwa_exists: false pvwa_hardened: false pvwa_registered: false pvwa_official: true +platform: "aws" pvwa_base_bin_drive: "C:" pvwa_zip_file_path: "" @@ -39,9 +39,10 @@ pvwa_enable_mobile_version: true pvwa_prerequisites_log: "{{ pvwa_installationautomation_folder }}\\pvwa_pre_req_result.txt" pvwa_install_log: "{{ pvwa_installationautomation_folder }}\\pvwa_installation_result.txt" pvwa_hardening_log: "{{ pvwa_installationautomation_folder }}\\pvwa_hardening_result.txt" -pvwa_registration_log: "{{ pvwa_installationautomation_folder }}\\pvwa_registration_result.txt" +pvwa_registration_log: "{{ pvwa_installationautomation_folder }}\\pvwa_registration_result.txt" accept_eula: "No" vault_username: "administrator" vault_port: 1858 +log_path_dest: "{{ playbook_dir | dirname }}/logs/pvwa" diff --git a/files/aws/AWS.EC2.Windows.CloudWatch.json b/files/aws/AWS.EC2.Windows.CloudWatch.json new file mode 100644 index 0000000..abd8eff --- /dev/null +++ b/files/aws/AWS.EC2.Windows.CloudWatch.json @@ -0,0 +1,108 @@ +{ + "IsEnabled":false, + "EngineConfiguration":{ + "PollInterval":"00:00:05", + "Components":[ + { + "Id":"CfnInitLog", + "FullName":"AWS.EC2.Windows.CloudWatch.CustomLog.CustomLogInputComponent,AWS.EC2.Windows.CloudWatch", + "Parameters":{ + "LogDirectoryPath":"C:\\cfn\\log", + "TimestampFormat":"yyyy-MM-dd HH:mm:ss,fff", + "Encoding":"ASCII", + "Filter":"cfn-init.log", + "CultureName":"en-US", + "TimeZoneKind":"Local" + } + }, + { + "Id":"CloudWatchCfnInitLog", + "FullName":"AWS.EC2.Windows.CloudWatch.CloudWatchLogsOutput,AWS.EC2.Windows.CloudWatch", + "Parameters":{ + "AccessKey":"", + "SecretKey":"", + "Region":"AWS_REGION_PH", + "LogGroup":"LOG_GROUP_PH", + "LogStream":"PVWA_CFN_LOG_PH" + } + }, + { + "Id":"Set-LocalService", + "FullName":"AWS.EC2.Windows.CloudWatch.CustomLog.CustomLogInputComponent,AWS.EC2.Windows.CloudWatch", + "Parameters":{ + "LogDirectoryPath":"C:\\CyberArk\\Deployment\\Logs", + "TimestampFormat":"yyyy-MM-dd HH:mm:ss", + "Encoding":"ASCII", + "Filter":"Set-LocalService.log", + "CultureName":"en-US", + "TimeZoneKind":"Local" + } + }, + { + "Id":"CloudWatchSet-LocalService", + "FullName":"AWS.EC2.Windows.CloudWatch.CloudWatchLogsOutput,AWS.EC2.Windows.CloudWatch", + "Parameters":{ + "AccessKey":"", + "SecretKey":"", + "Region":"AWS_REGION_PH", + "LogGroup":"LOG_GROUP_PH", + "LogStream":"PVWA_LOCALSERVICE_LOG_PH" + } + }, + { + "Id":"PVWAConfiguration", + "FullName":"AWS.EC2.Windows.CloudWatch.CustomLog.CustomLogInputComponent,AWS.EC2.Windows.CloudWatch", + "Parameters":{ + "LogDirectoryPath":"C:\\CyberArk\\Deployment\\Logs", + "TimestampFormat":"yyyy-MM-dd HH:mm:ss", + "Encoding":"ASCII", + "Filter":"PVWAConfiguration.log", + "CultureName":"en-US", + "TimeZoneKind":"Local" + } + }, + { + "Id":"CloudWatchPVWAConfiguration", + "FullName":"AWS.EC2.Windows.CloudWatch.CloudWatchLogsOutput,AWS.EC2.Windows.CloudWatch", + "Parameters":{ + "AccessKey":"", + "SecretKey":"", + "Region":"AWS_REGION_PH", + "LogGroup":"LOG_GROUP_PH", + "LogStream":"PVWA_CONF_LOG_PH" + } + }, + { + "Id":"PVWARegistration", + "FullName":"AWS.EC2.Windows.CloudWatch.CustomLog.CustomLogInputComponent,AWS.EC2.Windows.CloudWatch", + "Parameters":{ + "LogDirectoryPath":"C:\\CyberArk\\Deployment\\Logs", + "TimestampFormat":"yyyy-MM-dd HH:mm:ss", + "Encoding":"ASCII", + "Filter":"PVWARegistration.log", + "CultureName":"en-US", + "TimeZoneKind":"Local" + } + }, + { + "Id":"CloudWatchPVWARegistration", + "FullName":"AWS.EC2.Windows.CloudWatch.CloudWatchLogsOutput,AWS.EC2.Windows.CloudWatch", + "Parameters":{ + "AccessKey":"", + "SecretKey":"", + "Region":"AWS_REGION_PH", + "LogGroup":"LOG_GROUP_PH", + "LogStream":"PVWAREGISTRATION_LOG_PH" + } + } + ], + "Flows":{ + "Flows":[ + "CfnInitLog,CloudWatchCfnInitLog", + "Set-LocalService,CloudWatchSet-LocalService", + "PVWAConfiguration,CloudWatchPVWAConfiguration", + "PVWARegistration,CloudWatchPVWARegistration" + ] + } + } +} \ No newline at end of file diff --git a/files/aws/CloudWatch.ps1 b/files/aws/CloudWatch.ps1 new file mode 100644 index 0000000..31ee147 --- /dev/null +++ b/files/aws/CloudWatch.ps1 @@ -0,0 +1,195 @@ + +[CmdletBinding()] +Param( + [Parameter(Mandatory=$true)][string]$Region, + [Parameter(Mandatory=$true)][string]$LogGroup, + [Parameter(Mandatory=$true)][string]$PVWACfnInitLogStream, + [Parameter(Mandatory=$true)][string]$PVWAConfiguration, + [Parameter(Mandatory=$true)][string]$PVWASetLocalService, + [Parameter(Mandatory=$true)][string]$PVWARegistration +) + +((Get-Content -Path "C:\Program Files\Amazon\SSM\Plugins\awsCloudWatch\AWS.EC2.Windows.CloudWatch.json" -Raw)` + -Replace 'false','true' ` + -Replace 'AWS_REGION_PH',$Region ` + -Replace 'LOG_GROUP_PH',$LogGroup ` + -Replace 'PVWA_CFN_LOG_PH',$PVWACfnInitLogStream ` + -Replace 'PVWA_CONF_LOG_PH',$PVWAConfiguration ` + -Replace 'PVWA_LOCALSERVICE_LOG_PH',$PVWASetLocalService ` + -Replace 'PVWAREGISTRATION_LOG_PH',$PVWARegistration)| Out-File ` + -FilePath "C:\Program Files\Amazon\SSM\Plugins\awsCloudWatch\AWS.EC2.Windows.CloudWatch.json" -Force -Encoding ASCII +# SIG # Begin signature block +# MIIgTgYJKoZIhvcNAQcCoIIgPzCCIDsCAQExDzANBglghkgBZQMEAgEFADB5Bgor +# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG +# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAF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SMAsG +# CWCGSAFlAwQCAaCBpDAaBgkqhkiG9w0BCQMxDQYLKoZIhvcNAQkQAQQwHAYJKoZI +# hvcNAQkFMQ8XDTIyMDUwMTE0MzQ0NlowLwYJKoZIhvcNAQkEMSIEIHMuxW8jy0QD +# KTSGdbUiy83hvQ7NdRm+UJ2UY6mrS4IQMDcGCyqGSIb3DQEJEAIvMSgwJjAkMCIE +# IMR0znYAfQI5Tg2l5N58FMaA+eKCATz+9lPvXbcf32H4MAsGCSqGSIb3DQEBAQSC +# AQAV/spN7ykGbSVWc+f0uw/NJ0UiGZAizA7BeHTA3Z5CZHGiQ9CkA9vnfT/sX2lv +# NDOnBQbgf+2nHQxoMr6kdG6mX14u89HmmsObOriC/JDRK5/AulTG4kJj3vxvQUNU +# OwkXVsqE4dbGo9QWh3duGzX8TMfVTDrcpWSWmJJGkJAqInI9qfyNGXKoC+4OBk1F +# niGhHHAERegyQGAFFzQV3oEMEE+bO96SOHNdqcRL+G9HNiJPf3TFRk27p0ZhPRY7 +# U/BYNCb45qZ9+GIx/1944ZE2t2BGGWJzy6ovHk9/EyIKtNrlyCnMn/70GRcAw+Ya +# ++2wV2aJHCbauSOk4FtAeKLe +# SIG # End signature block diff --git a/files/aws/Common.ps1 b/files/aws/Common.ps1 new file mode 100644 index 0000000..f248515 --- /dev/null +++ b/files/aws/Common.ps1 @@ -0,0 +1,194 @@ +function WriteLog{ + [CmdletBinding()] + param( + $LogFile, + $LogLevel, + $Log + ) + + if (!(Test-Path $LogFile)) { + $NewLogFile = New-Item $LogFile -Force -ItemType File + } + + $FormattedDate = Get-Date -Format "yyyy-MM-dd HH:mm:ss" + "$($FormattedDate) [$($LogLevel)] $($Log)" | Out-File -FilePath $LogFile -Append -Encoding ASCII + + if ($LogLevel.StartsWith("USER")) { + Write-Host "$Log" + } +} +# SIG # Begin signature block +# MIIgTgYJKoZIhvcNAQcCoIIgPzCCIDsCAQExDzANBglghkgBZQMEAgEFADB5Bgor +# BgEEAYI3AgEEoG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XR3b3JrMSgwJgYDVQQDEx9TeW1h +# bnRlYyBTSEEyNTYgVGltZVN0YW1waW5nIENBAhB71OWvuswHP6EBIwQiQU0SMAsG +# CWCGSAFlAwQCAaCBpDAaBgkqhkiG9w0BCQMxDQYLKoZIhvcNAQkQAQQwHAYJKoZI +# hvcNAQkFMQ8XDTIyMDUwMTE0MzQ0OVowLwYJKoZIhvcNAQkEMSIEIER0bbdwWGP/ +# 5VFf/VyOnbT/ry8bAjRMyTUY0vPJ1vtXMDcGCyqGSIb3DQEJEAIvMSgwJjAkMCIE +# IMR0znYAfQI5Tg2l5N58FMaA+eKCATz+9lPvXbcf32H4MAsGCSqGSIb3DQEBAQSC +# AQCPDyBpOOatYMG1VMhtcrrTBTLipmSxfltX+SExCQlUpm9Nzuzmtyn3hIWtkc2K +# Dk7VufxsabEX4raobE/8Ml1sT4tGSmbnJcAFBWPD9aetdedjt6IjQuACXzwF5Hpf +# aaPJjVx0sxkYg/CIM4T1X4txH06gkCmmFcVPpnCfvQhtIud9bV6gJ6axpcJCKi3S +# NBSSo9hXmJKchNjrzcn9coVeHT3pgrQxzaCQ1Fywri1+qTtWKH7ZawF4U7vP/J1X +# ktd+E0sfRsQYOyQgHDzFQkNKWZTHHf/0ctCktfNlt2q47QaqlFv4Hu4yogFQ4oyX +# oQ0lUQeLZWQWejxIhINDW0It +# SIG # End signature block diff --git a/files/aws/PVWAConfiguration.ps1 b/files/aws/PVWAConfiguration.ps1 new file mode 100644 index 0000000..146a1d6 --- /dev/null +++ b/files/aws/PVWAConfiguration.ps1 @@ -0,0 +1,217 @@ +[CmdletBinding()] +Param( + [Parameter(Mandatory=$true)][string]$VaultIpAddress, + [Parameter(Mandatory=$true)][string]$VaultAdminUser, + [Parameter(Mandatory=$true)][string]$VaultPort, + [Parameter(Mandatory=$true)][string]$HostName +) + +. "$PSScriptRoot\Common.ps1" + +$LogFile = "C:\CyberArk\Deployment\Logs\PVWAConfiguration.log" + + +try{ + WriteLog -LogFile $LogFile -LogLevel "INFO" -Log "Send request to hostname" + if ($HostName -eq "empty") { + $HostNameRequest = Invoke-WebRequest -Uri http://169.254.169.254/latest/meta-data/hostname -UseBasicParsing + $HostName = $HostNameRequest.Content + } + $PVWAURL = "https://$HostName/PasswordVault" + $ScriptPath = $PSScriptRoot + $FilePath = "C:\CyberArk\PVWA\InstallationAutomation\Registration\PVWARegisterComponentConfig.xml" + $xml = [xml](Get-Content $filePath) + WriteLog -LogFile $LogFile -LogLevel "INFO" -Log "Get vault IP" + $step1 = $xml.SelectSingleNode("//Parameter[@Name = 'vaultip']") + $step1.Value = $VaultIpAddress + WriteLog -LogFile $LogFile -LogLevel "INFO" -Log "Get vault port" + $step2 = $xml.SelectSingleNode("//Parameter[@Name = 'vaultport']") + $step2.Value = $VaultPort + WriteLog -LogFile $LogFile -LogLevel "INFO" -Log "Get vault user" + $step3 = $xml.SelectSingleNode("//Parameter[@Name = 'vaultuser']") + $step3.Value = $VaultAdminUser + WriteLog -LogFile $LogFile -LogLevel "INFO" -Log "Get PVWA URL" + $step4 = $xml.SelectSingleNode("//Parameter[@Name = 'pvwaUrl']") + $step4.Value = $PVWAURL + WriteLog -LogFile $LogFile -LogLevel "INFO" -Log "Save xml" + $xml.Save($filePath) +} +catch{ + WriteLog -LogFile $LogFile -LogLevel "ERROR" -Log $_.Exception.Message + exit 1 + } +# SIG # Begin signature block +# MIIgTQYJKoZIhvcNAQcCoIIgPjCCIDoCAQExDzANBglghkgBZQMEAgEFADB5Bgor +# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG +# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCByMS+qaBnFCqFs +# PH4GtuEoBipv3Mk2GQq5CPeKyWzAcqCCDl8wggboMIIE0KADAgECAhB3vQ4Ft1kL +# th1HYVMeP3XtMA0GCSqGSIb3DQEBCwUAMFMxCzAJBgNVBAYTAkJFMRkwFwYDVQQK +# Ex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YLKoZIhvcNAQkQAi8xKDAmMCQwIgQg +# xHTOdgB9AjlODaXk3nwUxoD54oIBPP72U+9dtx/fYfgwCwYJKoZIhvcNAQEBBIIB +# AKNe36q2qh86oxt3L+BQNq/C5UgwTd4jHOYWzqIjVGpt2ZOPnse4G541fZG41TiY +# BHkOsy+durfyTImO5SqUcQRNRUr5n8zG0+uEUxVCETjt7688ENLcFqgInaKlrNWl +# 1NoiKXqdoMCJaC7AfviYFZ+ZyXvYjcGRvzybldt2gPPICOJFjqD/R2MhnE8s5nLp +# uxrEeaJyFTObeCKYzwN6oBxGisYX8ksOPOEmes8A9pDyfD2p+lj/x/tM8DF624XH +# CNkOacSV7oSdgb70UMAHrtl6xLU38tWTcQhLMCcJyhWQmDJ4ORF5SwI+mhAfI6gC +# PyEnAkw1EtS3NEIKonObz/4= +# SIG # End signature block diff --git a/files/aws/PVWARegistration.ps1 b/files/aws/PVWARegistration.ps1 new file mode 100644 index 0000000..f9ce8ad --- /dev/null +++ b/files/aws/PVWARegistration.ps1 @@ -0,0 +1,208 @@ +[CmdletBinding()] +Param( + [Parameter(Mandatory=$true)][string]$VaultAdminUser, + [Parameter(Mandatory=$true)][string]$SSMAdminPassParameterID +) + +. "$PSScriptRoot\Common.ps1" + +$LogFile = "C:\CyberArk\Deployment\Logs\PVWARegistration.log" + +try{ + WriteLog -LogFile $LogFile -LogLevel "INFO" -Log "Getting Admin password from ssm" + $AdminPassword = (Get-SSMParameterValue -Name "$SSMAdminPassParameterID" -WithDecryption $true).Parameters.Value + $ScriptPath = $PSScriptRoot + WriteLog -LogFile $LogFile -LogLevel "INFO" -Log "Setting path location for registration" + Set-Location "C:\CyberArk\PVWA\InstallationAutomation\Registration" + WriteLog -LogFile $LogFile -LogLevel "INFO" -Log "Convert Admin password to secure string for registration PS" + $secStrObj = ConvertTo-SecureString $AdminPassword -AsPlainText -Force + $Action = .\PVWARegisterComponent.ps1 -pwd $AdminPassword + # $Action = .\PVWARegisterComponent.ps1 -spwdObj $secStrObj + $Action | Out-File -FilePath "pvwa_registration_log.log" + $Result = Get-Content "pvwa_registration_log.log" -Raw | ConvertFrom-Json + if ($Result.isSucceeded -eq 0) { + exit 0 + } else { + exit 1 + } +} +catch{ + WriteLog -LogFile $LogFile -LogLevel "ERROR" -Log $_.Exception.Message + exit 1 + } + +# SIG # Begin signature block +# MIIgTQYJKoZIhvcNAQcCoIIgPjCCIDoCAQExDzANBglghkgBZQMEAgEFADB5Bgor +# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG +# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCAXtlBgkx6Pmttv +# 8WDH6KoPyUS5j/4K1sDLfJlyn903mqCCDl8wggboMIIE0KADAgECAhB3vQ4Ft1kL +# th1HYVMeP3XtMA0GCSqGSIb3DQEBCwUAMFMxCzAJBgNVBAYTAkJFMRkwFwYDVQQK +# ExBHbG9iYWxTaWduIG52LXNhMSkwJwYDVQQDEyBHbG9iYWxTaWduIENvZGUgU2ln +# bmluZyBSb290IFI0NTAeFw0yMDA3MjgwMDAwMDBaFw0zMDA3MjgwMDAwMDBaMFwx +# CzAJBgNVBAYTAkJFMRkwFwYDVQQKExBHbG9iYWxTaWduIG52LXNhMTIwMAYDVQQD +# EylHbG9iYWxTaWduIEdDQyBSNDUgRVYgQ29kZVNpZ25pbmcgQ0EgMjAyMDCCAiIw +# DQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMsg75ceuQEyQ6BbqYoj/SBerjgS +# i8os1P9B2BpV1BlTt/2jF+d6OVzA984Ro/ml7QH6tbqT76+T3PjisxlMg7BKRFAE +# eIQQaqTWlpCOgfh8qy+1o1cz0lh7lA5tD6WRJiqzg09ysYp7ZJLQ8LRVX5YLEeWa +# tSyyEc8lG31RK5gfSaNf+BOeNbgDAtqkEy+FSu/EL3AOwdTMMxLsvUCV0xHK5s2z +# BZzIU+tS13hMUQGSgt4T8weO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cJ +# hsT8kSWyG5bphQjo3ep0YG5gpVZ6DchEWNzm+UgUnuW/3gC9d7GYFHIUJN/HESwf +# AD/DSxTGZxzMHgajkF9cVIs+4zNbgg/Ft4YCTnGf6WZFP3YxggJaMIICVgIBATCB +# izB3MQswCQYDVQQGEwJVUzEdMBsGA1UEChMUU3ltYW50ZWMgQ29ycG9yYXRpb24x +# HzAdBgNVBAsTFlN5bWFudGVjIFRydXN0IE5ldHdvcmsxKDAmBgNVBAMTH1N5bWFu +# dGVjIFNIQTI1NiBUaW1lU3RhbXBpbmcgQ0ECEHvU5a+6zAc/oQEjBCJBTRIwCwYJ +# YIZIAWUDBAIBoIGkMBoGCSqGSIb3DQEJAzENBgsqhkiG9w0BCRABBDAcBgkqhkiG +# 9w0BCQUxDxcNMjIwNTAxMTQzNDU1WjAvBgkqhkiG9w0BCQQxIgQgYFR/0FKpNMrH +# 6XGam1wNGM8BwUA4Sgzaod16upQl/fswNwYLKoZIhvcNAQkQAi8xKDAmMCQwIgQg +# xHTOdgB9AjlODaXk3nwUxoD54oIBPP72U+9dtx/fYfgwCwYJKoZIhvcNAQEBBIIB +# ABihHAv2BhBFs5cylt5llZm2yM1OLqsJ2R3zcPgn7eI5LNCa/ffH2eJypv6cx7Xz +# gbWhVOkxKEnQIIk8KCZFmiZocsIuqsWhskqOYKbZnKHJ9iQWydVd23SSK8kQdQ1R +# X7QKYr8jsbw+iViUYp1a+PmDNmC2/pG4J5AxSGMrv0P9QAlegwzRCTegVw8W26MD +# hftl+hMKZV9zjUKfS8QLbtJL+T4pcV7Mh9WClMpLXuH4HjP3ATFz1yCD8KR67tsC +# 8Gu9xdWgiKLOW14fAHPqfdYJLXzBI23BHS94CAXw5N1wF1yoaQJvKUZI7JSe5AEH +# eYNqor2pS/5sxtB5Ez/Bgzc= +# SIG # End signature block diff --git a/files/aws/Set-LocalService.ps1 b/files/aws/Set-LocalService.ps1 new file mode 100644 index 0000000..85687ba --- /dev/null +++ b/files/aws/Set-LocalService.ps1 @@ -0,0 +1,210 @@ +[CmdletBinding()] +Param( + [Parameter(Mandatory=$true)][string[]]$Services, + [Parameter(Mandatory=$true)][string]$Username +) +. C:\ProgramData\Amazon\EC2-Windows\Launch\Module\Scripts\New-RandomPassword.ps1 +. C:\ProgramData\Amazon\EC2-Windows\Launch\Module\Scripts\Confirm-Password.ps1 + +. "$PSScriptRoot\Common.ps1" + + +$LogFile = "C:\CyberArk\Deployment\Logs\Set-LocalService.log" + +try{ + WriteLog -LogFile $LogFile -LogLevel "INFO" -Log "Set new password" + $Password = New-RandomPassword + $adsi = [ADSI]"WinNT://$env:COMPUTERNAME" + $existing = $adsi.Children | where {$_.SchemaClassName -eq 'user' -and $_.Name -eq $Username } + if ($existing -eq $null) { + Write-Error "User $Username does not exist" + return + } + WriteLog -LogFile $LogFile -LogLevel "INFO" -Log "Set existing password" + $existing.SetPassword($Password) + foreach ($Service in $Services) + { + $filter = 'Name=' + "'" + $Service + "'" + '' + $s = Get-WMIObject -class Win32_Service -Filter $filter + $s.Change($Null,$Null,$Null,$Null,$Null,$Null,$Null,$Password,$Null,$Null,$Null) + } + } + catch{ + WriteLog -LogFile $LogFile -LogLevel "ERROR" -Log $_.Exception.Message + exit 1 + } +# SIG # Begin signature block +# MIIgTgYJKoZIhvcNAQcCoIIgPzCCIDsCAQExDzANBglghkgBZQMEAgEFADB5Bgor +# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG +# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCD+jBSUGO9KRsQj +# ujDWJgLs9Eawfm8ieOrx+jRUej2lZaCCDl8wggboMIIE0KADAgECAhB3vQ4Ft1kL +# th1HYVMeP3XtMA0GCSqGSIb3DQEBCwUAMFMxCzAJBgNVBAYTAkJFMRkwFwYDVQQK +# ExBHbG9iYWxTaWduIG52LXNhMSkwJwYDVQQDEyBHbG9iYWxTaWduIENvZGUgU2ln +# bmluZ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FMaA+eKCATz+9lPvXbcf32H4MAsGCSqGSIb3DQEBAQSC +# AQBTpCObj8nbszfR2xiIYTZuNTU+a+z+bd3WqJqeIqic4v480c+AgdBSXT71guDu +# m5kSpgO5XoR3H/SpvmRdESPsWlWfUYCQmLl0YlC/Ny6XYKlm15mhYL2mQT8f1/LZ +# /VOXKw+twFnLyzHAR2JwUXe/OuWUcaLV6buYmDCyB4R3gylS5Vy1aw4LVHzyI705 +# p2C+iiM2uMvQOQJuMUZ38023T/inPdvVQmghhqSvngzuTQ66KKQQJCEhfmfyzm7z +# dXX2BBxZg5n85qI+rh+ZbARUKMxJbchA6HPk9m9llMwI7tMRCb3fkTEXaiDoLcUX +# u+7++j1hH/RAk8cNAhWZgx+X +# SIG # End signature block diff --git a/files/azure/CreateSelfCertAndBind.ps1 b/files/azure/CreateSelfCertAndBind.ps1 new file mode 100644 index 0000000..cd38251 --- /dev/null +++ b/files/azure/CreateSelfCertAndBind.ps1 @@ -0,0 +1,225 @@ + +# The name of the certificate +$certificateDnsName = $env:computername + +# The Website that we will assign the certificate +$siteName = "Default Web Site" + +# ---------------------------------------------------------------------------------------- +# SSL CERTIFICATE CREATION +# ---------------------------------------------------------------------------------------- + +# create the ssl certificate that will expire in 30 years +try +{ + $newCert = New-SelfSignedCertificate -DnsName $certificateDnsName -CertStoreLocation cert:\LocalMachine\My -NotAfter (Get-Date).AddYears(30) + "Certificate Details:`r`n`r`n $newCert" + + + # ---------------------------------------------------------------------------------------- + # IIS BINDINGS + # ---------------------------------------------------------------------------------------- + + + $webbindings = Get-WebBinding -Name $siteName + $webbindings + + + $hasSsl = $webbindings | Where-Object { $_.protocol -like "*https*" } + + if($hasSsl) + { + Write-Output "An SSL certificate is already assigned. Removing it..." + Get-WebBinding -Port 443 -Name "Default Web Site" | Remove-WebBinding + Write-Output "Removing of SSL binding finished successfully" + } + + "Applying TLS/SSL Certificate" + New-WebBinding -Name $siteName -Port 443 -Protocol https + (Get-WebBinding -Name $siteName -Port 443 -Protocol "https").AddSslCertificate($newCert.Thumbprint, "my") +} +catch +{ + Write-Output "An Error ocured on certificate creation..." + +} +"`r`n`r`nNew web bindings" +$webbindings = Get-WebBinding -Name $siteName +$webbindings + + +# SIG # Begin signature block +# MIIgTgYJKoZIhvcNAQcCoIIgPzCCIDsCAQExDzANBglghkgBZQMEAgEFADB5Bgor +# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG +# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCCKdP5NkIXSHmbg +# kZrn9Rq2enZ+5+/RLMp/XluDcvm81KCCDl8wggboMIIE0KADAgECAhB3vQ4Ft1kL +# th1HYVMeP3XtMA0GCSqGSIb3DQEBCwUAMFMxCzAJBgNVBAYTAkJFMRkwFwYDVQQK +# ExBHbG9iYWxTaWduIG52LXNhMSkwJwYDVQQDEyBHbG9iYWxTaWduIENvZGUgU2ln +# bmluZyBSb290IFI0NTAeFw0yMDA3MjgwMDAwMDBaFw0zMDA3MjgwMDAwMDBaMFwx +# CzAJBgNVBAYTAkJFMRkwFwYDVQQKExBHbG9iYWxTaWduIG52LXNhMTIwMAYDVQQD +# EylHbG9iYWxTaWduIEdDQyBSNDUgRVYgQ29kZVNpZ25pbmcgQ0EgMjAyMDCCAiIw +# DQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMsg75ceuQEyQ6BbqYoj/SBerjgS +# i8os1P9B2BpV1BlTt/2jF+d6OVzA984Ro/ml7QH6tbqT76+T3PjisxlMg7BKRFAE +# eIQQaqTWlpCOgfh8qy+1o1cz0lh7lA5tD6WRJiqzg09ysYp7ZJLQ8LRVX5YLEeWa +# tSyyEc8lG31RK5gfSaNf+BOeNbgDAtqkEy+FSu/EL3AOwdTMMxLsvUCV0xHK5s2z +# BZzIU+tS13hMUQGSgt4T8weOdLqEgJ/SpBUO6K/r94n233Hw0b6nskEzIHXMsdXt +# HQcZxOsmd/KrbReTS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lIFJ7lv94AvXexmBRyFCTfxxEs +# HwA/w0sUxmcczB4Go5BfXFSLPuMzW4IPxbeGAk5xn+lmRT92MYICWjCCAlYCAQEw +# gYswdzELMAkGA1UEBhMCVVMxHTAbBgNVBAoTFFN5bWFudGVjIENvcnBvcmF0aW9u +# MR8wHQYDVQQLExZTeW1hbnRlYyBUcnVzdCBOZXR3b3JrMSgwJgYDVQQDEx9TeW1h +# bnRlYyBTSEEyNTYgVGltZVN0YW1waW5nIENBAhB71OWvuswHP6EBIwQiQU0SMAsG +# CWCGSAFlAwQCAaCBpDAaBgkqhkiG9w0BCQMxDQYLKoZIhvcNAQkQAQQwHAYJKoZI +# hvcNAQkFMQ8XDTIyMDUwMTE0MzY1OFowLwYJKoZIhvcNAQkEMSIEIB/jOebatD+3 +# gA+X54Q+O7/SzSBQrsz5reYsO1CqrNmNMDcGCyqGSIb3DQEJEAIvMSgwJjAkMCIE +# IMR0znYAfQI5Tg2l5N58FMaA+eKCATz+9lPvXbcf32H4MAsGCSqGSIb3DQEBAQSC +# AQBUiR0Vrk7Lz843/ANSvt8IpwUGyT1Dsn1393873oLy9YB2ETICizXCZ2kqDAQd +# lf6Hi34EF8+NXUMByu7fnM6RKMdhCyQfUGaz+GSwqvHknn9db/MfT6eRWtEl0m65 +# 7Visiakz5X78sGz55Kp7VyQAK5TXaV+HkHcBd4rLB995lpl6V6M1WBLwncMIFC0B +# Y2AhwJPU0i791A91QzPXu/yzrtKQH7NwFK0Z6I0ngvSU23Sof3ic2TmlMnnY6htX +# pxBi1xBwqwOnj1Uqtl4ye/BwFcUKVhZwO+83dm3bQPPSzHSb/K7Hkfab+KoGUKZL +# AI7JzucBjfGsG2wD0i1hQBc2 +# SIG # End signature block diff --git a/files/azure/Set-LocalAccountPassword.ps1 b/files/azure/Set-LocalAccountPassword.ps1 new file mode 100644 index 0000000..a2a10be --- /dev/null +++ b/files/azure/Set-LocalAccountPassword.ps1 @@ -0,0 +1,187 @@ +[CmdletBinding()] +Param( + [Parameter(Mandatory=$true)][string]$Username, + [Parameter(Mandatory=$true)][string]$Password +) +$adsi = [ADSI]"WinNT://$env:COMPUTERNAME" +$existing = $adsi.Children | where {$_.SchemaClassName -eq 'user' -and $_.Name -eq $Username } +if ($existing -eq $null) { + Write-Error "User $Username does not exist" + return +} +$existing.SetPassword($Password) +# SIG # Begin signature block +# MIIgTgYJKoZIhvcNAQcCoIIgPzCCIDsCAQExDzANBglghkgBZQMEAgEFADB5Bgor +# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG +# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCBO9/zWXoj2FZTK +# hZLdI/BHULq4GoWgSA/dJX8Cwusa8qCCDl8wggboMIIE0KADAgECAhB3vQ4Ft1kL +# th1HYVMeP3XtMA0GCSqGSIb3DQEBCwUAMFMxCzAJBgNVBAYTAkJFMRkwFwYDVQQK +# ExBHbG9iYWxTaWduIG52LXNhMSkwJwYDVQQDEyBHbG9iYWxTaWduIENvZGUgU2ln +# bmluZyBSb290IFI0NTAeFw0yMDA3MjgwMDAwMDBaFw0zMDA3MjgwMDAwMDBaMFwx +# CzAJBgNVBAYTAkJFMRkwFwYDVQQKExBHbG9iYWxTaWduIG52LXNhMTIwMAYDVQQD +# EylHbG9iYWxTaWduIEdDQyBSNDUgRVYgQ29kZVNpZ25pbmcgQ0EgMjAyMDCCAiIw +# DQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMsg75ceuQEyQ6BbqYoj/SBerjgS +# i8os1P9B2BpV1BlTt/2jF+d6OVzA984Ro/ml7QH6tbqT76+T3PjisxlMg7BKRFAE +# eIQQaqTWlpCOgfh8qy+1o1cz0lh7lA5tD6WRJiqzg09ysYp7ZJLQ8LRVX5YLEeWa +# tSyyEc8lG31RK5gfSaNf+BOeNbgDAtqkEy+FSu/EL3AOwdTMMxLsvUCV0xHK5s2z +# BZzIU+tS13hMUQGSgt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vWxHqcalB+Q15OKmhDc+0sdo+mnrHIsV0zd9H +# CYbE/JElshuW6YUI6N3qdGBuYKVWeg3IRFjc5vlIFJ7lv94AvXexmBRyFCTfxxEs +# HwA/w0sUxmcczB4Go5BfXFSLPuMzW4IPxbeGAk5xn+lmRT92MYICWjCCAlYCAQEw +# gYswdzELMAkGA1UEBhMCVVMxHTAbBgNVBAoTFFN5bWFudGVjIENvcnBvcmF0aW9u +# MR8wHQYDVQQLExZTeW1hbnRlYyBUcnVzdCBOZXR3b3JrMSgwJgYDVQQDEx9TeW1h +# bnRlYyBTSEEyNTYgVGltZVN0YW1waW5nIENBAhB71OWvuswHP6EBIwQiQU0SMAsG +# CWCGSAFlAwQCAaCBpDAaBgkqhkiG9w0BCQMxDQYLKoZIhvcNAQkQAQQwHAYJKoZI +# hvcNAQkFMQ8XDTIyMDQxMzEwMzkyMFowLwYJKoZIhvcNAQkEMSIEIAhkFZ4vLZGs +# lumbGaxrHcD6TQKO31AU7UKVr1OfZUA2MDcGCyqGSIb3DQEJEAIvMSgwJjAkMCIE +# IMR0znYAfQI5Tg2l5N58FMaA+eKCATz+9lPvXbcf32H4MAsGCSqGSIb3DQEBAQSC +# AQCik40EeguLLx1pNjWIthOUHIlRta8H0tMx4pKtzEzzSzEGpPuuOKWOiUoKRoTB +# 7HG2KiALb1CsxnaO+iMjXrjjXYcfgievFX9bwNpvYwJ8cy9jWGnEVsBowcwdjFLk +# slsRDt/VTPJ/cj8+YPUDz1PR/v0q/VkcIYM/qNkyaQSQdHi2bRoLLe4fR5cCb70w +# Max0om2xC8Krfz3ZL7yt3m2I/8s+5jpl6RhqJfK6MnKGa5vA4WK1/TKCWEjmIs60 +# xNmfyoGMQ8V45NcitL7dTby/dVAB3yFfs9SUiknYYUIAbmmmwfLZD0Y03pP1iDCR +# BBfgh8lNwJbB59kNAjbjqmfy +# SIG # End signature block diff --git a/files/azure/Set-ServiceLogon.ps1 b/files/azure/Set-ServiceLogon.ps1 new file mode 100644 index 0000000..18ed7a1 --- /dev/null +++ b/files/azure/Set-ServiceLogon.ps1 @@ -0,0 +1,183 @@ +[CmdletBinding()] +Param( + [Parameter(Mandatory=$true)][string]$Service, + [Parameter(Mandatory=$true)][string]$Password +) +$filter = 'Name=' + "'" + $Service + "'" + '' +$s = Get-WMIObject -class Win32_Service -Filter $filter +$s.Change($Null,$Null,$Null,$Null,$Null,$Null,$Null,$Password,$Null,$Null,$Null) +# SIG # Begin signature block +# MIIgTQYJKoZIhvcNAQcCoIIgPjCCIDoCAQExDzANBglghkgBZQMEAgEFADB5Bgor +# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG +# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCDyO51C9aeDvjtd +# aOeX7N+4tzhyoHJ3K4vraQUM4ywKRaCCDl8wggboMIIE0KADAgECAhB3vQ4Ft1kL +# th1HYVMeP3XtMA0GCSqGSIb3DQEBCwUAMFMxCzAJBgNVBAYTAkJFMRkwFwYDVQQK +# ExBHbG9iYWxTaWduIG52LXNhMSkwJwYDVQQDEyBHbG9iYWxTaWduIENvZGUgU2ln +# bmluZyBSb290IFI0NTAeFw0yMDA3MjgwMDAwMDBaFw0zMDA3MjgwMDAwMDBaMFwx +# CzAJBgNVBAYTAkJFMRkwFwYDVQQKExBHbG9iYWxTaWduIG52LXNhMTIwMAYDVQQD +# EylHbG9iYWxTaWduIEdDQyBSNDUgRVYgQ29kZVNpZ25pbmcgQ0EgMjAyMDCCAiIw +# DQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMsg75ceuQEyQ6BbqYoj/SBerjgS +# i8os1P9B2BpV1BlTt/2jF+d6OVzA984Ro/ml7QH6tbqT76+T3PjisxlMg7BKRFAE +# eIQQaqTWlpCOgfh8qy+1o1cz0lh7lA5tD6WRJiqzg09ysYp7ZJLQ8LRVX5YLEeWa +# tSyyEc8lG31RK5gfSaNf+BOeNbgDAtq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f981..d9d6c12 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -1,12 +1,15 @@ --- + galaxy_info: + namespace: cyberark + role_name: pvwa_ansible author: - Nimrod Yakobovitz - Yogev Chen - Avishay Bar - Ziv Lifshits - Maish Saidel-Keesing - description: Installs CyberArk PSM software + description: Installs CyberArk PVWA software company: CyberArk license: Apache2 @@ -16,9 +19,10 @@ galaxy_info: - name: Windows versions: - 2016 + - 2019 galaxy_tags: - - psm + - pvwa - cyberark - security diff --git a/tasks/main.yml b/tasks/main.yml index 971d94d..3cd96fe 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -2,39 +2,39 @@ # tasks file for pvwa - name: Validate input parameters - include_tasks: pvwa_validateparameters.yml + ansible.builtin.include_tasks: pvwa_validateparameters.yml - name: Extract PVWA package - include_tasks: pvwa_extract.yml + ansible.builtin.include_tasks: pvwa_extract.yml when: - pvwa_extract - name: Running PVWA prerequisities - include_tasks: pvwa_prerequisites.yml + ansible.builtin.include_tasks: pvwa_prerequisites.yml when: - pvwa_prerequisites - name: Running PVWA install - include_tasks: pvwa_install.yml + ansible.builtin.include_tasks: pvwa_install.yml when: - pvwa_install - not pvwa_exists - name: Running PVWA hardening - include_tasks: pvwa_hardening.yml + ansible.builtin.include_tasks: pvwa_hardening.yml when: - pvwa_hardening - pvwa_exists - not pvwa_hardened - name: Running PVWA registration - include_tasks: pvwa_registration.yml + ansible.builtin.include_tasks: pvwa_registration.yml when: - pvwa_registration or pvwa_registration_configure_instance or pvwa_registration_configure_vault or pvwa_registration_register_instance - pvwa_exists - not pvwa_registered - name: Running PVWA clean - include_tasks: pvwa_clean.yml + ansible.builtin.include_tasks: pvwa_clean.yml when: - pvwa_clean diff --git a/tasks/pvwa_clean.yml b/tasks/pvwa_clean.yml index bf9aeca..4ab56c5 100644 --- a/tasks/pvwa_clean.yml +++ b/tasks/pvwa_clean.yml @@ -2,73 +2,81 @@ # tasks file for pvwa clean - name: Find files to delete in Windows Temp folder - win_find: + ansible.windows.win_find: paths: "C:\\Windows\\Temp" patterns: ['PVWA*.*', 'InstallationAutomation*.*'] register: files_to_delete - name: Clean Windows Temp Folder - win_file: + ansible.windows.win_file: path: "{{ item.path }}" state: absent with_items: "{{ files_to_delete.files }}" - name: Clean cred files - win_file: + ansible.windows.win_file: path: "{{ item }}" state: absent with_items: - "{{ pvwa_installation_path }}\\CredFiles\\appuser.ini" - "{{ pvwa_installation_path }}\\CredFiles\\gwuser.ini" -- name: Clean run History - win_shell: | - try { - $path = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU" - - if (& { Test-Path $path } 2>&1) { - $arr = (Get-Item -Path $path).Property - foreach ($item in $arr) - { - if ($item -ne "(Default)") - { - Remove-ItemProperty -Path $path -Name $item -ErrorAction SilentlyContinue - } - } - } - } catch { - Write-Output "Error occured: $error" - exit 1 - } - exit 0 - - name: Keep installation automation folder - win_copy: + ansible.windows.win_copy: src: "{{ pvwa_installationautomation_folder }}" dest: "{{ pvwa_base_bin_drive }}\\Cyberark\\PVWA" - remote_src: True - ignore_errors: yes + remote_src: true - name: Delete the deployment folder - win_file: + ansible.windows.win_file: path: "{{ pvwa_extract_folder }}" state: absent -- name: clean event logs - win_shell: | - try { - wevtutil el | ForEach-Object { wevtutil cl "$_" } - } catch { - Write-Output "Error occured: $error" - exit 1 - } +############################### + +- name: Set CyberArk Scheduled Tasks Service Startup Mode to Manual + ansible.windows.win_service: + name: CyberArk Scheduled Tasks + start_mode: manual + state: stopped + +- name: Stop PVWA application pool + community.windows.win_iis_webapppool: + name: PasswordVaultWebAccessPool + state: stopped + +- name: Create Deployment Folders + ansible.windows.win_file: + path: "{{ item }}" + state: directory + with_items: + - "C:\\CyberArk" + - "C:\\CyberArk\\Deployment" + - "C:\\CyberArk\\Deployment\\Logs" + +- name: Copy PS1 scripts - AWS + ansible.windows.win_copy: + src: "files/aws/{{ item }}" + dest: C:\CyberArk\Deployment\ + with_items: + - PVWARegistration.ps1 + - PVWAConfiguration.ps1 + - Set-LocalService.ps1 + - CloudWatch.ps1 + - Common.ps1 + when: platform == 'aws' + +- name: Copy PS1 scripts - Azure + ansible.windows.win_copy: + src: "files/azure/{{ item }}" + dest: C:\CyberArk\ + with_items: + - Set-LocalAccountPassword.ps1 + - Set-ServiceLogon.ps1 + - CreateSelfCertAndBind.ps1 + when: platform == 'azure' -- name: clean recycle bin - win_shell: | - try { - $Recycler = (New-Object -ComObject Shell.Application).Namespace(0xa) - $Recycler.items() | ForEach-Object { rm $_.path -Force -Recurse } - } catch { - Write-Output "Error occured: $error" - exit 1 - } +- name: Copy CloudWatch Json + ansible.windows.win_copy: + src: "files/aws/AWS.EC2.Windows.CloudWatch.json" + dest: "C:\\Program Files\\Amazon\\SSM\\Plugins\\awsCloudWatch\\" diff --git a/tasks/pvwa_extract.yml b/tasks/pvwa_extract.yml index eb78c0d..988929f 100644 --- a/tasks/pvwa_extract.yml +++ b/tasks/pvwa_extract.yml @@ -2,41 +2,35 @@ # tasks file for pvwa_extract - name: Create folder - win_file: + ansible.windows.win_file: path: "{{ pvwa_extract_folder }}" state: directory - name: Copy PVWA package from local source - win_copy: + ansible.windows.win_copy: src: "{{ pvwa_zip_file_path }}" dest: "{{ pvwa_extract_folder }}\\{{ pvwa_artifact_name }}" register: st -- fail: +- name: Check if package exists in path + ansible.builtin.fail: msg: "{{ pvwa_zip_file_path }} not exists, failing..." when: not st.checksum -- name: Check if package is valid using checksum - fail: - msg: "Checksum does not match, please validate your package." - when: - - st.checksum != pvwa_sha1_checksum - - not pvwa_ignore_checksum - - name: Unzip the PVWA package - win_unzip: + community.windows.win_unzip: src: "{{ pvwa_extract_folder }}\\{{ pvwa_artifact_name }}" dest: "{{ pvwa_extract_folder }}" when: pvwa_official - name: Create component folder - win_file: + ansible.windows.win_file: path: "{{ pvwa_extract_folder }}\\{{ pvwa_component_folder }}" state: directory when: not pvwa_official - name: Unzip the PVWA package - win_unzip: + community.windows.win_unzip: src: "{{ pvwa_extract_folder }}\\{{ pvwa_artifact_name }}" dest: "{{ pvwa_extract_folder }}\\{{ pvwa_component_folder }}" when: not pvwa_official diff --git a/tasks/pvwa_hardening.yml b/tasks/pvwa_hardening.yml index 6c06fa9..0e02b33 100644 --- a/tasks/pvwa_hardening.yml +++ b/tasks/pvwa_hardening.yml @@ -5,7 +5,7 @@ block: - name: Run PVWA hardening - win_shell: | + ansible.windows.win_shell: | $ErrorActionPreference = "SilentlyContinue" $Action = .\PVWA_Hardening.ps1 $Action | Out-File -FilePath "{{ pvwa_hardening_log }}" @@ -19,46 +19,47 @@ chdir: "{{ pvwa_installationautomation_folder }}" - name: Get log path for hardening - win_shell: | + ansible.windows.win_shell: | $Result = Get-Content "{{ pvwa_hardening_log }}" Write-Output $Result register: log_result - name: Fetch hardening log from original folder - fetch: + ansible.builtin.fetch: src: '{{ item.logPath }}' - dest: '{{ playbook_dir | dirname }}/logs/pvwa/{{ inventory_hostname }}_hardening.log' - flat: yes + dest: '{{ log_path_dest }}/pvwa_hardening.log' + flat: true with_items: - "{{ log_result.stdout | from_json }}" rescue: - name: Get log path for hardening - win_shell: | + ansible.windows.win_shell: | $Result = Get-Content "{{ pvwa_hardening_log }}" Write-Output $Result register: log_result - name: Fetch hardening log from original folder - fetch: + ansible.builtin.fetch: src: '{{ item.logPath }}' - dest: '{{ playbook_dir | dirname }}/logs/pvwa/{{ inventory_hostname }}_hardening.log' - flat: yes + dest: '{{ log_path_dest }}/pvwa_hardening.log' + flat: true with_items: - "{{ log_result.stdout | from_json }}" - - fail: - msg: 'ERROR: Hardening failed. For more info check {{ playbook_dir | dirname }}/logs/pvwa/{{ inventory_hostname }}_hardening.log' + - name: Fail when hardening not successful + ansible.builtin.fail: + msg: 'ERROR: Hardening failed. For more info check {{ log_path_dest }}/pvwa_hardening.log' # Validate PVWA Hardening - name: Get PVWA Service Info - win_service: + ansible.windows.win_service: name: CyberArk Scheduled Tasks register: service_info - name: Set fact on hardening if correct user running the service - set_fact: + ansible.builtin.set_fact: pvwa_hardened: true when: service_info.exists and service_info.username == ".\\PVWAReportsUser" diff --git a/tasks/pvwa_install.yml b/tasks/pvwa_install.yml index 3afb803..0fbf9c4 100644 --- a/tasks/pvwa_install.yml +++ b/tasks/pvwa_install.yml @@ -2,7 +2,7 @@ # tasks file for pvwa installation - name: Set installation folder on xml config file - win_shell: | + ansible.windows.win_shell: | try { $filePath = "{{ pvwa_installationautomation_folder }}\\Installation\\InstallationConfig.xml" @@ -28,7 +28,7 @@ block: - name: Run PVWA installation - win_shell: | + ansible.windows.win_shell: | Set-Location "{{ pvwa_installationautomation_folder }}\Installation" #$ErrorActionPreference = "SilentlyContinue" $Action = .\PVWAInstallation.ps1 @@ -43,21 +43,21 @@ chdir: "{{ pvwa_installationautomation_folder }}\\Installation" - name: Get log path for installation - win_shell: | + ansible.windows.win_shell: | $Result = Get-Content "{{ pvwa_install_log }}" Write-Output $Result register: log_result - name: Fetch installation log from original folder - fetch: + ansible.builtin.fetch: src: '{{ item.logPath }}' - dest: '{{ playbook_dir | dirname }}/logs/pvwa/{{ inventory_hostname }}_install.log' - flat: yes + dest: '{{ log_path_dest }}/pvwa_install.log' + flat: true with_items: - "{{ log_result.stdout | from_json }}" - name: Validate PVWA installation - win_lineinfile: + community.windows.win_lineinfile: path: '{{ item.logPath }}' regexp: 'Operation Succeeded' state: present @@ -68,22 +68,23 @@ rescue: - name: Get log path for installation - win_shell: | + ansible.windows.win_shell: | $Result = Get-Content "{{ pvwa_install_log }}" Write-Output $Result register: log_result - name: Fetch installation log from path - fetch: + ansible.builtin.fetch: src: '{{ item.logPath }}' - dest: '{{ playbook_dir | dirname }}/logs/pvwa/{{ inventory_hostname }}_install.log' - flat: yes + dest: '{{ log_path_dest }}/pvwa_install.log' + flat: true with_items: - "{{ log_result.stdout | from_json }}" - - fail: - msg: 'ERROR: Installation failed. For more info check {{ playbook_dir | dirname }}/logs/pvwa/{{ inventory_hostname }}_install.log' + - name: Fail when installation not successful + ansible.builtin.fail: + msg: 'ERROR: Installation failed. For more info check {{ log_path_dest }}/pvwa_install.log' - name: Set PVWA exists variable - set_fact: + ansible.builtin.set_fact: pvwa_exists: true diff --git a/tasks/pvwa_prerequisites.yml b/tasks/pvwa_prerequisites.yml index 5e7c7d9..de0bb65 100644 --- a/tasks/pvwa_prerequisites.yml +++ b/tasks/pvwa_prerequisites.yml @@ -1,11 +1,46 @@ --- + +- name: Get roles directory dirname + ansible.builtin.set_fact: + dotnet_installer_path: "C:\\ndp48-x86-x64-allos-enu.exe" + +- name: Download .NET Framework 4.8 + ansible.windows.win_get_url: + url: > + https://download.visualstudio.microsoft.com/download/pr/014120d7-d689-4305-befd-3cb711108212/0fd66638cde16859462a6243a4629a50/ndp48-x86-x64-allos-enu.exe + dest: "{{ dotnet_installer_path }}" + +- name: Install Microsoft .NET Framework 4.8 + ansible.windows.win_package: + path: "{{ dotnet_installer_path }}" + product_id: '{50e73eb2-10f7-4457-954a-6b06fccc7d04}' + arguments: /q /norestart + register: dotnet_install + +- name: Delete .NET Framework Installer + ansible.windows.win_file: + path: "{{ dotnet_installer_path }}" + state: absent + +- name: Reboot host if required + ansible.windows.win_reboot: + when: dotnet_install.reboot_required + +- name: Install IIS Web-Server with sub features and management tools + ansible.windows.win_feature: + name: "web-server" + state: present + restart: true + include_sub_features: true + include_management_tools: true + # tasks file for pvwa prerequisities - name: Pre-Installation Block block: - name: Run PVWA prerequisities script - win_shell: | + ansible.windows.win_shell: | # Script Name: PVWAPreInstall.ps1 # Description: Initiating pre-installation proccess of PVWA. If success, returns OK @@ -27,40 +62,41 @@ exit 1 } - - name: Get log path for preinstall - win_shell: | + - name: Get log path for prerequisites + ansible.windows.win_shell: | $Result = Get-Content "{{ pvwa_prerequisites_log }}" Write-Output $Result register: log_result - - name: Fetch preinstall log from path - fetch: + - name: Fetch prerequisites log from path + ansible.builtin.fetch: src: '{{ item.logPath }}' - dest: '{{ playbook_dir | dirname }}/logs/pvwa/{{ inventory_hostname }}_preinstall.log' - flat: yes + dest: '{{ log_path_dest }}/pvwa_prerequisites.log' + flat: true with_items: - "{{ log_result.stdout | from_json }}" rescue: - - name: Get log path for preinstall - win_shell: | + - name: Get log path for prerequisites + ansible.windows.win_shell: | $Result = Get-Content "{{ pvwa_prerequisites_log }}" Write-Output $Result register: log_result - - name: Fetch preinstall log from path - fetch: + - name: Fetch prerequisites log from path + ansible.builtin.fetch: src: '{{ item.logPath }}' - dest: '{{ playbook_dir | dirname }}/logs/pvwa/{{ inventory_hostname }}_preinstall.log' - flat: yes + dest: '{{ log_path_dest }}/pvwa_prerequisites.log' + flat: true with_items: - "{{ log_result.stdout | from_json }}" - - fail: - msg: 'ERROR: Preinstallation failed. For more info check {{ playbook_dir | dirname }}/logs/pvwa/{{ inventory_hostname }}_preinstall.log' + - name: Fail when prerequisites not successful + ansible.builtin.fail: + msg: 'ERROR: Prerequisites failed. For more info check {{ log_path_dest }}/pvwa_prerequisites.log' - name: Enable HTTP Activation for .net framework - win_feature: + ansible.windows.win_feature: name: NET-WCF-HTTP-Activation45 state: present diff --git a/tasks/pvwa_registration.yml b/tasks/pvwa_registration.yml index 67e89c6..2c047af 100644 --- a/tasks/pvwa_registration.yml +++ b/tasks/pvwa_registration.yml @@ -4,57 +4,65 @@ - name: Registration Block block: - - set_fact: + - name: Set registration vars as facts + ansible.builtin.set_fact: pvwa_registration_configure_instance: true pvwa_registration_configure_vault: true pvwa_registration_register_instance: true when: pvwa_registration - name: Assign PVWA IP - set_fact: + ansible.builtin.set_fact: pvwa_url: "https://{{ ansible_host }}/PasswordVault" when: pvwa_url is not defined - name: Stop report service - win_service: + ansible.windows.win_service: name: "CyberArk Scheduled Tasks" state: stopped when: - pvwa_registration_configure_instance - name: Create configure instance input json - win_copy: + ansible.windows.win_copy: content: "{{ lookup('template', 'templates/ConfigureInstanceInput.json.j2') | to_nice_json }}" dest: '{{ pvwa_installation_path }}\Env\ConfigureInstanceInput.json' when: - pvwa_registration_configure_instance - name: Configure instance - win_shell: | - .\PVWADeploy.ps1 -Action ConfigureInstance -ParametersFile "{{ pvwa_installation_path }}\Env\ConfigureInstanceInput.json" -configFilesPath "{{ pvwa_installation_path }}" + ansible.windows.win_shell: | + .\PVWADeploy.ps1 -Action ConfigureInstance ` + -ParametersFile "{{ pvwa_installation_path }}\Env\ConfigureInstanceInput.json" ` + -configFilesPath "{{ pvwa_installation_path }}" args: chdir: "{{ pvwa_registrationtool_folder }}" when: - pvwa_registration_configure_instance register: pvwa_deploy_output - - fail: - msg: "failed to run PVWADeploy.ps1 ConfigureInstance. Please refer to {{ pvwa_installation_path }}\\Env\\Log\\ConfigureInstance.log for more information." + - name: Fail when ConfigureInstance not successful + ansible.builtin.fail: + msg: > + "failed to run PVWADeploy.ps1 ConfigureInstance. Please refer to {{ pvwa_installation_path }}\\Env\\Log\\ConfigureInstance.log for more information." when: - (pvwa_deploy_output.stdout is defined) and (pvwa_deploy_output.stdout.find('Failed to run') != -1) - pvwa_registration_configure_instance - name: Create configure vault input json - win_copy: + ansible.windows.win_copy: content: "{{ lookup('template', 'templates/ConfigureVaultInput.json.j2') | to_nice_json }}" dest: '{{ pvwa_installation_path }}\Env\ConfigureVaultInput.json' when: - pvwa_registration_configure_vault - name: Configure vault - win_shell: | + ansible.windows.win_shell: | $secure_vault_password_object = ConvertTo-SecureString '{{ vault_password }}' -AsPlainText -Force - .\PVWADeploy.ps1 -Action ConfigureVault -ParametersFile "{{ pvwa_installation_path }}\Env\ConfigureVaultInput.json" -configFilesPath "{{ pvwa_installation_path }}" -VaultSecurePassword $secure_vault_password_object + .\PVWADeploy.ps1 -Action ConfigureVault ` + -ParametersFile "{{ pvwa_installation_path }}\Env\ConfigureVaultInput.json" ` + -configFilesPath "{{ pvwa_installation_path }}" ` + -VaultSecurePassword $secure_vault_password_object args: chdir: "{{ pvwa_registrationtool_folder }}" when: @@ -62,23 +70,28 @@ register: pvwa_deploy_output no_log: true - - fail: - msg: "failed to run PVWADeploy.ps1 ConfigureVault. Please refer to {{ pvwa_installation_path }}\\Env\\Log\\ConfigureVault.log for more information." + - name: Fail when ConfigureVault not successful + ansible.builtin.fail: + msg: > + "failed to run PVWADeploy.ps1 ConfigureVault. Please refer to {{ pvwa_installation_path }}\\Env\\Log\\ConfigureVault.log for more information." when: - (pvwa_deploy_output.stdout is defined) and (pvwa_deploy_output.stdout.find('Failed to run') != -1) - pvwa_registration_configure_vault - name: Create register instance input json - win_copy: + ansible.windows.win_copy: content: "{{ lookup('template', 'templates/RegisterInstanceInput.json.j2') | to_nice_json }}" dest: '{{ pvwa_installation_path }}\Env\RegisterInstanceInput.json' when: - pvwa_registration_register_instance - name: Register instance - win_shell: | + ansible.windows.win_shell: | $secure_vault_password_object = ConvertTo-SecureString '{{ vault_password }}' -AsPlainText -Force - .\PVWADeploy.ps1 -Action RegisterInstance -ParametersFile "{{ pvwa_installation_path }}\Env\RegisterInstanceInput.json" -configFilesPath "{{ pvwa_installation_path }}" -VaultSecurePassword $secure_vault_password_object + .\PVWADeploy.ps1 -Action RegisterInstance ` + -ParametersFile "{{ pvwa_installation_path }}\Env\RegisterInstanceInput.json" ` + -configFilesPath "{{ pvwa_installation_path }}" ` + -VaultSecurePassword $secure_vault_password_object args: chdir: "{{ pvwa_registrationtool_folder }}" when: @@ -87,22 +100,24 @@ no_log: true - name: IIS Restart - win_shell: | + ansible.windows.win_shell: | iisreset /stop iisreset /start when: - pvwa_registration_register_instance - - fail: - msg: "failed to run PVWADeploy.ps1 RegisterInstance. Please refer to {{ pvwa_installation_path }}\\Env\\Log\\RegisterInstance.log for more information." + - name: Fail when RegisterInstance not successful + ansible.builtin.fail: + msg: > + "failed to run PVWADeploy.ps1 RegisterInstance. Please refer to {{ pvwa_installation_path }}\\Env\\Log\\RegisterInstance.log for more information." when: - (pvwa_deploy_output.stdout is defined) and (pvwa_deploy_output.stdout.find('Failed to run') != -1) - pvwa_registration_register_instance - name: Check that you can connect (GET) to pvwa and it returns a status 200 - win_uri: + ansible.windows.win_uri: url: "https://127.0.0.1/PasswordVault/api/server" - validate_certs: no + validate_certs: false timeout: 60 register: pvwa_server_info until: pvwa_server_info.status_code == 200 @@ -112,18 +127,20 @@ - pvwa_registration_register_instance - name: Start report service - win_service: + ansible.windows.win_service: name: "CyberArk Scheduled Tasks" state: started when: - pvwa_registration_register_instance - - set_fact: + - name: Set registration status as fact + ansible.builtin.set_fact: pvwa_registered: true when: - pvwa_registration_register_instance rescue: - - fail: - msg: 'ERROR: Registration failed. For more info check {{ playbook_dir | dirname }}/logs/pvwa/{{ inventory_hostname }}_registration.log' + - name: Fail when registration not successful + ansible.builtin.fail: + msg: 'ERROR: Registration failed.' diff --git a/tasks/pvwa_validateparameters.yml b/tasks/pvwa_validateparameters.yml index ae03e5f..f345487 100644 --- a/tasks/pvwa_validateparameters.yml +++ b/tasks/pvwa_validateparameters.yml @@ -1,57 +1,58 @@ --- # tasks file for pvwa_validateparameters -- name: check EULA is accepted - fail: +- name: Check EULA is accepted + ansible.builtin.fail: msg: "You must accept EULA to start the playbook" - when: (accept_eula|type_debug != 'bool' and accept_eula|lower != "yes") or (accept_eula|type_debug == 'bool' and not accept_eula) + when: (accept_eula | type_debug != 'bool' and accept_eula | lower != "yes") or (accept_eula | type_debug == 'bool' and not accept_eula) - name: Check if PVWA is already installed (present in appwiz) (64-bit) - win_reg_stat: + ansible.windows.win_reg_stat: path: HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\{{ pvwa_guid }} name: Publisher register: pvwa_appwiz_info_64bit - name: Check if PVWA is already installed (present in appwiz) (32-bit) - win_reg_stat: + ansible.windows.win_reg_stat: path: HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{{ pvwa_guid }} name: Publisher register: pvwa_appwiz_info_32bit - name: Check if PVWA was installed with scripted installer - win_reg_stat: + ansible.windows.win_reg_stat: path: HKLM:\SOFTWARE\CyberArk\PVWA register: pvwa_script_installation - name: Set fact if PVWA is already installed - set_fact: + ansible.builtin.set_fact: pvwa_exists: true when: pvwa_appwiz_info_64bit.exists or pvwa_appwiz_info_32bit.exists or pvwa_script_installation.exists - name: Get PVWA Service Info - win_service: + ansible.windows.win_service: name: CyberArk Scheduled Tasks register: service_info - name: Set fact on hardening if correct user is running the service - set_fact: + ansible.builtin.set_fact: pvwa_hardened: true when: service_info.exists and service_info.username == ".\\PVWAReportsUser" - name: Set pvwa_upgrade to false if undefined - set_fact: + ansible.builtin.set_fact: pvwa_upgrade: false when: pvwa_upgrade is undefined - name: Check connection to PVWA to validate registration - win_uri: + ansible.windows.win_uri: url: "https://127.0.0.1/PasswordVault/api/server" - validate_certs: no + validate_certs: false timeout: 60 register: pvwa_server_info - ignore_errors: yes + ignore_errors: true -- set_fact: +- name: Set service info as facts + ansible.builtin.set_fact: pvwa_registered: true when: - pvwa_server_info is defined diff --git a/tests/default.yml b/tests/default.yml index 5635331..ba6a140 100644 --- a/tests/default.yml +++ b/tests/default.yml @@ -1,45 +1,23 @@ --- - hosts: pvwa - gather_facts: no + gather_facts: false tasks: - name: Get roles directory dirname - set_fact: + ansible.builtin.set_fact: roles_dirname: "{{ playbook_dir | dirname | basename }}" - dotnet_installer_path: "C:\\ndp48-x86-x64-allos-enu.exe" - - - name: Download .NET Framework 4.8 - win_get_url: - url: https://download.visualstudio.microsoft.com/download/pr/014120d7-d689-4305-befd-3cb711108212/0fd66638cde16859462a6243a4629a50/ndp48-x86-x64-allos-enu.exe - dest: "{{ dotnet_installer_path }}" - - - name: Install Microsoft .NET Framework 4.8 - win_package: - path: "{{ dotnet_installer_path }}" - product_id: '{50e73eb2-10f7-4457-954a-6b06fccc7d04}' - arguments: /q /norestart - register: dotnet_install - - - name: Delete .NET Framework Installer - win_file: - path: "{{ dotnet_installer_path }}" - state: absent - name: download package from s3 aws_s3: bucket: cloud-initiatives-pipeline-bucket - object: "Packages/v13.2/Password Vault Web Access-Rls-v13.2.zip" + object: "Packages/v13.0/Password Vault Web Access-Rls-v13.0.zip" dest: "/tmp/pvwa.zip" mode: get delegate_to: localhost - - name: Reboot host if required - win_reboot: - when: dotnet_install.reboot_required - - name: pvwa Deployment - include_role: + ansible.builtin.include_role: name: "{{ roles_dirname }}" vars: - pvwa_extract: true diff --git a/tests/group_vars/pvwa.yml b/tests/group_vars/pvwa.yml index 11dd4ac..264188e 100644 --- a/tests/group_vars/pvwa.yml +++ b/tests/group_vars/pvwa.yml @@ -8,7 +8,7 @@ ansible_winrm_operation_timeout_sec: 600 ansible_port: 5986 ansible_become_user: "{{ ansible_user }}" -ansible_become: yes +ansible_become: true ansible_become_method: runas ansible_become_flags: logon_type=new_credentials logon_flags=netcredentials_only ansible_become_password: "{{ ansible_password }}" diff --git a/vars/main.yml b/vars/main.yml index f73b892..02f5377 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -1,3 +1,2 @@ --- # vars file for pvwa -pvwa_sha1_checksum: "63c159d7fb08facfb5df9ec3a82ab0ef829871af"