Encrypting repository passwords with SaveValue
Available in Cognitive Toolkit 2.4.1+
The Cognitive Toolkit offers an easy way to encrypt your repository passwords or secret-keys with the savevalue tool. Your password or secret-key will be encrypted with the industry-standard Microsoft Data Protection and used in place for ANY source setting file referencing a value such as username or password.
Microsoft Data Protection uses your currently authenticated user account to encrypt data. This means the data is only usable by the Windows account used at the time of encryption.
There are multiple tools that looks for a source setting file such as Migrate and Crawl(ContentServer, Sharepoint, box, documentum, exchange, filenet, onedrive)
Encrypting the password
Start by encrypting the password
Open the directory that CognitiveToolkit.exe resides in, in CMD
Run the following command:
CODECognitiveToolkit.exe savevalue
You will be prompted to enter the key name. They key name is used to identify what value you are going to encrypt such as a Content Server Password. For example: we used the key name cspassword
Once you select enter or return on your keyboard. You will now be prompt to enter a value. The value is the password you are encrypting. For example:
Select enter on your or return on your keyboard. You will notice a new file in the Cognitive Toolkit directory called saved-parameters.yaml. This file contains the encrypted password and any other variables you save. Deleting this file will remove any saved parameters
Using the encrypted password in Cognitive Toolkit command
Once the password has been encrypted and saved, it is ready to be used in a source setting file. You will no longer specify password
in the command, the Cognitive Toolkit will recognize that the tool you are using requires the --password parameter and replace it for you.
Example:
Before using savevalue
CrawlContentServer -u http://localhost:9200 -i shiny --database-type oracle --start-node-id 2000 --folders -d 170.15.15.10:1521/xepdb1 --username db_admin --password 12345 --schema otcs
After using savevalue
CrawlContentServer -u http://localhost:9200 -i shiny --database-type oracle --start-node-id 2000 --folders -d 170.15.15.10:1521/xepdb1 --username db_admin --schema otcs
Using the encrypted password in the Cognitive Toolkit source file
Once the password has been encrypted and saved, it is ready to be used in a source setting file. In the source setting file for connecting to other repositories, you can use the stored password (or any other saved parameter) by referencing it with a ~ prefix.
Before using saveparameter
{
"sourceType" : "ContentServer",
"sourceConnectionSettings" : {
"username" : "admin",
"password" : "12345",
"contentServerUrl" : "http://170.15.15.10/otcs/cs.exe",
"otdsUrl" : "http://170.15.15.10:8002/otdsws"
}
}
After using saveparameter
{
"sourceType" : "ContentServer",
"sourceConnectionSettings" : {
"username" : "admin",
"password" : "~cspassword",
"contentServerUrl" : "http://170.15.15.10/otcs/cs.exe",
"otdsUrl" : "http://170.15.15.10:8002/otdsws"
}