CP - How internal user password rotation and login work with DR and Distributed Vaults?
Question
How Credential Providers work behind the scene when it comes to the internal user password rotation (credential file) and login to the Vault ?
Environment
9.8;9.9;9.9.5;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;12.2;11.9;11.8;12.4;12.3;12.5 Privileged Access Manager (PAM, self-hosted);Privilege Cloud Application Server Credential Provider (ASCP);Credential Provider;Central Credential Provider
Answer
Before detailing the logic, this is important to understand what is included in the Credential File and inside the Configuration File (main_appprovider.conf. <platform>.<version>) in the AppProvider safe.
Sections "Credential File content" and "Definitions of AutomaticProviderPasswordRefreshInterval & AutomaticParmsRefreshInterval" provide explanations.
Credential File content :
The Provider's credential file (AppProviderUser.cred) includes 2 parameters named Password and NewPassword. The terminology changed from Password to Secret starting 12.1 and later versions.
Example of an AppProviderUser.cred (version 12.4) :
Definitions of AutomaticProviderPasswordRefreshInterval & AutomaticParmsRefreshInterval:
Both parameters are located inside the configuration file of the Provider (main_appprovider.conf. <platform>.<version>) in the AppProviderConf safe.
AutomaticProviderPasswordRefreshInterval (default is 86400 seconds, 24 hours. Not visible per default in the configuration file):
"The frequency in seconds that the Credential Provider takes to refresh the connection to the vault and relogin. After login, the user's password is changed in the vault and updated in its credential file appprovideruser.cred. This process runs as part of the AutomaticParmsRefresh background job and therefore the frequency of this process depends on the AutomaticParmsRefreshInterval's value as well. The default is every 24h."
Note: this parameter was introduced in version 12.0 and later. For earlier versions, it is not recognized as a valid parameter if set. The default hard coded 24 hours interval will apply.
Sample of the warning in the APPTrace.log (debug needs to be enabled):
CASPR002W Unknown parameter AutomaticProviderPasswordRefreshInterval (Location:C:\Program Files (x86)\CyberArk\ApplicationPasswordProvider\Env\main_appprovider.conf.Win64.7.20:4)
APPAP315W Parameters file contains at least one unknown parameter. Reason: [CASPR002W Unknown parameter AutomaticProviderPasswordRefreshInterval (Location:C:\Program Files (x86)\CyberArk\ApplicationPasswordProvider\Env\main_appprovider.conf.Win64.7.20:4)]
AutomaticParmsRefreshInterval (default is 3600 seconds, 1 hour. Visible per default in the configuration):
"The frequency in seconds that the Credential Provider will refresh the main configuration file stored on the Credential Provider machine from the file in the Vault."
Official Documentation Reference
Internal Provider user password rotation and login:
The internal Credential Provider user password is rotated every 24 hours per default (not hard coded). This is defined by the AutomaticProviderPasswordRefreshInterval in the configuration file (main_appprovider.conf. <platform>.<version>) inside the AppProviderConf safe.
This is possible to change the AutomaticProviderPasswordRefreshInterval default value. For this, it is necessary to modify also the AutomaticParmsRefreshInterval value.
To apply the changes :
- if only modifying AutomaticParmsRefreshInterval: this requires to restart the Provider service to apply the new value.
- If modifying AutomaticProviderPasswordRefreshInterval and AutomaticParmsRefreshInterval:
It is possible to use the appprvmgr Utility (refreshparms command) available in the Provider installation folder to apply the new value for the AutomaticProviderPasswordRefreshInterval.
For the AutomaticParmsRefreshInterval, restarting the Provider service is still mandatory.
Without restarting the Provider service, in the example below, the internal Provider user password would still be changed every hour when the AutomaticParmsRefresh Background job is kicking in:
AutomaticParmsRefreshInterval=3600 (every hour)
AutomaticProviderPasswordRefreshInterval=1800 (every 30 minutes)
To verify the configuration used by the Provider, the following command can be used :
Command is:
Windows : appprvmgr.exe showparms
UNIX : apprvmgr ShowParms
Example from a Windows Credential Provider:
Expected default behaviors :
Multiple scenarios exist and details are mentioned below. Per default, the internal Provider user password is rotated every 24 hours as stated above.
- Scenario 1 (continuous working DR replication):
When a failover to the Secondary Vault is performed with a working DR replication, the internal users passwords and credential files are in sync.
The Providers will be able to failover automatically except if the Secondary Vault IP is not specified in the vault.ini file.
- Scenario 2 (DR replication was stopped less than 48 hours ago):
When a failover to the Secondary Vault is performed without a replication for less than 48 hours:
- The Credential Provider will try to use the new password (NewPassword / NewSecret) first to connect to the Vault.
- It will print the following error once for each Provider in the italog on the active Vault: ITATS528E Authentication failure for <Provider_User> from station: <ip address> (code: -66).
- The Provider will then try the previous password (Password / Secret) and will be successfully connecting to the Vault.
- Scenario 3 (DR replication was stopped for more than 48 hours):
When a failover to the Secondary Vault is performed without a replication for more than 48 hours:
- The Credential Provider will try to use the new password (NewPassword / NewSecret) first to connect to the Vault.
- It will print the following error once for each Provider in the italog on the active Vault: ITATS528E Authentication failure for <Provider_User> from station: <ip address> (code: -66).
- The Provider will then try the previous password (Password / Secret) and will be also failing with the error ITATS528E Authentication failure for <Provider_User> from station: <ip address> (code: -66).