This documentation is for WSO2 API Manager 1.7.0 View documentation for the latest release.
Encrypting Passwords - API Manager 1.7.0 - WSO2 Documentation

All docs This doc
Skip to end of metadata
Go to start of metadata

Encrypting passwords provides better security and less vulnerability to security attacks than saving passwords in plain text. It is recommended in a production setup. WSO2 API Manager provides a secure vault implementation that encrypts passwords, stores them in the registry, maps them to aliases and uses the alias instead of the actual passwords in configuration files. At runtime, the API Manager looks up aliases and decrypts the passwords. The secure vault is unable to encrypt the passwords of registry resources at the moment.

The steps below explain how to encrypt passwords in different contexts: 

Encrypting passwords in configuration files

  1. Shutdown the server if it is already running. 

  2. Download the file from here and save it in the <APIM_HOME>/repository/conf/security/ folder. It contains all the aliases to different server components. Note that this file is available in the default product packs in the other releases.

  3. Open the file and note that it has several aliases already defined as the alias name and the value where the value is <file name>//<xpath to the property value to be secured>, <true if the XML element starts with a capital letter>. Uncomment the entries you want to encrypt.

  4. Download the file from here and save it in the <APIM_HOME>/repository/conf/security/ folder. It maps the default alias to their plain text passwords in square brackets. Uncomment the ones you want. Note that this file is available in the default product pack in the other releases.

  5. Get the cipher tool from the <APIM_HOME>/bin folder. This script reads the aliases, encrypts their plain-text passwords, and stores them in the secure vault. If you are using the default primary keystore, give  wso2carbon as its password when prompted.

    Tip: By default, the primary keystore, which is <APIM_HOME>/repository/resources/security/wso2carbon.jks is used as the secure vault. If you want to use another keystore or a custom callback class to handle decryption, modify the <APIM_HOME>/repository/conf/security/ file as described in WSO2 Carbon Secure Vault in the WSO2 Carbon documentation.

    On Windows: ciphertool.bat -Dconfigure
    On Linux: sh -Dconfigure
  6. Note that the configuration files are automatically updated with the relevant password alias after running the cipher tool. For example, as the Carbon.Security.KeyStore.Password property is uncommented in this example, after you run the cipher tool, the plain-text password in <APIM_HOME>/repository/conf/carbon.xml file will be replaced by the alias as follows.

        <!-- Keystore password-->
        <Password svns:secretAlias="Carbon.Security.KeyStore.Password">password</Password>

    Tip: As you encrypted the primary keystore's password in this example, you are prompted to enter the primary keystore password every time you start the server.

Encrypting secure endpoint passwords

When creating an API using the API Publisher, you specify the endpoint of its backend implementation in the Implement tab. If you select the endpoint as secured, you are prompted to give credentials in plain-text.

The steps below show how to secure the endpoint's password that is given in plain-text in the UI.

  1. Shut down the server if it is already running and set the element <EnableSecureVault> in <APIM_HOME>/repository/conf/api-manager.xml to true. By default, the system stores passwords in configuration files in plain text because this values is set to false
  2. Define synapse property in the file as follows:
  3. Run the cipher tool available in <APIM_HOME>/binIf on windows, the file is ciphertool.bat. If you are using the default keystore, give  wso2carbon as the primary keystore password when prompted.

    sh -Dconfigure
  • No labels