Integration with CipherTrust Manager
This section lists the steps to integrate IBM DB2 with CipherTrust Manager.
Prerequisites
This section provides the prerequisites for integration of IBM DB2 with CipherTrust Manager.
Setting up the Environment
You need to set up the environment before starting the integration. Setting up the environment includes the following steps:
Using Root User
Create a work folder where all the certificates, keystore, and config files will be created. This work folder will be owned by DB2 instance user.
mkdir <folder path>
Assign permission to DB2 instance user to the above created work folder.
chown -R <DB2 instance user> <folder path>
After performing the above steps, DB2 instance user should have correct permission on the above created work folder.
To check the permission, try to create a dummy text file inside the above create work folder using the DB2 instance user.
For Example:
(as db2user) cd /opt/wallet/KMIP
(as db2user) touch test.txt
(as db2user) ls -l
Ensure that test.txt
is created.
Note
In this document, we will use:
/opt/wallet/KMIP
as the work folder.db2user
as the DB2 instance user.
Creating a Local Keystore
To create a local keystore, run the following command:
/home/<DB2 instance user>/sqllib/gskit/bin/gsk8capicmd_64 -keydb -create -db <work folder path followed by the local keystore filename> -pw <PASSWORD> -type pkcs12 -stash
For example: /home/db2user/sqllib/gskit/bin/gsk8capicmd_64 -keydb -create -db /opt/wallet/KMIP/clientkeydb.p12 -pw "asdf1234" -type pkcs12 -stash
After executing the above command, ensure that local keystore file (clientkeydb.p12
in this case) is created at the specified location.
Configuration on CipherTrust Manager
To configure the CipherTrust Manager, you need to perform the following steps:
Creating a Domain (Optional)
Perform the following steps on CipherTrust Manager:
Note
This step is optional and needs to be performed only if you want to integrate within a domain.
Navigate to Admin Settings > Domains.
Click Add Domain. The Add Domain page appears.
Specify the following information:
Name - Enter the domain name.
Admins - Select the admins (one or more) from the list available in the drop down. For example, admin.
Parent CA - Select parent CA as root CA.
Allow Subdomain User Management - Select this check box if you want to enable user management in the subdomain through this domain.
Click Save.
Click the current domain name at the top right corner to switch to the newly created domain.
Creating a User
To create a user, perform the following steps:
Log on to the CipherTrust Manager GUI.
Navigate to Access Management > Users.
On the Users page, click Add User.
On the Add User screen, provide the following details:
Full Name
Username
Email
Password
Password Match
For more information on creating a user depending on the selected connection type, refer to Managing Users.
Click Add User. The newly created user is listed on the Users page.
To create a user, perform the following steps:
Note
You can only create users in sub domains if you have enabled Allow Subdomain User Management while creating a domain.
Log on to the CipherTrust Manager GUI with the User you created within the Sub Domain.
Navigate to Access Management > Users.
On the Users page, click Create User.
On the Create User screen provide the following details:
Enter Username.
Enter Password.
Click Create. The newly created user is listed on the Users page.
Assigning User to a Group
Perform the following steps to add user to a group:
Navigate to Access Management > Users.
Select the required User from the list, the respective User details page appears.
Click GROUPS. On the search bar, enter the Key Admins or Key Users group depending on the level of access you want to grant to the user.
Click Add. User is now assigned to the selected Group .
Registering a KMIP Client
You can register a KMIP client on the CipherTrust Manager through:
Auto Registration
Manual Registration
Create a Registration Token using the following steps:
Log on to the CipherTrust Manager in the root domain.
Go to Access Management > Registration Tokens.
Click Add Registration Token.
Copy the Registration Token once it is created.
To enable Auto Registration perform the following steps:
Go to Admin Settings > Interfaces.
Select the desired KMIP interface from the list. The corresponding Interface Details page is displayed.
On the Interface Details page, select Auto Registration checkbox to enable Auto Registration.
Paste the
Registration Token
.Select the mode as TLS, verify client cert, user name taken from client cert, auth request is optional.
Click Update.
Log on to the CipherTrust Manager.
Go to Products > KMIP.
Create Client Profile using the following steps:
Go to Client Profile and click Add Profile.
Add a Profile Name.
Select CN in Username Location in Certificate.
Click Certificate Details.
Paste the content of
client.csr
.Click Save.
Create Registration Token using the following steps:
Navigate to Registration Tokens under Access Management and click Add Registration Token > Begin.
Add a Name Prefix.
Specify a Token Lifetime value along with Certificate Duration, and Client Capacity for the token.
Click Next. You can alternatively click Select CA to proceed further.
Select the CA Type as Local or External depending on the type of CA required.
Select the appropriate CA from the dropdown menu and click Select Profile.
Select the Client Profile from the dropdown which you have created in the above step.
Click Create Token.
Copy the value of the Token created and click Add Token.
Note
If you are using External CA then you can select the external CA which was created using openssl and uploaded on the CipherTrust Manager.
Go to Registered Clients and click Add Client.
Specify client name and paste the Registration Token generated in the above step.
Note
If you are using external CA then you need to paste the signed client certificate in the Client Certificate field.
Click Save to save the client certificate.
You can register a KMIP client on the CipherTrust Manager through:
Auto Registration
Manual Registration
Create a Registration Token in the sub-domain using the following steps:
Log on to the CipherTrust Manager in your specified subdomain.
Go to Access Management > Registration Tokens.
Click Add Registration Token > Begin.
Add a Name Prefix.
Specify a Token Lifetime value along with the Client Capacity for the token.
Copy the value of the Registration Token once it is created.
To enable Auto Registration perform the following steps:
Log on to the CipherTrust Manager in the root domain.
Go to Admin Settings > Interfaces.
Select the desired kmip interface from the list. The respective Interface Detail page appears.
elect Auto Registration.
Paste the
Registration Token
.Select the mode as TLS, verify client cert, user name taken from client cert, auth request is optional.
Click Update.
Log on to the CipherTrust Manager into your domain.
Go to Products > KMIP.
Create Client Profile using the following steps:
Go to Client Profile and click Add Profile.
Add a Profile Name.
Select CN in Username Location in Certificate.
Expand the Certificate Details section.
You can either paste the content of a generated client.csr or you can create one, by filling in the details.
In case of domains, the format to enter the Common Name field for the CSR is:
domainName||domainUser
Click Save.
Create a Registration Token using the following steps:
Go to Registration Token and click New Registration Token > Begin.
Add a Name Prefix.
Specify a Token Lifetime value along with the Client Capacity for the token.
Click Select CA.
Select the CA type as Local/External depending on what you are using.
Select the appropriate CA from the dropdown menu and click Select Profile.
Select the Client Profile from the dropdown which you have created in the above step.
Click Create Token.
Copy the value of the Token created and click Done.
If you are using External CA then you can select the external CA which was created using openssl and uploaded on the CipherTrust Manager.
Go to Registered Clients and click Add Client.
Specify client name and paste the Registration Token generated in the above step.
Note
If you are using external CA then you need to paste the signed client certificate in the Client Certificate field.
Click Save to save the client certificate.
Configuring the KMIP Interface
The KMIP interface can be configured through:
Go to Admin Settings > Interfaces.
On the KMIP Interface, click the ellipsis button (...) and then click View/Edit.
Select the Auto Registration checkbox if you auto-registered your KMIP client and paste the value of the registration token that you created.
Note
By default, Auto Registration is disabled.
Select the mode as TLS, verify client cert, user name taken from client cert, auth request is optional.
Specify selections for Local CA for Automatic Server Certificate Generation as desired.
Note
Local CA for Automatic Server Certificate Generation should be set to Turn off auto generation from Local CA in case of External CA.
Select the CA according to your preference:
If you are using External CA then select the CA under External Trusted CAs
If you are using Local CA then select the CA under Local Trusted CAs
If you are using an External CA, expand the Upload Certificate section:
In the Certificate field, paste the contents of Server Certificate, CA, and Server Key file in the same order. Do not introduce any space or character or symbol between the contents of these files.
Select certificate Format as PEM.
Password field is optional and can be skipped.
Click Update.
Switch to Root Domain.
Go to Admin Settings > Interfaces.
On the KMIP Interface, click the ellipsis button (...) and then click View/Edit.
Select the Auto Registration checkbox if you auto-registered your KMIP client and paste the value of the registration token that you created.
Note
By default, the Auto Registration is disabled.
Select the mode as TLS, verify client cert, user name taken from client cert, auth request is optional.
Specify selections for Local CA for Automatic Server Certificate Generation as desired.
Note
Local CA for Automatic Server Certificate Generation should be set to Turn off auto generation from Local CA in case of External CA.
Select the CA according to your preference.
Login to your sub-domain. Go to CA > Local. Click the ellipsis (...) and copy the contents of your CA Certificate.
Logout of your sub-domain and now login to the root domain.
Go to CA > External > Add External CA.
Enter a name for this Domain CA and select the text radio button and paste the certificate contents.
Click Add External CA.
Go to Admin Settings > Interfaces.
Click the Add icon to add the External CA.
Click Update.
Note
If you are using an External CA in the root Domain, you need to add the CA as an External CA in both the root domain as well as the sub-domain and modify the interface accordingly.
Go to Admin Settings > Interfaces.
Click the Add icon to add the External CA.
Click Update.
On the KMIP interface, click the ellipsis (...) > Certificate Options > Upload New Certificate > Ok.
Select the Certificate Chain option and click Build Certificate Chain.
Click on Text and paste the contents of Server Certificate, CA, and Server Key file in the same order. Do not introduce any space, character or symbol between the contents of these files.
Select certificate Format as PEM.
Click on Upload Certificate.
Configuration on IBM DB2
Generating Master Encryption Key in the CipherTrust Manager
To generate the Master Encryption Key in the CipherTrust Manager, perform the following steps:
Create a centralized KeyStore.
To store a Master Encryption Key in CipherTrust Manager for a DB2 native encryption, you need to create a configuration file that contains all details about this centralized KeyStore i.e. the CipherTrust Manager.
In the work folder (/opt/wallet/KMIP) of the DB2 server, create kmip.cfg file with the following details:
VERSION=1 PRODUCT_NAME=KEYSECURE ALLOW_KEY_INSERT_WITHOUT_KEYSTORE_BACKUP=true SSL_KEYDB=/opt/wallet/KMIP/clientkeydb.p12 SSL_KEYDB_STASH=/opt/wallet/KMIP/clientkeydb.sth SSL_KMIP_CLIENT_CERTIFICATE_LABEL=DB2_CLIENT_CERT ALLOW_NONCRITICAL_BASIC_CONSTRAINT=false MASTER_SERVER_HOST=IP of CM MASTER_SERVER_KMIP_PORT=<port for KMIP interface> CLONE_SERVER_HOST= CLONE_SERVER_KMIP_PORT=
where:
SSL_KEYDB (Required): Absolute path and name of the local keystore file that holds the SSL certificates for communication between DB2 server and the CipherTrust Manager.
SSL_KEYDB_STASH (Optional): Absolute path and name of the stash file for the local keystore that hold the certificates for communication between DB2 server and the CipherTrust Manager.
SSL_KMIP_CLIENT_CERTIFICATE_LABEL (Required): The label of the SSL certificate for authenticating the client during communication with the CipherTrust Manager.
MASTER_SERVER_HOST is the CipherTrust Manager IP.
MASTER_SERVER_KMIP_PORT is the KMIP interface Port in the CipherTrust Manager.
Configure a DB2 instance to use CipherTrust Manager as centralized keystore.
Enter into DB2 command line using the db2 command with the DB2@instance user.
Update the keystore to point to our new config file kmip.cfg.
db2 => update dbm cfg using keystore_location <file path>/kmip.cfg db2 => update dbm cfg using keystore_type kmip
Stop and Start the database.
db2 => db2stop db2 => db2start
Creating an Encrypted Database
To create an encrypted database you need to add the parameter encrypt in the create database command.
db2 => create db <database_name> encrypt
For Example: db2 => create db myencdb encrypt
Note
In the above example, an encrypted database myencdb is created. This database is using the native encryption of DB2.
After executing the above command, a master encryption key is created in the CipherTrust Manager.