How to Load Balance PSMP?
Objective
Load balancing for PSMP can be accomplished by placing the PSMPs behind a load balancer and configuring the load balancer for pass through of SSH traffic (port 22). Additionally, configure the load balancer for session persistence (sticky sessions).
When users connect with PuTTY, PowerShell, MobaXTerm or other SSH utilities, they can use to the load balancer's address instead of individual PSMP server addresses.
A note about Load Balancer High Availability:
Idira recommends configuring load balancing infrastructure itself to also be highly available and redundant.
Environment
9.10;10.0;10.1;10.2;10.3;10.4;10.5;10.6;10.7;10.8;10.9;10.10;11.1;11;11.2;11.3;11.4;11.5;11.6;11.7;12.0;12.1;14.2;14.4;14.5;14.6;15.0
Procedure
These are the recommendations to set up the load balancer:
- Standard port: 22
- Standard protocol: SSH
- Application Load Balancing: CyberArk recommends the use of an application-aware load balancing platforms, deployed as a reverse proxy, for all implementations.
- Health Monitoring: Configure TCP monitoring for SSH service health. If the load balancing infrastructure is capable of service-level monitoring, configure the load balancer to additionally monitor the health of the PSMP service (“psmpsrv”).
- SSL Configuration: Enable SSL pass-through/Do not terminate the SSH session at the load balancer, to protect the communication line between the load balancer and the PSMP nodes.
- Routing Algorithm: Set load balancing method to least connections so the load, on average, is balanced equally between the PSMP nodes.
- Persistent Sessions: CyberArk recommends sticky sessions be enabled to ensure all session-related traffic is consistently routed to and through the same PSMP server. A failure to do this can cause the authentication session to go through one PSMP server and the password retrieval from the Vault to go through another PSMP server, thus the connection would fail.
Prior to placing the PSMP Servers behind a load balancer, copy the SSH Keys (ssh_host_* files) stored in the "/etc/ssh/sshd_config" directory of one PSMP Server and copy/replace the files in the other PSMP Servers that will be load-balanced.
IMPORTANT: When copying the "ssh_host_*" files from one PSMP Server, ensure that the file permissions and owners of those files are replicated to the additional PSMP Server(s). For example, to copy the "ssh_host_ecdsa_key" file from the image below to another PSMP Server, set the permissions as follows on the secondary PSMP Server(s):
# chown root:ssh_keys ssh_host_ecdsa_key
# chmod 640 ssh_host_ecdsa_key
This ensures that all the PSMP Servers contain the same public key which will be presented to end users when connecting through the load balancer.
When a connection is made through the load-balancer to the PSMP, the following happens:
- The connection to the PSMP via the PSMP Load-Balancer is initiated
- The Load-Balancer directs the connection to a PSMP Server in its pool of servers
- That PSMP Server provides its public key certificate in the negotiation back to the user's workstation
- The user's workstation accepts the public key certificate presented and will associate that public key certificate with address of PSMP Load-Balancer entered in Step 1
As a result, if the same public key certificate is not copied from one PSMP Server to the rest of the other PSMP Servers in the load-balanced pool, the user's workstation will receive a different public key certificate each time. The user will see security errors warning that a potential man-in-the-middle attack could be occurring since the public key it receives is always changing. This affects end-user experience forcing them to accept the new public certificate and ignore the error each time they connect.
An example of the error can be found below:
WARNING - POTENTIAL SECURITY BREACH!
The server's host key does not match the one <SSH_Client> has cached in the registry. This means that either the server administrator has changed the host key, or you have actually connected to another computer pretending to be the server.
Additional Information
Details
Q:
Does PSMP support Network Load Balancing?
A:
Load balancing for PSMP can be done external to CyberArk.
This can be accomplished by placing the PSMPs behind a load balancer and configuring the load balancer for pass through of SSH traffic (port 22).
Then, point PuTTY to the load balancer address instead of an individual PSMP server address. Due to the fact SSH traffic is a stateful connection, there is no requirement for configuring anything
for session persistence.