Replace a Compromised Secure Credential Store
The following steps describe how to replace a secure credential store. It assumes the following:
- You have a single-tenant Controller installation.
- You know the plain-text value of your Account Access Key. You can view the access key in the Controller under Settings > License.
As detailed in the sections that follow, the steps are broken into these parts:
-
Create a new secure credential store.
-
Update the Controller with the password of the new secure credential store.
-
Update the account access key.
-
Update the account access key for the system account.
-
Restart the Controller and update passwords.
Create a new Secure Credential Store
-
Rename the existing secure credential keystore file.
-
Initialize a new secure credential keystore using the secure credential store utility. By default the utility installs to:
<controller_home>/tools/lib/scs-tool.jar
For example:/controller/jre8/bin/java -jar ./scs-tool.jar generate_ks -filename '<controller_home>/.appd.scskeystore' -storepass 'MyCredentialStorePassword'
Successfully created and initialized new KeyStore file: /opt/appdynamics/Controller/.appd.scskeystore Verification - New KeyStore file: /opt/appdynamics/Controller/.appd.scskeystore is properly initialized.
Update the Controller with the new Secure Credential Store Password
-
Shut down the Controller.
-
Obfuscate the password you used to initialize the secure credential keystore:
/controller/jre8/bin/java -jar <controller_home>/tools/lib/scs-tool.jar obfuscate -plaintext '<Secure_Credential_Store_Password>'
/controller/jre8/bin/java -jar /opt/appdynamics/Platform/controller/tools/lib/scs-tool.jar obfuscate -plaintext 'MyCredentialStorePassword'
s_gsnwR6+LDch8JBf1RamiBoWfMvjjipkrtJMZXAYEkw8=
-
Log in as the root user:
<controller_home>/bin/controller.sh login-db
Note: On Windows, use controller.bat. -
Update the secure credential keystore password to the newly obfuscated password:
UPDATE global_configuration_cluster SET value = '<obfuscated_secure_credential_keystore_password>' WHERE name = 'scs.keystore.password';
Update the Account Access Key
-
Log in as the root user:
<controller_home>/bin/controller.sh login-db
Note: On Windows, use controller.bat. -
Update the account access key for the account to the plain text string. When the Controller starts, it will encrypt the account access key:
UPDATE account SET access_key = '<plain_text_account_access_key>', encryption_scheme = NULL WHERE id = <account_id>;
Note: You can get the account id by running the following query:select id account_id,name account_name,access_key,encryption_scheme from account;
-
Only if you changed the plain text value of the account access key. Update the account access key for the agent users:
UPDATE user SET encrypted_password = SHA1('<plain_text_account_access_key>') WHERE account_id = <account_id> AND name = 'singularity-agent';
Note: The access ey belongs to the "customer1" account in a single-tenant Controller and the "default" account in a multi-tenant Controller. In addition,account_id
is the account id of the "customer1" account in a single-tenant Controller and the "default" account in a multi-tenant Controller. -
If you have default license rules, update the account access key using
v1_license_rules
API.Warning: For earlier Controller versions, you must use browser tools to migrate license rules.
Update the Account Access Key for the System Account
-
Generate the new access key for the system account:
../jre/1.8.0_152/bin/java -jar ./tools/lib/scs-tool.jar encrypt -filename ./.appd.scskeystore -storepass 'REPLACE_TO_NOT_OBFUSCATED_STOREPASS_VALUE' -plaintext 'NEW_SYSTEM_ACCOUNT_ACCESS_KEY'
-
Once you have generated the system account access key:
-
Edit he
controller-info.xml
file to add your specific information:<controller-dir>/appserver/jetty/appagent/verX.X.X.X/conf/controller-info.xml
-
Edit the
credential-store-password
value with the obfuscatedstorepass
value. -
Edit the
account-access-key
with new encrypted access key value. -
Run SQL:
update account set access_key='ENCRYPTED_SYSTEM_ACCOUNT_ACCESS_KEY' where id=1; update mds_auth.account set access_key='ENCRYPTED_SYSTEM_ACCOUNT_ACCESS_KEY' where id='00000000-0000-0000-0000-000000000001'; update mds_auth.account set access_key='ENCRYPTED_SYSTEM_ACCOUNT_ACCESS_KEY' where id='00000000-0000-0000-0000-000000000002';
-
Update the account access key for the agent users.
UPDATE user SET encrypted_password = SHA1('<plain_text_system_account_access_key>') WHERE account_id = <system_account_id> AND name = 'singularity-agent';
-
Stop
appserver
. -
Start
appserver
.
-
Restart the Controller and Update Passwords
-
Restart the Controller.
-
Log in to the Controller as a user with the following permissions:
- Administer users, groups, roles, authentication, etc.
- Configure Email / SMS.
-
As necessary, re-enter the following passwords:
- LDAP authentication user password. See LDAP Authentication.
- Database collector credentials:
- database user password. See Add a Database Collector.
- machine user password. See Configure the Database Agent to Monitor Server Hardware.
- SMTP server / Email password. See Enable an Email Server.