To store master keys in a centralized keystore with Db2 native encryption,
you need to set up TLS communication between
the Db2 instance
and the centralized KMIP key manager.
About this task
- On the Db2
server, the gsk8capicmd_64 command is used to create, extract, and add TLS certificates to the
local keystore. For detailed information about the command, see: GSKCapiCmd User
Guide.
- Some examples below show self-signed certificates. Self-signed certificates are suitable for test environments, but for production environments certificates that are signed by third party certificate authorities are more appropriate.
- Some information about using the IBM® Security Key
Lifecycle Manager web interface and command line interface is included below. For more complete
information, see: Setup for TLS handshake between IBM
Security Key Lifecycle Manager server and client device .
Procedure
-
On the Db2
server: create an TLS signer
certificate.
-
Create the certificate by issuing the gsk8capicmd_64 command.
- Example
-
gsk8capicmd_64 -cert -create -db "clientkeydb.p12"
-label "DB2_signer_certificate"
-dn "CN=weblinux.Raleigh.ibm.com,O=ibm,OU=IBM HTTP Server,L=RTP,ST=NC,C=US"
-sig_alg SHA256_WITH_RSA -size 2048
-
Extract the certificate to a file by issuing the gsk8capicmd_64
command.
- Example
-
gsk8capicmd_64 -cert -extract -db "clientkeydb.p12"
-label "DB2_signer_certificate"
-target "/path/to/DB2_certificate_file.pem"
-format ascii
-
Securely transmit the Db2 server certificate
file to the centralized key manager.
-
On the centralized key manager: add the Db2 server certificate to
the keystore.
The following substeps describe how to add a certificate to IBM Security Key Lifecycle Manager
using the web console.
-
Create a device group :
- On the Advanced Configuration tab page, select Create from
the Device group list.
- Select the device
family Many devices to many keys with access via certificate and then enter
DB2 as the new device group name.
- Leave the Enable machine affinity check box unselected.
-
Import the DB2 server certificate file :
- On the Welcome tab page, select your new group, DB2.
- From the Go to list, select Manage Keys and Devices. You are
taken to the Advanced Configuration tab page.
- From the Add list, select Certificates.
- When prompted, specify the certificate name and the file path.
- From the menu in the Advanced Configuration window, select Client Device
Communication Certificates > Import.
-
On the centralized key manager: create an TLS signer
certificate.
The following substeps describe how to create a certificate and then extract it to a file using
the IBM Security Key Lifecycle Manager web console and command-line interface.
-
Create a self-signed certificate or obtain a certificate from a certificate authority .
-
Extract the certificate to a file using the command-line interface :
- Enable the Jython scripting language.
- Example
-
./wsadmin.sh -username "<admin-user>"
-password "<password>" -lang jython
- Export the certificate using the tklmCertExport command.
- Example
-
print AdminTask.tklmCertExport
('[-uuid CERTIFICATE-61f8e7ca-62aa-47d5-a915–8adbfbdca9de
-format DER
-fileName d:\\ISKLM_certificate_file.pem]')
-
Securely transmit the centralized key manager certificate file to the Db2 server.
-
On the Db2
server: add the centralized key manager certificate to the local keystore.
-
Add the certificate by issuing the gsk8capicmd_64 command.
- Example
-
gsk8capicmd_64 -cert -add -db "clientkeydb.p12"
-label "ISKLM_signer_certificate"
-file "/path/to/ISKLM_certificate_file.pem"
Results
When the Db2 database manager
connects to the centralized key manager, TLS communication will be
used.
What to do next
Configuring a Db2 instance to use a keystoreNote: TLS 1.3 support is
available starting in SGKLM Version 4.1.1. For compatibility with
Db2, SGKLM installations
running 4.1.1 FP1 to FP4 must apply a fix for IJ39961. Before turning on TLS 1.3, ensure that
Db2 is updated
to version
11.5.8 or
later. For more information, see
TransportListener.ssl.protocols in the SGKLM
Documentation.