keytool -importpass -alias db1pass -keystore /opt/secure/secure.jks -storetype PKCS12
keypass
x34!2axf |
|
Changing Keystore Entries
It is not possible to change a username or password when it is in the keystore. Instead, you have to:
- delete the entry using the
keytool -delete
command; see Keystore Syntax, above. - add a different username or password using the
keytool -importpass
command, using the same alias.
For the commands, see Keystore Syntax, above.
Tip |
---|
If you change an alias, remember to update any configuration files that use the alias. |
If you are running more than one PhixFlow instance, you may have a keystore for each instance. In this case, you can use the same alias in each keystore. For example, each keystore can have a "pepperKey" or "databasePassword".
If you are using one keystore for multiple PhixFlow instances, then each instance must have a unique alias. It is good practice for the alias to clearly indicate the instance. For example if you have separate Production and Development instances you could use the aliases:
- ProdDatabasePassword, DevDatabasePassword
- ProdPepperKey, DevPepperKey.
Remember to update phixflow-instance.xml to refer to the pepper alias you set in the keystore.
Understanding How PhixFlow Uses A Keystore
PhixFlow has a secret service wrapper that it uses to communicate with the keystore. The configuration file webapp/WEB-INF/classes/phixflow-secret.xml
tells Phixflow where to find the keystore file and its password. PhixFlow periodically checks the keystore based on the retryDelay
. This defaults to 10 seconds, set in milliseconds. This means PhixFlow can use updated information in the keystore without requiring a Tomcat restart.
Example: Accessing the PhixFlow Database
This example illustrates how PhixFlow uses a keystore to access its own database.When PhixFlow is running, it provides the account credentials to its database as follows:
- phixflow-datasource.xml stores alias credentials for the database. It requests actual credentials from phixflow-secret.xml.
- phixflow-secret.xml asks the keystore for the actual credentials.
- The keystore password is configured as an environment variable This file stores the location of the keystore file and optionally its password (2a in the diagram below).
- Alternatively, phixflow-secret.xml stores the location of the keystore file and optionally its password (2b in the diagram below)
- The keystore file returns the actual account credentials to phixflow-secret
- which, in turn, passes the actual credentials to phixflow-datasource.xml.
- phixflow-datasource.xml then uses the actual credentials to log into the database, so that PhixFlow can update it.
This is shown in the diagram below.