PSMP Tunnelling examples
Symptom
The documentation can be hard to understand for command syntax with the use of SSH Tunneling
https://docs.cyberark.com/Product-Doc/OnlineHelp/PAS/Latest/en/Content/PASIMP/PSSO-PMSP.htm#PSMforSSHCommand
Tunneling for PSMP in Integrated mode was introduced in version 12.6 with an update to the PSMP "Option 1 Syntax"
TunnelingServerPort value should be a single port (This is different from TunnelingPorts – The list of ports on the target machine)
TunnelingServerPort – 'TunnelingServer' is the PSMP Server; the default value is 55555. -- This is the value with the port on the PSM for SSH machine that is enabled for SSH tunneling. Setting 2 or more ports for this variable will cause the PSMP service to not start.
Here are some example configurations that we will attempt to simplify:
Given the example syntax:
ssh -L localPort:127.0.0.1:tunneltargetPort VaultUser@TargetUser[#TargetDomain]@TargetMachine#TargetPort# tunneltargetPort@proxyaddress
VaultUser=VU
TargetUser=TU
[TargetDomain]=DM [usage depending on use case]
TargetMachine=1.1.1.1
**TargetPort=22
localPort=5000
tunneltargetPort=8000
PSMPaddress=1.2.3.4
** TargetPort is required to be specified; even if it is the default port 22
Environment
12.6;13.0 Privileged Access Manager (PAM, self-hosted) PSMP PSMP Tunneling
Cause
The documentation can be hard to understand for command syntax with the use of SSH Tunneling
Resolution
Example for a basic 'local' target account:
# ssh -L 5000:127.0.0.1:8000 vu@tu@1.1.1.1#22#8000@1.2.3.4
Example for a domain target account:
# ssh -L 5000:127.0.0.1:8000 vu@tu#dm@1.1.1.1#22#8000@1.2.3.4
Example for a vault user domain account = vu@xyz.com (** Need to configure "additional delimiter", exampled with '%')
# ssh -L 5000:127.0.0.1:8000 vu@xyz.com%tu#dm%1.1.1.1#22#8000@1.2.3.4
This creates a tunnel on port 8000 of the target machine (1.1.1.1) and makes it available to the end user machine on port 5000.
In order to configure PuTTY to correctly pass the above information:
Host Name (or IP address):
- enter the base of our connection string; ie one of the following from our examples above:
vu@tu@1.1.1.1#22#8000@1.2.3.4
vu@tu#dm@1.1.1.1#22#8000@1.2.3.4
vu@xyz.com%tu#dm%1.1.1.1#22#8000@1.2.3.4
Then we nee to provide the information from "-L localPort:127.0.0.1:tunneltargetPort" into
Configuration: Connection > SSH > Tunnels >
Source port = localPort = 5000
Destination = 127.0.0.1:tunneltargetPort = 127.0.0.1:8000
L5000 127.0.0.1:8000