PSM Hardening Tasks
This section describes the hardening tasks in detail. Use this reference to troubleshoot your automatic installation or to perform one or more of the hardening tasks manually .
Run the hardening script
Manually perform the following to run the hardening script.
-
To check the current PowerShell script execution policy, open the PowerShell window, then run the command Get-ExecutionPolicy.The command will return a RemoteSigned status.
Get-ExecutionPolicy
-
If the command does not return the RemoteSigned status, run the following command to allow local PowerShell scripts to run
Set-ExecutionPolicy RemoteSigned –force
For more information about this command, refer to PowerShell's man page.
-
Remove the read-only permissions from the PSM hardening script file PSMHardening.ps1.
-
Open the PSM hardening script using Notepad and proceed with the following options:
-
To enable the PSM to connect to Web applications change the value of $SUPPORT_WEB_APPLICATIONS to $true.
- To harden a PSM cluster:
In the $PSM_VAULT_FILE_PATH parameter, specify the shared Vault folder and/or the Vault file that is not under the PSM directory path.
In the $PSM_RECORDING_PATH parameter, specify the shared recording folder and/or recording directory that is not under the PSM directory path.
-
In a PowerShell window, open the PSM installation >\Hardening folder.
CD “C:\Program Files (x86)\CyberArk\PSM\Hardening”
-
To start the script, run the following command:
./PSMHardening.ps1
-
Check the log for errors.
-
If the log contains errors, refer to the # Error Codes section in the hardening script for troubleshooting suggestions. If you cannot solve the problem, contact your CyberArk support representative.
-
If the PVWA is installed on the same machine, check that the script recognized and modified the PVWA folders’ permissions.
-
If the script did not recognize the PVWA, or a warning message was written in the log, modify the permissions manually as follows:
Object | User | Permission |
---|---|---|
C:\CyberArk | PSMConnect PSMAdminConnect | Deny All Access |
C:\InetPub | PSMConnect PSMAdminConnect | Deny All Access |
-
Return the security level for running PowerShell scripts to the same status as it was before you ran the script. For example, to set the execution policy to Restricted, run the following command:
Set-ExecutionPolicy restricted
For more information about this command, refer to PowerShell's man page.
After running the hardening script
The following tasks should be done after the hardening script finishes running.
Hide PSM local drives in PSM sessions
This procedure hides the PSM local drives in the PSM sessions.
If you add a new local drive to the PSM machine, run the Hardening stage again with the Runs post hardening tasks step enabled to apply the hiding policy on the newly added drive. Before running the Hardening stage, any PSM local Shadow user in the system must be removed, along with its user profile.
1. | Open Properties for Computer > Advanced system settings > Advanced Tab > User Profiles > Settings.... |
2. | Delete any user profile with the PSM- prefix. |
1. | Go to Computer Management > Local Users and Groups > Users. |
2. | Remove any user with the PSM generated Shadow-User description. |
Block Internet Explorer developer tools
This procedure blocks Internet Explorer development tools when connecting to web sites through the PSM.
Internet Explorer developer tools are blocked in the PSM in order to prevent end users who connect via the PSM from accessing it.
-
From Start, run the following executable: gpedit.msc; the Local Group Policy Editor window appears.
-
In Computer Configuration, select Administrative Templates; a list of available templates is displayed.
-
In the list of templates, double-click Windows Components, and then double-click Internet Explorer; a list of settings is displayed.
-
Double-click Toolbars.
-
Double-click Turn off Developer Tools, then in the settings window, select Enabled.
-
Click OK.
Block the Internet Explorer context menu
This procedure blocks Internet Explorer context menus when connecting to web sites through PSM.
The Internet Explorer context menu in the PSM is blocked in order to prevent end users from adding the developer tools.
-
From Start, run the following executable: regedit.exe; the Registry Editor window appears.
-
Display the contents of the following key:
HKEY_LOCAL_MACHINE \ SOFTWARE \ Policies \ Microsoft \ Internet Explorer \ Restrictions.
-
Change the value of the DWORD NoBrowserContextMenu to 1. If DWORD does not exist, create it.
Run AppLocker rules
To create a hardened and secure PSM environment, the system must limit the applications that can be launched during a PSM session. To do this, the PSM uses the Windows AppLocker feature, which defines a set of rules that allow or deny applications from running on the PSM machine, based on unique file identities. These rules specify which users or groups can run those applications.
The PSM installation includes an AppLocker script which enables PSM users to invoke internal PSM applications, mandatory Windows applications, and third- party external applications that are used as clients in the PSM.
All AppLocker rules are defined in the PSMConfigureAppLocker.xml file in the PSM installation folder > Hardening.
-
If your environment includes executables that must be allowed, in addition to those that are built-in to the PSM installation, such as PSM Universal Connectors executables, you must edit this file to add rules that will allow these executables.
-
If you have connectors deployed using shared universal connector deployment on multiple PSM servers they will be updated automatically in the AppLocker rules. For details, see Deploy Universal Connectors on multiple PSM servers.
-
Beginning in version 12.2.4, DLL files are allowed only if they are uploaded by the allowed executables included in the PSMConfigureApplocker.xml file. The PSMConfigureApplocker script automatically finds the relevant DLL files and adds a corresponding Applocker rule for these DLLs. However, we recommend that you verify that all PSM connectors are properly working after the upgrade. If any of the PSM connectors fail due to blocked DLL files, see Detect blocked DLL files.
-
Make sure that the organizational GPO AppLocker policy is not enabled on the PSM machine.
- Configure the PSM machine to allow PowerShell scripts to run:
Open a PowerShell window, then run the Get-ExecutionPolicy command to check the current PowerShell script execution policy, as shown in the following example.
The command will return the RemoteSigned status.
Get-ExecutionPolicy
If the above command does not return the RemoteSigned status, run the Set-ExecutionPolicy command to allow local PowerShell scripts to run, as shown in the following example:
Set-ExecutionPolicy RemoteSigned –force
For more information about this command, refer to the PowerShell man page.
-
In the PSM installation folder, remove the read-only permissions from the PSMConfigureAppLocker.xml file.
-
Open the PSMConfigureAppLocker.xml configuration file and edit the PSM AppLocker configuration manually.
-
Make sure that the paths specified in the file specify the PSM installation folder path.
-
If your environment includes executables that must be allowed, in addition to those that are built-in the PSM installation, such as PSM Universal Connectors executables, add a rule for each executable to allow it on the PSM server.
-
-
Run the Automatic PSM AppLocker Configuration Script to set the AppLocker and ensure that PSM users can only run approved applications. This script enables PSM users to invoke internal PSM applications and mandatory Windows applications. The PowerShell script that configures the AppLocker Rules is called PSMConfigureAppLocker.ps1. This PSMConfigureAppLocker.ps1 script file is located in the folder PSM installation > Hardening
-
In a PowerShell window, open the PSM installation >\Hardening folder.
CD “C:\Program Files (x86)\CyberArk\PSM\Hardening”
-
To start the script, run the following command:
./PSMConfigureAppLocker.ps1
-
After running the AppLocker script, you can return the security level for running PowerShell scripts to the same status as it was before you ran the AppLocker script.
For example, to set the execution policy to restricted, run the following command:
|
For more information, refer to PowerShell's main page.
Hardening 'In Domain' deployments
This section describes the hardening procedure for In Domain deployments, including each file type and its configuration, as well as the procedures for applying and editing these files in a customer's environment.
-
Open the Group Policy Management Console (GPMC.msc) on your domain.
-
Expand Group Policy Management, then the <yourDomain> forest, and then Domains.
-
Expand <yourDomain>, then right-click Group Policy Objects and select New.The New GPO window appears.
- In the Name field, specify the name of the new GPO (for example, CyberArk PSM Hardening), then click OK.
- In the Group Policy Objects, right-click the newly created GPO then select Import Settings….
The Import Settings Wizard appears.
-
In the Welcome to the Import Settings Wizard window, click Next. The Backup GPO window appears.
You do not have to configure backup as this GPO is new.
- Click Next. The Backup location screen appears.
- Click Browse, and select the location of the folder where the hardening settings are stored. For example,
CyberArk PSM Hardening - GPO Settings
from the installation package.
Be sure to unzip the folder where the hardening settings are stored. If CPM is installed on the same machine, use |
- Then click Next. The Source GPO window appears.
- Select the Hardening GPO, for example, PSM Hardening GPO, then click Next. The Scanning Backup window appears.
- Click Next. The Completing the Import Settings Wizard window appears.
- Click Finish. The Import window appears and shows the progress of the GPO import.
- When the GPO import process is complete, click OK.
Hardening 'Out of Domain' deployments
This section describes how to apply hardening procedures in 'Out of Domain' deployments.
-
Copy the relevant INF hardening file to the local machine (CyberArk component).
-
In a command line, run gpedit.msc.
-
Display Computer Configuration, then display Windows Settings.
-
Right-click Security Settings, and Import Policy.
- Browse to the folder where the INF hardening file is located, for example, CyberArk PSM Hardening, and open it.
-
Copy the relevant Advanced Audit.csv file to the local machine (CyberArk component).
-
In a command line, run gpedit.msc.
-
Display Computer Configuration, then display Windows Settings, and expand Security Settings.
-
Expand Advanced Audit Policy Configuration, then right-click System Audit Policies – Local Group Policy Object, and select Import Settings.
- Browse to the folder where the Advanced Audit.csv is saved, and open it.
General hardening tasks
This section describes the manual hardening tasks that are necessary for all types of deployments and that are part of maintaining your system. Perform them after running the hardening script, and after completing the in-domain hardening tasks (if necessary). You should also perform them periodically, for example if you change something in the environment (add servers, upgrade a version), after an operating system upgrade, and as part of general maintenance activities.
Update your operating system
Microsoft releases periodic updates (security updates and service packs) to address security issues that have been discovered in their software. Make sure your operating system is updated to the latest version.
You can install the updates in either of the following ways:
- Manually install updates and service packs.
- Automatically install with Server Update Services (WSUS), which is located on a corporate network.
Install an anti-virus solution
In today’s world, the pace of virus development is very fast. Servers without anti-virus protection are exposed to two risks:
- Server infected with viruses that might damage the server and the entire network.
- Trojan horses that are planted to allow remote control of the server and to all the information on it.
Install an anti-virus solution and update it as needed.
Validate proper server roles
Server roles can be set using the Server Manager. Ensure that the unnecessary roles are not installed on the server
Restrict network protocols
Install only the required protocols and remove unnecessary ones.
For example, only TCP/IP are necessary, and ensure that no additional protocols such as IPX or NetBEUI are allowed.
Rename default accounts
It is recommended to change the names of both the Administrator and the guest account to names that don't provide information about their permissions.
It is also recommended to create a new locked and unprivileged Administrator user name as bait.
Enable Microsoft Edge
Configure AppLocker to enable Microsoft Edge
-
Remove the read-only permission from the PSMConfigureAppLocker.xml file.
-
In the Hardening subfolder of the PSM installation folder, open the PSMConfigureAppLocker.xml configuration file and edit the AllowedApplications section:
Make sure that the following lines exist and are uncommented:
<Application Name="PSM-WebAppDispatcher" Type="Exe" SessionType="*" Path="C:\Program Files (x86)\CyberArk\PSM\Components\CyberArk.PSM.WebAppDispatcher.exe" Method="Hash" />
<Application Name="PSM-ProgressBar" Type="Exe" SessionType="*" Path="C:\Program Files (x86)\CyberArk\PSM\Components\CyberArk.ProgressBar.exe" Method="Hash" />
<Application Name="Edge" Type="Exe" Path="C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe" Method="Publisher" />
<Application Name="msedgedriver" Type="Exe" Path="C:\Program Files (x86)\CyberArk\PSM\Components\msedgedriver.exe" Method="Hash" />Verify that the path specified in the xml matches the browser installation path.
-
Save the PSMConfigureAppLocker.xml configuration file and close it.
-
Use the following command to run PowerShell and start the script:
CD “C:\Program Files (x86)\CyberArk\PSM\Hardening” PSMConfigureAppLocker.ps1
For more information, see Run AppLocker rules.
Harden the Edge browser on the PSM server
For PSM servers that are part of a domain, after you configure the connection components you must harden the PSM server. In the Secure Web Application Connectors Framework zip file package, inside the Hardening folder, there are two zip files that contain the GPO settings used to harden the PSM server:
-
CyberArk Hardening - In Domain - PSM V1.9.0 - Shared CPM.zip - Use this file if both PSM and CPM are installed on the same server.
-
CyberArk Hardening - In Domain - PSM V1.9.0.zip - Use this file if PSM and CPM are installed on different servers.
To perform the hardening, you import the Group Policy Object (GPO) hardening settings. Before importing the new file, make sure to backup your existing GPO.
For detailed information how to perform hardening, see Hardening 'In Domain' deployments.
In the Secure Web Application Connectors Framework zip file package, run the RunGroupPolicyLoader.bat file located in the Hardening folder.
After running this script, make sure the output logs are empty.
Harden the PSM server in 'In Domain' deployments
This section describes how to harden the PSM server in 'In Domain' deployments, which involves the GPO file. The GPO should be imported during the installation process. You will receive the hardening package from CyberArk as a zipped file. Unzip this file so that you can import the hardening GPO. Follow your organization's security policy when customizing the GPO settings.
-
If smart cards are not used with the PSM server(s), use the following to disable this feature.
Policy Setting Services
Vulnerability: Unnecessary services are expose the server to vulnerabilities and increasing the attack surface
Smart Card
Disabled
Smart Card Removal Policy
Disabled
-
To Harden via a Group Policy Object (GPO),
Create a new group policy object (Services): Computer Configuration → Policies → Windows Settings → Security Settings → System Services
Policy Setting Services
Vulnerability: Unnecessary services expose the server to vulnerabilities and increase the attack surface
Do not allow smart card device redirection
Enabled
-
To Harden via a Group Policy Object (GPO), do the following:
Create a new group policy object (Services): Computer Configuration → Policies → Administrative Templates → Windows Components → Remote Desktop Services → Remote Desktop Session Host → Device and Resource Redirection
-
To Enable the Firewall, do the following:
Assuming all required network rules for proper PSM functioning are known (user machines, target machines and other servers and services), it is recommended to enable the Windows firewall.
Policy Setting Services
Vulnerability: Unnecessary services expose the server to vulnerabilities and increase the attack surface.
Windows Firewall Enabled
-
To Harden via a Group Policy Object (GPO):
Create a new group policy object (Services): Computer Configuration → Policies → Windows Settings → Security Settings → System Services
-
To Disable Remote Desktop Services Redirection, do the following:
If Clipboard/Drive/Printer redirection are not being used, disable them.
Policy Setting Terminal Service Hardening
Vulnerability: Clipboard mapping enables the client to transfer a virus or a malicious application to the server as well as copy configuration or sensitive data from the server back to the client machine. There is a risk of infecting to the whole network or damaging the system.
Do not allow Clipboard redirection Enabled Do not allow drive redirection Enabled Do not allow printer redirection Enabled
-
To Harden via a Group Policy Object (GPO)
Create a new group policy object (Services): Computer Configuration → Policies → Administrative Templates → Windows Components → Remote Desktop Services → Remote Desktop Session Host → Device and Resource Redirection
Harden the PSM server in 'Out of Domain' deployments
Use the following procedures to harden PSM servers in ‘Out of Domain’ deployments. You will receive the hardening package from CyberArk as a zipped file. Unzip this file so that you can import the hardening INF and CSV files.
Administrative templates
To manually configure Remote Desktop Services, do the following:
Policy | Setting | |
---|---|---|
Services | ||
Administrative Templates → Windows components → Remote Desktop Services → Remote Desktop Session Host → Connections |
||
Automatic reconnection | Disabled | |
Configure keep-alive connection interval |
Enabled |
|
Deny logoff of an administrator logged in to the console session |
Enabled |
|
Set rules for remote control of Remote Desktop Services user sessions |
Enabled |
|
Do not allow LPT port redirection |
Enabled |
|
Do not allow supported Plug and Play device redirection |
Enabled |
|
Administrative Templates → Windows components → Remote Desktop Services → Remote Desktop Session Host → Remote Session Environment |
||
Remove "Disconnect" option from Shut Down dialog | Enabled | |
Remove Windows Security item from Start menu |
Enabled |
|
Administrative Templates → Windows components → Remote Desktop Services → Remote Desktop Session Host → Security |
||
Do not allow local administrators to customize permissions | Not Defined | |
Require secure RPC communication |
Enabled |
|
Set client connection encryption level |
Enabled |
|
Administrative Templates → Windows components → Remote Desktop Services → Remote Desktop Session Host → Session Time Limits |
||
End session when time limits are reached | Enabled | |
Set time limit for active but idle Remote Desktop Services sessions |
Not Defined |
|
Set time limit for disconnected sessions |
Enabled |
|
Administrative Templates → Windows components → Remote Desktop Services → Remote Desktop Session Host → Temporary folders |
||
Do not delete temp folders upon exit | Disabled | |
Do not use temporary folders per session |
Disabled |
Policy | Setting | |||||||
---|---|---|---|---|---|---|---|---|
Services Administrative Templates → Windows components → Remote Desktop Services → Remote Desktop Session Host → Device and Resource Redirection |
||||||||
Do not allow Clipboard redirection |
|
|||||||
Do not allow COM port redirection |
|
|||||||
Do not allow drive redirection |
|
- At a command line, run gpedit.msc.
-
Display Computer Configuration, then display Windows Settings, and expand Security Settings.
- Expand Local Policies, then select User Rights Assignment.
- Add the PSMShadowUsers group to the Allow log on locally list.
-
Add the PSMConnect / PSMAdminConnect users to the Allow log on through Remote Desktop Services list. To ensure that unauthorized users will not gain access to the PSM server, this setting must only be allowed for the PSMConnect and PSMAdminConnect users, and for maintenance users who are required to logon remotely to the PSM server. You will have to redefine this setting after each PSM server upgrade. Make sure that the effective policy, including configurations made at domain level, defines this setting as described above.