SSH Key Generation Delay in PVWA
Symptom
Users experience a significant delay (over 10 seconds) when generating SSH keys within the Password Vault Web Access. This delay is observed specifically during the key generation process itself, prior to key storage.
Environment
Privileged Access Manager (PAM, self-hosted) Password Vault Web Access
PVWA (Self-hosted)
Version: 12.6
Key Type: RSA 4096-bit
Cause
The prolonged SSH key generation time is attributed to the computational intensity of the RSA 4096-bit key generation algorithm, which relies on a third-party cryptographic library. This algorithm demands considerable processing resources, resulting in extended processing durations.
Vault server logs indicate that the Vault processes SSH key generation requests rapidly, ruling out backend performance issues.
PVWA logs reveal a substantial time gap between the initiation and completion of the key generation process within the PVWA.
The delay is isolated to the key generation process within the PVWA, not the subsequent storage of the key.
Relevant Log Lines from PVWA.App.log - RSA 4096-bit key generation started, and it took approximately 9.7 seconds to complete:
```
2025-01-31 13:00:37,098 Deleting all user cached ssh keys for user XXXXXXX || || ajv
2025-01-31 13:00:37,098 Generating Keypair [Alg: RSA, Size: 4096] || || ajv
2025-01-31 13:00:46,817 Storing public key on the backend || || ajv
```
Resolution
It is recommended that key generation delays be mitigated by transitioning to a more efficient encryption algorithm. Ed25519 and ECDSA generate key pairs significantly faster than RSA.
Consult the documentation or guidelines related to choosing appropriate cryptographic algorithms and key sizes to determine the most suitable option for your environment:
https://www.ssh.com/academy/ssh/keygen#choosing-an-algorithm-and-key-size