PVWA - PVWA stops working 30 days after manual cred file sync
Symptom
PVWA stops working 30 days after new cred files have been created
Environment
11.5;12.2;12.6;13.0;13.2;14.0;14.2;14.4 Privileged Access Manager (PAM, self-hosted) Password Vault Web Access Password Vault Web Access User Management
Cause
The PVWA rotates it's PVWAAppUser and PVWAGWUser credentials every day, however, if for some reason the cred files cannot be written to with new passwords, the old passwords will still be usable for 30 days by default. This default is configured through the DaysForPasswordExpiration parameter in the passparm.ini file on the Vault.
After 30 days, the passwords will expire and the PVWA will no longer be able to login to the vault.
The PVWA.App.Log will have entries like the following if the cred files cannot be written to:-
2025-01-16 01:40:30,361 || ERROR || 32 || || || || b628e717-98c6-4b28-835d-1128f7449498 || Failed to logon agent user. || CyberArk.Services.Exceptions.SystemException: CASTM053E Unexpected error in ChangeToRandomPasswordFromFile: [New password could not be written to file] code [-2059001], Reason: CASCF001E Failed to write credential file [C:\CyberArk\Password Vault Web Access\CredFiles\gwuser.ini]. Reason: CASPR001E Error parsing parameters file (Location:CCAGParmsStreamFile.cpp:178), Reason: Parms file [C:\CyberArk\Password Vault Web Access\CredFiles\gwuser.ini] open for write failed.. -etc
If the directory permissions of the cred files are correct (C:\Cyberark\Password Vault Web Access\CredFiles), then the likely cause is the the credfiles were created in a different directory on the same volume with incomplete permissions, and moved to the credfiles directory.
See this document from Microsoft - https://learn.microsoft.com/en-us/troubleshoot/windows-client/windows-security/permissions-on-copying-moving-files - specifically the comment "when you move an object to a different folder on the same volume...the original permissions are retained"
Resolution
Options to avoid this problem are as follows:-
- Create the cred files in C:\Cyberark\Password Vault Web Access\Env (the same directory as the CreateCredFile.exe file) and move them to C:\Cyberark\Password Vault Web Access\CredFiles
- Create the cred files in the C:\Cyberark\Password Vault Web Access\CredFiles
- Create the cred files in a new folder with the same permissions as C:\Cyberark\Password Vault Web Access\CredFiles and move them to C:\Cyberark\Password Vault Web Access\CredFiles
- Create the cred files in a new folder and then use the options explained in the Microsoft document mentioned above when moving them to C:\Cyberark\Password Vault Web Access\CredFiles