CPM - SSH Fingerprint Mismatch (with FIPS Mode Enabled)
Symptom
Failure to successfully establish an SSH connection to a given target.
This issue can occur using any of the *nix-based CPM plugins. Various possible error messages in both the pm and debug logs could occur, including:
• CACPM344E - Error: Invalid prompt or did not receive any prompt. State: "StartSessionSSH". code: 7001 - plug-in cannot work with old cached key / The server's host key does not match the one PuTTY has cached in the registry.
• ERROR: An established connection was aborted by the server ---> Renci.SshNet.Common.SshConnectionException: An established connection was aborted by the server.
• CACPM250E Operation on remote machine on password object Safe: <safe_name>, Folder: Root, Object: <object_name> failed (try #0) with the following error: Execution error. EXT01::Fingerprint mismatch for 'ssh-ed25519@22:1.1.1.1'. Error code:9007
• ERROR: Fingerprint mismatch for 'ssh-ed25519@22:<FQDN>' ---> Expect.NET.FingerPrintMismatchException: Fingerprint mismatch for 'ssh-ed25519@22:<FQDN>'.
In a PuTTY connection from the CPM to the target, you may see an error such as "WARNING - POTENTIAL SECURITY BREACH! The server's host key does not match the one PuTTY has cached in the registry", or something similar.
Environment
Privileged Access Manager (PAM, self-hosted) Central Policy Manager (CPM)
Cause
When the algorithms are changed to FIPS-compliant, it does result in a fingerprint change since the SSH fingerprint validation now must use FIPS-compliant hashing algorithms.
Any hosts that had their non FIPS fingerprint cached will result in a fingerprint validation error.
That is why the cache will need to be purged when enabling RunInFIPSCompliantmode=Yes.
Systems not supporting FIPS-compliant algorithms will fail CPM validations.
Those systems should be assigned to a separate CPM / Platform that is not configured to force FIPS-compliant algorithms. That is due to the fact that enabling FIPS is a global CPM setting.
Resolution
1) Clear cached fingerprint from registry for that target system
Method 1: The preferred work around for when a known change of SSH keys has occurred is to manually PuTTY into the target from the CPM (as the Administrator user) and accept the new key. In doing so, this will update and store the new key in the Windows registry.
Method 2: In some events it may be necessary to delete the key from the registry if the manual PuTTY process does not work. To do so:
a. On the CPM, go to the registry: Start -> Run -> regedit.exe
Note: When working with Windows Registry, please always backup the keys prior to modifying them.
b. Go to where the key is stored:
- If the Idira Password Manager service runs as the Local System account: HKEY_USERS\.Default\Software\CyberArk\Expect.NET\HostKeys
- If the Idira Password Manager service runs as a specific account, you have a few options:
i: Log onto the CPM as that user and go to HKEY_CURRENT_USER\Software\CyberArk\Expect.NET\HostKeys
ii: If the SID of that user is known, go to HKEY_USERS\<user_sid>\Software\CyberArk\Expect.NET\HostKeys
iii: If the SID is not known, right-click on the HKEY_USERS hive, click Find, and enter the hostname or IP of the target (based on how the address is configured in PVWA).
c. Regardless of the specific method above used to locate the key, once the key has been found, on the right hand side of the registry window, right-click and delete the key for that particular target.
Note - The format of the key is generally: ssh-<encryption_method>@port:<hostname/IP>
Method 3 Disable a platform to override a fingerprint
In the PVWA, select Adminstration > Platform Management.
Edit the Platform settings: Select the Unix|AIX platform, click on the right side of the screen, and select Edit.
Under Automatic Password Management > Additional Policy Settings, right-click Parameters, and select Add Parameter.
Add the following parameter:
Parameter StoreKeyinCache
Set the value to No (default is Yes if not specified)
Click OK.
2) Set RunInFIPSCompliantmode=Yes
3) Perform a verify (this will cache the new fingerprint)
4) You should now be able to perform a change or reconcile on this account