Chapter 15. Detailed Example of a Certificate System Migration
This chapter contains a detailed example of a full Certificate System migration.
Table 15.1. Example System Configurations
In this example, all of the Certificate System 6.1 (SP 4) servers are located on a single machine called alpha.example.com and are all migrated to Certificate System 7.2 instances located on a single machine called server.example.com. It is strongly recommended that real deployments separate the subsystems across multiple machines.
Additionally, each subsystem uses a simple password; real deployments should use more robust, cryptographically stronger passwords containing uppercase letters, lowercase letters, numbers, and other special characters.
This example migration follows all migration steps described previously between Certificate Management System 6.1 (SP4) and Certificate System 7.2, based on the configurations in Table 15.1, “Example System Configurations”. The migration of each subsystem must be completed before beginning the next subsystem migration.
No upgrade path exists for the Registration Authority (RA) subsystem because this subsystem is no longer supported. To preserve the data in the RA subsystem, flush all data in RA request queues by processing it on the CA subsystem. Then stop the RA subsystem and database so that no further data can be gathered by it.
As indicated in the server configuration table, this example assumes that a professional backup system is used to back up the entire Certificate Management System 6.1 (SP4) system, rather than the included backup facilities.
Before running the backup tools, stop all of the Certificate Management System 6.1 (SP4) servers.
Stop the OCSP, DRM, and CA instances.
cd /usr/netscape/servers/cert-ocsp
./stop-cert
cd /usr/netscape/servers/cert-drm
./stop-cert
cd /usr/netscape/servers/cert-ca
./stop-cert
Stop the CMS 6.1 (SP 4) Administration Server instance.
cd /usr/netscape/servers
./stop-admin
Stop the OCSP, DRM, and CA internal database instances.
cd /usr/netscape/servers/slapd-ocsp-db
./stop-slapd
cd /usr/netscape/servers/slapd-drm-db
./stop-slapd
cd /usr/netscape/servers/slapd-ca-db
./stop-slapd
Stop the Configuration Directory Server instance.
cd /usr/netscape/servers/slapd-ds
./stop-slapd
After stopping the server, back up the entire CMS 6.1 (SP 4) system using the external backup tool.
Install a new Certificate System 7.2 system on the Red Hat Enterprise Linux 4 (AS) machine, server.example.com.
Download the Certificate System packages from the Red Hat Network or through the up2date command.
To install the subsystems, run the install utility; this is not necessary if the subsystems were installed through up2date.
rhpki-install -pki-subsystem=ca
-pki_package_path=/media/cdrom/RedHat/RPMS -force
Configure the CA instance. It is possible to change the names of migrated Certificate System subsystem instances, but greater care must be taken when extracting and renaming certain portions of the data. Because port numbers are stored in the server.xml file, which is unaffected by subsystem migration, port numbers can be changed between instances without difficulty.
Go through the HTML configuration wizard. When the installation process is completed, the server returns a URL pointing to the configuration wizard. For example:
http://server.example.com:9080/ca/admin/console/config/ login?pin=Yc6EuvuY2OeezKeX7REk
For more information on the panels in the configuration wizard, see chapter 2, "Installation and Configuration," in the Certificate System Administration Guide.
Do the following to migrate the Certificate Management System 6.1 CA subsystem security databases to the Certificate System 7.2 HSM:
For more detailed information on migrating the 6.1 CA subsystem, refer to Section 7.5.1.2, “Case II: Security Databases to HSM Migration”.
Remove the 7.2 CA security databases which will receive migrated data.
rm /var/lib/rhpki-ca/alias/cert8.db
rm /var/lib/rhpki-ca/alias/key3.db
Copy the certificate and key security databases from the old server to the new server.
cp /usr/netscape/servers/alias/cert-ca-alpha-cert8.db
/var/lib/rhpki-ca/alias/cert8.db
cp /usr/netscape/servers/alias/cert-ca-alpha-key3.db
/var/lib/rhpki-ca/alias/key3.db
Log into the new server hosting server.example.com as the Certificate System user, and open the Certificate System alias/ directory.
cd /var/lib/rhpki-ca/alias
Log in as root, and set the file user and group to the new server Certificate System user and group.
su
chown pkiuser:pkiuser cert8.db
chown pkiuser:pkiuser key3.db
Log out as root. As the Certificate System user, change the permissions on the files.
chmod 00600 cert8.db
chmod 00600 key3.db
List the certificates stored in the old security databases by using the certutil command. In this example, -L lists the certificates.
certutil -L -d .
Server-Cert cert-ca cu,cu,cu
caSigningCert cert-ca cu,cu,cu
ocspSigningCert cert-ca CTu,Cu,Cu
Export the public/private key pairs of each entry in the Certificate System databases using the pk12util tool; -o exports the key pairs to a PKCS #12 file, and -n gives the name of the certificate and the old database prefix.
pk12util -o ServerCert.p12 -n "Server-Cert cert-ca" -d .Enter Password or Pin for "NSS Certificate DB":******** Enter password for PKCS12 file: ******** Re-enter password: ******** pk12util: PKCS12 EXPORT SUCCESSFULpk12util -o caSigningCert.p12 -n "caSigningCert cert-ca" -d .Enter Password or Pin for "NSS Certificate DB":******** Enter password for PKCS12 file: ******** Re-enter password: ******** pk12util: PKCS12 EXPORT SUCCESSFULpk12util -o ocspSigningCert.p12 -n "ocspSigningCert cert-ca" -d .Enter Password or Pin for "NSS Certificate DB":******** Enter password for PKCS12 file: ******** Re-enter password: ******** pk12util: PKCS12 EXPORT SUCCESSFUL
For this example, the old security databases did not contain any additional public/private key pairs.
Delete the old security databases.
rm cert8.db
rm key3.db
Register the new HSM in the new token database.
modutil -nocertdb -dbdir . -add "epsilon" -libfile /usr/lib/libepsilon.so
Identify the new HSM slot name.
modutil -dbdir . -nocertdb -list
This reveals slots called rho, tau, and phi. The slot called rho is used for the CA.
Create new security databases.
certutil -N -d .
Import the public/private key pairs of each entry from the PKCS #12 files into the new HSM.
pk12util -i ServerCert.p12 -d . -h rhoEnter Password or Pin for "rho":******** Enter password for PKCS12 file: ******** pk12util: PKCS12 IMPORT SUCCESSFULpk12util -i caSigningCert.p12 -d . -h rhoEnter Password or Pin for "rho":******** Enter password for PKCS12 file: ******** pk12util: PKCS12 IMPORT SUCCESSFULpk12util -i ocspSigningCert.p12 -d . -h rhoEnter Password or Pin for "rho":******** Enter password for PKCS12 file: ******** pk12util: PKCS12 IMPORT SUCCESSFUL
Optionally, delete the PKCS #12 files.
rm ServerCert.p12
rm caSigningCert.p12
rm ocspSigningCert.p12
Set the trust bits on the public/private key pairs that were imported into the new HSM.
certutil -M -n "rho:Server-Cert cert-ca" -t "cu,cu,cu" -d . -h epsilon
certutil -M -n "rho:caSigningCert cert-ca" -t "CTu,CTu,CTu" -d . -h epsilon
certutil -M -n "rho:ocspSigningCert cert-ca" -t "CTu,Cu,Cu" -d . -h epsilon
Open the CS.cfg configuration file.
cd /var/lib/rhpki-ca/conf/
vi CS.cfg
Edit the ca.signing.cacertnickname and ca.ocsp_signing.cacertnickname attributes to reflect the new CA information.
ca.signing.cacertnickname=rho:caSigningCert cert-ca
ca.ocsp_signing.cacertnickname=rho:ocspSigningCert cert-ca
Since there is CA-DRM connectivity, also modify the ca.connector.KRA.nickname attribute.
ca.connector.KRA.nickname=rho:caSigningCert cert-ca
In the same directory, edit the serverCertNick.conf file to contain the old certificate nickname. For example:
vi serverCertNick.conf
rho:Server-Cert cert-ca
To migrate the CA password cache data from the 6.1 pwdcache.db and password.conf files to the 7.2 password.conf file, do the following:
For more detailed instructions on migrating the password files, refer to Section 8.3, “Migrating 6.0, 6.1, 6.2, 7.0, and 7.1 Password Cache Data”.
Log into the old server hosting alpha.example.com as the Certificate System user.
Use the PasswordCache tool on the old Certificate System to extract the password information from the CA database.
cd /usr/netscape/servers/cert-ca/config/
/usr/netscape/servers/bin/cert/tools/PasswordCache password
-d /usr/netscape/servers/alias -P cert-ca-alpha-
list
cert/key prefix = cert-ca-alpha-
path = /usr/netscape/servers/alias
about to read password cache
----- Password Cache Content -----
internal : diamond
Internal LDAP Database : diamond
The passwords are displayed in clear text; write down this information.
This example server also uses the password.conf file to start the old CA instance automatically on alpha.example.com. Copy the password.conf file to server.example.com, overwriting the default password.conf file.
cp /usr/netscape/servers/cert-ca/config/password.conf
/var/lib/rhpki-ca/conf/password.conf
Log into the new server hosting server.example.com as the Certificate System user, and open the CA subsystem conf/ directory.
cd /var/lib/rhpki-ca/conf/
Log in as root, and set the file user and group to the new server Certificate System user and group.
su
chown pkiuser:pkiuser password.conf
Log out as root. As the Certificate System user, change the permissions on the file.
chmod 00600 password.conf
Copy the passwords extracted from the old server pwdcache.db into the password.conf file.
For more detailed information on migrating internal databases, see Section 9.8, “Migrating Internal Databases for 6.1”.
To migrate the 6.1 (SP4) internal databases to the new Certificate System 7.2 server, do the following:
Log into the new CA server hosting server.example.com as the Certificate System user, and export the new internal database content to LDIF using the db2ldif tool.
cd /opt/redhat-ds/slapd-DS-instance/db/server.example.com-rhpki-ca-db
db2ldif -n server.example.com-rhpki-ca
The LDIF file location is given when the export from the database is finished.
ldif file: /opt/redhat-ds/slapd-DS-instance/ldif/2005_06_07_874021.ldif
Open the given LDIF location, and rename the LDIF file new.ldif.
cd /opt/redhat-ds/slapd-DS-instance/ldif
mv 2005_06_07_874021.ldif new.ldif
Copy the latest version of the migration utility from the new Certificate System to the old server.
Since the Certificate System migration utility is platform independent, always use the latest version of the migration utility on both server installations. The latest migration tools are available in the /usr/share/rhpki/migrate directory of the new server instance.
Open the migration tools directory.
cd /usr/share/rhpki
Package the latest version of the migration utility using zip or tar.
tar -cvf migrate.tar migrate
Regardless of the packaging tool used, the corresponding tool must be present on the old server machine. If the platforms are identical and the zip utility is used, copy the unzip utility to the /usr/netscape/servers/bin/cert/ directory so that the zip and unzip versions match.
Copy the package from the new server to the old server, then remove the package from the new server.
cp /usr/share/rhpki/migrate.tar /usr/netscape/servers/bin/cert
rm /usr/share/rhpki/migrate.tar
Log into the old server hosting alpha.example.com as the Certificate System user, and open the Certificate System bin/cert/ directory.
cd /usr/netscape/servers/bin/cert
Log into alpha.example.com as root, and set the file user and group to the old Certificate Management System user and group.
su
chown cmsuser:cmsgroup migrate.tar
Log out as root. As the Certificate System user, change the permissions on the file.
chmod 00600 migrate.tar
Since the old Certificate Management System migration utility will not be used, remove the old upgrade/ directory.
rm -rf /usr/netscape/servers/bin/cert/upgrade
Unpackage the latest version of the migration utility using unzip or tar.
tar -xvf migrate.tar
Remove the migration utility package and any additional utilities, such as the unzip utility, that were copied to the old Certificate System server.
rm migrate.tar
Run the db2ldif command to export the database contents to LDIF.
cd /usr/netscape/servers/slapd-ca-db
db2ldif -n userRoot
The LDIF file location is shown when the export from the database is complete.
ldif file: /usr/netscape/servers/slapd-ca-db/ldif/2005_06_07_439837.ldif
Open the given LDIF location, and rename the LDIF file old.ldif.
cd /usr/netscape/servers/slapd-ca-db/ldif
mv 2005_06_07_439837.ldif old.ldif
Adjust the LDIF content of old.ldif.
In this example, the LDIF file is relatively small, so any text editor works. For large files, use an appropriate program.
Open the 6.1 CA database directory.
cd /usr/netscape/servers/slapd-ca-db/ldif
Replace the following entry with the one in new.ldif.
cn=aclResources,o=CertificateServer
Add new groups for the the security domains.
cn=Security Domain Administrators,ou=groups,basedncn=Enterprise CA Administrators,ou=groups,basedncn=Enterprise KRA Administrators,ou=groups,basedncn=Enterprise OCSP Administrators,ou=groups,basedncn=Enterprise TKS Administrators,ou=groups,basedncn=Enterprise TPS Administrators,ou=groups,basedn
Convert the old.ldif file to a text file.
Open the version-to-text directory in the 6.1 server's migrate/ directory.
cd /usr/netscape/servers/bin/cert/migrate/61ToTxt
Edit the run.sh script by uncommenting and setting the values for the following lines:
Run the run.sh to use the old.ldif file to create a text file.
run.sh /usr/netscape/servers/slapd-ca-db/ldif/old.ldif >
/usr/netscape/servers/slapd-ca-db/ldif/old.txt
Open the old CA LDIF directory, and copy the old.txt file to the new CA server instance's internal database LDIF directory.
cd /usr/netscape/servers/slapd-ca-db/ldif
cp /usr/netscape/servers/slapd-ca-db/ldif/old.txt
/opt/redhat-ds/slapd-DS-instance/ldif
Log into the new CA server hosting server.example.com as the Certificate System user, and open the Certificate System ldif/ directory.
cd /opt/redhat-ds/slapd-DS-instance/ldif
Log in as root, and set the file user and group to the Certificate System user and group.
su
chown pkiuser:pkiuser old.txt
Log out as root. As the Certificate System user, change the permissions on the file.
chmod 00600 old.txt
Convert the old.txtfile to LDIF.
Open the text-to-version directory in the Red Hat Certificate System migration directory.
cd /usr/share/rhpki/migrate/TxtTo72
Edit the run.sh tool by uncommenting and setting the values for the following lines:
Run run.sh to use old.txt to create an LDIF file.
run.sh /opt/redhat-ds/slapd-DS-instance/ldif/old.txt >
/opt/redhat-ds/slapd-DS-instance/ldif/old.ldif
Import the old.ldif LDIF file into this new CA server instance's internal database.
Renew the CA SSL server certificate by doing the following:
For more detailed information on renewing the CA SSL server certificate, see Section 12.1, “Renewing a CA SSL Server Certificate by Signing It with the CA Signing Certificate”.
pkiconsole https://server.example.com:9443/ca
Select the 7.2 CA instance with the migrated data, and open the Console for that instance.
Select the System Keys and Certificates option from the menu on the left.
Press the Add/Renew button to launch the Certificate Setup Wizard.
Go through the certificate wizard panels and fill in the information as directed.
In the Type of Operation panel, select the Request a certificate option (the default).
In the Certificate Selection panel, select SSL Server Certificate from the pull-down menu, and use the default option, Sign this SSL Certificate with my CA Signing Certificate. The SSL server certificate is automatically generated.
In the Key-Pair Information for the SSL Server Certificate panel, select Create new key pair since the renewed SSL server certificate requires changing the CN component of its DN. Fill in information in the other fields on this panel or use the defaults.
Select the desired hashing algorithm or use the default, SHA-1, in the Message Digest Algorithm panel.
The next panel is Subject Name for the SSL Certificate. For the CN component, enter server.example.com. Fill in information in the other fields on this panel; it is strongly recommended that the O and C components also be filled in.
Click through the remaining panels in the Certificate Setup Wizard; fill in settings as desired or accept the defaults.
The CA's SSL server certificate is automatically renewed with the updated data.
/etc/init.d/rhpki-ca restart
After migrating the Certificate Management System 6.1 (SP 4) CA instance to the corresponding Certificate System 7.2 CA instance, access the end-entity services and the agent services interfaces of the Certificate System 7.2 CA instance to ensure that everything is working properly.
http://server.example.com:9080/ca https://server.example.com:9443/ca
Then log into the Certificate System Console to verify that the new instance can be managed through the Console.
pkiconsole https://server.example.com:9443/ca
The port numbers for all CA interfaces can be found in the server.xml in the CA instance conf/ directory.