Page History
...
The first step is to update the
cipher-tool.properties
file and thecipher-text.properties
file with information of the passwords that you want to encrypt.Open the
cipher-tool.properties
file stored in the<PRODUCT_HOME>/repository/conf/security
folder. The file should contain information about the files in which the passwords (that require encryption) are located as shown below:Code Block <alias>=<file_name>//<xpath>,<true/false>
For example, if you want to encrypt the admin user password in the
user-mgt.xml
file, the following should be added to thecipher-tool.properties
file:Code Block UserManager.AdminUser.Password=repository/conf/user-mgt.xml//UserManager/Realm/Configuration/AdminUser/Password,false
Info Either the relative path or the absolute path of each file starting from
<PRODUCT_HOME>
should be given. The last value that follows the file path is set to 'true' or 'false' indicating whether or note the value to be encrypted is an attribute.Open the
cipher-text.properties
file stored in the<PRODUCT_HOME>/repository/conf/security
folder. This file should contain the secret alias names and the corresponding plain text passwords (enclosed within square brackets) as shown below.Code Block <alias>=[plain_text_password]
For example, if you want to encrypt the admin user password in the
user-mgt.xml
file, the following should be added to thecipher-tool.properties
file:Code Block UserManager.AdminUser.Password=[admin]
Info By default, the
cipher-tool.properties
file and thecipher-text.properties
file files that is are shipped with your product pack will contain information on the most common passwords that require encryption. If a required password is missing in the default files, you can add them manually. For example, if you want to encrypt a the password that is used to connect to an LDAP user store connection password (configured in theuser-mgt.xml
file), add the following:Add a new entry to the
cipher-tool.properties
file as shown below. Note that the<alias>
value should be the same value that is hard coded in the relevant Carbon component. In the case of user store connection password, there are two possible alias values as shown below.Using the
UserStoreManager.Property.ConnectionPassword
alias:Code Block UserStoreManager.Property.ConnectionPassword=user-mgt.xml//UserManager/Realm/UserStoreManager/Property[@name='ConnectionPassword'],true
Using the
UserManager.Configuration.Property.ConnectionPassword
alias:Code Block UserManager.Configuration.Property.ConnectionPassword=user-mgt.xml//UserManager/Realm/UserStoreManager/Property[@name='ConnectionPassword'],true
Add a new entry to the
cipher-text.properties
file corresponding to the new entry in thecipher-tool.properties
file:Code Block //Use the alias corresponding to the value in the cipher-tool.properties file. #UserStoreManager.Property.ConnectionPassword=[password] #UserManager.Configuraton.Property.ConnectionPassword=[password]
Save the information.
Open a command prompt and go to the
<PRODUCT_HOME>/bin
directory, where the cipher tool scripts (for Windows and Linux) are stored.Execute the cipher tool script from the command prompt using the command relevant to your OS:
On Linux:
./ciphertool.sh -Dconfigure
On Windows:
./ciphertool.bat -Dconfigure
The following message will be prompted: "[Please Enter Primary KeyStore Password of Carbon Server :]". Enter the keystore password (which is "
wso2carbon
" for the default keystore) and proceed. If the script execution is successful, you will see the following message: "Secret Configurations are written to the property file successfully".Note If you are using the cipher tool for the first time, the
-
Dconfigure
command will first initialize the tool for your product. The tool will then start encrypting the plain text passwords you specified in thecipher-text.properties
file.Shown below is an example of an alias and the corresponding plain text password (in square brackets) in the
cipher-text.properties
file:Code Block UserManager.AdminUser.Password=[admin]
If a password is not specified in the
cipher-text.properties
file for an alias, the user needs to provide it through the command line. Check whether the alias is a known password alias in Carbon configurations. If the tool modifies the configuration element and file, you must replace the configuration element with the alias name. Define a Secret Callback in the configuration file and add proper namespaces for defining the Secure Vault.- Now, to verify the password encryption:
Open the
cipher-text.properties
file and see that the plain text passwords are replaced by a cipher value.Open the
secret-conf.properties
file from the<PRODUCT_HOME>/repository/conf/security/
folder and see that the default configurations are changed.
...