Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Create a custom hibernate file which accesses the Database accounts, password, and URL from the Credential Store.

Parameter String to retrieve the data from Credential Store

The SOSKeePassDatabase class uses a parameter string that holds a URI and a number of query parameters:

URI

cs://<entry_path>@<property_name> - required 

...

  • file - required 
    the path to the credential store database file. This file can be stored anywhere in the file system.

  • password - optional 
    the password for the credential store database file. 
    It is recommended not to use this parameter and instead to use a key_file to access the credential store.

  • key_file - optional, default: <credential_store_database_filename_without_extension>.key 

For detailed information about query parameter Query Parameters.

...

Refer to the Knowledge base article Using a Credential Store for Jobs#Syntax for detailed description.

Syntax for hibernate Configuration files

The hibernate configuration file is introduced with different elements (property options) which can be used to retrieve the information from Credential Store.

It provides two types of syntax:

Full Syntax

The Full syntax used in the hibernate file to access the credentialsis used when the complete URI is to be used with each property element of the Hibernate configuration file. The following syntax can be used to retrieve the information from Credential Store: 

  • <property name="hibernate.connection.passwordusername">cs://<entry_path>@user?file=some/path/database.kdbx<<path to database kdbx file></property> 
  • <property name="hibernate.connection.password">cs://<entry_path>@password?file=some/path/database.kdbx<<path to database kdbx file></property>
  • <property name="hibernate.connection.url">cs://<entry_path>@url?file=some/path/database.kdbx<<path to database kdbx file></property>

Alternatively, use the short syntax in the hibetnate file : 

  • <property name="hibernate.connection.username">cs://@user</property> 
  • <property name="hibernate.connection.password">cs://@password</property> 
  • <property name="hibernate.connection.url">cs://@url</property>

Short Syntax

The Short syntax is used when the credential store items are to be used in the hibernate configuration to provide the details about the credential store       Inroducing new hibernate configuration credential store items for the Short syntax:

  • <property name="hibernate.sos.credential_store_file">some/path/database.kdbx</property>  → Stores the path to the credential store file
  • <property name="hibernate.sos.credential_store_key_file">some/path/database.key</property>  → Stores the path of the key file to open the credential store
  • <property name="hibernate.sos.credential_store_password">some password</property>  → Stores the password of the credential store file
  • <property name="hibernate.sos.credential_store_entry_path">/some/entry/path</property> → specifies the directory structure and entry name in the credentials store file.

After adding the credential store items in the hibernate configuration file the database information can be retrieved from the credential store by using following property element: 

  • <property name="hibernate.connection.username">cs://@user</property> 
  • <property name="hibernate.connection.password">cs://@password</property> 
  • <property name="hibernate.connection.url">cs://@url</property>     


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Save the custom hibernate.cfg.xml file on any location and assign the path of the hibernate file in the job parameter. 

...