[Download] | [Documentation Home] | [Release Note]

Secure Passwords in DataService Configuration

Introduction

WSO2 Data Services Server provides the feature to securely store sensitive data such as password fields using the Secure Vault functionality. Users can encript their passwords using tokens instead of the actual password inside the data service configuration file. This guide will explain you how to secure your password in data-source configuration.

Step 1 - Run ciphertool script from bin directory
Linux: sh ciphertool.sh -Dconfigure
Windows: ciphertool.bat -Dconfigure

Step 2 - Encrypt the plain text using ciphertool

Again run the ciphertool script without '-Dconfigure'. It will ask for the KeyStore Password of Carbon Server. The default value of the KeyStore password is 'wso2carbon'. Then provide the plain text value that need to be encrypted. It will return you the encrypted text value.

DS

Figure 1: Encrypt plain text value using ciphertool

Step 3 - Update the cipher-text.properties file by adding new alias and encrypted value

cipher-text.properties file is located at {DSS_HOME}/repository/conf/security/ directory. Open this file and add alias name and encripted value.(alias name can be any name as you preferred.)
Eg: DSS.Samples.DB.Pwd=d6RmzIGebavMJULd1F2FBjIz0jKw469xwB7LRZF8q50alZ+wr6ueQOGudXz/csK5/srP3us2aI9w\nm/mW+j/P+lWad3g7kgah8koBxSxfM/W911vl9ipcndxfBl4tT0gi/AS1PEqzOhdrI34mrrEiOId7\nov/aWbQ7fm6ChAOz6Ak\=

Step 4 - Use alias inside .dbs file

In 'Add Data Source' page, you need to enable the flag 'Use as Scret Alias' and provide the alias name instead of actual password in 'Password' filed.

DS

Figure 2: Enabling 'Scret Alias' flag and providing Alias name

This will add the namespace and alias to the .dbs file as follows.

DS

Figure 3: .dbs configuration