Introduction
- The Credential Store (CS) allows sensitive data to be encrypted and stored securely and independently of the application(s) such as YADE and the JobScheduler YADE JITL Jobs that use this data.
- The advantage of using a CS is that the CS stores sensitive information such as credentials in a standardized, secure and fully encrypted database and sensitive authentication information is not exposed in use. Applications access the CS database by using password, encryption-key file or a combination of both.
- The CS requires the use of a
.kdb
or.kdbx
database and the installation of a kdb-compatible user interface such as "KeePass", "KeePass 2" or "KeePass-X".
Scope
This article describes the use of the Credential Store with the YADE Client and describes a relatively simple configuration to allow users to get a working example up and running.
This description provided in this article also applies for the configuration of a settings file and Credential Store to enable the use of the Credential Store with the YADE JITL job.
Feature Summary
The Credential Store provides the following features:
- Storage of configuration information for use in a jump host / DMZ. FEATURE AVAILABILITY STARTING FROM RELEASE 1.12.2
Example Description
The example presented in this article illustrates the configuration and use of the Credential Store in a simple file transfer operation that is carried out with the YADE Client.
The file transfer operation is based on the file transfer example described in The YADE Client Command Line Interface - Tutorial 1 - Getting Started article. The tutorial describes the configuration required to download a number of files from an online server provided by the SOS GmbH and save these files on the user's local file system. Using this server means that users can get a working example up and running with a minimum of effort. A simplified version of the configuration used in the tutorial (only specifying transfer by FTP) is available as a download: sos-berlin_demo_2_local.xml.
In the current example, the Credential Store is to store configuration information for the online server - i.e. for the file transfer source. The principle described can be equally well used for the configuration of multiple file transfer source, target, proxy and jump-host servers and for the other file transfer protocols that can be used by the YADE Client.
Note that a YADE Client is required to carry out the example file transfer. Instructions for installing and configuring the YADE Client can be found in the YADE - Tutorials article.
Configuration Procedure
Installing the Credential Store and configuring the database
KeePass 2 has been used in the current article to implement the Credential Store database. The installation and use of KeePass is described on the KeePass Web Site.
Feature Availability
FEATURE AVAILABILITY STARTING FROM RELEASE 1.12.2
All Credential Store features such as secure, compliant and password-free use of the Credential Store as well as compatibility with Keepass .kdb
databases require the YADE Client in version 1.12.2 or newer.
Database Configuration
Credential Store databases are stored as a file on the file system.
For the examples described in the current article the following database was configured (on a Windows system):
- Path:
%USERPROFILE%\jade_demo\keepass\demo_cred_store.kdbx
- Master Password:
sos
Note that a Master Key file (not used in the example below) can be generated using the Files/Change Master Key KeePass menu option and then selecting the Show expert options checkbox.
Adding the configuration information to the Credential Store
Configuration information is stored in the Credential Store as an Entry and Entries can be organized into Groups.
The following information can be stored in a CS Entry:
- Title: The identifier for the Entry, this could be a string containing, for example, the host name/server name.
- User name: The user identification of a user account who is authenticated for the operation.
- Password: Assigned password for a user account or passphrase for a private key.
- URL: The host name/server name or IP address of the server.
- Notes: This block can be used to specify additional parameters for the file transfer.
- File Attachment & Custom Fields: Files such as PGP or SSH private keys can be stored as attachments.
- A first attachment is specified as an attachment .
- Further attachments are specified using my_custom_field parameters.
YADE will retrieve the contents of an attached file at run-time - intermediate or temporary files are not created when reading attachments.
Note that attachments are specified in the KeePass GUI via the AdvancedEdit Entry tab.
The following information needs to be specified for the current example:
- Groups:
demo,ftp
(optional) - Title:
demo_on_test.sos-berlin.com
- User name:
demo
- Password:
demo
- URL:
test.sos-berlin.com
(Alternatively, the IP address could have been specified here.)
The following screenshot shows that two Groups have been configured for the current example, named "demo" and "ftp", along with the Entry "demo_on_test.sos-berlin.com".
The next screenshot shows the configuration of the parameters in the "demo_on_test.sos-berlin.com" Entry:
Integrating the Credential Store in a File Transfer Configuration
The use of the Credential Store is specified in YADE Client file transfer configuration files, which are written in XML. We recommend using the SOS XML Editor to edit these files. Instructions for downloading, installing and using the XML Editor are linked from this page.
In the remainder of the current article, it is assumed that readers have made themselves familiar with the organization of the YADE Client file transfer configurations into Profiles and Fragments. This is described in The YADE Client Command Line Interface - Tutorial 1 - Getting Started article mentioned above.
The current example uses the XML configuration from the Getting Started tutorial article above and describes the necessary configuration elements required to move the sensitive information such as user name and password from the XML file to the Credential Store. Users wishing implement the current example should download the tutorial file transfer configuration file linked above and open it in their XML Editor, where they can then add the necessary configuration information.
The information required to use the Credential Store falls into two "areas":
- Information about the Credential Store itself (location, how to access its contents, etc.).
This information is configured in the XML file in a CredentialStoreFragment. - Information about how the information in the Credential Store (server address, password, etc.) is to be accessed for the file transfer.
This information is stored as a string in each of the relevant XML ProtocolFragment child elements (Hostname, Account. etc.).
In addition, the ProtocolFragment element has a reference specifying that the Credential Store is to be used.
Specifying the Credential Store
The following list shows the organization of the XML elements required to specify the Credential Store. These elements and their attributes are shown in full in the XML Editor screenshot below.
Fragments
ProtocolFragments
FTPFragment name
="ftp_demo_sos-berlin_cs"- ....
CredentialStoreFragmentRef
ref ="ftp_demo"
CredentialStoreFragments
CredentialStoreFragment
name ="ftp_demo"CSFile file path
%USERPROFILE%\jade_demo....CSAuthentication
PasswordAuthentication
- ...
CSEntryPath
Profiles
- ...
Addressing the information in the Credential Store
Parameters stored in a Credential Store database Entry can be addressed in the CredentialStoreFragment XML element as follows:
- The CSEntryPath element is used to specify the base path in the Credential Store database to the Entry.
In the current example this would be set to:demo/ftp/
demo_on_test.sos-berlin.com
wheredemo
andftp
are (optional) Group names, as already mentioned, anddemo_on_test.sos-berlin.com
is the Title of the KeePass database Entry.
The Credential Store Entry parameters are addressed using one of the following syntaxes:
- relative:
cs://@parameter_name
, where the parameter_name is the name of the relevant parameter specified for the Entry - for example, url and the CSEntryPath element is filled as shown above
- fully specified:
cs://
, and where the CSEntryPath element, which is a required element, is left blankdemo/ftp/
@parameter_namedemo_on_test.sos-berlin.com
The following parameters are fully specified in the Credential Store in the current example:
- Hostname:
cs://
(wheredemo/ftp/
@urldemo_on_test.sos-berlin.com
@url
specifies the URL element stored in the database ) - Account:
(wherecs://
demo/ftp/
@userdemo_on_test.sos-berlin.com
@user
specifies the User name element stored in the database) - Password:
(wherecs://
@passworddemo/ftp/
demo_on_test.sos-berlin.com
@password
specifies the Password element stored in the database)
Note that a full list of parameters is described in the Adding an Entry to the Credential Store section above.
Configuration in the XML Editor
The parts of the XML configuration relevant to the use of the Credential Store are shown in the following screenshot of the configuration for the current example, with parameter values highlighted according to their function:
The Transfer Target Directory
As can be seen in the screenshot above, the CopyTarget.Directory parameter is by default set for a Windows environment and set to:
${USERPROFILE}\jade_demo\transfer_receive
Depending on their operating system, users may find it necessary to modify this attribute before running the example.
XML Listing
The following code block can be opened to show the full XML configuration for the example:
Running the YADE Client with the Credential Store
The use of the Credential Store is contained within the settings file and is not exposed when calling the YADE Client. For example, on Windows systems, the YADE Client is called for the current example using:
C:\Program Files\sos-berlin.com\jade\client\bin>jade.cmd -settings="%USERPROFILE%\jade_demo\sos-berlin_demo_2_local_cs.xml" -profile="ftp_server_2_local_cs"
After the YADE command has finished execution the number of files transferred can be read from the log file.
Note that the log files neither indicate that a credential store has been use for the transfer nor reveal any passwords.
Download Example
A download is available containing a full XML configuration file for Windows users and .kdbx
database: jade_demo.zip
Windows users with the necessary permissions will be able to use these files by unpacking the zip file to a jade_demo
folder in their User directory.
Users of other operating systems may have to make minor configuration changes.
Advanced Configuration
Key File Authentication
Key file authentication can be used for the Credential Store either alone or together with the password authentication described in the example above.
This option allows the the Credential Store to be used completely securely, yet without passwords, if required.
Key file authentication has to be configured for the Credential Store and in the XML settings file.
Configuring key file authentication for the Credential Store
KeePass provides a Create Composite Master Key function that is reached with the Files / Master Key... menu item. screen
The Create Composite Master Key function is shown in the following screenshot (Note that the Show expert options checkbox has to be selected first.):
Note also that the Master Password checkbox should not be selected if key file authentication is to be used without a master password.
The entropy of the key generated can be increased as part of the key creation procedure. This is done as part of the key generation procedure in the interface shown in the next screenshot.
For the purpose of this article the key has been saved in the jade_demo
folder used for the download example.
The next section describes the configuration of the XML settings file to include a reference to this file.
Configuring key file authentication in the XML settings file
Key file authentication is configured in the XML settings file by specifying a KeyFileAuthentication element as a child of the CSAuthentication element in the Credential Store fragment.
The key file element can be added either instead of or alongside a password authentication element as required.
This is shown in the following list:
CredentialStoreFragments
CredentialStoreFragment
name ="ftp_demo"CSFile file path
%USERPROFILE%\jade_demo....CSAuthentication
PasswordAuthentication
- .
CSPassword
password
- .
KeyFileAuthentication
CSKeyFile
path to key file ....
CSEntryPath
demo/ftp/....
See Also: