Overview
PhixFlow expects to use a keystore for:
- a pepper string, which PhixFlow will add to local user passwords when encrypting them
- the database username and password.
The pepper string and database account credentials are encrypted and stored here, along with their aliases. You can then use an alias to retrieve each secret from the keystore.
To configure the keystore, use the Java keytool -importpass
command at the command line. In the following examples, we have used
- a file type of PKCS12. You can also use JCEKS.
- a keystore name of keystore.jks. If you use a different name for the keystore, you must update its name in the phixflow-secret.xml configuration file.
- Adding Data to a Keystore for the command syntax and how the keystore works
- Understanding Password Encryption for information about the pepper string and how to ensure user security information is migrated to use the most secure encryption
- Considerations for Pepper Strings for whether or not to use different pepper keys for different instances.
Panel | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
|
Tip |
---|
When you run the keytool -importpass command, it always prompts for a "password". This is because the keytool does not distinguish between the secrets that it stores. At the prompt, enter the actual value you want to store securely. |
Create the keystore and add the pepper string and its alias
Note |
---|
The following commands assume you have set the environment variable JAVA_HOME. If you do not, you can set it in your current session following the command examples:
Alternatively, replace JAVA_HOME in the commands below with the base installation directory of Java. |
- Run the
-importpass
command, specifying the alias:pepperKey
The alias is case-sensitive and must match phixflow-instance.xml:
If you use a different alias, update phixflow-instance.xml to use the same alias.<prop key="pepperKey">pepperKey</prop>
When prompted, enter the password you want to set for the keystore file, then re-enter to confirm it.
Keep a secure record of this password.Tip If you are following these instructions to upgrade PhixFlow, and your keystore already exists, in step 2 enter the password for your keystore.
See also: Adding Data to a Keystore- When prompted for the password, enter the string you want to use to pepper user passwords.
We recommend this string has the same characteristics as a password. For example it should be a random string containing at least 6 letters, numbers and special characters.
Keep a secure record of the pepper key.
Code Block | ||
---|---|---|
| ||
"%JAVA_HOME%\bin\keytool" -importpass -alias pepperKey -keystore C:\secure\keystore.jks -storetype PKCS12 |
Code Block | ||
---|---|---|
| ||
&"$env:JAVA_HOME\bin\keytool.exe" -importpass -alias pepperKey -keystore C:\secure\keystore.jks -storetype PKCS12 |
Code Block | ||
---|---|---|
| ||
$JAVA_HOME/bin/keytool -importpass -alias pepperkey -keystore /opt/secure/keystore.jks -storetype PKCS12 |
Add Database Credentials
Step 1 Add the database username
1.1 Run the -importpass
command, specifying the alias username for the PhixFlow database, for example phixflow-database-user
.
1.2 When prompted, enter the keystore password.
1.3 When prompted for the password, enter the actual username for the PhixFlow database, for example phixflow
.
Code Block | ||
---|---|---|
| ||
"%JAVA_HOME%\bin\keytool" -importpass -alias phixflow-database-user -keystore C:\secure\keystore.jks -storetype PKCS12 |
Code Block | ||
---|---|---|
| ||
&"$env:JAVA_HOME\bin\keytool.exe" -importpass -alias phixflow-database-user -keystore C:\secure\keystore.jks -storetype PKCS12 |
Code Block | ||
---|---|---|
| ||
$JAVA_HOME/bin/keytool -importpass -alias phixflow-database-user -keystore /opt/secure/keystore.jks -storetype PKCS12 |
Step 2 Add the database password and alias to the keystore file
2.1. Run the -importpass
command specifying the alias password for the PhixFlow database, for example phixflow-database-password
.
2.2 When prompted, enter the keystore password.
2.3 When prompted for the password, enter the actual password for the PhixFlow database.
Code Block | ||
---|---|---|
| ||
"%JAVA_HOME%\bin\keytool" -importpass -alias phixflow-database-password -keystore C:\secure\keystore.jks -storetype PKCS12 |
Code Block | ||
---|---|---|
| ||
&"$env:JAVA_HOME\bin\keytool.exe" -importpass -alias phixflow-database-password -keystore C:\secure\keystore.jks -storetype PKCS12 |
Code Block | ||
---|---|---|
| ||
$JAVA_HOME/bin/keytool -importpass -alias phixflow-database-password -keystore C:\secure\keystore.jks -storetype PKCS12 |
Step 3 Configure phixflow-datasource.xml
Edit phixflow-datasource.xml to add the aliases for the PhixFlow database username and password. For example:
Code Block |
---|
<property name="username"> <value>phixflow-database-user</value> </property> <property name="password"> <value>phixflow-database-password</value> </property> |
Step 4 Set the Environment Variable
Note |
---|
We recommend that you use an environment variable for the keystore password, as it provides additional security. |
Create an environment variable with the form <variable-name>:
<keystore-password>
In Windows | In Linux | |
---|---|---|
<variable-name> | In Windows: In the environment variable, specify any variable name you choose. | Use the For information about how to set environment variables in Linux, see: |
<keystore-password> | Specify the password for the keystore. |
Warning |
---|
Never add the keystore password to the profile for the Tomcat user. |
Step 5 Configure phixflow-secret.xml
Copy phixflow-secret.xml.example to phixflow-secret.xml and edit it to set the values as follows:
Required? | Property | Value | Example |
---|---|---|---|
Required | keystoreType | The type of the keystore, either PKCS12 or JCEKS |
|
Required | keystoreFile | The path to the keystore. |
|
Either (recommended) | keystorePassEnvironmentVariable | The name of the environment variable. Use |
|
Or | keystorePass | The password for the keystore. Use |
|
Warning |
---|
On startup, PhixFlow checks that there is one password mechanism, either |