Este conteúdo não está disponível no idioma selecionado.
Chapter 7. Installing and configuring Red Hat Certificate System
Red Hat Certificate System provides different subsystems that can be installed individually. For example, you can install multiple subsystem instances on a single server or you can run them independently on different hosts. This enables you to adapt the installation to your environment to provide a higher availability, scalability, and fail-over support.
In a Common Criteria evaluated environment, the Certificate System includes the following subsystems:
- Certificate Authority (CA)
- Key Recovery Authority (KRA)
- Online Certificate Status Protocol (OCSP) Responder
- Token Key Service (TKS)
- Token Processing System (TPS)
TKS and TPS are for TMS (Token Management System) only.
Each subsystem is installed and configured individually as a standalone Tomcat web server instance.
The order in which the individual subsystems are set up is important because of relationships between the different subsystems:
- At least one CA running as a security domain is required before any of the other public key infrastructure (PKI) subsystems can be installed.
- Install the OCSP after you have configured the CA.
- The KRA and TKS subsystems can be installed in any order, after you have configured the CA and OCSP.
- The TPS subsystem depends on the CA and TKS, and optionally on the KRA and OCSP subsystem.
For a non-TMS setup, you can install CA, OCSP, and KRA subsystems, while in a TMS setup, you can install CA, OCSP, KRA, TKS, and TPS.
In general, it is more secure to store passwords in an adequately protected file rather than entering them on the command line. However, for ease of demonstration, this example installation procedure may specify passwords as command-line parameters.
Please note that during installation, before the system is up and running, you will see that we instruct readers to configure the system by editing the files directly. However, for auditing purposes, once a PKI instance is installed, PKI administrators are expected to use the appropriate CLI (as demonstrated when applicable) or pkiconsole
(becoming deprecated) to configure the PKI instances.
In the examples that follow, you will see a mix of both methods being used. The CLI examples are shown in some cases to help the reader get familiar with them as an alternative, before they start using them post-installation.
7.1. Preparing a pkispawn setup Copiar o linkLink copiado para a área de transferência!
The following sections describe the preparation for a RSA Common Criteria setup on a RHEL 8.6 operating system.
7.1.1. Creating OS users and groups Copiar o linkLink copiado para a área de transferência!
When installing Red Hat Certificate System, the pkiuser
account and the corresponding pkiuser
group are automatically created. Certificate System uses this account and group to start services.
This section describes the creation of users and groups on the OS that hosts the RHCS system; rhcs10.example.com in this example.
pkiadmin is a group at the OS level which allows users under this group to have access to PKI files. This group should contain the following users:
-
pkiuser
, which is the default user that owns PKI files at installation and runs PKI processes upon installation. - Members that belong to the "Administrators" group of a PKI/CS instance. These are assigned pkiadmin OS membership because they need to have access to certain PKI configuration files at times. As part of a post-installation procedure, you will later be instructed to create an OS user for each Certificate System administrator who should be able to start and stop or directly configure the instance on the operating system. For details, see Section 7.13, “Post-installation”.
Other PKI roles such as Agents and Auditors do not have direct access to the PKI/CS files on the OS file systems, so they are only recognized and authenticated through a PKI/CS instance.
For the purpose of this example, three OS users will be created to serve the three distinct PKI roles:
- jgenie (Jane Genie): this non-root user belongs to the pkiadmin administrator group on the OS, as well as to the PKI Administrators group.
- jsmith (John Smith): a non-root regular user on the OS, but belongs to the PKI Agents group.
- aguru (Astrid Guru): a non-root regular user on the OS, but belongs to the PKI Auditors group.
Procedure:
Create an OS administrator group (e.g. pkiadmin):
/usr/sbin/groupadd -r pkiadmin
# /usr/sbin/groupadd -r pkiadmin
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create OS users:
Create an OS user that belongs to the OS group pkiadmin (e.g. Jane Genie - jgenie). In our example, this person will serve as a PKI Administrator user:
/usr/sbin/useradd -g pkiadmin -d /home/jgenie -s /bin/bash -c "Red Hat Certificate System Administrator Jane Genie" -m jgenie
# /usr/sbin/useradd -g pkiadmin -d /home/jgenie -s /bin/bash -c "Red Hat Certificate System Administrator Jane Genie" -m jgenie
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create an OS user (e.g John Smith - jsmith). In our example, this person will serve as a PKI Agent user:
/usr/sbin/useradd -c "Red Hat Certificate System Agent John Smith" -m jsmith
# /usr/sbin/useradd -c "Red Hat Certificate System Agent John Smith" -m jsmith
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create an OS user (e.g. Astrid Guru - aguru). In our example, this person will serve as a PKI Auditor user:
/usr/sbin/useradd -c "Red Hat Certificate System Auditor Astrid Guru" -m aguru
# /usr/sbin/useradd -c "Red Hat Certificate System Auditor Astrid Guru" -m aguru
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Associate
pkiuser
with thepkiadmin
andnfast
groups:/usr/sbin/usermod -a -G pkiadmin pkiuser
# /usr/sbin/usermod -a -G pkiadmin pkiuser
Copy to Clipboard Copied! Toggle word wrap Toggle overflow /usr/sbin/usermod -a -G nfast pkiuser
# /usr/sbin/usermod -a -G nfast pkiuser
Copy to Clipboard Copied! Toggle word wrap Toggle overflow NOTEIf using a Thales Luna HSM, associate
pkiuser
with thehsmusers
group (instead ofnfast
):/usr/sbin/usermod -a -G hsmusers pkiuser
# /usr/sbin/usermod -a -G hsmusers pkiuser
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Please see Section 4.4, “Supported Hardware Security Modules” for more information on Luna’s limitations.
Since the tests in this example use an Entrust HSM, associate the users who are to administer the HSM device with the
nfast
group:/usr/sbin/usermod -a -G nfast jgenie
# /usr/sbin/usermod -a -G nfast jgenie
Copy to Clipboard Copied! Toggle word wrap Toggle overflow NOTEAgain, if using a Thales Luna HSM, associate the users who are to administer the HSM device with the
hsmusers
group (instead ofnfast
). For example:/usr/sbin/usermod -a -G hsmusers jgenie
# /usr/sbin/usermod -a -G hsmusers jgenie
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Please see Section 4.4, “Supported Hardware Security Modules” for more information on Luna’s limitations.
Verification:
List the groups
pkiuser
and jgenie belong to:groups pkiuser jgenie
# groups pkiuser jgenie pkiuser : pkiuser nfast pkiadmin jgenie : pkiadmin nfast
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
At a later stage, once you have completed the SubCA installation, you will be instructed on how to get user certificates issued for these PKI role users individually, in order for them to perform their privileged functions.
7.1.2. Installing and configuring the DS instances Copiar o linkLink copiado para a área de transferência!
Install and configure DS instances on the second machine, e.g. rhds11.example.com. For the purpose of our examples, we are creating the following instances:
- CC-RSA-RootCA-LDAP: the internal database for the RootCA instance
- CC-RSA-OCSP-rootca-LDAP: the internal database for the RootCA’s OCSP instance (optional: see Section 7.1.2.2, “Installing a DS instance for the RootCA’s OCSP”)
- CC-RSA-SubCA-LDAP: the internal database for the SubCA
- CC-RSA-OCSP-subca-LDAP: the internal database for the SubCA’s OCSP instance
- CC-RSA-KRA-LDAP: the internal database for the KRA
- CC-RSA-TKS-LDAP: if TMS is of interest, this instance will act as the internal database and the authentication database for the TKS
- CC-RSA-TPS-LDAP: if TMS is of interest, this instance will act as the internal database and the authentication database for the TPS
Before proceeding, make sure you have followed the Chapter 6, Prerequisites for installation.
7.1.2.1. Installing a DS instance for the RootCA Copiar o linkLink copiado para a área de transferência!
The DS instance CC-RSA-RootCA-LDAP will host the RootCA’s internal database. It is listening over the standard LDAP/LDAPS ports, 389 and 636, respectively.
The port numbers used by this example are listed under Section 6.8, “Adding ports to the firewall and with SELinux context”.
On rhds11.example.com:
Create the RootCA directory server installation file at a chosen location (e.g.
/root/pki_rsa
):Copy to Clipboard Copied! Toggle word wrap Toggle overflow ImportantMake sure you specify the FQDN (see Section 6.3, “Setting the FQDN”) of the machine hosting the Directory Server instance in the
full_machine_name
, and that thesuffix
matches.Optional: To view other configuration options for future reference, you can create a template file using the
dscreate create-template
command:dscreate create-template /root/pki_rsa/ldap-template.cfg
# dscreate create-template /root/pki_rsa/ldap-template.cfg
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Set up the directory server instance using the
.cfg
file:dscreate from-file /root/pki_rsa/rootca-ldap.cfg
# dscreate from-file /root/pki_rsa/rootca-ldap.cfg Starting installation... Completed installation for CC-RSA-RootCA-LDAP
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
By default for each new Directory Server instance, a bootstrap SSL server certificate with the nickname "Server-Cert" is created for temporary use. It is issued by a bootstrap self-signed CA certificate with the nickname "Self-Signed-CA".
The /etc/dirsrv/slapd-CC-RSA-RootCA-LDAP/dse.ldif
file has nsslapd-security: on
and nsSSLPersonalitySSL: Server-Cert
.
Verification:
List the bootstrap certificates to verify:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Export the certificate:
certutil -L -d /etc/dirsrv/slapd-CC-RSA-RootCA-LDAP/ -n "Self-Signed-CA" -a -o /opt/pki_rsa/temp-dirsrv-rootca-cert.pem
# certutil -L -d /etc/dirsrv/slapd-CC-RSA-RootCA-LDAP/ -n "Self-Signed-CA" -a -o /opt/pki_rsa/temp-dirsrv-rootca-cert.pem
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Copy the certificate to rhcs10.example.com:
scp /opt/pki_rsa/temp-dirsrv-rootca-cert.pem root@rhcs10.example.com:/opt/pki_rsa/temp-dirsrv-rootca-cert.pem
# scp /opt/pki_rsa/temp-dirsrv-rootca-cert.pem root@rhcs10.example.com:/opt/pki_rsa/temp-dirsrv-rootca-cert.pem
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Test out the LDAP server setup for the Directory Server machine, for example by running the following on rhds11.example.com:
LDAPTLS_CACERT=/opt/pki_rsa/temp-dirsrv-rootca-cert.pem ldapsearch -x -D "cn=Directory Manager" -H ldaps://rhds11.example.com:636 -b "dc=example,dc=com" -w SECret.123
# LDAPTLS_CACERT=/opt/pki_rsa/temp-dirsrv-rootca-cert.pem ldapsearch -x -D "cn=Directory Manager" -H ldaps://rhds11.example.com:636 -b "dc=example,dc=com" -w SECret.123
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Test out the LDAP server setup for the Certificate System machine, for example by running the following on rhcs10.example.com:
LDAPTLS_CACERT=/opt/pki_rsa/temp-dirsrv-rootca-cert.pem ldapsearch -x -D "cn=Directory Manager" -H ldaps://rhds11.example.com:636 -b "dc=example,dc=com" -w SECret.123
# LDAPTLS_CACERT=/opt/pki_rsa/temp-dirsrv-rootca-cert.pem ldapsearch -x -D "cn=Directory Manager" -H ldaps://rhds11.example.com:636 -b "dc=example,dc=com" -w SECret.123
Copy to Clipboard Copied! Toggle word wrap Toggle overflow The LDAP search should be successful, e.g:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
7.1.2.2. Installing a DS instance for the RootCA’s OCSP Copiar o linkLink copiado para a área de transferência!
In general, a root CA is not recommended for doing day-to-day certificate issuance. Therefore, an OCSP for the root CA is not required. In the example that follows, the RootCA’s OCSP is only presented for demonstration purposes.
The DS instance CC-RSA-OCSP-rootca-LDAP will host the internal database for the RootCA’s OCSP. It is listening over the standard LDAP/LDAPS ports, 6389 and 6636, respectively.
The port numbers used by this example are listed under Section 6.8, “Adding ports to the firewall and with SELinux context”.
On rhds11.example.com:
Create the RootCA’s OCSP directory server installation file at a chosen location (e.g.
/root/pki_rsa
):Copy to Clipboard Copied! Toggle word wrap Toggle overflow ImportantMake sure you specify the FQDN (see Section 6.3, “Setting the FQDN”) of the machine hosting the Directory Server instance in the
full_machine_name
, and that thesuffix
matches.Set up the directory server instance using the
.cfg
file:dscreate from-file /root/pki_rsa/ocsp-rootca-ldap.cfg
# dscreate from-file /root/pki_rsa/ocsp-rootca-ldap.cfg Starting installation... Completed installation for CC-RSA-OCSP-rootca-LDAP
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
By default for each new Directory Server instance, a bootstrap SSL server certificate with the nickname "Server-Cert" is created for temporary use. It is issued by a bootstrap self-signed CA certificate with the nickname "Self-Signed-CA".
The /etc/dirsrv/slapd-CC-RSA-OCSP-rootca-LDAP/dse.ldif
file has nsslapd-security: on
and nsSSLPersonalitySSL: Server-Cert
.
Verification:
List the bootstrap certificates to verify:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Export the certificate:
certutil -L -d /etc/dirsrv/slapd-CC-RSA-OCSP-rootca-LDAP/ -n "Self-Signed-CA" -a -o /opt/pki_rsa/temp-dirsrv-ocsp-rootca-cert.pem
# certutil -L -d /etc/dirsrv/slapd-CC-RSA-OCSP-rootca-LDAP/ -n "Self-Signed-CA" -a -o /opt/pki_rsa/temp-dirsrv-ocsp-rootca-cert.pem
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Copy the certificate to rhcs10.example.com:
scp /opt/pki_rsa/temp-dirsrv-ocsp-rootca-cert.pem root@rhcs10.example.com:/opt/pki_rsa/temp-dirsrv-ocsp-rootca-cert.pem
# scp /opt/pki_rsa/temp-dirsrv-ocsp-rootca-cert.pem root@rhcs10.example.com:/opt/pki_rsa/temp-dirsrv-ocsp-rootca-cert.pem
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Test out the LDAP server setup for the Directory Server machine, for example by running the following on rhds11.example.com:
LDAPTLS_CACERT=/opt/pki_rsa/temp-dirsrv-ocsp-rootca-cert.pem ldapsearch -x -D "cn=Directory Manager" -H ldaps://rhds11.example.com:6636 -b "dc=example,dc=com" -w SECret.123
# LDAPTLS_CACERT=/opt/pki_rsa/temp-dirsrv-ocsp-rootca-cert.pem ldapsearch -x -D "cn=Directory Manager" -H ldaps://rhds11.example.com:6636 -b "dc=example,dc=com" -w SECret.123
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Test out the LDAP server setup for the Certificate System machine, for example by running the following on rhcs10.example.com:
LDAPTLS_CACERT=/opt/pki_rsa/temp-dirsrv-ocsp-rootca-cert.pem ldapsearch -x -D "cn=Directory Manager" -H ldaps://rhds11.example.com:6636 -b "dc=example,dc=com" -w SECret.123
# LDAPTLS_CACERT=/opt/pki_rsa/temp-dirsrv-ocsp-rootca-cert.pem ldapsearch -x -D "cn=Directory Manager" -H ldaps://rhds11.example.com:6636 -b "dc=example,dc=com" -w SECret.123
Copy to Clipboard Copied! Toggle word wrap Toggle overflow The LDAP search should be successful, e.g:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
7.1.2.3. Installing a DS instance for the SubCA Copiar o linkLink copiado para a área de transferência!
The DS instance CC-RSA-SubCA-LDAP will host the SubCA’s internal database. It is listening over the LDAP/LDAPS ports, 7389 and 7636 respectively.
The port numbers used by this example are listed under Section 6.8, “Adding ports to the firewall and with SELinux context”.
On rhds11.example.com:
Create the SubCA directory server installation file at a chosen location (e.g.
/root/pki_rsa
):Copy to Clipboard Copied! Toggle word wrap Toggle overflow ImportantMake sure you specify the FQDN (see Section 6.3, “Setting the FQDN”) of the machine hosting the Directory Server instance in the
full_machine_name
, and that thesuffix
matches.Set up the directory server instance using the
.cfg
file:dscreate from-file /root/pki_rsa/subca-ldap.cfg
# dscreate from-file /root/pki_rsa/subca-ldap.cfg Starting installation... Completed installation for CC-RSA-SubCA-LDAP
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
By default for each new Directory Server instance, a bootstrap SSL server certificate with the nickname "Server-Cert" is created for temporary use. It is issued by a bootstrap self-signed CA certificate with the nickname "Self-Signed-CA".
The /etc/dirsrv/slapd-CC-RSA-SubCA-LDAP/dse.ldif
file has nsslapd-security: on
and nsSSLPersonalitySSL: Server-Cert
.
Verification:
List the bootstrap certificates to verify:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Export the certificate:
certutil -L -d /etc/dirsrv/slapd-CC-RSA-SubCA-LDAP/ -n "Self-Signed-CA" -a -o /opt/pki_rsa/temp-dirsrv-subca-cert.pem
# certutil -L -d /etc/dirsrv/slapd-CC-RSA-SubCA-LDAP/ -n "Self-Signed-CA" -a -o /opt/pki_rsa/temp-dirsrv-subca-cert.pem
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Copy the certificate to rhcs10.example.com:
scp /opt/pki_rsa/temp-dirsrv-subca-cert.pem root@rhcs10.example.com:/opt/pki_rsa/temp-dirsrv-subca-cert.pem
# scp /opt/pki_rsa/temp-dirsrv-subca-cert.pem root@rhcs10.example.com:/opt/pki_rsa/temp-dirsrv-subca-cert.pem
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Test out the LDAP server setup for the Directory Server machine, for example by running the following on rhds11.example.com:
LDAPTLS_CACERT=/opt/pki_rsa/temp-dirsrv-subca-cert.pem ldapsearch -x -D "cn=Directory Manager" -H ldaps://rhds11.example.com:7636 -b "dc=example,dc=com" -w SECret.123
# LDAPTLS_CACERT=/opt/pki_rsa/temp-dirsrv-subca-cert.pem ldapsearch -x -D "cn=Directory Manager" -H ldaps://rhds11.example.com:7636 -b "dc=example,dc=com" -w SECret.123
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Test out the LDAP server setup for the Certificate System machine, for example by running the following on rhcs10.example.com:
LDAPTLS_CACERT=/opt/pki_rsa/temp-dirsrv-subca-cert.pem ldapsearch -x -D "cn=Directory Manager" -H ldaps://rhds11.example.com:7636 -b "dc=example,dc=com" -w SECret.123
# LDAPTLS_CACERT=/opt/pki_rsa/temp-dirsrv-subca-cert.pem ldapsearch -x -D "cn=Directory Manager" -H ldaps://rhds11.example.com:7636 -b "dc=example,dc=com" -w SECret.123
Copy to Clipboard Copied! Toggle word wrap Toggle overflow The LDAP search should be successful, e.g:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
7.1.2.4. Installing a DS instance for the SubCA’s OCSP Copiar o linkLink copiado para a área de transferência!
The DS instance CC-RSA-OCSP-subca-LDAP will host the internal database for the SubCA’s OCSP. It is listening over the LDAP/LDAPS ports, 11389 and 11636 respectively.
The port numbers used by this example are listed under Section 6.8, “Adding ports to the firewall and with SELinux context”.
On rhds11.example.com:
Create the SubCA’s OCSP directory server installation file at a chosen location (e.g.
/root/pki_rsa
):Copy to Clipboard Copied! Toggle word wrap Toggle overflow ImportantMake sure you specify the FQDN (see Section 6.3, “Setting the FQDN”) of the machine hosting the Directory Server instance in the
full_machine_name
, and that thesuffix
matches.Set up the directory server instance using the
.cfg
file:dscreate from-file /root/pki_rsa/ocsp-subca-ldap.cfg
# dscreate from-file /root/pki_rsa/ocsp-subca-ldap.cfg Starting installation... Completed installation for CC-RSA-OCSP-subca-LDAP
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
By default for each new Directory Server instance, a bootstrap SSL server certificate with the nickname "Server-Cert" is created for temporary use. It is issued by a bootstrap self-signed CA certificate with the nickname "Self-Signed-CA".
The /etc/dirsrv/slapd-CC-RSA-OCSP-subca-LDAP/dse.ldif
file has nsslapd-security: on
and nsSSLPersonalitySSL: Server-Cert
.
Verification:
List the bootstrap certificates to verify:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Export the certificate:
certutil -L -d /etc/dirsrv/slapd-CC-RSA-OCSP-subca-LDAP/ -n "Self-Signed-CA" -a -o /opt/pki_rsa/temp-dirsrv-ocsp-subca-cert.pem
# certutil -L -d /etc/dirsrv/slapd-CC-RSA-OCSP-subca-LDAP/ -n "Self-Signed-CA" -a -o /opt/pki_rsa/temp-dirsrv-ocsp-subca-cert.pem
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Copy the certificate to rhcs10.example.com:
scp /opt/pki_rsa/temp-dirsrv-ocsp-subca-cert.pem root@rhcs10.example.com:/opt/pki_rsa/temp-dirsrv-ocsp-subca-cert.pem
# scp /opt/pki_rsa/temp-dirsrv-ocsp-subca-cert.pem root@rhcs10.example.com:/opt/pki_rsa/temp-dirsrv-ocsp-subca-cert.pem
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Test out the LDAP server setup for the Directory Server machine, for example by running the following on rhds11.example.com:
LDAPTLS_CACERT=/opt/pki_rsa/temp-dirsrv-ocsp-subca-cert.pem ldapsearch -x -D "cn=Directory Manager" -H ldaps://rhds11.example.com:11636 -b "dc=example,dc=com" -w SECret.123
# LDAPTLS_CACERT=/opt/pki_rsa/temp-dirsrv-ocsp-subca-cert.pem ldapsearch -x -D "cn=Directory Manager" -H ldaps://rhds11.example.com:11636 -b "dc=example,dc=com" -w SECret.123
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Test out the LDAP server setup for the Certificate System machine, for example by running the following on rhcs10.example.com:
LDAPTLS_CACERT=/opt/pki_rsa/temp-dirsrv-ocsp-subca-cert.pem ldapsearch -x -D "cn=Directory Manager" -H ldaps://rhds11.example.com:11636 -b "dc=example,dc=com" -w SECret.123
# LDAPTLS_CACERT=/opt/pki_rsa/temp-dirsrv-ocsp-subca-cert.pem ldapsearch -x -D "cn=Directory Manager" -H ldaps://rhds11.example.com:11636 -b "dc=example,dc=com" -w SECret.123
Copy to Clipboard Copied! Toggle word wrap Toggle overflow The LDAP search should be successful, e.g:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
7.1.2.5. Installing a DS instance for the KRA Copiar o linkLink copiado para a área de transferência!
The DS instance CC-RSA-KRA-LDAP will host the KRA’s internal database. It is listening over the LDAP/LDAPS ports, 22389 and 22636 respectively.
The port numbers used by this example are listed under Section 6.8, “Adding ports to the firewall and with SELinux context”.
On rhds11.example.com:
Create the KRA directory server installation file at a chosen location (e.g.
/root/pki_rsa
):Copy to Clipboard Copied! Toggle word wrap Toggle overflow ImportantMake sure you specify the FQDN (see Section 6.3, “Setting the FQDN”) of the machine hosting the Directory Server instance in the
full_machine_name
, and that thesuffix
matches.Set up the directory server instance using the
.cfg
file:dscreate from-file /root/pki_rsa/kra-ldap.cfg
# dscreate from-file /root/pki_rsa/kra-ldap.cfg Starting installation... Completed installation for CC-RSA-KRA-LDAP
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
By default for each new Directory Server instance, a bootstrap SSL server certificate with the nickname "Server-Cert" is created for temporary use. It is issued by a bootstrap self-signed CA certificate with the nickname "Self-Signed-CA".
The /etc/dirsrv/slapd-CC-RSA-KRA-LDAP/dse.ldif
file has nsslapd-security: on
and nsSSLPersonalitySSL: Server-Cert
.
Verification:
List the bootstrap certificates to verify:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Export the certificate:
certutil -L -d /etc/dirsrv/slapd-CC-RSA-KRA-LDAP/ -n "Self-Signed-CA" -a -o /opt/pki_rsa/temp-dirsrv-kra-cert.pem
# certutil -L -d /etc/dirsrv/slapd-CC-RSA-KRA-LDAP/ -n "Self-Signed-CA" -a -o /opt/pki_rsa/temp-dirsrv-kra-cert.pem
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Copy the certificate to rhcs10.example.com:
scp /opt/pki_rsa/temp-dirsrv-kra-cert.pem root@rhcs10.example.com:/opt/pki_rsa/temp-dirsrv-kra-cert.pem
# scp /opt/pki_rsa/temp-dirsrv-kra-cert.pem root@rhcs10.example.com:/opt/pki_rsa/temp-dirsrv-kra-cert.pem
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Test out the LDAP server setup for the Directory Server machine, for example by running the following on rhds11.example.com:
LDAPTLS_CACERT=/opt/pki_rsa/temp-dirsrv-kra-cert.pem ldapsearch -x -D "cn=Directory Manager" -H ldaps://rhds11.example.com:22636 -b "dc=example,dc=com" -w SECret.123
# LDAPTLS_CACERT=/opt/pki_rsa/temp-dirsrv-kra-cert.pem ldapsearch -x -D "cn=Directory Manager" -H ldaps://rhds11.example.com:22636 -b "dc=example,dc=com" -w SECret.123
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Test out the LDAP server setup for the Certificate System machine, for example by running the following on rhcs10.example.com:
LDAPTLS_CACERT=/opt/pki_rsa/temp-dirsrv-kra-cert.pem ldapsearch -x -D "cn=Directory Manager" -H ldaps://rhds11.example.com:22636 -b "dc=example,dc=com" -w SECret.123
# LDAPTLS_CACERT=/opt/pki_rsa/temp-dirsrv-kra-cert.pem ldapsearch -x -D "cn=Directory Manager" -H ldaps://rhds11.example.com:22636 -b "dc=example,dc=com" -w SECret.123
Copy to Clipboard Copied! Toggle word wrap Toggle overflow The LDAP search should be successful, e.g:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
7.1.2.6. Installing a DS instance for the TKS Copiar o linkLink copiado para a área de transferência!
If TMS is of interest, install and configure a DS instance on rhds11.example.com, to host the TKS internal database. Red Hat Directory Server is listening over the LDAP/LDAPS ports, 16389 and 16636 respectively.
Please note that TMS is not supported for ECC.
On rhds11.example.com:
Create the TKS directory server installation file at a chosen location (e.g.
/root/pki_rsa
):Copy to Clipboard Copied! Toggle word wrap Toggle overflow ImportantMake sure you specify the FQDN (see Section 6.3, “Setting the FQDN”) of the machine hosting the Directory Server instance in the
full_machine_name
, and that thesuffix
matches.Set up the directory server instance using the
.cfg
file:dscreate from-file /root/pki_rsa/tks-ldap.cfg
# dscreate from-file /root/pki_rsa/tks-ldap.cfg Starting installation... Completed installation for CC-RSA-TKS-LDAP
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
By default for each new Directory Server instance, a bootstrap SSL server certificate with the nickname "Server-Cert" is created for temporary use. It is issued by a bootstrap self-signed CA certificate with the nickname "Self-Signed-CA".
The /etc/dirsrv/slapd-CC-RSA-TKS-LDAP/dse.ldif
file has nsslapd-security: on
and nsSSLPersonalitySSL: Server-Cert
.
Verification:
List the bootstrap certificates to verify:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Export the certificate:
certutil -L -d /etc/dirsrv/slapd-CC-RSA-TKS-LDAP/ -n "Self-Signed-CA" -a -o /opt/pki_rsa/temp-dirsrv-tks-cert.pem
# certutil -L -d /etc/dirsrv/slapd-CC-RSA-TKS-LDAP/ -n "Self-Signed-CA" -a -o /opt/pki_rsa/temp-dirsrv-tks-cert.pem
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Copy the certificate to rhcs10.example.com:
scp /opt/pki_rsa/temp-dirsrv-tks-cert.pem root@rhcs10.example.com:/opt/pki_rsa/temp-dirsrv-tks-cert.pem
# scp /opt/pki_rsa/temp-dirsrv-tks-cert.pem root@rhcs10.example.com:/opt/pki_rsa/temp-dirsrv-tks-cert.pem
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Test out the LDAP server setup for the Directory Server machine, for example by running the following on rhds11.example.com:
LDAPTLS_CACERT=/opt/pki_rsa/temp-dirsrv-tks-cert.pem ldapsearch -x -D "cn=Directory Manager" -H ldaps://rhds11.example.com:16636 -b "dc=example,dc=com" -w SECret.123
# LDAPTLS_CACERT=/opt/pki_rsa/temp-dirsrv-tks-cert.pem ldapsearch -x -D "cn=Directory Manager" -H ldaps://rhds11.example.com:16636 -b "dc=example,dc=com" -w SECret.123
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Test out the LDAP server setup for the Certificate System machine, for example by running the following on rhcs10.example.com:
LDAPTLS_CACERT=/opt/pki_rsa/temp-dirsrv-tks-cert.pem ldapsearch -x -D "cn=Directory Manager" -H ldaps://rhds11.example.com:16636 -b "dc=example,dc=com" -w SECret.123
# LDAPTLS_CACERT=/opt/pki_rsa/temp-dirsrv-tks-cert.pem ldapsearch -x -D "cn=Directory Manager" -H ldaps://rhds11.example.com:16636 -b "dc=example,dc=com" -w SECret.123
Copy to Clipboard Copied! Toggle word wrap Toggle overflow The LDAP search should be successful, e.g:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
7.1.2.7. Installing a DS instance for the TPS Copiar o linkLink copiado para a área de transferência!
If TMS is of interest, install and configure a DS instance on rhds11.example.com, to host the TPS internal database. Red Hat Directory Server is listening over the LDAP/LDAPS ports, 17389 and 17636 respectively.
On rhds11.example.com:
Create the TPS directory server installation file at a chosen location (e.g.
/root/pki_rsa
):Copy to Clipboard Copied! Toggle word wrap Toggle overflow ImportantMake sure you specify the FQDN (see Section 6.3, “Setting the FQDN”) of the machine hosting the Directory Server instance in the
full_machine_name
, and that thesuffix
matches.Set up the directory server instance using the
.cfg
file:dscreate from-file /root/pki_rsa/tps-ldap.cfg
# dscreate from-file /root/pki_rsa/tps-ldap.cfg Starting installation... Completed installation for CC-RSA-TPS-LDAP
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
By default for each new Directory Server instance, a bootstrap SSL server certificate with the nickname "Server-Cert" is created for temporary use. It is issued by a bootstrap self-signed CA certificate with the nickname "Self-Signed-CA".
The /etc/dirsrv/slapd-CC-RSA-TPS-LDAP/dse.ldif
file has nsslapd-security: on
and nsSSLPersonalitySSL: Server-Cert
.
Verification:
List the bootstrap certificates to verify:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Export the certificate:
certutil -L -d /etc/dirsrv/slapd-CC-RSA-TPS-LDAP/ -n "Self-Signed-CA" -a -o /opt/pki_rsa/temp-dirsrv-tps-cert.pem
# certutil -L -d /etc/dirsrv/slapd-CC-RSA-TPS-LDAP/ -n "Self-Signed-CA" -a -o /opt/pki_rsa/temp-dirsrv-tps-cert.pem
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Copy the certificate to rhcs10.example.com:
scp /opt/pki_rsa/temp-dirsrv-tps-cert.pem root@rhcs10.example.com:/opt/pki_rsa/temp-dirsrv-tps-cert.pem
# scp /opt/pki_rsa/temp-dirsrv-tps-cert.pem root@rhcs10.example.com:/opt/pki_rsa/temp-dirsrv-tps-cert.pem
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Test out the LDAP server setup for the Directory Server machine, for example by running the following on rhds11.example.com:
LDAPTLS_CACERT=/opt/pki_rsa/temp-dirsrv-tps-cert.pem ldapsearch -x -D "cn=Directory Manager" -H ldaps://rhds11.example.com:17636 -b "dc=example,dc=com" -w SECret.123
# LDAPTLS_CACERT=/opt/pki_rsa/temp-dirsrv-tps-cert.pem ldapsearch -x -D "cn=Directory Manager" -H ldaps://rhds11.example.com:17636 -b "dc=example,dc=com" -w SECret.123
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Test out the LDAP server setup for the Certificate System machine, for example by running the following on rhcs10.example.com:
LDAPTLS_CACERT=/opt/pki_rsa/temp-dirsrv-tps-cert.pem ldapsearch -x -D "cn=Directory Manager" -H ldaps://rhds11.example.com:17636 -b "dc=example,dc=com" -w SECret.123
# LDAPTLS_CACERT=/opt/pki_rsa/temp-dirsrv-tps-cert.pem ldapsearch -x -D "cn=Directory Manager" -H ldaps://rhds11.example.com:17636 -b "dc=example,dc=com" -w SECret.123
Copy to Clipboard Copied! Toggle word wrap Toggle overflow The LDAP search should be successful, e.g:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
7.1.3. Enabling TLS authentication between CS and its internal LDAP server Copiar o linkLink copiado para a área de transferência!
This section is for general information about TLS authentication before you proceed with installing Certificate System. Actual steps with complete example installation files are presented in later sections.
The examples in Section 7.1.2, “Installing and configuring the DS instances” instructed you to set up the LDAP instances with support for TLS authentication. The following explains the parameters in the configuration file you pass to the pkispawn
utility when installing Certificate System so that CS and DS can communicate via TLS.
-
The value of the
pki_ds_database
parameter is a name used by thepkispawn
utility to create the corresponding subsystem database on the Directory Server instance. -
The value of the
pki_ds_hostname
parameter depends on the install location of the Directory Server instance. This depends on the values used in Section 7.1.2, “Installing and configuring the DS instances”.
When you set pki_ds_secure_connection=True
, you must set the following parameters:
-
pki_ds_secure_connection_ca_pem_file
: Sets the fully-qualified path including the file name of the file which contains an exported copy of the Directory Server’s CA certificate. This file must exist prior topkispawn
being able to utilize it. -
pki_ds_ldaps_port
: Sets the value of the secure LDAPS port Directory Server is listening to. The default is636
.
Pkispawn
will assume and create a basic TLS server authentication connection with the selected DS instance based on the parameters described above and used in our example settings.
However, optionally, Red Hat Certificate System can communicate with its internal LDAP server via TLS mutual authentication. After you complete the installation, you will have the possibility to make the connection require TLS mutual authentication against the Directory Server by following Section 7.13.13, “Enabling TLS mutual authentication from CS to DS” in the post-installation section.
Note that at that time, once you have set up mutual authentication, the pki_ds_password
would no longer be relevant.
7.2. Installing RHCS using the pkispawn utility Copiar o linkLink copiado para a área de transferência!
In Red Hat Certificate System, administrators set up the individual subsystems using the pkispawn
utility. This section gives you an overall understanding of how installing using pkispawn
works. Please read it carefully to ensure that you make the right choices when following the installation examples.
If you are already familiar with pkispawn
, you can go directly to Section 7.2.3, “Installation example (introduction)”.
7.2.1. Creating the pkispawn configuration file Copiar o linkLink copiado para a área de transferência!
The pkispawn
utility requires a configuration file. This file contains parameters that are grouped into sections. These sections are stacked, so that parameters defined in earlier sections can be overridden by parameters defined in later sections. The sections are read in the following order:
- [DEFAULT] - subsystem-independent settings
- [Tomcat]
- [CA], [KRA], [OCSP], [TKS], or [TPS] - the subsystem-specific sections
When it runs, pkispawn
:
Reads the default values from the
/usr/share/pki/server/etc/default.cfg
file. For further details, see thepki_default.cfg(5)
man page.ImportantDo not edit the
/usr/share/pki/server/etc/default.cfg
file. Instead, you will be instructed to create a configuration file that will override the defaults. For details about using a configuration file, see the examplepkispawn
configuration files in the following sections that correspond to each different type of subsystem.- Reads the administrator-provided configuration file mentioned above to override the default values.
- Performs the installation of the requested subsystem.
- Passes the settings to a Java servlet that performs the configuration based on the settings.
pkispawn settings
The following provides information on how to create a configuration file for pkispawn
along with some of the major parameters. Please see the pkispawn(8)
and pki_default.cfg(5)
man pages, specifically /usr/share/pki/server/etc/default.cfg
on details such as
-
which
[ ]
section a parameter belongs to or - the exact spelling of a parameter,
- etc.
Create a text file for the pkispawn
configuration settings, such as /root/pki/config.subsystem.txt
, and fill it with the settings described below. You must add every setting under the corresponding [ ]
section. You can refer to the /usr/share/pki/server/etc/default.cfg
file to confirm the proper placement.
This section describes a general minimum configuration with Directory Server running on the same host as Certificate System. Depending on your environment, additional parameters may be necessary. For additional examples, see the EXAMPLES section in the pkispawn(8)
man page.
For descriptions about the parameters covered in this section, see the pki_default.cfg(5)
man page.
Subsystem-independent settings
Independently of the subsystem you install, the following settings are required in the configuration file in the [DEFAULT]
section:
Set a unique instance name:
pki_instance_name=instance_name
# pki_instance_name=instance_name
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Set the host name:
pki_hostname=server.example.com
# pki_hostname=server.example.com
Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteCertificate System creates unique certificate nicknames based on these parameters and the instance name. The uniqueness of certificate nicknames is very important in keeping the HSM token shared by multiple PKI instances functional.
Set the port numbers for the HTTP and HTTPS protocols:
pki_https_port=port_number pki_http_port=port_number
pki_https_port=port_number pki_http_port=port_number
Copy to Clipboard Copied! Toggle word wrap Toggle overflow ImportantTo run more than one Certificate System instance on the same host, you must set ports in the
pki_https_port
andpki_http_port
parameters that are not used by any other service on the host. By default, Certificate System uses port 8080 for HTTP and 8443 for HTTPS.Set the HSM-specific parameters:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow For further details, see Section 6.6.3, “Preparing for installing Certificate System with an HSM”.
If building an RSA Certificate System instance, use the following configuration:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Allowed choices for the key_algorithm parameters are:
SHA256withRSA SHA384withRSA SHA512withRSA
SHA256withRSA SHA384withRSA SHA512withRSA
Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteYou can set these algorithm parameters to a value specified in the
ca.profiles.defaultSigningAlgsAllowed
parameter in the CA’sCS.cfg
file. For details, see the B.2.10 Signing Algorithm Constraint annex in the Administration Guide (Common Criteria Edition). Signature algorithm must matchkey_type
.To use Elliptic Curve Cryptography (ECC) instead of RSA when creating certificates, set:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Allowed choices for the
key_algorithm
parameters are:SHA256withEC SHA384withEC SHA512withEC
SHA256withEC SHA384withEC SHA512withEC
Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteYou can set these algorithm parameters to a value specified in the
ca.profiles.defaultSigningAlgsAllowed
parameter in the CA’sCS.cfg
file. For details, see the For details, see the B.2.10 Signing Algorithm Constraint annex in the Administration Guide (Common Criteria Edition). The signature algorithm must match withkey_type
.For ECC, the allowed choices for
key_size
are:nistp256 nistp384 nistp521
nistp256 nistp384 nistp521
Copy to Clipboard Copied! Toggle word wrap Toggle overflow For ECC, the allowed choice for
key_type
isecc
.Set the client directory of the bootstrap admin user:
pki_client_dir=bootstrap_admin_directory
pki_client_dir=bootstrap_admin_directory
Copy to Clipboard Copied! Toggle word wrap Toggle overflow By default, the path is set to
~/.dogtag/instance_name/
ImportantThe
pki_admin_*
andpki_client_*
parameters belong to the bootstrap user that is automatically created by the installation process. For further information about default roles (privileges) and the bootstrap user, see Section 2.6.6, “Users, authorization, and access controls”. For descriptions about the parameters covered in this section, see thepki_default.cfg(5)
man page.Set various passwords for the bootstrap admin user:
pki_admin_password=password pki_client_database_password=password pki_client_pkcs12_password=password
pki_admin_password=password pki_client_database_password=password pki_client_pkcs12_password=password
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Set the parameters for the LDAPS connection to Directory Server running on the same host:
pki_ds_database=back-end database name pki_ds_hostname=hostname pki_ds_secure_connection=True pki_ds_secure_connection_ca_pem_file=path_to_CA_or_self-signed_certificate pki_ds_password=password
pki_ds_database=back-end database name pki_ds_hostname=hostname pki_ds_secure_connection=True pki_ds_secure_connection_ca_pem_file=path_to_CA_or_self-signed_certificate pki_ds_password=password
Copy to Clipboard Copied! Toggle word wrap Toggle overflow If you use a self-signed certificate in Directory Server use the following command to export it from the Directory Server’s Network Security Services (NSS) database:
certutil -L -d /etc/dirsrv/slapd-instance_name/ \ -n "server-cert" -a -o /root/ds.crt
# certutil -L -d /etc/dirsrv/slapd-instance_name/ \ -n "server-cert" -a -o /root/ds.crt
Copy to Clipboard Copied! Toggle word wrap Toggle overflow For the CA that will act as a security domain, set the proper parameters:
for a CA that acts as a security domain
# for a CA that acts as a security domain pki_security_domain_hostname= pki_security_domain_name=example.com Security Domain pki_security_domain_user=caadmin pki_security_domain_password=SD password
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
[Tomcat] section:
Set the Tomcat JServ Protocol (AJP) port:
pki_ajp_port=Tomcat_AJP_port
pki_ajp_port=Tomcat_AJP_port
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Set the Tomcat server port:
pki_tomcat_server_port=Tomcat_server_port
pki_tomcat_server_port=Tomcat_server_port
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
To run more than one PKI subsystem instance on the same host, you must set ports in the pki_ajp_port
and pki_tomcat_server_port parameters
that are not used by any other service on the host. By default, the pki_ajp_port
is set to 8009 and pki_tomcat_server_port
to 8005.
Subsystem-specific settings
After you have created the initial configuration file, add the subsystem-specific settings to it. Search for subsystem-specific sections ([CA]
, [OCSP]
, [KRA]
, [TKS]
, or [TPS]
) in the /usr/share/pki/server/etc/default.cfg
file.
For examples, see:
- [CA] - Section 7.3, “Create and configure the RootCA (Part I)”
- [OCSP] - Section 7.4, “Create and configure the OCSP instance (RootCA)” and Section 7.7, “Create and configure the OCSP instance (SubCA)”
- [CA] - Section 7.6, “Create and configure the SubCA (Part I)”
- [KRA] - Section 7.9, “Create and configure the KRA instance”
- [TKS] - Section 7.10, “Create and configure the TKS instance”
- [TPS] - Section 7.11, “Create and configure the TPS instance”
7.2.2. Installation methods (single-step or two-step) Copiar o linkLink copiado para a área de transferência!
You can run pkispawn
in either single-step installation or two-step installation:
- Single-step installation
In a single-step installation process, you first create a configuration file and then run
pkispawn
once against this file as follows:pkispawn -s [CA, OCSP, KRA, TKS, TPS] -f cs_inst.cfg –debug
# pkispawn -s [CA, OCSP, KRA, TKS, TPS] -f cs_inst.cfg –debug
Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteBefore starting the installation, it is good practice to first run a precheck using the configuration file:
E.g. for the CA:
pkispawn -s CA -f rootca_inst.cfg --precheck --debug pkispawn -s CA -f rootca_inst.cfg --debug
# pkispawn -s CA -f rootca_inst.cfg --precheck --debug # pkispawn -s CA -f rootca_inst.cfg --debug
Copy to Clipboard Copied! Toggle word wrap Toggle overflow For a complete example, see Section 7.3.1, “Installing the RootCA instance (single-step method)”.
- Two-step installation
In a two-step installation, administrators are allowed to manually update configuration files between the two parts of the installation. This method allows for better customization.
The two-step installation consists of the following major parts:
First step
During this step,
pkispawn
copies configuration files from the/usr/share/pki/
directory to the instance-specific/etc/pki/instance_name/
directory. Additionally, pkispawn sets the settings based on values defined in the deployment configuration file. The first step ofpkispawn
is run as the following:pkispawn -s [CA, OCSP, KRA, TKS, TPS] -f cs_inst.cfg --skip-configuration –debug
# pkispawn -s [CA, OCSP, KRA, TKS, TPS] -f cs_inst.cfg --skip-configuration –debug
Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteBefore starting the installation, it is good practice to first run a precheck using the configuration file.
E.g. for the CA:
pkispawn -s CA -f rootca_inst.cfg --skip-configuration --precheck --debug pkispawn -s CA -f rootca_inst.cfg --skip-configuration --debug
# pkispawn -s CA -f rootca_inst.cfg --skip-configuration --precheck --debug # pkispawn -s CA -f rootca_inst.cfg --skip-configuration --debug
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Between step customization
Between running the two pkispawn
steps, you have the opportunity to manually update some instance-specific configuration files before the next pkispawn step. Parameters you customize at this point are in general things that you cannot configure in the pkispawn
configuration file but would affect the outcome or behavior of the system. Examples for such customization include, but are not limited to:
system certificate enrollment profiles under
/var/lib/pki/<CA instance name>/ca/conf/*.profile
(see Chapter 11, Configuring certificate profiles)- e.g. adding a desired certificate extension (which is not in the default profile) to a system certificate by editing the corresponding system certificate profile
- e.g. Changing the validity period of a system certificate by editing the corresponding system certificate profile
ciphers list (see Section 7.13.11, “Update the ciphers list”)
- e.g. further restricting the supported ciphers
- etc.
Second step
During this step, pkispawn
continues the installation based on the configuration files in the instance-specific /etc/pki/instance_name/
directory. This second step is run as the following:
pkispawn -s [CA, OCSP, KRA, TKS, TPS] -f cs_inst.cfg --skip-installation –debug
# pkispawn -s [CA, OCSP, KRA, TKS, TPS] -f cs_inst.cfg --skip-installation –debug
Before starting the installation, it is good practice to first run a precheck using the configuration file.
E.g. for the CA:
pkispawn -s CA -f rootca_inst.cfg --skip-installation --precheck --debug pkispawn -s CA -f rootca_inst.cfg --skip-installation --debug
# pkispawn -s CA -f rootca_inst.cfg --skip-installation --precheck --debug
# pkispawn -s CA -f rootca_inst.cfg --skip-installation --debug
For a complete example, see Section 7.3.2, “Installing the RootCA instance (two-step method)”.
7.2.3. Installation example (introduction) Copiar o linkLink copiado para a área de transferência!
To better demonstrate how you can install each type of CS instance, we provide the following installation/configuration procedure example of a RSA setup for the following RSA RHCS subsystems on separate Tomcat instances where an Entrust nShield Connect XC unit is employed with supported firmware/software:
- non-TMS: root CA (RootCA), OCSP (for the RootCA), subordinate CA (SubCA), OCSP (for the SubCA), KRA (for the SubCA).
- TMS (if of interest): TKS (for the SubCA), TPS (for the SubCA).
In general, a root CA is not recommended for doing day-to-day certificate issuance. Therefore, an OCSP for the root CA is not required. In our present example, the RootCA’s OCSP is only presented for demonstration purposes.
For an ECC environment, please see the ECC example.
In the following example setup procedures, we will use the pkispawn
utility to create the following PKI topology, where the RootCA (having its own OCSP instance) provides the certificate issuance for the SubCA’s CA signing certificate, while the SubCA is the security domain to both its own OCSP and KRA instances, and if TMS is of interest, the TKS and TPS instances:
To gain a better picture of the process involved, we advise you to:
- Follow Chapter 6, Prerequisites for installation if you have not done it yet.
Follow either the single-step installation or two-step installation example to install
- RootCA
- OCSP of RootCA (optional)
- SubCA
- OCSP of SubCA
- KRA
(if TMS is of interest - RSA only) continue to follow either the single-step installation or two-step installation example to install
- TKS
- TPS
7.3. Create and configure the RootCA (Part I) Copiar o linkLink copiado para a área de transferência!
To install and configure a RootCA instance, use either one of two pkispawn
methods:
7.3.1. Installing the RootCA instance (single-step method) Copiar o linkLink copiado para a área de transferência!
Configuring a RootCA instance using the single-step method requires creating a configuration file and running the pkispawn
tool once.
In this example, the RootCA is installed on rhcs10.example.com (as well as other instances), with its internal directory server on rhds11.example.com.
Prerequisites
- You are logged in to rhcs10.example.com as root user.
- You have Section 7.1.2.1, “Installing a DS instance for the RootCA”. In our example, CC-RSA-RootCA-LDAP is the RootCA’s internal database.
Procedure
Create a CA installation file at a chosen location (e.g.
/root/pki_rsa
) on the machine that will host the RHCS instance (rhcs10.example.com).cd /root/pki_rsa
# cd /root/pki_rsa
Copy to Clipboard Copied! Toggle word wrap Toggle overflow vi rootca_inst.cfg
# vi rootca_inst.cfg
Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteUnless explicitly specified, system certificate nicknames are automatically named bearing the value specified for
pki_instance_name
. To avoid certificate nickname conflicts on a shared HSM, use a unique instance name for each instance creation.
The values specified in the installation file below are examples. In addition to changing the HSM password, edit the values accordingly, for example ports, directories, nicknames, domains…
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Run the
pkispawn
tool to install the RHCS CA instance:pkispawn -s CA -f rootca_inst.cfg --debug
# pkispawn -s CA -f rootca_inst.cfg --debug
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification steps
Show the status of the installed CA:
pki-server status rhcs10-RSA-RootCA
# pki-server status rhcs10-RSA-RootCA
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Note down the Unsecure EE, Secure EE, Agent, Admin and pkiconsole URLs.
Verify the sanity of the CA by running the following command. It should display certificates:
pki -p 8443 -h rhcs10.example.com ca-cert-find
# pki -p 8443 -h rhcs10.example.com ca-cert-find
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
An untrusted issuer warning for the CA signing certificate will display when connecting to the RootCA with a pki command for the first time, as seen below:
WARNING: UNTRUSTED ISSUER encountered on 'CN=rhcs10.example.com,OU=rhcs10-RSA-RootCA,O=Example-rhcs10-RSA-RootCA' indicates a non-trusted CA cert 'CN=CA Signing Certificate,OU=rhcs10-RSA-RootCA,O=Example-rhcs10-RSA-RootCA' Trust this certificate (y/N)?
WARNING: UNTRUSTED ISSUER encountered on 'CN=rhcs10.example.com,OU=rhcs10-RSA-RootCA,O=Example-rhcs10-RSA-RootCA' indicates a non-trusted CA cert 'CN=CA Signing Certificate,OU=rhcs10-RSA-RootCA,O=Example-rhcs10-RSA-RootCA'
Trust this certificate (y/N)?
Select y
to trust the CA signing cert if the Subject DN matches the hostname as expected. The warning will not display again.
Once you are done with this section (single-step method), skip directly to Section 7.3.3, “Disable non-CMC and non-installation profiles” to continue with the RootCA installation.
7.3.2. Installing the RootCA instance (two-step method) Copiar o linkLink copiado para a área de transferência!
Configuring a RootCA instance using the two-step method requires creating a configuration file and running the pkispawn
tool twice.
In this example, the RootCA is installed on rhcs10.example.com.
Prerequisites
- You are logged in to rhcs10.example.com as root user.
- You have Section 7.1.2.1, “Installing a DS instance for the RootCA”. In our example, CC-RSA-RootCA-LDAP is the RootCA’s internal database.
First step of RootCA installation
Create a CA installation file at a chosen location (e.g.
/root/pki_rsa
) on the machine that will host the RHCS instance (rhcs10.example.com).cd /root/pki_rsa vi rootca_inst.cfg
# cd /root/pki_rsa # vi rootca_inst.cfg
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteUnless explicitly specified, system certificate nicknames are automatically named bearing the value specified for
pki_instance_name
. To avoid certificate nickname conflicts on a shared HSM, use a unique instance name for each instance creation. However, in a two-step installation, thepki_instance_name
value of both files should match. The following values are just examples.Run the
pkispawn
tool to install the RHCS CA instance:pkispawn -s CA -f rootca_inst.cfg --skip-configuration --debug
# pkispawn -s CA -f rootca_inst.cfg --skip-configuration --debug
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Between-step configuration
As explained in Between step customization, you can customize certain things, such as the certificate profile of a system certificate.
Setting the Subject Key Identifier extension message digest algorithm for the CA signing certificate:
Open the enrollment profile for this CA’s signing certificate:
vi /var/lib/pki/rhcs10-RSA-RootCA/ca/conf/caCert.profile
# vi /var/lib/pki/rhcs10-RSA-RootCA/ca/conf/caCert.profile
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Add the following parameter:
7.default.params.messageDigest=SHA-256
7.default.params.messageDigest=SHA-256
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Save the file.
Likewise, do the same for the CA signing cert that this CA will be issuing in the future:
Open the enrollment profile for the CA signing certificate:
vi /var/lib/pki/rhcs10-RSA-RootCA/ca/profiles/ca/caInstallCACert.cfg
# vi /var/lib/pki/rhcs10-RSA-RootCA/ca/profiles/ca/caInstallCACert.cfg
Copy to Clipboard Copied! Toggle word wrap Toggle overflow vi /var/lib/pki/rhcs10-RSA-RootCA/ca/profiles/ca/caCMCcaCert.cfg
# vi /var/lib/pki/rhcs10-RSA-RootCA/ca/profiles/ca/caCMCcaCert.cfg
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Add the following parameter:
policyset.caCertSet.8.default.params.messageDigest=SHA-256
policyset.caCertSet.8.default.params.messageDigest=SHA-256
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Save the file.
Other between-step configuration changes can take place here too. For example, if you wish to extend the validity period of the audit signing certificate of this subsystem:
Open the corresponding configuration file:
vi /var/lib/pki/rhcs10-RSA-RootCA/ca/profiles/ca/caInternalAuthAuditSigningCert.cfg
# vi /var/lib/pki/rhcs10-RSA-RootCA/ca/profiles/ca/caInternalAuthAuditSigningCert.cfg
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Change the following range parameters to the desired values:
policyset.auditSigningCertSet.2.constraint.params.range=720 policyset.auditSigningCertSet.2.default.params.range=720
policyset.auditSigningCertSet.2.constraint.params.range=720 policyset.auditSigningCertSet.2.default.params.range=720
Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Save the file. Once you have done the second step of
pkispawn
in the next section, you should expect the validity of the audit signing certificate of this subsystem to match the values you have changed to.
Second step of RootCA installation
The second step of pkispawn
in this case involves running the tool against the same file in a different manner to configure the RHCS CA instance.
Run the
pkispawn
tool to configure the CA:pkispawn -s CA -f rootca_inst.cfg --skip-installation --debug
# pkispawn -s CA -f rootca_inst.cfg --skip-installation --debug
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification steps
Show the status of the installed CA:
pki-server status rhcs10-RSA-RootCA
# pki-server status rhcs10-RSA-RootCA
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Note down the Unsecure EE, Secure EE, Agent, Admin and pkiconsole URLs.
Verify the sanity of the CA by running the following command. It should display certificates:
pki -p 8443 -h rhcs10.example.com ca-cert-find
# pki -p 8443 -h rhcs10.example.com ca-cert-find
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
An untrusted issuer warning for the CA signing certificate will display when connecting to the RootCA with a pki command for the first time, as seen below:
WARNING: UNTRUSTED ISSUER encountered on 'CN=rhcs10.example.com,OU=rhcs10-RSA-RootCA,O=Example-rhcs10-RSA-RootCA' indicates a non-trusted CA cert 'CN=CA Signing Certificate,OU=rhcs10-RSA-RootCA,O=Example-rhcs10-RSA-RootCA' Trust this certificate (y/N)?
WARNING: UNTRUSTED ISSUER encountered on 'CN=rhcs10.example.com,OU=rhcs10-RSA-RootCA,O=Example-rhcs10-RSA-RootCA' indicates a non-trusted CA cert 'CN=CA Signing Certificate,OU=rhcs10-RSA-RootCA,O=Example-rhcs10-RSA-RootCA'
Trust this certificate (y/N)?
Select y
to trust the CA signing cert if the Subject DN matches the hostname as expected. The warning will not display again.
7.3.3. Disable non-CMC and non-installation profiles Copiar o linkLink copiado para a área de transferência!
The profiles are stored in /var/lib/pki_rsa/rhcs10-RSA-RootCA/ca/profiles/ca/
. CMC profiles contain "CMC" in their profile ID. This section provides procedures to disable non-CMC and non-installation profiles.
Procedure
Generate a list of non-CMC profiles to be edited:
ls /var/lib/pki/rhcs10-RSA-RootCA/ca/profiles/ca | grep -v CMC | grep -v Install | grep -v caInternal | grep -v caECInternal | grep -v caAdminCert | grep -v caECAdminCert | tee /root/pki_rsa/ca-profile-deletelist.txt
# ls /var/lib/pki/rhcs10-RSA-RootCA/ca/profiles/ca | grep -v CMC | grep -v Install | grep -v caInternal | grep -v caECInternal | grep -v caAdminCert | grep -v caECAdminCert | tee /root/pki_rsa/ca-profile-deletelist.txt
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Stop the RootCA instance:
pki-server stop rhcs10-RSA-RootCA
pki-server stop rhcs10-RSA-RootCA
Copy to Clipboard Copied! Toggle word wrap Toggle overflow For every profile in the list, change the
visible
andenable
parameters fromtrue
tofalse
. For example, use the following command to setvisible=false
andenable=false
:cat /root/pki_rsa/ca-profile-deletelist.txt | while read line; do sed -i 's/^visible=true/visible=false/g' /var/lib/pki/rhcs10-RSA-RootCA/ca/profiles/ca/$line; sed -i 's/^enable=true/enable=false/g' /var/lib/pki/rhcs10-RSA-RootCA/ca/profiles/ca/$line; done
# cat /root/pki_rsa/ca-profile-deletelist.txt | while read line; do sed -i 's/^visible=true/visible=false/g' /var/lib/pki/rhcs10-RSA-RootCA/ca/profiles/ca/$line; sed -i 's/^enable=true/enable=false/g' /var/lib/pki/rhcs10-RSA-RootCA/ca/profiles/ca/$line; done
Copy to Clipboard Copied! Toggle word wrap Toggle overflow In addition, also change the
visible
parameter for thecaCMCUserCert
profile tofalse
:sed -i 's/^visible=true/visible=false/' /var/lib/pki/rhcs10-RSA-RootCA/ca/profiles/ca/caCMCUserCert.cfg
# sed -i 's/^visible=true/visible=false/' /var/lib/pki/rhcs10-RSA-RootCA/ca/profiles/ca/caCMCUserCert.cfg
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Start the RootCA instance:
pki-server start rhcs10-RSA-RootCA
pki-server start rhcs10-RSA-RootCA
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
7.3.4. Create a CA chain file Copiar o linkLink copiado para a área de transferência!
In later procedures, you will need the CA certificates and CA chain. It is important to keep the certificate chain file up to date. We are placing the CA chain file, ca-chain.pem
, as well as the individual CA .pem
files under the /opt/pki_rsa
directory on both rhcs10.example.com (the machine hosting the CS instances), and rhds11.example.com (the machine hosting the DS instances).
Create a CA chain file for later use:
certutil -L -d /var/lib/pki/rhcs10-RSA-RootCA/alias -n "CA Signing Cert - rhcs10-RSA-RootCA" -a > /opt/pki_rsa/rootCA.pem
# certutil -L -d /var/lib/pki/rhcs10-RSA-RootCA/alias -n "CA Signing Cert - rhcs10-RSA-RootCA" -a > /opt/pki_rsa/rootCA.pem
Copy to Clipboard Copied! Toggle word wrap Toggle overflow cp /opt/pki_rsa/rootCA.pem /opt/pki_rsa/ca-chain.pem
# cp /opt/pki_rsa/rootCA.pem /opt/pki_rsa/ca-chain.pem
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Copy the files to rhds11.example.com (the machine that hosts the DS instances):
scp /opt/pki_rsa/rootCA.pem root@rhds11.example.com:/opt/pki_rsa
# scp /opt/pki_rsa/rootCA.pem root@rhds11.example.com:/opt/pki_rsa
Copy to Clipboard Copied! Toggle word wrap Toggle overflow scp /opt/pki_rsa/ca-chain.pem root@rhds11.example.com:/opt/pki_rsa
# scp /opt/pki_rsa/ca-chain.pem root@rhds11.example.com:/opt/pki_rsa
Copy to Clipboard Copied! Toggle word wrap Toggle overflow On rhds11.example.com, edit the
/etc/openldap/ldap.conf
file so thatTLS_CACERT
points to the CA chain file we just created:echo "TLS_CACERT /opt/pki_rsa/ca-chain.pem" >> /etc/openldap/ldap.conf
# echo "TLS_CACERT /opt/pki_rsa/ca-chain.pem" >> /etc/openldap/ldap.conf
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Restart the DS instance for the RootCA:
dsctl slapd-CC-RSA-RootCA-LDAP restart
# dsctl slapd-CC-RSA-RootCA-LDAP restart
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
7.3.5. Prepare the RootCA to sign other CMC certificate requests Copiar o linkLink copiado para a área de transferência!
The procedure in this section aims to create an nssdb containing the RootCA’s bootstrap admin certificate/key, thus allowing the pki administrators to sign CMC full requests for role user certificates at later steps.
Previously, in the pkispawn
configuration file, we specified the following parameters:
pki_client_dir=/opt/pki_rsa/rhcs10-RSA-RootCA pki_client_admin_cert_p12=/opt/pki_rsa/rhcs10-RSA-RootCA/ca_admin_cert.p12 pki_client_database_dir=/opt/pki_rsa/rhcs10-RSA-RootCA/certs_db
pki_client_dir=/opt/pki_rsa/rhcs10-RSA-RootCA
pki_client_admin_cert_p12=/opt/pki_rsa/rhcs10-RSA-RootCA/ca_admin_cert.p12
pki_client_database_dir=/opt/pki_rsa/rhcs10-RSA-RootCA/certs_db
These parameters tell pkispawn
where to place the bootstrap admin certificate and keys, therefore, in theory, you would not need to follow the steps in this section. However, since we would like to demonstrate a working example to the readers, for ease of execution and description, we are designating /root/.dogtag/pki_rsa_bootstrap/certs_db
to be the location of the nssdb that contains all the bootstrap admin user’s certificates and keys throughout this example.
Prerequisite
- You are logged in to rhcs10.example.com as root user.
Procedure
Create a client nssdb:
pki -d /root/.dogtag/pki_rsa_bootstrap/certs_db -c SECret.123 client-init
# pki -d /root/.dogtag/pki_rsa_bootstrap/certs_db -c SECret.123 client-init
Copy to Clipboard Copied! Toggle word wrap Toggle overflow NOTEThe directory specified at
-d
should not already exist. If it does exist, another RHCS instance might be using it. In that case, it’s advised to move it out of the way or specify a different path. You can check if there are any certificates with:certutil -L -d /root/.dogtag/pki_rsa_bootstrap/certs_db
# certutil -L -d /root/.dogtag/pki_rsa_bootstrap/certs_db
Copy to Clipboard Copied! Toggle word wrap Toggle overflow and if none exist, you can select
Yes
to overwrite.Import the CA signing certificate into the nssdb:
pki -d /root/.dogtag/pki_rsa_bootstrap/certs_db -c SECret.123 client-cert-import "CA Signing Cert - rhcs10-RSA-RootCA" --ca-cert /opt/pki_rsa/rootCA.pem
# pki -d /root/.dogtag/pki_rsa_bootstrap/certs_db -c SECret.123 client-cert-import "CA Signing Cert - rhcs10-RSA-RootCA" --ca-cert /opt/pki_rsa/rootCA.pem
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Import the RootCA bootstrap admin certificate/key into the nssdb:
pki -d /root/.dogtag/pki_rsa_bootstrap/certs_db -c SECret.123 client-cert-import --pkcs12 /opt/pki_rsa/rhcs10-RSA-RootCA/ca_admin_cert.p12 --pkcs12-password SECret.123
# pki -d /root/.dogtag/pki_rsa_bootstrap/certs_db -c SECret.123 client-cert-import --pkcs12 /opt/pki_rsa/rhcs10-RSA-RootCA/ca_admin_cert.p12 --pkcs12-password SECret.123 ---------------------------------------- Imported certificates from PKCS #12 file ----------------------------------------
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification:
List the certificates:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow As the bootstrap admin user, list the users in the RootCA:
pki -d /root/.dogtag/pki_rsa_bootstrap/certs_db/ -c SECret.123 -p 8443 -n "PKI Bootstrap Administrator for RSA-RootCA" ca-user-find
# pki -d /root/.dogtag/pki_rsa_bootstrap/certs_db/ -c SECret.123 -p 8443 -n "PKI Bootstrap Administrator for RSA-RootCA" ca-user-find
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Copy to Clipboard Copied! Toggle word wrap Toggle overflow
7.3.6. Check for random serial numbers Copiar o linkLink copiado para a área de transferência!
List the certificates to make sure all the subsystem certificates have random serial numbers.
pki -p 8443 ca-cert-find | grep -i serial
# pki -p 8443 ca-cert-find | grep -i serial
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
7.3.7. Verify that the RootCA signing certificate has no AIA Copiar o linkLink copiado para a área de transferência!
It is important to note that since this is a self-signed (root) CA signing certificate, it should not contain an AIA (Authority Information Access) extension.
To verify that the RootCA signing certificate is issued correctly:
certutil -L -d /var/lib/pki/rhcs10-RSA-RootCA/alias/ -n "CA Signing Cert - rhcs10-RSA-RootCA"
# certutil -L -d /var/lib/pki/rhcs10-RSA-RootCA/alias/ -n "CA Signing Cert - rhcs10-RSA-RootCA"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow You should observe that there is no AIA extension.
To allow for the RootCA role user certificates to contain AIA extensions pointing to the OCSP instance (yet to be created in the following section), relevant sections are placed in Section 7.5, “Create and configure the RootCA (Part II)”, AFTER the OCSP instance creation.
7.3.8. Configure support for CRL Distribution Point Copiar o linkLink copiado para a área de transferência!
For more information on CRL Distribution Points, why they are needed and where they are best suited, see Section 9.4.1.2, “Enabling automatic revocation checking on the CA”.
To configure support for CRL Distribution Points, as an example, we describe how to set up a file-based CRL publisher as well as the partitioning of the CRL. You will also learn how to enable a certificate enrollment profile to issue certificates with the CRL Distribution Point extension. Finally, we describe how to replace the temporary Server-Cert of the CA’s LDAP server with a certificate issued from the CRL Distribution Point profiles.
Before proceeding with the following changes, stop the RootCA instance:
pki-server stop rhcs10-RSA-RootCA
# pki-server stop rhcs10-RSA-RootCA
7.3.8.1. CA Setup to support Server Cert CRL File Publishing Copiar o linkLink copiado para a área de transferência!
Before proceeding, save a copy of the configuration file before editing:
cp /var/lib/pki/rhcs10-RSA-RootCA/ca/conf/CS.cfg /var/lib/pki/rhcs10-RSA-RootCA/ca/conf/CS.cfg.bak.<date>
# cp /var/lib/pki/rhcs10-RSA-RootCA/ca/conf/CS.cfg /var/lib/pki/rhcs10-RSA-RootCA/ca/conf/CS.cfg.bak.<date>
7.3.8.1.1. Set up the file-based publisher: crlFilePublisher Copiar o linkLink copiado para a área de transferência!
The configuration in this section creates a file-based CRL publisher called crlFilePublisher. When set up correctly, the CRL is stored under directory /var/lib/pki/rhcs10-RSA-RootCA/crl
in DER format.
Create the CRL directory for publishing the file-based partitioned CRL:
mkdir /var/lib/pki/rhcs10-RSA-RootCA/crl chown pkiuser.pkiuser /var/lib/pki/rhcs10-RSA-RootCA/crl
# mkdir /var/lib/pki/rhcs10-RSA-RootCA/crl # chown pkiuser.pkiuser /var/lib/pki/rhcs10-RSA-RootCA/crl
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Add the following to the CA’s
CS.cfg
:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
7.3.8.1.2. Set up the file-based publishing rule: FileCrlRule Copiar o linkLink copiado para a área de transferência!
The configuration in this section creates a file-based publishing rule called FileCrlRule. The predicate specifies the issuing point to a partitioned CRL called ServerCertCRL (defined in Section 7.3.8.1.4, “Set up the CRL-partitioning for certificates issued via a profile”).
Add the following to the CA’s
CS.cfg
:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
7.3.8.1.3. Modify the LDAP-based publishing rule: LdapCrlRule Copiar o linkLink copiado para a área de transferência!
This configuration explicitly sets the LdapCrlRule predicate to the master (full) CRL. The master CRL is continuously supplied to the OCSP responder for proper OCSP support.
Modify the following in the CA’s
CS.cfg
:ca.publish.rule.instance.LdapCrlRule.predicate=issuingPointId==MasterCRL
ca.publish.rule.instance.LdapCrlRule.predicate=issuingPointId==MasterCRL
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
7.3.8.1.4. Set up the CRL-partitioning for certificates issued via a profile Copiar o linkLink copiado para a área de transferência!
The configuration in this section demonstrates how to partition a CRL to a smaller subset that could be utilized in the FileCrlRule defined above. The CRL is partitioned by the certificate enrollment profile(s) specified in the profileList parameter. A comma-separated list can be used for multiple profiles (for example, caCMCserverCertWithCRLDP.cfg and caCMCECserverCertWithCRLDP.cfg).
Add the following to the CA’s
CS.cfg
:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
For an ECC CA, set the following to SHA512withEC:
ca.crl.ServerCertCRL.signingAlgorithm=SHA512withEC
ca.crl.ServerCertCRL.signingAlgorithm=SHA512withEC
7.3.8.2. Set up CRL HTTP service in the CA Copiar o linkLink copiado para a área de transferência!
The CRL served by the CRL Distribution Point is published to a file (see sections above). This file is served by a non-SSL Tomcat service that we are adding to the CA’s server.xml
as shown below:
Add the following
CRL
service before theCatalina
service in the file/var/lib/pki/rhcs10-RSA-RootCA/conf/server.xml
:Copy to Clipboard Copied! Toggle word wrap Toggle overflow In the above CRL service, choose a connector port number that has not been used. For example, if the root CA’s HTTP port is 8080, then pick 8085. Ensure that the port is added for SELinux and firewall, for example:
semanage port -a -t http_port_t -p tcp 8085 firewall-cmd --permanent --add-port=8085/tcp firewall-cmd --reload
# semanage port -a -t http_port_t -p tcp 8085 # firewall-cmd --permanent --add-port=8085/tcp # firewall-cmd --reload
Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteIf your selected port has been pre-assigned with another SELinux context, you will see an error message that looks like the following:
ValueError: Port tcp/8085 already defined
ValueError: Port tcp/8085 already defined
Copy to Clipboard Copied! Toggle word wrap Toggle overflow You can also search and find out whether the CRL HTTP port is pre-assigned by using the following command:
semanage port -l | grep <port>
# semanage port -l | grep <port>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow We recommend that you select another port. However, if you wish to use the same port, you could do the following:
semanage port -m -t http_port_t -p tcp 8085
# semanage port -m -t http_port_t -p tcp 8085
Copy to Clipboard Copied! Toggle word wrap Toggle overflow When the server is restarted, the directory CRL/localhost is created under the CA’s conf directory if it does not exist. However, to prepare for the addition of the
crl.xml
file, do the following:mkdir -p /var/lib/pki/rhcs10-RSA-RootCA/conf/CRL/localhost chown -R pkiuser:pkiuser /var/lib/pki/rhcs10-RSA-RootCA/conf/CRL/localhost
# mkdir -p /var/lib/pki/rhcs10-RSA-RootCA/conf/CRL/localhost # chown -R pkiuser:pkiuser /var/lib/pki/rhcs10-RSA-RootCA/conf/CRL/localhost
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create a
crl.xml
file under/var/lib/pki/rhcs10-RSA-RootCA/conf/CRL/localhost
, and add the following content:<Context docBase="/var/lib/pki/rhcs10-RSA-RootCA/crl"> <Resources allowLinking="true" cachingAllowed="false" /> </Context>
<Context docBase="/var/lib/pki/rhcs10-RSA-RootCA/crl"> <Resources allowLinking="true" cachingAllowed="false" /> </Context>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Set the
user:group
ownership for thecrl.xml
file:chown pkiuser:pkiuser /var/lib/pki/rhcs10-RSA-RootCA/conf/CRL/localhost/crl.xml
chown pkiuser:pkiuser /var/lib/pki/rhcs10-RSA-RootCA/conf/CRL/localhost/crl.xml
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
The CRL Distribution Point set in the enrollment profile looks like this (see next section for full example): http://rhcs10.example.com:8085/crl/ServerCertCRL.crl
File-based CRL publisher is only recommended for smaller CRLs with less frequently issued or revoked certificates. It is only recommended if necessary, such as in the case of CA startup setup described in this section.
7.3.8.3. CA’s enrollment profile configuration with CRL Distribution Points Copiar o linkLink copiado para a área de transferência!
Enable the desired profile(s) to include the CRL Distribution Points. These are the profiles corresponding to the configuration in the sections above.
Open the
caCMCserverCertWithCRLDP.cfg
profile (for enrollments with RSA keys) in the/var/lib/pki/<ca instance directory/ca/profiles/ca/
directory and update as follows:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Open the
caCMCECserverCertWithCRLDP.cfg
(for enrollments with ECC keys) in the/var/lib/pki/<ca instance directory/ca/profiles/ca/
directory and update as follows:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Set user:group ownership:
chown -R pkiuser:pkiuser /var/lib/pki/rhcs10-RSA-RootCA/ca/profiles/ca/caCMCserverCertWithCRLDP.cfg chown -R pkiuser:pkiuser /var/lib/pki/rhcs10-RSA-RootCA/ca/profiles/ca/caCMCECserverCertWithCRLDP.cfg
# chown -R pkiuser:pkiuser /var/lib/pki/rhcs10-RSA-RootCA/ca/profiles/ca/caCMCserverCertWithCRLDP.cfg # chown -R pkiuser:pkiuser /var/lib/pki/rhcs10-RSA-RootCA/ca/profiles/ca/caCMCECserverCertWithCRLDP.cfg
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Register a new profile in the CA’s
CS.cfg
:Add the following lines for each profile:
profile.caCMCserverCertWithCRLDP.class_id=caEnrollImpl profile.caCMCserverCertWithCRLDP.config=/var/lib/pki/rhcs10-RSA-RootCA/ca/profiles/ca/caCMCserverCertWithCRLDP.cfg profile.caCMCECserverCertWithCRLDP.class_id=caEnrollImpl profile.caCMCECserverCertWithCRLDP.config=/var/lib/pki/rhcs10-RSA-RootCA/ca/profiles/ca/caCMCECserverCertWithCRLDP.cfg
profile.caCMCserverCertWithCRLDP.class_id=caEnrollImpl profile.caCMCserverCertWithCRLDP.config=/var/lib/pki/rhcs10-RSA-RootCA/ca/profiles/ca/caCMCserverCertWithCRLDP.cfg profile.caCMCECserverCertWithCRLDP.class_id=caEnrollImpl profile.caCMCECserverCertWithCRLDP.config=/var/lib/pki/rhcs10-RSA-RootCA/ca/profiles/ca/caCMCECserverCertWithCRLDP.cfg
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Edit the
profile.list
entry to add the two new profiles. For example::profile.list=caCMCserverCertWithCRLDP,caCMCECserverCertWithCRLDP,acmeServerCert,caCMCserverCert,caCMCECserverCert, …
profile.list=caCMCserverCertWithCRLDP,caCMCECserverCertWithCRLDP,acmeServerCert,caCMCserverCert,caCMCECserverCert, …
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
7.3.8.4. Set up for more immediate CRL update Copiar o linkLink copiado para a área de transferência!
Since server certs do not often get revoked, it is reasonable to update the CRL as soon as there is a revocation. Edit the CA’s CS.cfg
:
ca.crl.ServerCertCRL.alwaysUpdate=true
ca.crl.ServerCertCRL.alwaysUpdate=true
7.3.8.5. Start up the CA once the CA’s configuration is updated Copiar o linkLink copiado para a área de transferência!
Once configuration is complete, start up the CA:
pki-server start rhcs10-RSA-RootCA
# pki-server start rhcs10-RSA-RootCA
You will be instructed to verify the CRL Distribution Point setup at the end of Section 7.5.1, “Replace the temporary DS certificate (RootCA)” once the CA’s Directory Server Server-Cert
has been replaced correctly.
7.4. Create and configure the OCSP instance (RootCA) Copiar o linkLink copiado para a área de transferência!
This section describes installing and configuring an OCSP instance against the RootCA.
The OCSP system certificates will be issued by the RootCA, and the OCSP will join the RootCA security domain.
In this example, the RootCA’s OCSP is installed on rhcs10.example.com, with its internal directory server on rhds11.example.com.
This is optional. In general, a root CA is not recommended for doing day-to-day certificate issuance. Therefore, an OCSP for the root CA is not required. In our present example, the RootCA’s OCSP is only presented for demonstration purposes.
Make sure that the file /opt/pki_rsa/ca-chain.pem
contains the complete CA certificate chain (at this point, only the RootCA certificates):
ls -l /opt/pki_rsa/ca-chain.pem cat /opt/pki_rsa/ca-chain.pem
# ls -l /opt/pki_rsa/ca-chain.pem
# cat /opt/pki_rsa/ca-chain.pem
7.4.1. Replace the temporary DS certificate (OCSP-rootca) Copiar o linkLink copiado para a área de transferência!
Prior to installing the OCSP for the RootCA, we are issuing an official SSL server certificate for the OCSP’s Directory Server to replace the temporary bootstrap one. To do that, we first create a certificate signing request (CSR) for the Directory Server certificate, then submit this request to the CA.
Ensure that you use the FQDN of the DS server, e.g. cn=rhds11.example.com
/ host=rhds11.example.com
.
Generate a CSR for the real DS certificate
On rhds11.example.com, generate a PKCS10 certificate signing request for the real DS certificate:
Stop DS:
dsctl slapd-CC-RSA-OCSP-rootca-LDAP stop
# dsctl slapd-CC-RSA-OCSP-rootca-LDAP stop
Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteIf you are not certain about the name of a DS instance, list all instances using: dsctl -l.
Use the
certutil
tool to generate the CSR:certutil -R -d /etc/dirsrv/slapd-CC-RSA-OCSP-rootca-LDAP -s "CN=rhds11.example.com" -g 2048 -f /etc/dirsrv/slapd-CC-RSA-OCSP-rootca-LDAP/pwdfile.txt -a -o /etc/dirsrv/slapd-CC-RSA-OCSP-rootca-LDAP/Server-Cert-ocsp-rootca.csr -z /etc/dirsrv/slapd-CC-RSA-OCSP-rootca-LDAP/noise.txt
# certutil -R -d /etc/dirsrv/slapd-CC-RSA-OCSP-rootca-LDAP -s "CN=rhds11.example.com" -g 2048 -f /etc/dirsrv/slapd-CC-RSA-OCSP-rootca-LDAP/pwdfile.txt -a -o /etc/dirsrv/slapd-CC-RSA-OCSP-rootca-LDAP/Server-Cert-ocsp-rootca.csr -z /etc/dirsrv/slapd-CC-RSA-OCSP-rootca-LDAP/noise.txt
Copy to Clipboard Copied! Toggle word wrap Toggle overflow ImportantEdit the
Server-Cert-ocsp-rootca.csr
output file obtained above to remove the few lines before "Begin Certificate Request". For example:
vi /etc/dirsrv/slapd-CC-RSA-OCSP-rootca-LDAP/Server-Cert-ocsp-rootca.csr
# vi /etc/dirsrv/slapd-CC-RSA-OCSP-rootca-LDAP/Server-Cert-ocsp-rootca.csr
Copy to Clipboard Copied! Toggle word wrap Toggle overflow The CSR file must start with the line "-----BEGIN CERTIFICATE REQUEST-----" and end with the line "-----END CERTIFICATE REQUEST-----".
Remote copy the
Server-Cert-ocsp-rootca.csr
file to the system where the CA resides. For example:scp /etc/dirsrv/slapd-CC-RSA-OCSP-rootca-LDAP/Server-Cert-ocsp-rootca.csr root@rhcs10.example.com:/root/.dogtag/pki_rsa_bootstrap/certs_db/Server-Cert-ocsp-rootca.csr
# scp /etc/dirsrv/slapd-CC-RSA-OCSP-rootca-LDAP/Server-Cert-ocsp-rootca.csr root@rhcs10.example.com:/root/.dogtag/pki_rsa_bootstrap/certs_db/Server-Cert-ocsp-rootca.csr
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Issue the real DS certificate
On rhcs10.example.com, issue the actual SSL server certificate:
Generate a CMC request:
Create a
CMCRequest
configuration file. For example:vim /root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.dirsrv-ocsp-rootca_pkcs10.cfg
# vim /root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.dirsrv-ocsp-rootca_pkcs10.cfg
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Copy to Clipboard Copied! Toggle word wrap Toggle overflow Generate the request using the
CMCRequest
command:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Submit the CMC request:
Create a
HttpClient
configuration file. For example:vim /root/.dogtag/pki_rsa_bootstrap/certs_db/HttpClient_dirsrv-ocsp-rootca.cfg
# vim /root/.dogtag/pki_rsa_bootstrap/certs_db/HttpClient_dirsrv-ocsp-rootca.cfg
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Copy to Clipboard Copied! Toggle word wrap Toggle overflow Submit the request using the
HttpClient
command:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Process the CMC Response:
Process the response using
CMCResponse
to display all certificates in chain individually in PEM format:ImportantRunning CMCResponse with the "-v" option returns the PEM of each certificate in the chain as Cert:0, Cert:1 etc. Below all the PEMs, the output also displays each certificate in the chain in pretty print format. Since the certificates are not displayed in a fixed order, in order to determine their position in the chain, you must examine the "Subject:" under each "Certificate". The corresponding PEM is displayed in the same position above.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Save the new
Server-Cert
DS certificate into a file in the bootstrap certificate directory (e.g./root/.dogtag/pki_rsa_bootstrap/certs_db/
) named accordingly. The.pem
file must start with the header-----BEGIN CERTIFICATE-----
and end with the footer-----END CERTIFICATE-----
. For example:vi /root/.dogtag/pki_rsa_bootstrap/certs_db/Server-Cert-ocsp-rootca.pem
# vi /root/.dogtag/pki_rsa_bootstrap/certs_db/Server-Cert-ocsp-rootca.pem
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Where
Server-Cert-ocsp-rootca.pem
is the newServer-Cert
certificate of the Directory Server instance that serves as the internaldb of the OCSP for the RootCA.NoteThe RootCA’s signing certificate should match with the output from the following command:
certutil -L -d /var/lib/pki/rhcs10-RSA-RootCA/alias/ -n "CA Signing Cert - rhcs10-RSA-RootCA" -a
# certutil -L -d /var/lib/pki/rhcs10-RSA-RootCA/alias/ -n "CA Signing Cert - rhcs10-RSA-RootCA" -a
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Remote copy the new
Server-Cert
certificate to rhds11.example.com. For example:scp /root/.dogtag/pki_rsa_bootstrap/certs_db/Server-Cert-ocsp-rootca.pem root@rhds11.example.com:/etc/dirsrv/slapd-CC-RSA-OCSP-rootca-LDAP/
# scp /root/.dogtag/pki_rsa_bootstrap/certs_db/Server-Cert-ocsp-rootca.pem root@rhds11.example.com:/etc/dirsrv/slapd-CC-RSA-OCSP-rootca-LDAP/
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Replace the temporary DS certificate
On rhds11.example.com, replace the temporary DS certificate with the actual DS certificate:
Save the contents of the
dirsrv
directory into a backup directory:cp -r /etc/dirsrv/slapd-CC-RSA-OCSP-rootca-LDAP/ /etc/dirsrv/save-rsa/slapd-CC-RSA-OCSP-rootca-LDAP/
# cp -r /etc/dirsrv/slapd-CC-RSA-OCSP-rootca-LDAP/ /etc/dirsrv/save-rsa/slapd-CC-RSA-OCSP-rootca-LDAP/
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Delete the old DS certificates:
certutil -D -d /etc/dirsrv/slapd-CC-RSA-OCSP-rootca-LDAP/ -f /etc/dirsrv/slapd-CC-RSA-OCSP-rootca-LDAP/pwdfile.txt -n "Server-Cert"
# certutil -D -d /etc/dirsrv/slapd-CC-RSA-OCSP-rootca-LDAP/ -f /etc/dirsrv/slapd-CC-RSA-OCSP-rootca-LDAP/pwdfile.txt -n "Server-Cert"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow certutil -D -d /etc/dirsrv/slapd-CC-RSA-OCSP-rootca-LDAP/ -f /etc/dirsrv/slapd-CC-RSA-OCSP-rootca-LDAP/pwdfile.txt -n "Self-Signed-CA"
# certutil -D -d /etc/dirsrv/slapd-CC-RSA-OCSP-rootca-LDAP/ -f /etc/dirsrv/slapd-CC-RSA-OCSP-rootca-LDAP/pwdfile.txt -n "Self-Signed-CA"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Import the newly created DS certificate and its CA certificate in chain one by one. For example:
certutil -d /etc/dirsrv/slapd-CC-RSA-OCSP-rootca-LDAP/ -f /etc/dirsrv/slapd-CC-RSA-OCSP-rootca-LDAP/pwdfile.txt -A -t "CT,C,C" -n "CA Signing Cert - rhcs10-RSA-RootCA" -i /opt/pki_rsa/rootCA.pem
# certutil -d /etc/dirsrv/slapd-CC-RSA-OCSP-rootca-LDAP/ -f /etc/dirsrv/slapd-CC-RSA-OCSP-rootca-LDAP/pwdfile.txt -A -t "CT,C,C" -n "CA Signing Cert - rhcs10-RSA-RootCA" -i /opt/pki_rsa/rootCA.pem
Copy to Clipboard Copied! Toggle word wrap Toggle overflow certutil -d /etc/dirsrv/slapd-CC-RSA-OCSP-rootca-LDAP/ -f /etc/dirsrv/slapd-CC-RSA-OCSP-rootca-LDAP/pwdfile.txt -A -t "u,u,u" -n "Server-Cert" -i /etc/dirsrv/slapd-CC-RSA-OCSP-rootca-LDAP/Server-Cert-ocsp-rootca.pem
# certutil -d /etc/dirsrv/slapd-CC-RSA-OCSP-rootca-LDAP/ -f /etc/dirsrv/slapd-CC-RSA-OCSP-rootca-LDAP/pwdfile.txt -A -t "u,u,u" -n "Server-Cert" -i /etc/dirsrv/slapd-CC-RSA-OCSP-rootca-LDAP/Server-Cert-ocsp-rootca.pem
Copy to Clipboard Copied! Toggle word wrap Toggle overflow List the certificates:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Start DS:
dsctl slapd-CC-RSA-OCSP-rootca-LDAP start
# dsctl slapd-CC-RSA-OCSP-rootca-LDAP start
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Test to confirm that the LDAP server is up and running (in case of a separate system, test on the CA host as well):
ldapsearch -x -D "cn=Directory Manager" -H ldaps://rhds11.example.com:6636 -b "dc=example,dc=com" -w SECret.123
# ldapsearch -x -D "cn=Directory Manager" -H ldaps://rhds11.example.com:6636 -b "dc=example,dc=com" -w SECret.123
Copy to Clipboard Copied! Toggle word wrap Toggle overflow If testing on a separate system, include the CA certificate chain in front of the
ldapsearch
command, for example:LDAPTLS_CACERT=/opt/pki_rsa/ca-chain.pem ldapsearch -x -D "cn=Directory Manager" -H ldaps://rhds11.example.com:6636 -b "dc=example,dc=com" -w SECret.123
# LDAPTLS_CACERT=/opt/pki_rsa/ca-chain.pem ldapsearch -x -D "cn=Directory Manager" -H ldaps://rhds11.example.com:6636 -b "dc=example,dc=com" -w SECret.123
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
7.4.2. Install the OCSP instance for the RootCA Copiar o linkLink copiado para a área de transferência!
To install the OCSP instance for the RootCA, use either the single-step method or the two-step method. The following procedure describes the single-step method. If you wish to install using the two-step method, please refer to Section 7.2.2, “Installation methods (single-step or two-step)” as well as Section 7.3.2, “Installing the RootCA instance (two-step method)”.
Prerequisites
- You are logged in to rhcs10.example.com as root user.
- You have Section 7.1.2.2, “Installing a DS instance for the RootCA’s OCSP”, in our example, CC-RSA-OCSP-rootca-LDAP is the internal database of the RootCA’s OCSP.
Procedure
Create an OCSP installation file at a chosen location (e.g.
/root/pki_rsa
) for generating certificate requests:cd /root/pki_rsa
# cd /root/pki_rsa
Copy to Clipboard Copied! Toggle word wrap Toggle overflow vi ocsp_rootca_inst.cfg
# vi ocsp_rootca_inst.cfg
Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteUnless explicitly specified, system certificate nicknames are automatically named bearing the value specified for
pki_instance_name
. To avoid certificate nickname conflicts on a shared HSM, use a unique instance name for each instance creation.
The values specified in the installation file below are examples. In addition to changing the HSM password, edit the values accordingly, for example ports, directories, nicknames, domains…
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Run the
pkispawn
tool to install the OCSP subsystem:pkispawn -s OCSP -f ocsp_rootca_inst.cfg --debug
# pkispawn -s OCSP -f ocsp_rootca_inst.cfg --debug
Copy to Clipboard Copied! Toggle word wrap Toggle overflow This will create the OCSP instance in
/var/lib/pki/rhcs10-RSA-OCSP-rootca
.
For ease of reference, if you wanted to install this OCSP using the two-step method:
First run the
pkispawn
tool with the--skip-configuration
option to install the RootCA’s OCSP instance:pkispawn -s OCSP -f ocsp_rootca_inst.cfg --skip-configuration --debug
# pkispawn -s OCSP -f ocsp_rootca_inst.cfg --skip-configuration --debug
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Customize the configuration files between the two installation steps
Run the
pkispawn
tool to configure the OCSP:pkispawn -s OCSP -f ocsp_rootca_inst.cfg --skip-installation --debug
# pkispawn -s OCSP -f ocsp_rootca_inst.cfg --skip-installation --debug
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
Show the status of the installed OCSP instance:
pki-server status rhcs10-RSA-OCSP-rootca
# pki-server status rhcs10-RSA-OCSP-rootca
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
7.4.3. Increase the RootCA’s OCSP pkiconsole timeout Copiar o linkLink copiado para a área de transferência!
- Log in to rhcs10.example.com as root.
Stop the RootCA’s OCSP service:
pki-server stop rhcs10-RSA-OCSP-rootca
pki-server stop rhcs10-RSA-OCSP-rootca
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Edit
/var/lib/pki/rhcs10-RSA-OCSP-rootca/conf/server.xml
to increase the timeout period:<Connector name="Secure" port="33443" … connectionTimeout="3000000"
<Connector name="Secure" port="33443" … connectionTimeout="3000000"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Start the RootCA’s OCSP service:
pki-server start rhcs10-RSA-OCSP-rootca
# pki-server start rhcs10-RSA-OCSP-rootca
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
7.4.4. Set the default AIA extension to point to this OCSP Copiar o linkLink copiado para a área de transferência!
By default, unless explicitly specified, the CA issues certificates with an AIA (Authority Information Access) extension pointing to the CA’s own internal OCSP. Now that you have set up an OCSP instance, you can configure the RootCA to start issuing certificates with an AIA extension that points to the OCSP instance instead.
On rhcs10.example.com as root:
Stop the RootCA:
pki-server stop rhcs10-RSA-RootCA
# pki-server stop rhcs10-RSA-RootCA
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Edit the RootCA’s
CS.cfg
and set theca.defaultOcspUri
variable to point to the OCSP. For example:ca.defaultOcspUri=http://rhcs10.example.com:33080/ocsp/ee/ocsp
ca.defaultOcspUri=http://rhcs10.example.com:33080/ocsp/ee/ocsp
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Start the RootCA:
pki-server start rhcs10-RSA-RootCA
# pki-server start rhcs10-RSA-RootCA
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
The OCSP URL of each subsystem (e.g. KRA) is set in its server.xml
file by default. When enabled, this directs the RHCS instance to use the static URL when looking up a certificate status, instead of the AIA extension embedded in the peer certificate. To use the AIA extension, you will be directed to follow Section 7.13.10.2, “Enabling OCSP for the CA / KRA / TKS / TPS” when installing the subsystem.
7.4.5. Create OCSP role users Copiar o linkLink copiado para a área de transferência!
Follow the steps in Section 7.12, “Create PKI role users” to create single-role admin, agent, audit users in OCSP. In order to do so, you will need to import the RootCA’s OCSP bootstrap administrator certificate,
ocsp_admin_cert.p12
. E.g.:pki -d /root/.dogtag/pki_rsa_bootstrap/certs_db -c SECret.123 client-cert-import --pkcs12 /opt/pki_rsa/rhcs10-RSA-OCSP-rootca/ocsp_admin_cert.p12 --pkcs12-password SECret.123
# pki -d /root/.dogtag/pki_rsa_bootstrap/certs_db -c SECret.123 client-cert-import --pkcs12 /opt/pki_rsa/rhcs10-RSA-OCSP-rootca/ocsp_admin_cert.p12 --pkcs12-password SECret.123 ---------------------------------------- Imported certificates from PKCS #12 file ----------------------------------------
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
7.4.6. Login to the OCSP pkiconsole with client authentication Copiar o linkLink copiado para a área de transferência!
-
Configure OCSP with
authType=sslclientauth
and import the role user certificate by following Section 7.13.6, “Configure pkiconsole login with client authentication”. Login to
pkiconsole
with the client authentication certificate of the role user:pkiconsole -d <home .redhat-idm-console dir> -n <client cert> https://rhcs10.example.com:33443/ocsp
# pkiconsole -d <home .redhat-idm-console dir> -n <client cert> https://rhcs10.example.com:33443/ocsp
Copy to Clipboard Copied! Toggle word wrap Toggle overflow And select the role user certificate nickname from the list, for example OCSP adminV. Login to the console should be successful.
7.4.7. Configuration for CRL publishing Copiar o linkLink copiado para a área de transferência!
Red Hat Certificate System offers two methods of CRL publishing to be consumed by an OCSP instance external to the CA:
- Direct CA→OCSP CRL publishing
- Indirect publishing with CA→LDAP, then OCSP←LDAP
By default, once you set up an OCSP instance, the first CRL publishing method is automatically set up as well, which allows direct CA→OCSP CRL publishing.
This section details the second method, which is to have the CA publish its CRLs to an LDAP server, and the OCSP can then pull the CRLs from the LDAP server.
7.4.7.1. Setting up the LDAP server for CRL publishing Copiar o linkLink copiado para a área de transferência!
On rhds11.example.com as root:
Install a Directory Server instance, which the CA will use to publish the CRL. Red Hat Directory Server is listening over the LDAP/LDAPS ports, 12389 and 12636 respectively.
Use the
dscreate create-template
command to create a template.cfg
file at a chosen location (e.g./root/pki_rsa
):dscreate create-template /root/pki_rsa/rootca-crl-publish-ldap.cfg
# dscreate create-template /root/pki_rsa/rootca-crl-publish-ldap.cfg
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Edit the
.cfg
file created in the previous step. Uncomment the below parameters and set them to customize the installation:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Install the Directory Server instance:
dscreate from-file /root/pki_rsa/rootca-crl-publish-ldap.cfg
# dscreate from-file /root/pki_rsa/rootca-crl-publish-ldap.cfg Starting installation... Completed installation for CC-RSA-RootCA-CRL-PUBLISH
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Add an ACI (Access Control Instruction) rule to allow anonymous bind access. By default, this is disabled.
Create the
ldapaci.ldif
file at a chosen location (e.g./root/pki_rsa/dirsrv/
) with the following content:dn: dc=example,dc=com changetype: modify add: aci aci: (targetattr!="userPassword || aci")(version 3.0; acl "Enable anonymous access"; allow (read, search, compare) userdn="ldap:///anyone";)
dn: dc=example,dc=com changetype: modify add: aci aci: (targetattr!="userPassword || aci")(version 3.0; acl "Enable anonymous access"; allow (read, search, compare) userdn="ldap:///anyone";)
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Run the
ldapmodify
command to add the ACI:ldapmodify -x -h rhds11.example.com -p 12389 -D 'cn=Directory Manager' -W -f /root/pki_rsa/dirsrv/ldapaci.ldif
# ldapmodify -x -h rhds11.example.com -p 12389 -D 'cn=Directory Manager' -W -f /root/pki_rsa/dirsrv/ldapaci.ldif
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Prepare the CRL publishing subtree:
Create two files in the
/root/pki_rsa/dirsrv
directory with the following content:For the
rootca_pki_subtree.ldif
file:dn: dc=pki,dc=example,dc=com objectClass: domain dc: pki
dn: dc=pki,dc=example,dc=com objectClass: domain dc: pki
Copy to Clipboard Copied! Toggle word wrap Toggle overflow For the
rootca_crl_subtree.ldif
file:dn: dc=crl,dc=pki,dc=example,dc=com objectClass: domain dc: crl
dn: dc=crl,dc=pki,dc=example,dc=com objectClass: domain dc: crl
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Add both entries to the CRL instance:
ldapadd -x -H ldap://rhds11.example.com:12389 -D "cn=Directory Manager" -W -f /root/pki_rsa/dirsrv/rootca_pki_subtree.ldif
# ldapadd -x -H ldap://rhds11.example.com:12389 -D "cn=Directory Manager" -W -f /root/pki_rsa/dirsrv/rootca_pki_subtree.ldif
Copy to Clipboard Copied! Toggle word wrap Toggle overflow ldapadd -x -H ldap://rhds11.example.com:12389 -D "cn=Directory Manager" -W -f /root/pki_rsa/dirsrv/rootca_crl_subtree.ldif
# ldapadd -x -H ldap://rhds11.example.com:12389 -D "cn=Directory Manager" -W -f /root/pki_rsa/dirsrv/rootca_crl_subtree.ldif
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
7.4.7.2. Configuring CRL publishing on the RootCA Copiar o linkLink copiado para a área de transferência!
To configure CRL publishing:
Add the
ca.publish.
properties:Stop the RootCA instance:
pki-server stop rhcs10-RSA-RootCA
# pki-server stop rhcs10-RSA-RootCA
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Configure the following properties in the RootCA’s
CS.cfg
configuration file (e.g./var/lib/pki/rhcs10-RSA-RootCA/ca/conf/CS.cfg
):Copy to Clipboard Copied! Toggle word wrap Toggle overflow NOTEAlternatively, you can use the
ca-config-set
command to update the properties. For example:pki-server ca-config-set -i rhcs10-RSA-RootCA ca.publish.ldappublish.ldap.ldapconn.host rhds11.example.com; pki-server ca-config-set -i rhcs10-RSA-RootCA ca.publish.ldappublish.ldap.ldapconn.port 12389; pki-server ca-config-set -i rhcs10-RSA-RootCA ca.publish.mapper.instance.LdapCaCertMap.dnPattern "cn=\$subj.cn,dc=crl,dc=pki,dc=example,dc=com"; pki-server ca-config-set -i rhcs10-RSA-RootCA ca.publish.mapper.instance.LdapCrlMap.dnPattern cn=\$subj.cn,dc=crl,dc=pki,dc=example,dc=com
# pki-server ca-config-set -i rhcs10-RSA-RootCA ca.publish.ldappublish.ldap.ldapconn.host rhds11.example.com; pki-server ca-config-set -i rhcs10-RSA-RootCA ca.publish.ldappublish.ldap.ldapconn.port 12389; pki-server ca-config-set -i rhcs10-RSA-RootCA ca.publish.mapper.instance.LdapCaCertMap.dnPattern "cn=\$subj.cn,dc=crl,dc=pki,dc=example,dc=com"; pki-server ca-config-set -i rhcs10-RSA-RootCA ca.publish.mapper.instance.LdapCrlMap.dnPattern cn=\$subj.cn,dc=crl,dc=pki,dc=example,dc=com
Copy to Clipboard Copied! Toggle word wrap Toggle overflow And so on.
You can check that the parameters were successfully updated by using the
ca-config-show
command. For example:pki-server ca-config-show -i rhcs10-RSA-RootCA ca.publish.ldappublish.ldap.ldapconn.host rhds11.example.com; pki-server ca-config-show -i rhcs10-RSA-RootCA ca.publish.ldappublish.ldap.ldapconn.port 12389; pki-server ca-config-show -i rhcs10-RSA-RootCA ca.publish.mapper.instance.LdapCaCertMap.dnPattern "cn=\$subj.cn,dc=crl,dc=pki,dc=example,dc=com"; pki-server ca-config-show -i rhcs10-RSA-RootCA ca.publish.mapper.instance.LdapCrlMap.dnPattern cn=\$subj.cn,dc=crl,dc=pki,dc=example,dc=com
# pki-server ca-config-show -i rhcs10-RSA-RootCA ca.publish.ldappublish.ldap.ldapconn.host rhds11.example.com; pki-server ca-config-show -i rhcs10-RSA-RootCA ca.publish.ldappublish.ldap.ldapconn.port 12389; pki-server ca-config-show -i rhcs10-RSA-RootCA ca.publish.mapper.instance.LdapCaCertMap.dnPattern "cn=\$subj.cn,dc=crl,dc=pki,dc=example,dc=com"; pki-server ca-config-show -i rhcs10-RSA-RootCA ca.publish.mapper.instance.LdapCrlMap.dnPattern cn=\$subj.cn,dc=crl,dc=pki,dc=example,dc=com
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Start the RootCA instance:
pki-server start rhcs10-RSA-RootCA
pki-server start rhcs10-RSA-RootCA
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Push the CRL and CA certificate to the LDAP directory via
curl
. For example:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Disable the direct CA→OCSP CRL publishing method:
Stop the RootCA:
pki-server stop rhcs10-RSA-RootCA
pki-server stop rhcs10-RSA-RootCA
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Edit the CA’s
CS.cfg
configuration file (e.g./var/lib/pki/rhcs10-RSA-RootCA/ca/conf/CS.cfg
) and set the following tofalse
:ca.publish.rule.instance.ocsprule-<host/port info>.enable=false
ca.publish.rule.instance.ocsprule-<host/port info>.enable=false
Copy to Clipboard Copied! Toggle word wrap Toggle overflow For example:
ca.publish.rule.instance.ocsprule-rhcs10-example-com-33443.enable=false
ca.publish.rule.instance.ocsprule-rhcs10-example-com-33443.enable=false
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Start the CA for the configuration change to take effect:
pki-server start rhcs10-RSA-RootCA
# pki-server start rhcs10-RSA-RootCA
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Update the Directory Server using
curl
. For example:curl \ -d "updateCRL=yes&updateCA=yes&xml=true" \ --cert-type P12 --cert /opt/pki_rsa/rhcs10-RSA-RootCA/ca_admin_cert.p12:SECret.123 \ -k https://rhcs10.example.com:8443/ca/agent/ca/updateDir | xmllint --format -
# curl \ -d "updateCRL=yes&updateCA=yes&xml=true" \ --cert-type P12 --cert /opt/pki_rsa/rhcs10-RSA-RootCA/ca_admin_cert.p12:SECret.123 \ -k https://rhcs10.example.com:8443/ca/agent/ca/updateDir | xmllint --format -
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Display the CRL using
curl
:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Run
ldapsearch
to verify that the CRL and the CA certificate are pushed to the LDAP directory:ldapsearch -x -D "cn=Directory Manager" -h "rhds11.example.com" -p 12389 -b "dc=example,dc=com" -w SECret.123
# ldapsearch -x -D "cn=Directory Manager" -h "rhds11.example.com" -p 12389 -b "dc=example,dc=com" -w SECret.123
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Disable certificate publishing for the RootCA (optional):
The following procedure is to prevent a WARNING message in the debug logs like the following:
2024-01-29 00:04:10 [Thread-18] INFO: CAPublisherProcessor: No rules enabled 2024-01-29 00:04:10 [Thread-18] SEVERE: PublishProcessor::publishCert : Failed to publish using rule: No rules enabled 2024-01-29 00:04:10 [Thread-18] WARNING: Could not publish certificate serial number 0x9c2762c. Error Failed to publish using rule: No rules enabled Failed to publish using rule: No rules enabled
2024-01-29 00:04:10 [Thread-18] INFO: CAPublisherProcessor: No rules enabled
2024-01-29 00:04:10 [Thread-18] SEVERE: PublishProcessor::publishCert : Failed to publish using rule: No rules enabled
2024-01-29 00:04:10 [Thread-18] WARNING: Could not publish certificate serial number 0x9c2762c. Error Failed to publish using rule: No rules enabled
Failed to publish using rule: No rules enabled
Stop the RootCA:
pki-server stop rhcs10-RSA-RootCA
# pki-server stop rhcs10-RSA-RootCA
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Edit
/var/lib/pki/rhcs10-RSA-RootCA/ca/conf/CS.cfg
and set the following:ca.publish.cert.enable=false
ca.publish.cert.enable=false
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Start the RootCA for the configuration change to take effect:
pki-server start rhcs10-RSA-RootCA
# pki-server start rhcs10-RSA-RootCA
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
7.4.7.3. Configuring the OCSP to pull the CRLs from the LDAP server Copiar o linkLink copiado para a área de transferência!
When you chose the alternative CRL publishing method, you need to set up the OCSP so that it knows where to pull the CRLs from. In order to do so, you need to configure the OCSP Revocation Info store information to point to the CRL publishing LDAP instance beforehand (that you have set up earlier in this chapter).
To configure the OCSP Revocation Info Store:
Stop the OCSP:
pki-server stop rhcs10-RSA-OCSP-rootca
# pki-server stop rhcs10-RSA-OCSP-rootca
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Set the
ldapStore
properties in the OCSP’sCS.cfg
configuration file (e.g./var/lib/pki/rhcs10-RSA-OCSP-rootca/ocsp/conf/CS.cfg
). Make sure you change theocsp.storeId
parameter fromdefStore
toldapStore
and add the following parameters:Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteThe default value of
refreshInSec0
is 86400, we configured it to be 120 for the purpose of testing, so that CRL updates happen every 2 minutes.Optionally, for better observation, you can set the debug level to 0 in the OCSP’s
CS.cfg
configuration file to ensure the LDAPStore update displays in the debug log. Otherwise, it will only display the status when there is no update.debug.level=0
debug.level=0
Copy to Clipboard Copied! Toggle word wrap Toggle overflow However, be warned that doing so will quickly increase the size of the debug log, especially with the OCSP systems. It is therefore only recommended for a short testing period.
Start the OCSP for the
ldapStore
configuration to take effect:pki-server start rhcs10-RSA-OCSP-rootca
# pki-server start rhcs10-RSA-OCSP-rootca
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
7.4.7.4. Testing CRL publishing Copiar o linkLink copiado para a área de transferência!
In this section, we are going to test CRL publishing by creating two user certificates, one of which will then be revoked. We will then check both the valid certificate and the revoked certificate against the OCSP instance to verify if the responses are as expected.
Create CMC certificates
Create agent-signed CMC certificates for user1
and for user2
, the CMC requests are signed by the bootstrap admin certificate. For example, for user1
:
List the certificates in the database:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Use the
PKCS10Client
tool to generate a PKCS10 certificate request:PKCS10Client -d /root/.dogtag/pki_rsa_bootstrap/certs_db -p SECret.123 -n "cn=test user1, uid=user1" -o /root/.dogtag/pki_rsa_bootstrap/certs_db/user1.req
# PKCS10Client -d /root/.dogtag/pki_rsa_bootstrap/certs_db -p SECret.123 -n "cn=test user1, uid=user1" -o /root/.dogtag/pki_rsa_bootstrap/certs_db/user1.req PKCS10Client: Certificate request written into /root/.dogtag/pki_rsa_bootstrap/certs_db/user1.req PKCS10Client: PKCS#10 request key id written into /root/.dogtag/pki_rsa_bootstrap/certs_db/user1.req.keyId
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Use
cat
on the.keyID
file to display the key id. You will need it for therequest.privKeyId=
field in the next step:cat /root/.dogtag/pki_rsa_bootstrap/certs_db/user1.req.keyId; echo
# cat /root/.dogtag/pki_rsa_bootstrap/certs_db/user1.req.keyId; echo
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Generate a CMC request:
Create a
CMCRequest
configuration file, using the PKCS#10 request and private key id you obtained from the previous step. For example:vi cmcRequest_p10_user1.cfg
# vi cmcRequest_p10_user1.cfg
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Copy to Clipboard Copied! Toggle word wrap Toggle overflow Generate the request using the
CMCRequest
command:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Submit the CMC request:
Create a
HttpClient
configuration file. For example:vim /root/.dogtag/pki_rsa_bootstrap/certs_db/HttpClient_cmc_p10_user1.cfg
# vim /root/.dogtag/pki_rsa_bootstrap/certs_db/HttpClient_cmc_p10_user1.cfg
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Copy to Clipboard Copied! Toggle word wrap Toggle overflow Submit the request using the
HttpClient
command:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Process the response using the
CMCResponse
command:Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Similarly, create a certificate for
user2
by repeating the above procedure with the adequate values.
Set up revocation
Now, set up revocation in order to revoke the user2
certificate:
Push the CRL and CA certificate to the LDAP directory:
- Login to the RootCA’s Agent UI in the browser.
- Select Update Revocation List and click Update.
Click Update Directory Server and select:
- Update the certificate revocation list to the directory
- Update Certificate Manager certificate to the directory
- Click Update Directory.
-
Wait for the OCSP’s
ldapStore
refresh to happen (observe the debug file in/var/lib/pki/rhcs10-RSA-OCSP-rootca/ocsp/logs/debug
).
Check the certificate status by using the
OCSPClient
tool. For example, using the certificate serial number ofuser1
(in decimal):Copy to Clipboard Copied! Toggle word wrap Toggle overflow Revoke the certificate of
user2
:Create a
CMCRequest
configuration file. For example:vi cmc-agent-signed-revoke.cfg
# vi cmc-agent-signed-revoke.cfg
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Copy to Clipboard Copied! Toggle word wrap Toggle overflow Generate the request using the
CMCRequest
command:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create a
HttpClient
configuration file. For example:vi HttpClient.revoke.agentSigned.cfg
# vi HttpClient.revoke.agentSigned.cfg
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Copy to Clipboard Copied! Toggle word wrap Toggle overflow Submit the request using the
HttpClient
command:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Process the CMC Response:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
-
Verify in the CA signed audit log, for example
/var/log/pki/rhcs10-RSA-RootCA/ca/signedAudit/ca_audit
, that theuser2
certificate indeed got revoked. Wait until the next CRL autoupdate (update interval in minutes configured by the
ca.crl.MasterCRL.autoUpdateInterval
of the RootCA’sCS.cfg
file. By default, this is set to 240 minutes).NoteAlternatively, if you want to manually update the CRL immediately, login to the RootCA’s Agent UI in the browser, and:
- Select Update Revocation List and click Update.
Click Update Directory Server and select:
- Update the certificate revocation list to the directory
-
Update Certificate Manager certificate to the directory
- Click Update Directory.
Once the
ldapStore
refresh completes, observe the debug file in/var/lib/pki/rhcs10-RSA-OCSP-rootca/ocsp/logs/debug
.Verify with the
OCSPCLient
tool that the certificate ofuser2
has been revoked, using its serial number in decimal (with-c
pointing to the nickname of the signing CA):Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Set ocsp.store.ldapStore.refreshInSec0
back to the desired value
Previously, we set ocsp.store.ldapStore.refreshInSec0=120
to allow for quicker CRL refresh (2 minutes) for testing purposes.
-
Please change the value in the OCSP’s
CS.cfg
to your desired value (in seconds), update the debug level back to 10 and restart the OCSP.
7.5. Create and configure the RootCA (Part II) Copiar o linkLink copiado para a área de transferência!
This section continues the RootCA installation. It will walk you through the process of replacing the temporary DS TLS server certificate. If you have installed an OCSP instance, the role user certificates and the TLS server certificate of the RootCA will bear AIA extensions pointing to the OCSP instance.
7.5.1. Replace the temporary DS certificate (RootCA) Copiar o linkLink copiado para a área de transferência!
Once the RootCA installation is complete, it can issue an official SSL server certificate for the Directory Server to replace the temporary one. Create a certificate signing request (CSR) for the Directory Server certificate, then submit this request to the CA using the RootCA bootstrap user credentials.
Ensure that you use the FQDN of the DS server, e.g. cn=rhds11.example.com
/ host=rhds11.example.com
.
Generate a CSR for the real DS certificate
On rhds11.example.com, generate a PKCS10 certificate signing request for the real DS certificate:
Verify the existence of the nssdb password file on this instance:
ls /etc/dirsrv/slapd-CC-RSA-RootCA-LDAP/pwdfile.txt
# ls /etc/dirsrv/slapd-CC-RSA-RootCA-LDAP/pwdfile.txt
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Stop DS:
dsctl slapd-CC-RSA-RootCA-LDAP stop
# dsctl slapd-CC-RSA-RootCA-LDAP stop
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Use the
certutil
tool to generate the CSR:certutil -R -d /etc/dirsrv/slapd-CC-RSA-RootCA-LDAP -s "CN=rhds11.example.com" -g 2048 -f /etc/dirsrv/slapd-CC-RSA-RootCA-LDAP/pwdfile.txt -a -o /etc/dirsrv/slapd-CC-RSA-RootCA-LDAP/Server-Cert-rootca.csr -z /etc/dirsrv/slapd-CC-RSA-RootCA-LDAP/noise.txt
# certutil -R -d /etc/dirsrv/slapd-CC-RSA-RootCA-LDAP -s "CN=rhds11.example.com" -g 2048 -f /etc/dirsrv/slapd-CC-RSA-RootCA-LDAP/pwdfile.txt -a -o /etc/dirsrv/slapd-CC-RSA-RootCA-LDAP/Server-Cert-rootca.csr -z /etc/dirsrv/slapd-CC-RSA-RootCA-LDAP/noise.txt
Copy to Clipboard Copied! Toggle word wrap Toggle overflow ImportantEdit the
Server-Cert-rootca.csr
output file obtained above to remove the few lines before "Begin Certificate Request". For example:
vi /etc/dirsrv/slapd-CC-RSA-RootCA-LDAP/Server-Cert-rootca.csr
# vi /etc/dirsrv/slapd-CC-RSA-RootCA-LDAP/Server-Cert-rootca.csr
Copy to Clipboard Copied! Toggle word wrap Toggle overflow The CSR file must start with the line "-----BEGIN CERTIFICATE REQUEST-----" and end with the line "-----END CERTIFICATE REQUEST-----".
Start DS:
dsctl slapd-CC-RSA-RootCA-LDAP start
# dsctl slapd-CC-RSA-RootCA-LDAP start
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Remote copy the
Server-Cert-rootca.csr
file to the system where the CA resides. For example:scp /etc/dirsrv/slapd-CC-RSA-RootCA-LDAP/Server-Cert-rootca.csr root@rhcs10.example.com:/root/.dogtag/pki_rsa_bootstrap/certs_db/Server-Cert-rootca.csr
# scp /etc/dirsrv/slapd-CC-RSA-RootCA-LDAP/Server-Cert-rootca.csr root@rhcs10.example.com:/root/.dogtag/pki_rsa_bootstrap/certs_db/Server-Cert-rootca.csr
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Issue the real DS certificate
On rhcs10.example.com, issue the actual SSL server certificate:
Generate a CMC request:
Create a
CMCRequest
configuration file. For example:vim /root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.dirsrv-rootca_pkcs10.cfg
# vim /root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.dirsrv-rootca_pkcs10.cfg
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Copy to Clipboard Copied! Toggle word wrap Toggle overflow Generate the request using the
CMCRequest
command:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Submit the CMC request:
Create a
HttpClient
configuration file. For example:vim /root/.dogtag/pki_rsa_bootstrap/certs_db/HttpClient_dirsrv-rootca.cfg
# vim /root/.dogtag/pki_rsa_bootstrap/certs_db/HttpClient_dirsrv-rootca.cfg
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteFor EC certificates, use the ECC profiles by setting:
servlet=/ca/ee/ca/profileSubmitCMCFull?profileId=caCMCECserverCertWithCRLDP
servlet=/ca/ee/ca/profileSubmitCMCFull?profileId=caCMCECserverCertWithCRLDP
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Submit the request using the
HttpClient
command:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Process the CMC Response :
Process the response using
CMCResponse
to display all certificates in chain individually in PEM format:ImportantRunning CMCResponse with the "-v" option returns the PEM of each certificate in the chain as Cert:0, Cert:1 etc. Below all the PEMs, the output also displays each certificate in the chain in pretty print format. Since the certificates are not displayed in a fixed order, in order to determine their position in the chain, you must examine the "Subject:" under each "Certificate". The corresponding PEM is displayed in the same position above.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Save the new
Server-Cert
DS certificate into a file in the bootstrap certificate directory (e.g./root/.dogtag/pki_rsa_bootstrap/certs_db/
) named accordingly. The.pem
file must start with the header-----BEGIN CERTIFICATE-----
and end with the footer-----END CERTIFICATE-----
. For example:vi /root/.dogtag/pki_rsa_bootstrap/certs_db/Server-Cert-rootca.pem
# vi /root/.dogtag/pki_rsa_bootstrap/certs_db/Server-Cert-rootca.pem
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Where
Server-Cert-rootca.pem
is the newServer-Cert
certificate of the Directory Server instance that serves as the internaldb of the RootCA.NoteThe RootCA’s signing certificate should match with the output from the following command:
certutil -L -d /var/lib/pki/rhcs10-RSA-RootCA/alias/ -n "CA Signing Cert - rhcs10-RSA-RootCA" -a
# certutil -L -d /var/lib/pki/rhcs10-RSA-RootCA/alias/ -n "CA Signing Cert - rhcs10-RSA-RootCA" -a
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Remote copy the new
Server-Cert
certificate to rhds11.example.com. For example:scp /root/.dogtag/pki_rsa_bootstrap/certs_db/Server-Cert-rootca.pem root@rhds11.example.com:/etc/dirsrv/slapd-CC-RSA-RootCA-LDAP/
# scp /root/.dogtag/pki_rsa_bootstrap/certs_db/Server-Cert-rootca.pem root@rhds11.example.com:/etc/dirsrv/slapd-CC-RSA-RootCA-LDAP/
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Replace the temporary DS certificate
On rhds11.example.com, replace the temporary DS certificate with the actual DS certificate:
Stop DS:
dsctl slapd-CC-RSA-RootCA-LDAP stop
# dsctl slapd-CC-RSA-RootCA-LDAP stop
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Save the contents of the
dirsrv
directory into a backup directory:cp -r /etc/dirsrv/slapd-CC-RSA-RootCA-LDAP/ /etc/dirsrv/save-rsa/slapd-CC-RSA-RootCA-LDAP/
# cp -r /etc/dirsrv/slapd-CC-RSA-RootCA-LDAP/ /etc/dirsrv/save-rsa/slapd-CC-RSA-RootCA-LDAP/
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Delete the old DS certificates:
certutil -D -d /etc/dirsrv/slapd-CC-RSA-RootCA-LDAP/ -f /etc/dirsrv/slapd-CC-RSA-RootCA-LDAP/pwdfile.txt -n "Server-Cert"
# certutil -D -d /etc/dirsrv/slapd-CC-RSA-RootCA-LDAP/ -f /etc/dirsrv/slapd-CC-RSA-RootCA-LDAP/pwdfile.txt -n "Server-Cert"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow certutil -D -d /etc/dirsrv/slapd-CC-RSA-RootCA-LDAP/ -f /etc/dirsrv/slapd-CC-RSA-RootCA-LDAP/pwdfile.txt -n "Self-Signed-CA"
# certutil -D -d /etc/dirsrv/slapd-CC-RSA-RootCA-LDAP/ -f /etc/dirsrv/slapd-CC-RSA-RootCA-LDAP/pwdfile.txt -n "Self-Signed-CA"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Import the newly created DS certificate and its CA certificate in chain one by one. For example:
certutil -d /etc/dirsrv/slapd-CC-RSA-RootCA-LDAP/ -f /etc/dirsrv/slapd-CC-RSA-RootCA-LDAP/pwdfile.txt -A -t "CT,C,C" -n "CA Signing Cert - rhcs10-RSA-RootCA" -i /opt/pki_rsa/rootCA.pem
# certutil -d /etc/dirsrv/slapd-CC-RSA-RootCA-LDAP/ -f /etc/dirsrv/slapd-CC-RSA-RootCA-LDAP/pwdfile.txt -A -t "CT,C,C" -n "CA Signing Cert - rhcs10-RSA-RootCA" -i /opt/pki_rsa/rootCA.pem
Copy to Clipboard Copied! Toggle word wrap Toggle overflow certutil -d /etc/dirsrv/slapd-CC-RSA-RootCA-LDAP/ -f /etc/dirsrv/slapd-CC-RSA-RootCA-LDAP/pwdfile.txt -A -t "u,u,u" -n "Server-Cert" -i /etc/dirsrv/slapd-CC-RSA-RootCA-LDAP/Server-Cert-rootca.pem
# certutil -d /etc/dirsrv/slapd-CC-RSA-RootCA-LDAP/ -f /etc/dirsrv/slapd-CC-RSA-RootCA-LDAP/pwdfile.txt -A -t "u,u,u" -n "Server-Cert" -i /etc/dirsrv/slapd-CC-RSA-RootCA-LDAP/Server-Cert-rootca.pem
Copy to Clipboard Copied! Toggle word wrap Toggle overflow List the certificates:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow On rhds11.example.com, start DS:
dsctl slapd-CC-RSA-RootCA-LDAP start
# dsctl slapd-CC-RSA-RootCA-LDAP start
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Test to confirm that the LDAP server is up and running (in case of a separate system, test on the CA host as well):
ldapsearch -x -D "cn=Directory Manager" -H ldaps://rhds11.example.com:636 -b "dc=example,dc=com" -w SECret.123
# ldapsearch -x -D "cn=Directory Manager" -H ldaps://rhds11.example.com:636 -b "dc=example,dc=com" -w SECret.123
Copy to Clipboard Copied! Toggle word wrap Toggle overflow If testing on a separate system, include the CA certificate chain in front of the
ldapsearch
command, for example:LDAPTLS_CACERT=/opt/pki_rsa/ca-chain.pem ldapsearch -x -D "cn=Directory Manager" -H ldaps://rhds11.example.com:636 -b "dc=example,dc=com" -w SECret.123
# LDAPTLS_CACERT=/opt/pki_rsa/ca-chain.pem ldapsearch -x -D "cn=Directory Manager" -H ldaps://rhds11.example.com:636 -b "dc=example,dc=com" -w SECret.123
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Remove the trust for the temporary DS certificate for the RootCA instance
On rhcs10.example.com remove the temporary DS certificate from the RootCA instance database:
Stop the CA:
pki-server stop rhcs10-RSA-RootCA
# pki-server stop rhcs10-RSA-RootCA
Copy to Clipboard Copied! Toggle word wrap Toggle overflow List the certificate:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Remove the temporary certificate from the nssdb:
certutil -D -d /var/lib/pki/rhcs10-RSA-RootCA/alias/ -n "DS temp CA certificate"
# certutil -D -d /var/lib/pki/rhcs10-RSA-RootCA/alias/ -n "DS temp CA certificate"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Enable certificate revocation checks
Now that the Directory Server certificate has been replaced, we can see the CRL Distribution Point being detected during startup of the CA by enabling certificate revocation checks:
To enable certificate revocation checks, in the respective
/var/lib/pki/rhcs10-RSA-RootCA/conf/server.xml
file:Set
enableOCSP
orenableRevocationCheck
totrue
:enableOCSP=true or enableRevocationCheck=true
enableOCSP=true or enableRevocationCheck=true
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Additionally, remove these two parameters and their assigned values:
ocspResponderURL ocspResponderCertNickname
ocspResponderURL ocspResponderCertNickname
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Disable the legacy revocation check method by editing the CA’s
CS.cfg
file and setting the following tofalse
:auths.revocationChecking.enabled=false
auths.revocationChecking.enabled=false
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Start the RootCA instance:
pki-server start rhcs10-RSA-RootCA
# pki-server start rhcs10-RSA-RootCA
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Verifying the CRL Distribution Point
Now that we have replaced the server-cert
of the root CA’s directory server using the profile caCMCserverCertWithCRLDP
, this effectively triggers the CRL distribution point to be referenced by the CA during startup when initiating a connection with its internal directory server.
This section provides a rudimentary method to verify the CRL Distribution Point setup in the CA (see Section 7.3.8, “Configure support for CRL Distribution Point”):
Check the publishing of the file-based CRL:
ls -l /var/lib/pki/rhcs10-RSA-RootCA/crl
# ls -l /var/lib/pki/rhcs10-RSA-RootCA/crl total 8 -rw-r--r--. 1 pkiuser pkiuser 574 Jun 20 18:08 ServerCertCRL-20240620-180859.der -rw-r--r--. 1 pkiuser pkiuser 613 Jun 20 18:09 ServerCertCRL-20240620-180938.der lrwxrwxrwx. 1 pkiuser pkiuser 68 Jun 20 18:09 ServerCertCRL.crl -> /var/lib/pki/rhcs10-RSA-RootCA/crl/ServerCertCRL-20240620-180938.der
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Display and verify the content of the CRL
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Do not remove the CRL file (soft link file ServerCertCRL.crl
, and its associated der file).
If you encounter a situation where the CRL file is missing or has been accidentally deleted from /var/lib/pki/rhcs10-RSA-RootCA/crl/
, preventing the CA from starting, follow the steps below to regenerate the CRL file:
Stop the CA service.
pki-server stop rhcs10-RSA-RootCA
# pki-server stop rhcs10-RSA-RootCA
Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Set the
enableRevocationCheck
orenableOCSP
parameter tofalse
(if it is currently set totrue
) in CA’sserver.xml
. -
Set the
ca.crl.ServerCertCRL.publishOnStart=
parameter totrue
in CA’sCS.cfg
. Start the CA service to regenerate the missing CRL file:
pki-server start rhcs10-RSA-RootCA
# pki-server start rhcs10-RSA-RootCA
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - After the CRL file has been recovered, stop the CA service once again.
-
Revert the
ca.crl.ServerCertCRL.publishOnStart=
parameter tofalse
in CA’sCS.cfg
. -
Set the
enableRevocationCheck
orenableOCSP
parameter totrue
in CA’sserver.xml
. - Start the CA service again to apply the changes.
By following these steps, you will successfully recover the missing CRL file and ensure the CA can start correctly.
Verifying that the CA is functioning
List the certificates in the CA:
pki -p 8443 ca-cert-find
# pki -p 8443 ca-cert-find
Copy to Clipboard Copied! Toggle word wrap Toggle overflow As the bootstrap admin user, list the users in the RootCA:
pki -d /root/.dogtag/pki_rsa_bootstrap/certs_db/ -c SECret.123 -p 8443 -n "PKI Bootstrap Administrator for RSA-RootCA" ca-user-find
# pki -d /root/.dogtag/pki_rsa_bootstrap/certs_db/ -c SECret.123 -p 8443 -n "PKI Bootstrap Administrator for RSA-RootCA" ca-user-find
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
7.6. Create and configure the SubCA (Part I) Copiar o linkLink copiado para a área de transferência!
To install and configure a SubCA instance, use either one of two pkispawn
methods:
In this installation example, since we intend to create an OCSP instance, we wish to create SubCA non-bootstrap role users certificates as well as the SubCA’s TLS server certificate, that bear the AIA extension pointing to the URL of the OCSP. To achieve this, we divide the SubCA creation and configuration, so that the setup happens in the following order:
- Install the SubCA (this section)
- Install the OCSP and set up the configuration for issuing certificates with the intended AIA
- Complete the non-bootstrap user creation and replacement of the temporary TLS server certificate for the SubCA
7.6.1. Install the SubCA instance (single-step method) Copiar o linkLink copiado para a área de transferência!
Configuring a SubCA instance using the single-step method requires creating a configuration file and running the pkispawn
tool once. In this example, the SubCA is installed on rhcs10.example.com (as well as other instances), with its internal directory server on rhds11.example.com. The SubCA signing certificate is issued by the RootCA, and the SubCA creates its own security domain.
Prerequisites
- You are logged in to rhcs10.example.com as root user.
- You have Section 7.1.2.3, “Installing a DS instance for the SubCA”, in our example, CC-RSA-SubCA-LDAP is the SubCA’s internal database.
Procedure
Create a SubCA installation file at a chosen location (e.g.
/root/pki_rsa
):cd /root/pki_rsa
# cd /root/pki_rsa
Copy to Clipboard Copied! Toggle word wrap Toggle overflow vi subca_inst.cfg
# vi subca_inst.cfg
Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteUnless explicitly specified, system certificate nicknames are automatically named bearing the value specified for
pki_instance_name
. To avoid certificate nickname conflicts on a shared HSM, use a unique instance name for each instance creation.
The values specified in the installation file below are examples. In addition to changing the HSM password, edit the values accordingly, for example ports, directories, nicknames, domains…
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Run the
pkispawn
tool to install the RHCS SubCA instance:pkispawn -s CA -f subca_inst.cfg --debug
# pkispawn -s CA -f subca_inst.cfg --debug
Copy to Clipboard Copied! Toggle word wrap Toggle overflow This will create the SubCA instance in
/var/lib/pki/rhcs10-RSA-SubCA
.
Verification steps
Show the status of the installed CA:
pki-server status rhcs10-RSA-SubCA
# pki-server status rhcs10-RSA-SubCA
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Note down the Unsecure EE, Secure EE, Agent, Admin and pkiconsole URLs.
Verify the sanity of the CA by running the following command. It should display certificates:
pki -p 31443 -h rhcs10.example.com ca-cert-find
# pki -p 31443 -h rhcs10.example.com ca-cert-find
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
An untrusted issuer warning for the CA signing certificate is displayed when connecting to the SubCA with a pki command for the first time, as seen below:
WARNING: UNTRUSTED ISSUER encountered on 'CN=rhcs10.example.com,OU=rhcs10-RSA-SubCA,O=Example-rhcs10-RSA-RootCA' indicates a non-trusted CA cert 'CN=CA Signing Certificate,OU=rhcs10-RSA-SubCA,O=Example-rhcs10-RSA-RootCA' Trust this certificate (y/N)?
WARNING: UNTRUSTED ISSUER encountered on 'CN=rhcs10.example.com,OU=rhcs10-RSA-SubCA,O=Example-rhcs10-RSA-RootCA' indicates a non-trusted CA cert 'CN=CA Signing Certificate,OU=rhcs10-RSA-SubCA,O=Example-rhcs10-RSA-RootCA'
Trust this certificate (y/N)?
Select ‘y’ to trust the CA signing cert if the Subject DN matches the hostname as expected. The warning will not display again.
Once you are done with this section (single-step method), skip directly to Section 7.6.3, “Update the CA certificate chain” to continue with the SubCA installation.
7.6.2. Installing the SubCA instance (two-step method) Copiar o linkLink copiado para a área de transferência!
Configuring a SubCA instance using the two-step method requires creating a configuration file and running the pkispawn
tool twice.
In this example, the SubCA is installed on rhcs10.example.com.
Prerequisites
- You are logged in to rhcs10.example.com as root user.
- You have Section 7.1.2.3, “Installing a DS instance for the SubCA”. In our example, CC-RSA-SubCA-LDAP is the SubCA’s internal database.
First step of SubCA installation
Create a CA installation file at a chosen location (e.g.
/root/pki_rsa
) on the machine that will host the RHCS instance (rhcs10.example.com).cd /root/pki_rsa vi subca_inst.cfg
# cd /root/pki_rsa # vi subca_inst.cfg
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteUnless explicitly specified, system certificate nicknames are automatically named bearing the value specified for
pki_instance_name
. To avoid certificate nickname conflicts on a shared HSM, use a unique instance name for each instance creation. However, in a two-step installation, thepki_instance_name
value of both files should match. The following values are just examples.Run the
pkispawn
tool to install the RHCS CA instance:pkispawn -s CA -f subca_inst.cfg --skip-configuration --debug
# pkispawn -s CA -f subca_inst.cfg --skip-configuration --debug
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Between-step configuration
As explained in Between step customization, you can customize certain things, such as the certificate profile of a system certificate.
Setting the Subject Key Identifier extension message digest algorithm for the CA signing certificate:
Open the enrollment profile for this CA’s signing certificate:
vi /var/lib/pki/rhcs10-RSA-SubCA/ca/conf/caCert.profile
# vi /var/lib/pki/rhcs10-RSA-SubCA/ca/conf/caCert.profile
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Add the following parameter:
7.default.params.messageDigest=SHA-256
7.default.params.messageDigest=SHA-256
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Save the file.
Likewise, do the same for the CA signing cert that this CA will be issuing in the future:
Open the enrollment profile for the CA signing certificate:
vi /var/lib/pki/rhcs10-RSA-SubCA/ca/profiles/ca/caInstallCACert.cfg
# vi /var/lib/pki/rhcs10-RSA-SubCA/ca/profiles/ca/caInstallCACert.cfg
Copy to Clipboard Copied! Toggle word wrap Toggle overflow vi /var/lib/pki/rhcs10-RSA-SubCA/ca/profiles/ca/caCMCcaCert.cfg
# vi /var/lib/pki/rhcs10-RSA-SubCA/ca/profiles/ca/caCMCcaCert.cfg
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Add the following parameter:
policyset.caCertSet.8.default.params.messageDigest=SHA-256
policyset.caCertSet.8.default.params.messageDigest=SHA-256
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Save the file.
Other between-step configuration changes can take place here too. For example, if you wish to extend the validity period of the audit signing certificate of this subsystem:
Open the corresponding configuration file:
vi /var/lib/pki/rhcs10-RSA-SubCA/ca/profiles/ca/caInternalAuthAuditSigningCert.cfg
# vi /var/lib/pki/rhcs10-RSA-SubCA/ca/profiles/ca/caInternalAuthAuditSigningCert.cfg
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Change the following range parameters to the desired values:
policyset.auditSigningCertSet.2.constraint.params.range=720 policyset.auditSigningCertSet.2.default.params.range=720
policyset.auditSigningCertSet.2.constraint.params.range=720 policyset.auditSigningCertSet.2.default.params.range=720
Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Save the file. Once you have done the second step of
pkispawn
in the next section, you should expect the validity of the audit signing certificate of this subsystem to match the values you have changed to.
Second step of SubCA installation
The second step of pkispawn
in this case involves running the tool against the same file in a different manner to configure the RHCS CA instance.
Run the
pkispawn
tool to configure the CA:pkispawn -s CA -f subca_inst.cfg --skip-installation --debug
# pkispawn -s CA -f subca_inst.cfg --skip-installation --debug
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification steps
Show the status of the installed CA:
pki-server status rhcs10-RSA-SubCA
# pki-server status rhcs10-RSA-SubCA
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Note down the Unsecure EE, Secure EE, Agent, Admin and pkiconsole URLs.
Verify the sanity of the CA by running the following command. It should display certificates:
pki -p 8443 -h rhcs10.example.com ca-cert-find
# pki -p 8443 -h rhcs10.example.com ca-cert-find
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
An untrusted issuer warning for the CA signing certificate is displayed when connecting to the SubCA with a pki command for the first time, as seen below:
WARNING: UNTRUSTED ISSUER encountered on 'CN=rhcs10.example.com,OU=rhcs10-RSA-SubCA,O=Example-rhcs10-RSA-RootCA' indicates a non-trusted CA cert 'CN=CA Signing Certificate,OU=rhcs10-RSA-SubCA,O=Example-rhcs10-RSA-RootCA' Trust this certificate (y/N)?
WARNING: UNTRUSTED ISSUER encountered on 'CN=rhcs10.example.com,OU=rhcs10-RSA-SubCA,O=Example-rhcs10-RSA-RootCA' indicates a non-trusted CA cert 'CN=CA Signing Certificate,OU=rhcs10-RSA-SubCA,O=Example-rhcs10-RSA-RootCA'
Trust this certificate (y/N)?
Select y
to trust the CA signing cert if the Subject DN matches the hostname as expected. The warning will not display again.
7.6.3. Update the CA certificate chain Copiar o linkLink copiado para a área de transferência!
Previously, we created the /opt/pki_rsa/ca-chain.pem
file, that contains the RootCA certificate. We need to update this CA chain by adding the SubCA certificate.
Retrieve the SubCA certificate into a
.pem
filecertutil -L -d /var/lib/pki/rhcs10-RSA-SubCA/alias -n "CA Signing Cert - rhcs10-RSA-SubCA" -a > /opt/pki_rsa/subCA.pem
# certutil -L -d /var/lib/pki/rhcs10-RSA-SubCA/alias -n "CA Signing Cert - rhcs10-RSA-SubCA" -a > /opt/pki_rsa/subCA.pem
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Update the CA certificate chain. For example:
cat /opt/pki_rsa/subCA.pem /opt/pki_rsa/rootCA.pem > /opt/pki_rsa/ca-chain.pem
# cat /opt/pki_rsa/subCA.pem /opt/pki_rsa/rootCA.pem > /opt/pki_rsa/ca-chain.pem
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
In the context of this example installation, you need to order a certificate chain in the following way:
-
The chain starts with the leaf certificate placed at the top of the
.pem
file. - Its immediate signing certificate follows next.
- The chain ends with the root certificate, at the bottom.
Copy the files to rhds11.example.com (the machine that hosts the DS instances):
scp /opt/pki_rsa/subCA.pem root@rhds11.example.com:/opt/pki_rsa
# scp /opt/pki_rsa/subCA.pem root@rhds11.example.com:/opt/pki_rsa
Copy to Clipboard Copied! Toggle word wrap Toggle overflow scp /opt/pki_rsa/ca-chain.pem root@rhds11.example.com:/opt/pki_rsa
# scp /opt/pki_rsa/ca-chain.pem root@rhds11.example.com:/opt/pki_rsa
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Restart the DS instance for the SubCA:
dsctl slapd-CC-RSA-SubCA-LDAP restart
# dsctl slapd-CC-RSA-SubCA-LDAP restart
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
7.6.4. Set up the SubCA bootstrap admin certificate Copiar o linkLink copiado para a área de transferência!
This procedure consists in importing the SubCA bootstrap certificate/key into the nssdb (in our example, /root/.dogtag/pki_rsa_bootstrap/certs_db
), in preparation for signing the CMC full request for role user certificates.
Optional: If you have not done this previously, import the RootCA signing certificate into the nssdb:
pki -d /root/.dogtag/pki_rsa_bootstrap/certs_db -c SECret.123 client-cert-import "CA Signing Cert - rhcs10-RSA-RootCA" --ca-cert /opt/pki_rsa/rootCA.pem
# pki -d /root/.dogtag/pki_rsa_bootstrap/certs_db -c SECret.123 client-cert-import "CA Signing Cert - rhcs10-RSA-RootCA" --ca-cert /opt/pki_rsa/rootCA.pem
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Import the SubCA signing certificate into the nssdb:
pki -d /root/.dogtag/pki_rsa_bootstrap/certs_db -c SECret.123 client-cert-import "CA Signing Cert - rhcs10-RSA-SubCA" --ca-cert /opt/pki_rsa/subCA.pem
# pki -d /root/.dogtag/pki_rsa_bootstrap/certs_db -c SECret.123 client-cert-import "CA Signing Cert - rhcs10-RSA-SubCA" --ca-cert /opt/pki_rsa/subCA.pem
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Import the SubCA bootstrap certificate into the nssdb:
pki -d /root/.dogtag/pki_rsa_bootstrap/certs_db -c SECret.123 client-cert-import --pkcs12 /opt/pki_rsa/rhcs10-RSA-SubCA/ca_admin_cert.p12 --pkcs12-password SECret.123
# pki -d /root/.dogtag/pki_rsa_bootstrap/certs_db -c SECret.123 client-cert-import --pkcs12 /opt/pki_rsa/rhcs10-RSA-SubCA/ca_admin_cert.p12 --pkcs12-password SECret.123 ---------------------------------------- Imported certificates from PKCS #12 file ----------------------------------------
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification:
List the contents of the nssdb:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
7.6.5. Disable non-CMC and non-installation profiles Copiar o linkLink copiado para a área de transferência!
The profiles are stored in /var/lib/pki/rhcs10-RSA-SubCA/ca/profiles/ca/
. CMC profiles contain "CMC" in their profile ID. This section provides procedures to disable non-CMC and non-installation profiles.
Procedure
Generate a list of non-CMC profiles to be edited:
ls /var/lib/pki/rhcs10-RSA-SubCA/ca/profiles/ca | grep -v CMC | grep -v Install | grep -v caInternal | grep -v caECInternal | grep -v caAdminCert | grep -v caECAdminCert | tee /root/pki_rsa/subca-profile-deletelist.txt
# ls /var/lib/pki/rhcs10-RSA-SubCA/ca/profiles/ca | grep -v CMC | grep -v Install | grep -v caInternal | grep -v caECInternal | grep -v caAdminCert | grep -v caECAdminCert | tee /root/pki_rsa/subca-profile-deletelist.txt
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Stop the SubCA instance:
pki-server stop rhcs10-RSA-SubCA
pki-server stop rhcs10-RSA-SubCA
Copy to Clipboard Copied! Toggle word wrap Toggle overflow For every profile in the list, change the
visible
andenable
parameters fromtrue
tofalse
. For example, use the following command to setvisible=false
andenable=false
:cat /root/pki_rsa/subca-profile-deletelist.txt | while read line; do sed -i 's/^visible=true/visible=false/g' /var/lib/pki/rhcs10-RSA-SubCA/ca/profiles/ca/$line; sed -i 's/^enable=true/enable=false/g' /var/lib/pki/rhcs10-RSA-SubCA/ca/profiles/ca/$line; done
# cat /root/pki_rsa/subca-profile-deletelist.txt | while read line; do sed -i 's/^visible=true/visible=false/g' /var/lib/pki/rhcs10-RSA-SubCA/ca/profiles/ca/$line; sed -i 's/^enable=true/enable=false/g' /var/lib/pki/rhcs10-RSA-SubCA/ca/profiles/ca/$line; done
Copy to Clipboard Copied! Toggle word wrap Toggle overflow In addition, also change the
visible
parameter for thecaCMCUserCert
profile tofalse
:sed -i 's/^visible=true/visible=false/' /var/lib/pki/rhcs10-RSA-SubCA/ca/profiles/ca/caCMCUserCert.cfg /var/lib/pki/rhcs10-RSA-SubCA/ca/profiles/ca/caCMCECUserCert.cfg
# sed -i 's/^visible=true/visible=false/' /var/lib/pki/rhcs10-RSA-SubCA/ca/profiles/ca/caCMCUserCert.cfg /var/lib/pki/rhcs10-RSA-SubCA/ca/profiles/ca/caCMCECUserCert.cfg
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Start the SubCA instance:
pki-server start rhcs10-RSA-SubCA
pki-server start rhcs10-RSA-SubCA
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
To allow for the SubCA role user certificates to contain AIA extensions pointing to the OCSP instance (yet to be created in the following section), relevant sections are placed in (Section 7.8, “Create and configure the SubCA (Part II)”), AFTER the OCSP instance creation.
7.6.6. Configure support for CRL Distribution Point Copiar o linkLink copiado para a área de transferência!
For more information on CRL Distribution Points, why they are needed and where they are best suited, see Section 9.4.1.2, “Enabling automatic revocation checking on the CA”.
To configure support for CRL Distribution Points, as an example, we describe how to set up a file-based CRL publisher as well as the partitioning of the CRL. You will also learn how to enable a certificate enrollment profile to issue certificates with the CRL Distribution Point extension. Finally, we describe how to replace the temporary Server-Cert of the CA’s LDAP server with a certificate issued from the CRL Distribution Point profiles.
Before proceeding with the following changes, stop the SubCA instance:
pki-server stop rhcs10-RSA-SubCA
# pki-server stop rhcs10-RSA-SubCA
7.6.6.1. CA Setup to support Server Cert CRL File Publishing Copiar o linkLink copiado para a área de transferência!
Before proceeding, save a copy of the configuration file before editing:
cp /var/lib/pki/rhcs10-RSA-SubCA/conf/CS.cfg /var/lib/pki/rhcs10-RSA-SubCA/conf/CS.cfg.bak.<date>
# cp /var/lib/pki/rhcs10-RSA-SubCA/conf/CS.cfg /var/lib/pki/rhcs10-RSA-SubCA/conf/CS.cfg.bak.<date>
7.6.6.1.1. Set up the file-based publisher: crlFilePublisher Copiar o linkLink copiado para a área de transferência!
The configuration in this section creates a file-based CRL publisher called crlFilePublisher. When set up correctly, the CRL is stored under directory /var/lib/pki/rhcs10-RSA-SubCA/crl
in DER format.
Create the CRL directory for publishing the file-based partitioned CRL:
mkdir /var/lib/pki/rhcs10-RSA-SubCA/crl chown pkiuser.pkiuser /var/lib/pki/rhcs10-RSA-SubCA/crl
# mkdir /var/lib/pki/rhcs10-RSA-SubCA/crl # chown pkiuser.pkiuser /var/lib/pki/rhcs10-RSA-SubCA/crl
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Add the following to the CA’s
CS.cfg
:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
7.6.6.1.2. Set up the file-based publishing rule: FileCrlRule Copiar o linkLink copiado para a área de transferência!
The configuration in this section creates a file-based publishing rule called FileCrlRule. The predicate specifies the issuing point to a partitioned CRL called ServerCertCRL (defined in Section 7.6.6.1.4, “Set up the CRL-partitioning for certificates issued via a profile”).
Add the following to the CA’s
CS.cfg
:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
7.6.6.1.3. Modify the LDAP-based publishing rule: LdapCrlRule Copiar o linkLink copiado para a área de transferência!
This configuration explicitly sets the LdapCrlRule predicate to the master (full) CRL. The master CRL is continuously supplied to the OCSP responder for proper OCSP support.
Modify the following in the CA’s
CS.cfg
:ca.publish.rule.instance.LdapCrlRule.predicate=issuingPointId==MasterCRL
ca.publish.rule.instance.LdapCrlRule.predicate=issuingPointId==MasterCRL
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
7.6.6.1.4. Set up the CRL-partitioning for certificates issued via a profile Copiar o linkLink copiado para a área de transferência!
The configuration in this section demonstrates how to partition a CRL to a smaller subset that could be utilized in the FileCrlRule defined above. The CRL is partitioned by the certificate enrollment profile(s) specified in the profileList parameter. A comma-separated list can be used for multiple profiles (for example, caCMCserverCertWithCRLDP.cfg and caCMCECserverCertWithCRLDP.cfg).
Add the following to the CA’s
CS.cfg
:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
For an ECC CA, set the following to SHA512withEC:
ca.crl.ServerCertCRL.signingAlgorithm=SHA512withEC
ca.crl.ServerCertCRL.signingAlgorithm=SHA512withEC
7.6.6.2. Set up CRL HTTP service in the CA Copiar o linkLink copiado para a área de transferência!
The CRL served by the CRL Distribution Point is published to a file (see sections above). This file is served by a non-SSL Tomcat service that we are adding to the CA’s server.xml
as shown below:
Add the following
CRL
service before theCatalina
service in the file/var/lib/pki/rhcs10-RSA-SubCA/conf/server.xml
:Copy to Clipboard Copied! Toggle word wrap Toggle overflow In the above CRL service, choose a connector port number that has not been used. For example, if the subordinate CA’s HTTP port is 31080, then pick 31085. Ensure that the port is added for SELinux, for example:
semanage port -a -t http_port_t -p tcp 31085 firewall-cmd --permanent --add-port=31085/tcp firewall-cmd --reload
# semanage port -a -t http_port_t -p tcp 31085 # firewall-cmd --permanent --add-port=31085/tcp # firewall-cmd --reload
Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteIf your selected port has been pre-assigned with another SELinux context, you will see an error message that looks like the following:
ValueError: Port tcp/31085 already defined
ValueError: Port tcp/31085 already defined
Copy to Clipboard Copied! Toggle word wrap Toggle overflow You can also search and find out whether the CRL HTTP port is pre-assigned by using the following command:
semanage port -l | grep <port>
# semanage port -l | grep <port>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow We recommend that you select another port. However, if you wish to use the same port, you could do the following:
semanage port -m -t http_port_t -p tcp 31085
# semanage port -m -t http_port_t -p tcp 31085
Copy to Clipboard Copied! Toggle word wrap Toggle overflow When the server is restarted, the directory CRL/localhost is created under the CA’s conf directory if it does not exist. However, to prepare for the addition of the
crl.xml
file, do the following:mkdir -p /var/lib/pki/rhcs10-RSA-SubCA/conf/CRL/localhost chown -R pkiuser:pkiuser /var/lib/pki/rhcs10-RSA-SubCA/conf/CRL/localhost
# mkdir -p /var/lib/pki/rhcs10-RSA-SubCA/conf/CRL/localhost # chown -R pkiuser:pkiuser /var/lib/pki/rhcs10-RSA-SubCA/conf/CRL/localhost
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create a
crl.xml
file under/var/lib/pki/rhcs10-RSA-SubCA/conf/CRL/localhost
, and add the following content:<Context docBase="/var/lib/pki/rhcs10-RSA-SubCA/crl"> <Resources allowLinking="true" cachingAllowed="false" /> </Context>
<Context docBase="/var/lib/pki/rhcs10-RSA-SubCA/crl"> <Resources allowLinking="true" cachingAllowed="false" /> </Context>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Set the
user:group
ownership for thecrl.xml
file:chown pkiuser:pkiuser /var/lib/pki/rhcs10-RSA-SubCA/conf/CRL/localhost/crl.xml
chown pkiuser:pkiuser /var/lib/pki/rhcs10-RSA-SubCA/conf/CRL/localhost/crl.xml
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
The CRL Distribution Point set in the enrollment profile looks like this (see next section for full example): http://rhcs10.example.com:31085/crl/ServerCertCRL.crl
File-based CRL publisher is only recommended for smaller CRLs with less frequently issued or revoked certificates. It is only recommended if necessary, such as in the case of CA startup setup described in this section.
7.6.6.3. CA’s enrollment profile configuration with CRL Distribution Points Copiar o linkLink copiado para a área de transferência!
Enable the desired profile(s) to include the CRL Distribution Points. These are the profiles corresponding to the configuration in the sections above.
Open the
caCMCserverCertWithCRLDP.cfg
profile (for enrollments with RSA keys) in the/var/lib/pki/<ca instance directory/ca/profiles/ca/
directory and update as follows:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Open the
caCMCECserverCertWithCRLDP.cfg
(for enrollments with ECC keys) in the/var/lib/pki/<ca instance directory/ca/profiles/ca/
directory and update as follows:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Set user:group ownership:
chown -R pkiuser:pkiuser /var/lib/pki/rhcs10-RSA-SubCA/ca/profiles/ca/caCMCserverCertWithCRLDP.cfg chown -R pkiuser:pkiuser /var/lib/pki/rhcs10-RSA-SubCA/ca/profiles/ca/caCMCECserverCertWithCRLDP.cfg
# chown -R pkiuser:pkiuser /var/lib/pki/rhcs10-RSA-SubCA/ca/profiles/ca/caCMCserverCertWithCRLDP.cfg # chown -R pkiuser:pkiuser /var/lib/pki/rhcs10-RSA-SubCA/ca/profiles/ca/caCMCECserverCertWithCRLDP.cfg
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Register a new profile in the CA’s
CS.cfg
:Add the following lines for each profile:
profile.caCMCserverCertWithCRLDP.class_id=caEnrollImpl profile.caCMCserverCertWithCRLDP.config=/var/lib/pki/rhcs10-RSA-SubCA/ca/profiles/ca/caCMCserverCertWithCRLDP.cfg profile.caCMCECserverCertWithCRLDP.class_id=caEnrollImpl profile.caCMCECserverCertWithCRLDP.config=/var/lib/pki/rhcs10-RSA-SubCA/ca/profiles/ca/caCMCECserverCertWithCRLDP.cfg
profile.caCMCserverCertWithCRLDP.class_id=caEnrollImpl profile.caCMCserverCertWithCRLDP.config=/var/lib/pki/rhcs10-RSA-SubCA/ca/profiles/ca/caCMCserverCertWithCRLDP.cfg profile.caCMCECserverCertWithCRLDP.class_id=caEnrollImpl profile.caCMCECserverCertWithCRLDP.config=/var/lib/pki/rhcs10-RSA-SubCA/ca/profiles/ca/caCMCECserverCertWithCRLDP.cfg
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Edit the
profile.list
entry to add the two new profiles. For example:profile.list=caCMCserverCertWithCRLDP,caCMCECserverCertWithCRLDP,acmeServerCert,caCMCserverCert,caCMCECserverCert, …
profile.list=caCMCserverCertWithCRLDP,caCMCECserverCertWithCRLDP,acmeServerCert,caCMCserverCert,caCMCECserverCert, …
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
7.6.6.4. Set up for more immediate CRL update Copiar o linkLink copiado para a área de transferência!
Since server certs do not often get revoked, it is reasonable to update the CRL as soon as there is a revocation. Edit the CA’s CS.cfg
:
ca.crl.ServerCertCRL.alwaysUpdate=true
ca.crl.ServerCertCRL.alwaysUpdate=true
7.6.6.5. Start up the CA once the CA’s configuration is updated Copiar o linkLink copiado para a área de transferência!
Once configuration is complete, start up the CA:
pki-server start rhcs10-RSA-SubCA
# pki-server start rhcs10-RSA-SubCA
You will be instructed to verify the CRL Distribution Point setup at the end of Section 7.8.2, “Replace the temporary DS certificate (SubCA)” once the CA’s Directory Server Server-Cert
has been replaced correctly.
7.7. Create and configure the OCSP instance (SubCA) Copiar o linkLink copiado para a área de transferência!
This section describes installing and configuring an OCSP instance against the SubCA.
The OCSP system certificates will be issued by the SubCA, and the OCSP will join the SubCA security domain.
In this example, the SubCA’s OCSP is installed on rhcs10.example.com, with its internal directory server on rhds11.example.com.
Make sure that the file /opt/pki_rsa/ca-chain.pem
contains the complete CA certificate chain (SubCA and RootCA certificates):
ls -l /opt/pki_rsa/ca-chain.pem cat /opt/pki_rsa/ca-chain.pem
# ls -l /opt/pki_rsa/ca-chain.pem
# cat /opt/pki_rsa/ca-chain.pem
7.7.1. Replace the temporary DS certificate (OCSP-subca) Copiar o linkLink copiado para a área de transferência!
Prior to installing the OCSP for the SubCA, we are issuing an official SSL server certificate for the OCSP’s Directory Server to replace the temporary bootstrap one. To do that, we first create a certificate signing request (CSR) for the Directory Server certificate, then submit this request to the CA.
Ensure that you use the FQDN of the DS server, e.g. cn=rhds11.example.com
/ host=rhds11.example.com
.
Generate a CSR for the real DS certificate
On rhds11.example.com, generate a PKCS10 certificate signing request for the real DS certificate:
Stop DS:
dsctl slapd-CC-RSA-OCSP-subca-LDAP stop
# dsctl slapd-CC-RSA-OCSP-subca-LDAP stop
Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteIf you are not certain about the name of a DS instance, list all instances using:
dsctl -l
Use the
certutil
tool to generate the CSR:certutil -R -d /etc/dirsrv/slapd-CC-RSA-OCSP-subca-LDAP -s "CN=rhds11.example.com" -g 2048 -f /etc/dirsrv/slapd-CC-RSA-OCSP-subca-LDAP/pwdfile.txt -a -o /etc/dirsrv/slapd-CC-RSA-OCSP-subca-LDAP/Server-Cert-ocsp-subca.csr -z /etc/dirsrv/slapd-CC-RSA-OCSP-subca-LDAP/noise.txt
# certutil -R -d /etc/dirsrv/slapd-CC-RSA-OCSP-subca-LDAP -s "CN=rhds11.example.com" -g 2048 -f /etc/dirsrv/slapd-CC-RSA-OCSP-subca-LDAP/pwdfile.txt -a -o /etc/dirsrv/slapd-CC-RSA-OCSP-subca-LDAP/Server-Cert-ocsp-subca.csr -z /etc/dirsrv/slapd-CC-RSA-OCSP-subca-LDAP/noise.txt
Copy to Clipboard Copied! Toggle word wrap Toggle overflow ImportantEdit the
Server-Cert-ocsp-subca.csr
output file obtained above to remove the few lines before "Begin Certificate Request". For example:
vi /etc/dirsrv/slapd-CC-RSA-OCSP-subca-LDAP/Server-Cert-ocsp-subca.csr
# vi /etc/dirsrv/slapd-CC-RSA-OCSP-subca-LDAP/Server-Cert-ocsp-subca.csr
Copy to Clipboard Copied! Toggle word wrap Toggle overflow The CSR file must start with the line "-----BEGIN CERTIFICATE REQUEST-----" and end with the line "-----END CERTIFICATE REQUEST-----".
Remote copy the
Server-Cert-ocsp-subca.csr
file to the system where the CA resides. For example:scp /etc/dirsrv/slapd-CC-RSA-OCSP-subca-LDAP/Server-Cert-ocsp-subca.csr root@rhcs10.example.com:/root/.dogtag/pki_rsa_bootstrap/certs_db/Server-Cert-ocsp-subca.csr
# scp /etc/dirsrv/slapd-CC-RSA-OCSP-subca-LDAP/Server-Cert-ocsp-subca.csr root@rhcs10.example.com:/root/.dogtag/pki_rsa_bootstrap/certs_db/Server-Cert-ocsp-subca.csr
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Issue the real DS certificate
On rhcs10.example.com, issue the actual SSL server certificate:
Generate a CMC request:
Create a
CMCRequest
configuration file. For example:vim /root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.dirsrv-ocsp-subca_pkcs10.cfg
# vim /root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.dirsrv-ocsp-subca_pkcs10.cfg
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Copy to Clipboard Copied! Toggle word wrap Toggle overflow Generate the request using the
CMCRequest
command:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Submit the CMC request:
Create a
HttpClient
configuration file. For example:vim /root/.dogtag/pki_rsa_bootstrap/certs_db/HttpClient_dirsrv-ocsp-subca.cfg
# vim /root/.dogtag/pki_rsa_bootstrap/certs_db/HttpClient_dirsrv-ocsp-subca.cfg
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Copy to Clipboard Copied! Toggle word wrap Toggle overflow Submit the request using the
HttpClient
command:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Process the CMC Response:
Process the response using
CMCResponse
to display all certificates in chain individually in PEM format:ImportantRunning CMCResponse with the "-v" option returns the PEM of each certificate in the chain as Cert:0, Cert:1 etc. Below all the PEMs, the output also displays each certificate in the chain in pretty print format. Since the certificates are not displayed in a fixed order, in order to determine their position in the chain, you must examine the "Subject:" under each "Certificate". The corresponding PEM is displayed in the same position above.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Save the new
Server-Cert
DS certificate into a file in the bootstrap certificate directory (e.g./root/.dogtag/pki_rsa_bootstrap/certs_db/
) named accordingly. The.pem
file must start with the header-----BEGIN CERTIFICATE-----
and end with the footer-----END CERTIFICATE-----
. For example:vi /root/.dogtag/pki_rsa_bootstrap/certs_db/Server-Cert-ocsp-subca.pem
# vi /root/.dogtag/pki_rsa_bootstrap/certs_db/Server-Cert-ocsp-subca.pem
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Where
Server-Cert-ocsp-subca.pem
is the newServer-Cert
certificate of the Directory Server instance that serves as the internaldb of the OCSP for the SubCA.NoteThe RootCA’s signing certificate should match with the output from the following command:
certutil -L -d /var/lib/pki/rhcs10-RSA-RootCA/alias/ -n "CA Signing Cert - rhcs10-RSA-RootCA" -a
# certutil -L -d /var/lib/pki/rhcs10-RSA-RootCA/alias/ -n "CA Signing Cert - rhcs10-RSA-RootCA" -a
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Remote copy the new
Server-Cert
certificate to rhds11.example.com. For example:scp /root/.dogtag/pki_rsa_bootstrap/certs_db/Server-Cert-ocsp-subca.pem root@rhds11.example.com:/etc/dirsrv/slapd-CC-RSA-OCSP-subca-LDAP/
# scp /root/.dogtag/pki_rsa_bootstrap/certs_db/Server-Cert-ocsp-subca.pem root@rhds11.example.com:/etc/dirsrv/slapd-CC-RSA-OCSP-subca-LDAP/
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Replace the temporary DS certificate
On rhds11.example.com, replace the temporary DS certificate with the actual DS certificate:
Save the contents of the
dirsrv
directory into a backup directory:cp -r /etc/dirsrv/slapd-CC-RSA-OCSP-subca-LDAP/ /etc/dirsrv/save-rsa/slapd-CC-RSA-OCSP-subca-LDAP/
# cp -r /etc/dirsrv/slapd-CC-RSA-OCSP-subca-LDAP/ /etc/dirsrv/save-rsa/slapd-CC-RSA-OCSP-subca-LDAP/
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Delete the old DS certificates:
certutil -D -d /etc/dirsrv/slapd-CC-RSA-OCSP-subca-LDAP/ -f /etc/dirsrv/slapd-CC-RSA-OCSP-subca-LDAP/pwdfile.txt -n "Server-Cert"
# certutil -D -d /etc/dirsrv/slapd-CC-RSA-OCSP-subca-LDAP/ -f /etc/dirsrv/slapd-CC-RSA-OCSP-subca-LDAP/pwdfile.txt -n "Server-Cert"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow certutil -D -d /etc/dirsrv/slapd-CC-RSA-OCSP-subca-LDAP/ -f /etc/dirsrv/slapd-CC-RSA-OCSP-subca-LDAP/pwdfile.txt -n "Self-Signed-CA"
# certutil -D -d /etc/dirsrv/slapd-CC-RSA-OCSP-subca-LDAP/ -f /etc/dirsrv/slapd-CC-RSA-OCSP-subca-LDAP/pwdfile.txt -n "Self-Signed-CA"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Import the newly created DS certificate and the CA certificates in its chain one by one. For example:
certutil -d /etc/dirsrv/slapd-CC-RSA-OCSP-subca-LDAP/ -f /etc/dirsrv/slapd-CC-RSA-OCSP-subca-LDAP/pwdfile.txt -A -t "CT,C,C" -n "CA Signing Cert - rhcs10-RSA-RootCA" -i /opt/pki_rsa/rootCA.pem
# certutil -d /etc/dirsrv/slapd-CC-RSA-OCSP-subca-LDAP/ -f /etc/dirsrv/slapd-CC-RSA-OCSP-subca-LDAP/pwdfile.txt -A -t "CT,C,C" -n "CA Signing Cert - rhcs10-RSA-RootCA" -i /opt/pki_rsa/rootCA.pem
Copy to Clipboard Copied! Toggle word wrap Toggle overflow certutil -d /etc/dirsrv/slapd-CC-RSA-OCSP-subca-LDAP/ -f /etc/dirsrv/slapd-CC-RSA-OCSP-subca-LDAP/pwdfile.txt -A -t "CT,C,C" -n "CA Signing Cert - rhcs10-RSA-SubCA" -i /opt/pki_rsa/subCA.pem
# certutil -d /etc/dirsrv/slapd-CC-RSA-OCSP-subca-LDAP/ -f /etc/dirsrv/slapd-CC-RSA-OCSP-subca-LDAP/pwdfile.txt -A -t "CT,C,C" -n "CA Signing Cert - rhcs10-RSA-SubCA" -i /opt/pki_rsa/subCA.pem
Copy to Clipboard Copied! Toggle word wrap Toggle overflow certutil -d /etc/dirsrv/slapd-CC-RSA-OCSP-subca-LDAP/ -f /etc/dirsrv/slapd-CC-RSA-OCSP-subca-LDAP/pwdfile.txt -A -t "u,u,u" -n "Server-Cert" -i /etc/dirsrv/slapd-CC-RSA-OCSP-subca-LDAP/Server-Cert-ocsp-subca.pem
# certutil -d /etc/dirsrv/slapd-CC-RSA-OCSP-subca-LDAP/ -f /etc/dirsrv/slapd-CC-RSA-OCSP-subca-LDAP/pwdfile.txt -A -t "u,u,u" -n "Server-Cert" -i /etc/dirsrv/slapd-CC-RSA-OCSP-subca-LDAP/Server-Cert-ocsp-subca.pem
Copy to Clipboard Copied! Toggle word wrap Toggle overflow List the certificates:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Start DS:
dsctl slapd-CC-RSA-OCSP-subca-LDAP start
# dsctl slapd-CC-RSA-OCSP-subca-LDAP start
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Test to confirm that the LDAP server is up and running (in case of a separate system, test on the CA host as well):
ldapsearch -x -D "cn=Directory Manager" -H ldaps://rhds11.example.com:11636 -b "dc=example,dc=com" -w SECret.123
# ldapsearch -x -D "cn=Directory Manager" -H ldaps://rhds11.example.com:11636 -b "dc=example,dc=com" -w SECret.123
Copy to Clipboard Copied! Toggle word wrap Toggle overflow If testing on a separate system, include the CA certificate chain in front of the
ldapsearch
command, for example:LDAPTLS_CACERT=/opt/pki_rsa/ca-chain.pem ldapsearch -x -D "cn=Directory Manager" -H ldaps://rhds11.example.com:11636 -b "dc=example,dc=com" -w SECret.123
# LDAPTLS_CACERT=/opt/pki_rsa/ca-chain.pem ldapsearch -x -D "cn=Directory Manager" -H ldaps://rhds11.example.com:11636 -b "dc=example,dc=com" -w SECret.123
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
7.7.2. Install the OCSP instance for the SubCA Copiar o linkLink copiado para a área de transferência!
To install the OCSP instance for the SubCA, use either the single-step method or the two-step method. The following procedure describes the single-step method. If you wish to install using the two-step method, please refer to Section 7.2.2, “Installation methods (single-step or two-step)” as well as Section 7.3.2, “Installing the RootCA instance (two-step method)”.
Prerequisites
- You are logged in to rhcs10.example.com as root user.
- You have Section 7.1.2.4, “Installing a DS instance for the SubCA’s OCSP”, in our example, CC-RSA-OCSP-subca-LDAP is the internal database of the SubCA’s OCSP.
Procedure
Create an OCSP installation file at a chosen location (e.g.
/root/pki_rsa
) for generating certificate requests:cd /root/pki_rsa
# cd /root/pki_rsa
Copy to Clipboard Copied! Toggle word wrap Toggle overflow vi ocsp_subca_inst.cfg
# vi ocsp_subca_inst.cfg
Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteUnless explicitly specified, system certificate nicknames are automatically named bearing the value specified for
pki_instance_name
. To avoid certificate nickname conflicts on a shared HSM, use a unique instance name for each instance creation.
The values specified in the installation file below are examples. In addition to changing the HSM password, edit the values accordingly, for example ports, directories, nicknames, domains…
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Run the
pkispawn
tool to install the OCSP subsystem:pkispawn -s OCSP -f ocsp_subca_inst.cfg --debug
# pkispawn -s OCSP -f ocsp_subca_inst.cfg --debug
Copy to Clipboard Copied! Toggle word wrap Toggle overflow This will create the OCSP instance in
/var/lib/pki/rhcs10-RSA-OCSP-subca
.
For ease of reference, if you wanted to install this OCSP using the two-step method:
First run the
pkispawn
tool with the--skip-configuration
option to install the SubCA’s OCSP instance:pkispawn -s OCSP -f ocsp_subca_inst.cfg --skip-configuration --debug
# pkispawn -s OCSP -f ocsp_subca_inst.cfg --skip-configuration --debug
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Customize the configuration files between the two installation steps
Run the
pkispawn
tool to configure the OCSP:pkispawn -s OCSP -f ocsp_subca_inst.cfg --skip-installation --debug
# pkispawn -s OCSP -f ocsp_subca_inst.cfg --skip-installation --debug
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
Show the status of the installed OCSP instance:
pki-server status rhcs10-RSA-OCSP-subca
# pki-server status rhcs10-RSA-OCSP-subca
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
7.7.3. Increase the SubCA’s OCSP pkiconsole timeout Copiar o linkLink copiado para a área de transferência!
- Log in to rhcs10.example.com as root.
Stop the SubCA’s OCSP service:
pki-server stop rhcs10-RSA-OCSP-subca
pki-server stop rhcs10-RSA-OCSP-subca
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Edit
/var/lib/pki/rhcs10-RSA-OCSP-subca/conf/server.xml
to increase the timeout period:<Connector name="Secure" port="32443" … connectionTimeout="3000000"
<Connector name="Secure" port="32443" … connectionTimeout="3000000"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Start the SubCA’s OCSP service:
pki-server start rhcs10-RSA-OCSP-subca
# pki-server start rhcs10-RSA-OCSP-subca
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
7.7.4. Set the default AIA extension to point to this OCSP Copiar o linkLink copiado para a área de transferência!
By default, unless explicitly specified, the CA issues certificates with an AIA (Authority Information Access) extension pointing to the CA’s own internal OCSP. Now that you have set up an OCSP instance, you can configure the SubCA to start issuing certificates with an AIA extension that points to the OCSP instance instead.
On rhcs10.example.com as root:
Stop the SubCA:
pki-server stop rhcs10-RSA-SubCA
# pki-server stop rhcs10-RSA-SubCA
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Edit the SubCA’s
CS.cfg
and set theca.defaultOcspUri
variable to point to the OCSP. For example:ca.defaultOcspUri=http://rhcs10.example.com:32080/ocsp/ee/ocsp
ca.defaultOcspUri=http://rhcs10.example.com:32080/ocsp/ee/ocsp
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Start the SubCA:
pki-server start rhcs10-RSA-SubCA
# pki-server start rhcs10-RSA-SubCA
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
The OCSP URL of each subsystem (e.g. KRA) is set in its server.xml
file by default. When enabled, this directs the RHCS instance to use the static URL when looking up a certificate status, instead of the AIA extension embedded in the peer certificate. To use the AIA extension, you will be directed to follow Section 7.13.10.2, “Enabling OCSP for the CA / KRA / TKS / TPS” when installing the subsystem.
7.7.5. Create OCSP role users Copiar o linkLink copiado para a área de transferência!
Follow the steps in Section 7.12, “Create PKI role users” to create single-role admin, agent, audit users in OCSP. In order to do so, you will need to import the SubCA’s OCSP bootstrap administrator certificate,
ocsp_admin_cert.p12
. E.g.:pki -d /root/.dogtag/pki_rsa_bootstrap/certs_db -c SECret.123 client-cert-import --pkcs12 /opt/pki_rsa/rhcs10-RSA-OCSP-subca/ocsp_admin_cert.p12 --pkcs12-password SECret.123
# pki -d /root/.dogtag/pki_rsa_bootstrap/certs_db -c SECret.123 client-cert-import --pkcs12 /opt/pki_rsa/rhcs10-RSA-OCSP-subca/ocsp_admin_cert.p12 --pkcs12-password SECret.123 ---------------------------------------- Imported certificates from PKCS #12 file ----------------------------------------
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
7.7.6. Login to the OCSP pkiconsole with client authentication Copiar o linkLink copiado para a área de transferência!
-
Configure OCSP with
authType=sslclientauth
and import the role user certificate by following Configure pkiconsole login with client authentication. Login to
pkiconsole
with the client authentication certificate of the role user:pkiconsole -d <home .redhat-idm-console dir> -n <client cert> https://rhcs10.example.com:32443/ocsp
# pkiconsole -d <home .redhat-idm-console dir> -n <client cert> https://rhcs10.example.com:32443/ocsp
Copy to Clipboard Copied! Toggle word wrap Toggle overflow And select the role user certificate nickname from the list, for example OCSP adminV. Login to the console should be successful.
7.7.7. Configuration for CRL publishing Copiar o linkLink copiado para a área de transferência!
Red Hat Certificate System offers two methods of CRL publishing to be consumed by an OCSP instance external to the CA:
- Direct CA→OCSP CRL publishing
- Indirect publishing with CA→LDAP, then OCSP←LDAP
By default, once you set up an OCSP instance, the first CRL publishing method is automatically set up as well, which allows direct CA→OCSP CRL publishing.
This section details the second method, which is to have the CA publish its CRLs to an LDAP server, and the OCSP can then pull the CRLs from the LDAP server.
7.7.7.1. Setting up the LDAP server for CRL publishing Copiar o linkLink copiado para a área de transferência!
On rhds11.example.com as root:
Install a Directory Server instance, which the CA will use to publish the CRL. Red Hat Directory Server is listening over the LDAP/LDAPS ports, 5389 and 5636 respectively.
Use the
dscreate create-template
command to create a template.cfg
file at a chosen location (e.g./root/pki_rsa
):dscreate create-template /root/pki_rsa/subca-crl-publish-ldap.cfg
# dscreate create-template /root/pki_rsa/subca-crl-publish-ldap.cfg
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Edit the
.cfg
file created in the previous step. Uncomment the below parameters and set them to customize the installation:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Install the Directory Server instance:
dscreate from-file /root/pki_rsa/subca-crl-publish-ldap.cfg
# dscreate from-file /root/pki_rsa/subca-crl-publish-ldap.cfg Starting installation... Completed installation for CC-RSA-SubCA-CRL-PUBLISH
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Add an ACI (Access Control Instruction) rule to allow anonymous bind access. By default, this is disabled.
Create the
ldapaci.ldif
file at a chosen location (e.g./root/pki_rsa/dirsrv/
) with the following content:dn: dc=example,dc=com changetype: modify add: aci aci: (targetattr!="userPassword || aci")(version 3.0; acl "Enable anonymous access"; allow (read, search, compare) userdn="ldap:///anyone";)
dn: dc=example,dc=com changetype: modify add: aci aci: (targetattr!="userPassword || aci")(version 3.0; acl "Enable anonymous access"; allow (read, search, compare) userdn="ldap:///anyone";)
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Run the
ldapmodify
command to add the ACI:ldapmodify -x -h rhds11.example.com -p 5389 -D 'cn=Directory Manager' -W -f /root/pki_rsa/dirsrv/ldapaci.ldif
# ldapmodify -x -h rhds11.example.com -p 5389 -D 'cn=Directory Manager' -W -f /root/pki_rsa/dirsrv/ldapaci.ldif
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Prepare the CRL publishing subtree:
Create two files in the
/root/pki_rsa/dirsrv
directory with the following content:For the
subca_pki_subtree.ldif
file:dn: dc=pki,dc=example,dc=com objectClass: domain dc: pki
dn: dc=pki,dc=example,dc=com objectClass: domain dc: pki
Copy to Clipboard Copied! Toggle word wrap Toggle overflow For the
subca_crl_subtree.ldif
file:dn: dc=crl,dc=pki,dc=example,dc=com objectClass: domain dc: crl
dn: dc=crl,dc=pki,dc=example,dc=com objectClass: domain dc: crl
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Add both entries to the CRL instance:
ldapadd -x -H ldap://rhds11.example.com:5389 -D "cn=Directory Manager" -W -f /root/pki_rsa/dirsrv/subca_pki_subtree.ldif
# ldapadd -x -H ldap://rhds11.example.com:5389 -D "cn=Directory Manager" -W -f /root/pki_rsa/dirsrv/subca_pki_subtree.ldif
Copy to Clipboard Copied! Toggle word wrap Toggle overflow ldapadd -x -H ldap://rhds11.example.com:5389 -D "cn=Directory Manager" -W -f /root/pki_rsa/dirsrv/subca_crl_subtree.ldif
# ldapadd -x -H ldap://rhds11.example.com:5389 -D "cn=Directory Manager" -W -f /root/pki_rsa/dirsrv/subca_crl_subtree.ldif
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
7.7.7.2. Configuring CRL publishing on the SubCA Copiar o linkLink copiado para a área de transferência!
To configure CRL publishing:
Add the
ca.publish.
properties:Stop the SubCA instance:
pki-server stop rhcs10-RSA-SubCA
# pki-server stop rhcs10-RSA-SubCA
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Configure the following properties in the SubCA’s
CS.cfg
configuration file (e.g./var/lib/pki/rhcs10-RSA-SubCA/ca/conf/CS.cfg
):Copy to Clipboard Copied! Toggle word wrap Toggle overflow NOTEAlternatively, you can use the
ca-config-set
command to update the properties. For example:pki-server ca-config-set -i rhcs10-RSA-SubCA ca.publish.ldappublish.ldap.ldapconn.host rhds11.example.com; pki-server ca-config-set -i rhcs10-RSA-SubCA ca.publish.ldappublish.ldap.ldapconn.port 5389; pki-server ca-config-set -i rhcs10-RSA-SubCA ca.publish.mapper.instance.LdapCaCertMap.dnPattern "cn=\$subj.cn,dc=crl,dc=pki,dc=example,dc=com"; pki-server ca-config-set -i rhcs10-RSA-SubCA ca.publish.mapper.instance.LdapCrlMap.dnPattern cn=\$subj.cn,dc=crl,dc=pki,dc=example,dc=com
# pki-server ca-config-set -i rhcs10-RSA-SubCA ca.publish.ldappublish.ldap.ldapconn.host rhds11.example.com; pki-server ca-config-set -i rhcs10-RSA-SubCA ca.publish.ldappublish.ldap.ldapconn.port 5389; pki-server ca-config-set -i rhcs10-RSA-SubCA ca.publish.mapper.instance.LdapCaCertMap.dnPattern "cn=\$subj.cn,dc=crl,dc=pki,dc=example,dc=com"; pki-server ca-config-set -i rhcs10-RSA-SubCA ca.publish.mapper.instance.LdapCrlMap.dnPattern cn=\$subj.cn,dc=crl,dc=pki,dc=example,dc=com
Copy to Clipboard Copied! Toggle word wrap Toggle overflow And so on.
You can check that the parameters were successfully updated by using the
ca-config-show
command. For example:pki-server ca-config-show -i rhcs10-RSA-SubCA ca.publish.ldappublish.ldap.ldapconn.host rhds11.example.com; pki-server ca-config-show -i rhcs10-RSA-SubCA ca.publish.ldappublish.ldap.ldapconn.port 5389; pki-server ca-config-show -i rhcs10-RSA-SubCA ca.publish.mapper.instance.LdapCaCertMap.dnPattern "cn=\$subj.cn,dc=crl,dc=pki,dc=example,dc=com"; pki-server ca-config-show -i rhcs10-RSA-SubCA ca.publish.mapper.instance.LdapCrlMap.dnPattern cn=\$subj.cn,dc=crl,dc=pki,dc=example,dc=com
# pki-server ca-config-show -i rhcs10-RSA-SubCA ca.publish.ldappublish.ldap.ldapconn.host rhds11.example.com; pki-server ca-config-show -i rhcs10-RSA-SubCA ca.publish.ldappublish.ldap.ldapconn.port 5389; pki-server ca-config-show -i rhcs10-RSA-SubCA ca.publish.mapper.instance.LdapCaCertMap.dnPattern "cn=\$subj.cn,dc=crl,dc=pki,dc=example,dc=com"; pki-server ca-config-show -i rhcs10-RSA-SubCA ca.publish.mapper.instance.LdapCrlMap.dnPattern cn=\$subj.cn,dc=crl,dc=pki,dc=example,dc=com
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Start the SubCA instance:
pki-server start rhcs10-RSA-SubCA
pki-server start rhcs10-RSA-SubCA
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Push the CRL and CA certificate to the LDAP directory via
curl
. For example:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Disable the direct CA→OCSP CRL publishing method:
Stop the SubCA:
pki-server stop rhcs10-RSA-SubCA
# pki-server stop rhcs10-RSA-SubCA
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Edit the CA’s
CS.cfg
configuration file (e.g./var/lib/pki/rhcs10-RSA-SubCA/ca/conf/CS.cfg
) and set the following tofalse
:ca.publish.rule.instance.ocsprule-<host/port info>.enable=false
ca.publish.rule.instance.ocsprule-<host/port info>.enable=false
Copy to Clipboard Copied! Toggle word wrap Toggle overflow For example:
ca.publish.rule.instance.ocsprule-rhcs10-example-com-32443.enable=false
ca.publish.rule.instance.ocsprule-rhcs10-example-com-32443.enable=false
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Start the CA for the configuration change to take effect:
pki-server start rhcs10-RSA-SubCA
# pki-server start rhcs10-RSA-SubCA
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Update the Directory Server using
curl
. For example:curl \ -d "updateCRL=yes&updateCA=yes&xml=true" \ --cert-type P12 --cert /opt/pki_rsa/rhcs10-RSA-SubCA/ca_admin_cert.p12:SECret.123 \ -k https://rhcs10.example.com:31443/ca/agent/ca/updateDir | xmllint --format -
# curl \ -d "updateCRL=yes&updateCA=yes&xml=true" \ --cert-type P12 --cert /opt/pki_rsa/rhcs10-RSA-SubCA/ca_admin_cert.p12:SECret.123 \ -k https://rhcs10.example.com:31443/ca/agent/ca/updateDir | xmllint --format -
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Display the CRL using
curl
:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Run
ldapsearch
to verify that the CRL and the CA certificate are pushed to the LDAP directory:ldapsearch -x -D "cn=Directory Manager" -h "rhds11.example.com" -p 5389 -b "dc=example,dc=com" -w SECret.123
# ldapsearch -x -D "cn=Directory Manager" -h "rhds11.example.com" -p 5389 -b "dc=example,dc=com" -w SECret.123
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Disable certificate publishing for the SubCA (optional):
The following procedure is to prevent a WARNING message in the debug logs like the following:
2024-01-29 00:04:10 [Thread-18] INFO: CAPublisherProcessor: No rules enabled 2024-01-29 00:04:10 [Thread-18] SEVERE: PublishProcessor::publishCert : Failed to publish using rule: No rules enabled 2024-01-29 00:04:10 [Thread-18] WARNING: Could not publish certificate serial number 0x9c2762c. Error Failed to publish using rule: No rules enabled Failed to publish using rule: No rules enabled
2024-01-29 00:04:10 [Thread-18] INFO: CAPublisherProcessor: No rules enabled
2024-01-29 00:04:10 [Thread-18] SEVERE: PublishProcessor::publishCert : Failed to publish using rule: No rules enabled
2024-01-29 00:04:10 [Thread-18] WARNING: Could not publish certificate serial number 0x9c2762c. Error Failed to publish using rule: No rules enabled
Failed to publish using rule: No rules enabled
Stop the SubCA:
pki-server stop rhcs10-RSA-SubCA
# pki-server stop rhcs10-RSA-SubCA
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Edit
/var/lib/pki/rhcs10-RSA-SubCA/ca/conf/CS.cfg
and set the following:ca.publish.cert.enable=false
ca.publish.cert.enable=false
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Start the SubCA for the configuration change to take effect:
pki-server start rhcs10-RSA-SubCA
# pki-server start rhcs10-RSA-SubCA
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
7.7.7.3. Configuring the OCSP to pull the CRLs from the LDAP server Copiar o linkLink copiado para a área de transferência!
When you chose the alternative CRL publishing method, you need to set up the OCSP so that it knows where to pull the CRLs from. In order to do so, you need to configure the OCSP Revocation Info store information to point to the CRL publishing LDAP instance beforehand (that you have set up earlier in this chapter).
To configure the OCSP Revocation Info Store:
Stop the OCSP:
pki-server stop rhcs10-RSA-OCSP-subca
# pki-server stop rhcs10-RSA-OCSP-subca
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Set the
ldapStore
properties in the OCSP’sCS.cfg
configuration file (e.g./var/lib/pki/rhcs10-RSA-OCSP-subca/ocsp/conf/CS.cfg
). Make sure you change theocsp.storeId
parameter fromdefStore
toldapStore
and add the following parameters:Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteThe default value of
refreshInSec0
is 86400, we configured it to be 120 for the purpose of testing, so that CRL updates happen every 2 minutes.Optionally, for better observation, you can set the debug level to 0 in the OCSP’s
CS.cfg
configuration file to ensure the LDAPStore update displays in the debug log. Otherwise, it will only display the status when there is no update.debug.level=0
debug.level=0
Copy to Clipboard Copied! Toggle word wrap Toggle overflow However, be warned that doing so will quickly increase the size of the debug log, especially with the OCSP systems. It is therefore only recommended for a short testing period.
Start the OCSP for the
ldapStore
configuration to take effect:pki-server start rhcs10-RSA-OCSP-subca
# pki-server start rhcs10-RSA-OCSP-subca
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
7.7.7.4. Testing CRL publishing Copiar o linkLink copiado para a área de transferência!
In this section, we are going to test CRL publishing by creating two user certificates, one of which will then be revoked. We will then check both the valid certificate and the revoked certificate against the OCSP instance to verify if the responses are as expected.
Create CMC certificates
Create agent-signed CMC certificates for user1
and for user2
, the CMC requests are signed by the bootstrap admin certificate. For example, for user1
:
List the certificates in the database:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Use the
PKCS10Client
tool to generate a PKCS10 certificate request:PKCS10Client -d /root/.dogtag/pki_rsa_bootstrap/certs_db -p SECret.123 -n "cn=test user1, uid=user1" -o /root/.dogtag/pki_rsa_bootstrap/certs_db/user1.req
# PKCS10Client -d /root/.dogtag/pki_rsa_bootstrap/certs_db -p SECret.123 -n "cn=test user1, uid=user1" -o /root/.dogtag/pki_rsa_bootstrap/certs_db/user1.req PKCS10Client: Certificate request written into /root/.dogtag/pki_rsa_bootstrap/certs_db/user1.req PKCS10Client: PKCS#10 request key id written into /root/.dogtag/pki_rsa_bootstrap/certs_db/user1.req.keyId
Copy to Clipboard Copied! Toggle word wrap Toggle overflow NOTEUse
cat
on thekeyId
file so it will be available for the next step:cat /root/.dogtag/pki_rsa_bootstrap/certs_db/user1.req.keyId; echo
# cat /root/.dogtag/pki_rsa_bootstrap/certs_db/user1.req.keyId; echo
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Generate a CMC request:
Create a
CMCRequest
configuration file, using the PKCS#10 request and private key id you obtained from the previous step. For example:vi cmcRequest_p10_user1.cfg
# vi cmcRequest_p10_user1.cfg
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Copy to Clipboard Copied! Toggle word wrap Toggle overflow Generate the request using the
CMCRequest
command:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Submit the CMC request:
Create a
HttpClient
configuration file. For example:vim /root/.dogtag/pki_rsa_bootstrap/certs_db/HttpClient_cmc_p10_user1.cfg
# vim /root/.dogtag/pki_rsa_bootstrap/certs_db/HttpClient_cmc_p10_user1.cfg
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Copy to Clipboard Copied! Toggle word wrap Toggle overflow Submit the request using the
HttpClient
command:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Process the response using the
CMCResponse
command:Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Similarly, create a certificate for
user2
by repeating the above procedure with the adequate values.
Set up revocation
Now, set up revocation in order to revoke the user2
certificate:
Push the CRL and CA certificate to the LDAP directory:
- Login to the SubCA’s Agent UI in the browser.
- Select Update Revocation List and click Update.
Click Update Directory Server and select:
- Update the certificate revocation list to the directory
- Update Certificate Manager certificate to the directory
- Click Update Directory.
-
Wait for the OCSP’s
ldapStore
refresh to happen (observe the debug file in/var/lib/pki/rhcs10-RSA-OCSP-subca/ocsp/logs/debug
).
Check the certificate status by using the
OCSPClient
tool. For example, using the certificate serial number ofuser1
(in decimal):Copy to Clipboard Copied! Toggle word wrap Toggle overflow Revoke the certificate of
user2
:Create a
CMCRequest
configuration file. For example:vi cmc-agent-signed-revoke.cfg
# vi cmc-agent-signed-revoke.cfg
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Copy to Clipboard Copied! Toggle word wrap Toggle overflow Generate the request using the
CMCRequest
command:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create a
HttpClient
configuration file. For example:vi HttpClient.revoke.agentSigned.cfg
# vi HttpClient.revoke.agentSigned.cfg
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Copy to Clipboard Copied! Toggle word wrap Toggle overflow Submit the request using the
HttpClient
command:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Process the CMC Response:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
-
Verify in the CA signed audit log, for example
/var/log/pki/rhcs10-RSA-SubCA/ca/signedAudit/ca_audit
, that theuser2
certificate indeed got revoked. Wait until the next CRL autoupdate (update interval in minutes configured by the
ca.crl.MasterCRL.autoUpdateInterval
of the SubCA’sCS.cfg
file. By default, this is set to 240 minutes.)NoteAlternatively, if you want to manually update the CRL immediately, login to the SubCA’s Agent UI in the browser, and:
- Select Update Revocation List and click Update.
Click Update Directory Server and select:
- Update the certificate revocation list to the directory
-
Update Certificate Manager certificate to the directory
- Click Update Directory.
Once the
ldapStore
refresh completes, observe the debug file in/var/lib/pki/rhcs10-RSA-OCSP-subca/ocsp/logs/debug
.Verify with the
OCSPCLient
tool that the certificate ofuser2
has been revoked, using its serial number in decimal (with-c
pointing to the nickname of the signing CA):Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Set ocsp.store.ldapStore.refreshInSec0
back to the desired value
Previously, we set ocsp.store.ldapStore.refreshInSec0=120
to allow for quicker CRL refresh (2 minutes) for testing purposes.
-
Please change the value in the OCSP’s
CS.cfg
to your desired value (in seconds), update the debug level back to 10 and restart the OCSP.
7.8. Create and configure the SubCA (Part II) Copiar o linkLink copiado para a área de transferência!
This section continues the SubCA installation, with the assumption that you have installed an OCSP instance. This is so that the role user certificates and the TLS server certificate of the SubCA will bear AIA extensions pointing to the OCSP instance.
7.8.1. Issue a non-bootstrap agent user certificate Copiar o linkLink copiado para a área de transferência!
In this section, we are going to use the SubCA’s bootstrap admin certificate to issue a certificate, rsa_SubCA_AgentV (for agent user jsmith), that is limited to PKI agent role privileges. This certificate can then be used for approving any future CMC certificate requests.
Prerequisite
- You are logged in to rhcs10.example.com as root user.
Create an agent certificate for a pki agent user
-
Follow the procedure as described in Section 7.12.3, “Agent users” to get an agent certificate (in this example, rsa_SubCA_AgentV) issued for a pki agent user (e.g. jsmith). NOTE: As explained at the beginning of that part, if you are simply testing/evaluating the product, for convenience, instead of using a non-root user (e.g. jsmith), you could generate the CSR for rsa_SubCA_AgentV in the same certificate database as that of the bootstrap user (
/root/.dogtag/pki_rsa_bootstrap/certs_db
) as root, and further import the certificate into the same certdb to use. In case you select to do that, substitute the user/certs_db accordingly in the instructions that follow.
Verification:
Show the status of the installed SubCA:
pki-server status rhcs10-RSA-SubCA
# pki-server status rhcs10-RSA-SubCA
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Note down the Secure Agent, Admin and pkiconsole URLs.
Perform a sanity test to verify the new SubCA Admin certificate was added successfully:
First, find the serial number of the user1 certificate created in Section 7.7.7.4, “Testing CRL publishing”:
pki -p 31443 -h rhcs10.example.com ca-cert-find --uid user1
# pki -p 31443 -h rhcs10.example.com ca-cert-find --uid user1
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Place a hold on
user1
’s certificate using the SubCA Agent’s credentials:pki -d /home/jsmith/certs_db -n rsa_SubCA_AgentV -p 31443 -h rhcs10.example.com ca-cert-hold <user1 serial number>
# pki -d /home/jsmith/certs_db -n rsa_SubCA_AgentV -p 31443 -h rhcs10.example.com ca-cert-hold <user1 serial number>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
-
Make sure the SubCA’s EE page is accessible on
rhcs10.example.com
.
7.8.2. Replace the temporary DS certificate (SubCA) Copiar o linkLink copiado para a área de transferência!
Once the SubCA installation is complete, it can issue an official SSL server certificate for the Directory Server to replace the temporary one. Create a certificate signing request (CSR) for the Directory Server certificate, then submit this request to the CA using the SubCA agent user (rsa_SubCA_AgentV) credentials.
Ensure that you use the FQDN of the DS server, e.g. cn=rhds11.example.com
/ host=rhds11.example.com
.
Generate a CSR for the real DS certificate
On rhds11.example.com, generate a PKCS10 certificate signing request for the real DS certificate:
Stop DS:
dsctl slapd-CC-RSA-SubCA-LDAP stop
# dsctl slapd-CC-RSA-SubCA-LDAP stop
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Use the
certutil
tool to generate the CSR:certutil -R -d /etc/dirsrv/slapd-CC-RSA-SubCA-LDAP -s "CN=rhds11.example.com" -g 2048 -f /etc/dirsrv/slapd-CC-RSA-SubCA-LDAP/pwdfile.txt -a -o /etc/dirsrv/slapd-CC-RSA-SubCA-LDAP/Server-Cert-subca.csr -z /etc/dirsrv/slapd-CC-RSA-SubCA-LDAP/noise.txt
# certutil -R -d /etc/dirsrv/slapd-CC-RSA-SubCA-LDAP -s "CN=rhds11.example.com" -g 2048 -f /etc/dirsrv/slapd-CC-RSA-SubCA-LDAP/pwdfile.txt -a -o /etc/dirsrv/slapd-CC-RSA-SubCA-LDAP/Server-Cert-subca.csr -z /etc/dirsrv/slapd-CC-RSA-SubCA-LDAP/noise.txt
Copy to Clipboard Copied! Toggle word wrap Toggle overflow ImportantEdit the
Server-Cert-subca.csr
output file obtained above to remove the few lines before "Begin Certificate Request". For example:
vi /etc/dirsrv/slapd-CC-RSA-SubCA-LDAP/Server-Cert-subca.csr
# vi /etc/dirsrv/slapd-CC-RSA-SubCA-LDAP/Server-Cert-subca.csr
Copy to Clipboard Copied! Toggle word wrap Toggle overflow The CSR file must start with the line "-----BEGIN CERTIFICATE REQUEST-----" and end with the line "-----END CERTIFICATE REQUEST-----".
Start DS:
dsctl slapd-CC-RSA-SubCA-LDAP start
# dsctl slapd-CC-RSA-SubCA-LDAP start
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Remote copy the
Server-Cert-subca.csr
file to the system where the CA resides. For example:scp /etc/dirsrv/slapd-CC-RSA-SubCA-LDAP/Server-Cert-subca.csr root@rhcs10.example.com:/root/.dogtag/pki_rsa_bootstrap/certs_db/Server-Cert-subca.csr
# scp /etc/dirsrv/slapd-CC-RSA-SubCA-LDAP/Server-Cert-subca.csr root@rhcs10.example.com:/root/.dogtag/pki_rsa_bootstrap/certs_db/Server-Cert-subca.csr
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Issue the real DS certificate
On rhcs10.example.com, issue the actual SSL server certificate:
Generate a CMC request:
Create a
CMCRequest
configuration file. For example:vim /root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.dirsrv-subca_pkcs10.cfg
# vim /root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.dirsrv-subca_pkcs10.cfg
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Copy to Clipboard Copied! Toggle word wrap Toggle overflow Generate the request using the
CMCRequest
command:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Submit the CMC request:
Create a
HttpClient
configuration file. For example:vim /root/.dogtag/pki_rsa_bootstrap/certs_db/HttpClient_dirsrv-subca.cfg
# vim /root/.dogtag/pki_rsa_bootstrap/certs_db/HttpClient_dirsrv-subca.cfg
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteFor EC certificates, use the ECC profiles by setting:
servlet=/ca/ee/ca/profileSubmitCMCFull?profileId=caCMCECserverCertWithCRLDP
servlet=/ca/ee/ca/profileSubmitCMCFull?profileId=caCMCECserverCertWithCRLDP
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Submit the request using the
HttpClient
command:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Process the CMC Response:
Process the response using
CMCResponse
to display all certificates in chain individually in PEM format:ImportantRunning CMCResponse with the "-v" option returns the PEM of each certificate in the chain as Cert:0, Cert:1 etc. Below all the PEMs, the output also displays each certificate in the chain in pretty print format. Since the certificates are not displayed in a fixed order, in order to determine their position in the chain, you must examine the "Subject:" under each "Certificate". The corresponding PEM is displayed in the same position above.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Save the new
Server-Cert
DS certificate into a file in the bootstrap certificate directory (e.g./root/.dogtag/pki_rsa_bootstrap/certs_db/
) named accordingly. The.pem
file must start with the header-----BEGIN CERTIFICATE-----
and end with the footer-----END CERTIFICATE-----
. For example:vi /root/.dogtag/pki_rsa_bootstrap/certs_db/Server-Cert-subca.pem
# vi /root/.dogtag/pki_rsa_bootstrap/certs_db/Server-Cert-subca.pem
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Where
Server-Cert-subca.pem
is the newServer-Cert
certificate of the Directory Server instance that serves as the internaldb of the SubCA.NoteThe RootCA’s signing certificate should match with the output from the following command:
certutil -L -d /var/lib/pki/rhcs10-RSA-RootCA/alias/ -n "CA Signing Cert - rhcs10-RSA-RootCA" -a
# certutil -L -d /var/lib/pki/rhcs10-RSA-RootCA/alias/ -n "CA Signing Cert - rhcs10-RSA-RootCA" -a
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Remote copy the new
Server-Cert
certificate to rhds11.example.com. For example:scp /root/.dogtag/pki_rsa_bootstrap/certs_db/Server-Cert-subca.pem root@rhds11.example.com:/etc/dirsrv/slapd-CC-RSA-SubCA-LDAP/
# scp /root/.dogtag/pki_rsa_bootstrap/certs_db/Server-Cert-subca.pem root@rhds11.example.com:/etc/dirsrv/slapd-CC-RSA-SubCA-LDAP/
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Replace the temporary DS certificate
On rhds11.example.com, replace the temporary DS certificate with the actual DS certificate:
Stop the SubCA’s LDAP instance:
dsctl slapd-CC-RSA-SubCA-LDAP stop
# dsctl slapd-CC-RSA-SubCA-LDAP stop
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Save the contents of the
dirsrv
directory into a backup directory:cp -r /etc/dirsrv/slapd-CC-RSA-SubCA-LDAP/ /etc/dirsrv/save-rsa/slapd-CC-RSA-SubCA-LDAP/
# cp -r /etc/dirsrv/slapd-CC-RSA-SubCA-LDAP/ /etc/dirsrv/save-rsa/slapd-CC-RSA-SubCA-LDAP/
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Delete the old DS certificates:
certutil -D -d /etc/dirsrv/slapd-CC-RSA-SubCA-LDAP/ -f /etc/dirsrv/slapd-CC-RSA-SubCA-LDAP/pwdfile.txt -n "Server-Cert"
# certutil -D -d /etc/dirsrv/slapd-CC-RSA-SubCA-LDAP/ -f /etc/dirsrv/slapd-CC-RSA-SubCA-LDAP/pwdfile.txt -n "Server-Cert"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow certutil -D -d /etc/dirsrv/slapd-CC-RSA-SubCA-LDAP/ -f /etc/dirsrv/slapd-CC-RSA-SubCA-LDAP/pwdfile.txt -n "Self-Signed-CA"
# certutil -D -d /etc/dirsrv/slapd-CC-RSA-SubCA-LDAP/ -f /etc/dirsrv/slapd-CC-RSA-SubCA-LDAP/pwdfile.txt -n "Self-Signed-CA"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Import the newly created DS certificate and the CA certificates in its chain one by one. For example:
certutil -d /etc/dirsrv/slapd-CC-RSA-SubCA-LDAP/ -f /etc/dirsrv/slapd-CC-RSA-SubCA-LDAP/pwdfile.txt -A -t "CT,C,C" -n "CA Signing Cert - rhcs10-RSA-RootCA" -i /opt/pki_rsa/rootCA.pem
# certutil -d /etc/dirsrv/slapd-CC-RSA-SubCA-LDAP/ -f /etc/dirsrv/slapd-CC-RSA-SubCA-LDAP/pwdfile.txt -A -t "CT,C,C" -n "CA Signing Cert - rhcs10-RSA-RootCA" -i /opt/pki_rsa/rootCA.pem
Copy to Clipboard Copied! Toggle word wrap Toggle overflow certutil -d /etc/dirsrv/slapd-CC-RSA-SubCA-LDAP/ -f /etc/dirsrv/slapd-CC-RSA-SubCA-LDAP/pwdfile.txt -A -t "CT,C,C" -n "CA Signing Cert - rhcs10-RSA-SubCA" -i /opt/pki_rsa/subCA.pem
# certutil -d /etc/dirsrv/slapd-CC-RSA-SubCA-LDAP/ -f /etc/dirsrv/slapd-CC-RSA-SubCA-LDAP/pwdfile.txt -A -t "CT,C,C" -n "CA Signing Cert - rhcs10-RSA-SubCA" -i /opt/pki_rsa/subCA.pem
Copy to Clipboard Copied! Toggle word wrap Toggle overflow certutil -d /etc/dirsrv/slapd-CC-RSA-SubCA-LDAP/ -f /etc/dirsrv/slapd-CC-RSA-SubCA-LDAP/pwdfile.txt -A -t "u,u,u" -n "Server-Cert" -i /etc/dirsrv/slapd-CC-RSA-SubCA-LDAP/Server-Cert-subca.pem
# certutil -d /etc/dirsrv/slapd-CC-RSA-SubCA-LDAP/ -f /etc/dirsrv/slapd-CC-RSA-SubCA-LDAP/pwdfile.txt -A -t "u,u,u" -n "Server-Cert" -i /etc/dirsrv/slapd-CC-RSA-SubCA-LDAP/Server-Cert-subca.pem
Copy to Clipboard Copied! Toggle word wrap Toggle overflow List the certificates:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Start DS:
dsctl slapd-CC-RSA-SubCA-LDAP start
# dsctl slapd-CC-RSA-SubCA-LDAP start
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Test to confirm that the LDAP server is up and running (in case of a separate system, test on the CA host as well):
ldapsearch -x -D "cn=Directory Manager" -H ldaps://rhds11.example.com:7636 -b "dc=example,dc=com" -w SECret.123
# ldapsearch -x -D "cn=Directory Manager" -H ldaps://rhds11.example.com:7636 -b "dc=example,dc=com" -w SECret.123
Copy to Clipboard Copied! Toggle word wrap Toggle overflow If testing on a separate system, include the CA certificate chain in front of the
ldapsearch
command, for example:LDAPTLS_CACERT=/opt/pki_rsa/ca-chain.pem ldapsearch -x -D "cn=Directory Manager" -H ldaps://rhds11.example.com:7636 -b "dc=example,dc=com" -w SECret.123
# LDAPTLS_CACERT=/opt/pki_rsa/ca-chain.pem ldapsearch -x -D "cn=Directory Manager" -H ldaps://rhds11.example.com:7636 -b "dc=example,dc=com" -w SECret.123
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Remove the trust for the temporary DS certificate for the SubCA instance
On rhcs10.example.com, remove the temporary DS certificate from the SubCA instance database:
Stop the SubCA:
pki-server stop rhcs10-RSA-SubCA
# pki-server stop rhcs10-RSA-SubCA
Copy to Clipboard Copied! Toggle word wrap Toggle overflow List the certificate:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Remove the temporary certificate from the nssdb:
certutil -D -d /var/lib/pki/rhcs10-RSA-SubCA/alias/ -n "DS temp CA certificate"
# certutil -D -d /var/lib/pki/rhcs10-RSA-SubCA/alias/ -n "DS temp CA certificate"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Enable certificate revocation checks
Now that the Directory Server certificate has been replaced, we can see the CRL Distribution Point being detected during startup of the CA by enabling certificate revocation checks:
To enable certificate revocation checks, in the respective
/var/lib/pki/rhcs10-RSA-SubCA/conf/server.xml
file:Set
enableOCSP
orenableRevocationCheck
totrue
:enableOCSP=true or enableRevocationCheck=true
enableOCSP=true or enableRevocationCheck=true
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Additionally, remove these two parameters and their assigned values:
ocspResponderURL ocspResponderCertNickname
ocspResponderURL ocspResponderCertNickname
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Disable the legacy revocation check method by editing the CA’s
CS.cfg
file and setting the following tofalse
:auths.revocationChecking.enabled=false
auths.revocationChecking.enabled=false
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Start the SubCA instance:
pki-server start rhcs10-RSA-SubCA
# pki-server start rhcs10-RSA-SubCA
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Verifying the CRL Distribution Point
Now that we have replaced the server-cert
of the subordinate CA’s directory server using the profile caCMCserverCertWithCRLDP
, this effectively triggers the CRL distribution point to be referenced by the CA during startup when initiating a connection with its internal directory server.
This section provides a rudimentary method to verify the CRL Distribution Point setup in the CA (see Section 7.6.6, “Configure support for CRL Distribution Point”):
Check the publishing of the file-based CRL:
ls -l /var/lib/pki/rhcs10-RSA-SubCA/crl
# ls -l /var/lib/pki/rhcs10-RSA-SubCA/crl total 4 -rw-r--r--. 1 pkiuser pkiuser 573 Jun 21 18:43 ServerCertCRL-20240621-175339.der lrwxrwxrwx. 1 pkiuser pkiuser 67 Jun 21 18:43 ServerCertCRL.crl -> /var/lib/pki/rhcs10-RSA-SubCA/crl/ServerCertCRL-20240621-175339.der
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Display and verify the content of the CRL
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Do not remove the CRL file (soft link file ServerCertCRL.crl
, and its associated der file).
If you encounter a situation where the CRL file is missing or has been accidentally deleted from /var/lib/pki/rhcs10-RSA-SubCA/crl/
, preventing the CA from starting, follow the steps below to regenerate the CRL file:
Stop the CA service.
pki-server stop rhcs10-RSA-SubCA
# pki-server stop rhcs10-RSA-SubCA
Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Set the
enableRevocationCheck
orenableOCSP
parameter tofalse
(if it is currently set totrue
) in CA’sserver.xml
. -
Set the
ca.crl.ServerCertCRL.publishOnStart=
parameter totrue
in CA’sCS.cfg
. Start the CA service to regenerate the missing CRL file:
pki-server start rhcs10-RSA-SubCA
# pki-server start rhcs10-RSA-SubCA
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - After the CRL file has been recovered, stop the CA service once again.
-
Revert the
ca.crl.ServerCertCRL.publishOnStart=
parameter tofalse
in CA’sCS.cfg
. -
Set the
enableRevocationCheck
orenableOCSP
parameter totrue
in CA’sserver.xml
. - Start the CA service again to apply the changes.
By following these steps, you will successfully recover the missing CRL file and ensure the CA can start correctly.
Verifying that the CA is functioning
List the certificates in the CA:
pki -p 31443 ca-cert-find
# pki -p 31443 ca-cert-find
Copy to Clipboard Copied! Toggle word wrap Toggle overflow As the bootstrap admin user, list the users in the SubCA:
pki -d /root/.dogtag/pki_rsa_bootstrap/certs_db/ -c SECret.123 -p 31443 -n "PKI Bootstrap Administrator for RSA-SubCA" ca-user-find
# pki -d /root/.dogtag/pki_rsa_bootstrap/certs_db/ -c SECret.123 -p 31443 -n "PKI Bootstrap Administrator for RSA-SubCA" ca-user-find
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
7.8.3. Increase the SubCA pkiconsole timeout Copiar o linkLink copiado para a área de transferência!
On rhcs10.example.com:
Stop the SubCA:
pki-server stop rhcs10-RSA-SubCA
# pki-server stop rhcs10-RSA-SubCA
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Edit
/var/lib/pki/rhcs10-RSA-SubCA/conf/server.xml
to increase the timeout period:<Connector name="Secure" port="31443" … connectionTimeout="3000000"
<Connector name="Secure" port="31443" … connectionTimeout="3000000"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Start the SubCA:
pki-server start rhcs10-RSA-SubCA
# pki-server start rhcs10-RSA-SubCA
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
7.8.5. Check for random serial numbers Copiar o linkLink copiado para a área de transferência!
Make sure all the subsystem certificates have random serial numbers:
- Visit the SubCA’s EE page and list the certificates to confirm they have random serial numbers.
Alternatively, you can check for random serial numbers using the following command:
pki -p 31443 ca-cert-find | grep -i serial
# pki -p 31443 ca-cert-find | grep -i serial
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
7.8.6. Create other SubCA role users Copiar o linkLink copiado para a área de transferência!
We have previously created an agent role user and a certificate for rsa_SubCA_AgentV.
Else, you could create other single-role users for the admin and audit roles by following the steps in Section 7.12, “Create PKI role users”.
7.8.7. Login to the SubCA pkiconsole with client authentication Copiar o linkLink copiado para a área de transferência!
-
Configure the SubCA with
sslclientauth
and import the role user certificate as described in Section 7.13.6, “Configure pkiconsole login with client authentication”. Login to
pkiconsole
with the client authentication certificate of the role user:pkiconsole -d <home .redhat-idm-console dir> -n <client cert> https://rhcs10.example.com:31443/ca
# pkiconsole -d <home .redhat-idm-console dir> -n <client cert> https://rhcs10.example.com:31443/ca
Copy to Clipboard Copied! Toggle word wrap Toggle overflow And select the role user certificate nickname from the list, for example rsa_SubCA_AdminV. Login to the console should be successful.
7.8.8. Post-installation Copiar o linkLink copiado para a área de transferência!
If you wish to install additional RHCS instances, please continue with the next relevant section. Once you have completed the installation of all of the RHCS instances you need, please go to Section 7.13, “Post-installation” to complete additional setup.
7.9. Create and configure the KRA instance Copiar o linkLink copiado para a área de transferência!
This section describes installing and configuring a KRA instance against the SubCA. In this example, the KRA is installed on rhcs10.example.com, with its internal directory server on rhds11.example.com.
Make sure that the file /opt/pki_rsa/ca-chain.pem
contains the contains the complete CA certificate chain (SubCA and RootCA certificates):
ls -l /opt/pki_rsa/ca-chain.pem cat /opt/pki_rsa/ca-chain.pem
# ls -l /opt/pki_rsa/ca-chain.pem
# cat /opt/pki_rsa/ca-chain.pem
7.9.1. Replace the temporary DS certificate (KRA) Copiar o linkLink copiado para a área de transferência!
Prior to installing the KRA, we are issuing an official SSL server certificate for the KRA’s Directory Server to replace the temporary bootstrap one. To do that, we first create a certificate signing request (CSR) for the Directory Server certificate, then submit this request to the CA.
Ensure that you use the FQDN of the DS server, e.g. cn=rhds11.example.com
/ host=rhds11.example.com
.
Generate a CSR for the real DS certificate
On rhds11.example.com, generate a PKCS10 certificate signing request for the real DS certificate:
Stop DS:
dsctl slapd-CC-RSA-KRA-LDAP stop
# dsctl slapd-CC-RSA-KRA-LDAP stop
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Use the
certutil
tool to generate the CSR:certutil -R -d /etc/dirsrv/slapd-CC-RSA-KRA-LDAP -s "CN=rhds11.example.com" -g 2048 -f /etc/dirsrv/slapd-CC-RSA-KRA-LDAP/pwdfile.txt -a -o /etc/dirsrv/slapd-CC-RSA-KRA-LDAP/Server-Cert-kra.csr -z /etc/dirsrv/slapd-CC-RSA-KRA-LDAP/noise.txt
# certutil -R -d /etc/dirsrv/slapd-CC-RSA-KRA-LDAP -s "CN=rhds11.example.com" -g 2048 -f /etc/dirsrv/slapd-CC-RSA-KRA-LDAP/pwdfile.txt -a -o /etc/dirsrv/slapd-CC-RSA-KRA-LDAP/Server-Cert-kra.csr -z /etc/dirsrv/slapd-CC-RSA-KRA-LDAP/noise.txt
Copy to Clipboard Copied! Toggle word wrap Toggle overflow ImportantEdit the
Server-Cert-kra.csr
output file obtained above to remove the few lines before "Begin Certificate Request". For example:
vi /etc/dirsrv/slapd-CC-RSA-KRA-LDAP/Server-Cert-kra.csr
# vi /etc/dirsrv/slapd-CC-RSA-KRA-LDAP/Server-Cert-kra.csr
Copy to Clipboard Copied! Toggle word wrap Toggle overflow The CSR file must start with the line "-----BEGIN CERTIFICATE REQUEST-----" and end with the line "-----END CERTIFICATE REQUEST-----".
Remote copy the
Server-Cert-kra.csr
file to the system where the CA resides. For example:scp /etc/dirsrv/slapd-CC-RSA-KRA-LDAP/Server-Cert-kra.csr root@rhcs10.example.com:/root/.dogtag/pki_rsa_bootstrap/certs_db/Server-Cert-kra.csr
# scp /etc/dirsrv/slapd-CC-RSA-KRA-LDAP/Server-Cert-kra.csr root@rhcs10.example.com:/root/.dogtag/pki_rsa_bootstrap/certs_db/Server-Cert-kra.csr
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Issue the real DS certificate
On rhcs10.example.com, issue the actual SSL server certificate:
Generate a CMC request:
Create a
CMCRequest
configuration file. For example:vim /root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.dirsrv-kra_pkcs10.cfg
# vim /root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.dirsrv-kra_pkcs10.cfg
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Copy to Clipboard Copied! Toggle word wrap Toggle overflow Generate the request using the
CMCRequest
command:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Submit the CMC request:
Create a
HttpClient
configuration file. For example:vim /root/.dogtag/pki_rsa_bootstrap/certs_db/HttpClient_dirsrv-kra.cfg
# vim /root/.dogtag/pki_rsa_bootstrap/certs_db/HttpClient_dirsrv-kra.cfg
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Copy to Clipboard Copied! Toggle word wrap Toggle overflow Submit the request using the
HttpClient
command:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Process the CMC Response:
Process the response using
CMCResponse
to display all certificates in chain individually in PEM format:ImportantRunning CMCResponse with the "-v" option returns the PEM of each certificate in the chain as Cert:0, Cert:1 etc. Below all the PEMs, the output also displays each certificate in the chain in pretty print format. Since the certificates are not displayed in a fixed order, in order to determine their position in the chain, you must examine the "Subject:" under each "Certificate". The corresponding PEM is displayed in the same position above.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Save the new
Server-Cert
DS certificate into a file in the bootstrap certificate directory (e.g./root/.dogtag/pki_rsa_bootstrap/certs_db/
) named accordingly. The.pem
file must start with the header-----BEGIN CERTIFICATE-----
and end with the footer-----END CERTIFICATE-----
. For example:vi /root/.dogtag/pki_rsa_bootstrap/certs_db/Server-Cert-kra.pem
# vi /root/.dogtag/pki_rsa_bootstrap/certs_db/Server-Cert-kra.pem
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Where
Server-Cert-kra.pem
is the newServer-Cert
certificate of the Directory Server instance that serves as the internaldb of the KRA.NoteThe RootCA’s signing certificate should match with the output from the following command:
certutil -L -d /var/lib/pki/rhcs10-RSA-RootCA/alias/ -n "CA Signing Cert - rhcs10-RSA-RootCA" -a
# certutil -L -d /var/lib/pki/rhcs10-RSA-RootCA/alias/ -n "CA Signing Cert - rhcs10-RSA-RootCA" -a
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Remote copy the new
Server-Cert
certificate to rhds11.example.com. For example:scp /root/.dogtag/pki_rsa_bootstrap/certs_db/Server-Cert-kra.pem root@rhds11.example.com:/etc/dirsrv/slapd-CC-RSA-KRA-LDAP/
# scp /root/.dogtag/pki_rsa_bootstrap/certs_db/Server-Cert-kra.pem root@rhds11.example.com:/etc/dirsrv/slapd-CC-RSA-KRA-LDAP/
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Replace the temporary DS certificate
On rhds11.example.com, replace the temporary DS certificate with the actual DS certificate:
Save the contents of the
dirsrv
directory into a backup directory:cp -r /etc/dirsrv/slapd-CC-RSA-KRA-LDAP/ /etc/dirsrv/save-rsa/slapd-CC-RSA-KRA-LDAP/
# cp -r /etc/dirsrv/slapd-CC-RSA-KRA-LDAP/ /etc/dirsrv/save-rsa/slapd-CC-RSA-KRA-LDAP/
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Delete the old DS certificates:
certutil -D -d /etc/dirsrv/slapd-CC-RSA-KRA-LDAP/ -f /etc/dirsrv/slapd-CC-RSA-KRA-LDAP/pwdfile.txt -n "Server-Cert"
# certutil -D -d /etc/dirsrv/slapd-CC-RSA-KRA-LDAP/ -f /etc/dirsrv/slapd-CC-RSA-KRA-LDAP/pwdfile.txt -n "Server-Cert"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow certutil -D -d /etc/dirsrv/slapd-CC-RSA-KRA-LDAP/ -f /etc/dirsrv/slapd-CC-RSA-KRA-LDAP/pwdfile.txt -n "Self-Signed-CA"
# certutil -D -d /etc/dirsrv/slapd-CC-RSA-KRA-LDAP/ -f /etc/dirsrv/slapd-CC-RSA-KRA-LDAP/pwdfile.txt -n "Self-Signed-CA"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Import the newly created DS certificate and the CA certificates in its chain one by one. For example:
certutil -d /etc/dirsrv/slapd-CC-RSA-KRA-LDAP/ -f /etc/dirsrv/slapd-CC-RSA-KRA-LDAP/pwdfile.txt -A -t "CT,C,C" -n "CA Signing Cert - rhcs10-RSA-RootCA" -i /opt/pki_rsa/rootCA.pem
# certutil -d /etc/dirsrv/slapd-CC-RSA-KRA-LDAP/ -f /etc/dirsrv/slapd-CC-RSA-KRA-LDAP/pwdfile.txt -A -t "CT,C,C" -n "CA Signing Cert - rhcs10-RSA-RootCA" -i /opt/pki_rsa/rootCA.pem
Copy to Clipboard Copied! Toggle word wrap Toggle overflow certutil -d /etc/dirsrv/slapd-CC-RSA-KRA-LDAP/ -f /etc/dirsrv/slapd-CC-RSA-KRA-LDAP/pwdfile.txt -A -t "CT,C,C" -n "CA Signing Cert - rhcs10-RSA-SubCA" -i /opt/pki_rsa/subCA.pem
# certutil -d /etc/dirsrv/slapd-CC-RSA-KRA-LDAP/ -f /etc/dirsrv/slapd-CC-RSA-KRA-LDAP/pwdfile.txt -A -t "CT,C,C" -n "CA Signing Cert - rhcs10-RSA-SubCA" -i /opt/pki_rsa/subCA.pem
Copy to Clipboard Copied! Toggle word wrap Toggle overflow certutil -d /etc/dirsrv/slapd-CC-RSA-KRA-LDAP/ -f /etc/dirsrv/slapd-CC-RSA-KRA-LDAP/pwdfile.txt -A -t "u,u,u" -n "Server-Cert" -i /etc/dirsrv/slapd-CC-RSA-KRA-LDAP/Server-Cert-kra.pem
# certutil -d /etc/dirsrv/slapd-CC-RSA-KRA-LDAP/ -f /etc/dirsrv/slapd-CC-RSA-KRA-LDAP/pwdfile.txt -A -t "u,u,u" -n "Server-Cert" -i /etc/dirsrv/slapd-CC-RSA-KRA-LDAP/Server-Cert-kra.pem
Copy to Clipboard Copied! Toggle word wrap Toggle overflow List the certificates:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Start DS:
dsctl slapd-CC-RSA-KRA-LDAP start
# dsctl slapd-CC-RSA-KRA-LDAP start
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Test to confirm that the LDAP server is up and running (in case of a separate system, test on the CA host as well):
ldapsearch -x -D "cn=Directory Manager" -H ldaps://rhds11.example.com:22636 -b "dc=example,dc=com" -w SECret.123
# ldapsearch -x -D "cn=Directory Manager" -H ldaps://rhds11.example.com:22636 -b "dc=example,dc=com" -w SECret.123
Copy to Clipboard Copied! Toggle word wrap Toggle overflow If testing on a separate system, include the CA certificate chain in front of the
ldapsearch
command, for example:LDAPTLS_CACERT=/opt/pki_rsa/ca-chain.pem ldapsearch -x -D "cn=Directory Manager" -H ldaps://rhds11.example.com:22636 -b "dc=example,dc=com" -w SECret.123
# LDAPTLS_CACERT=/opt/pki_rsa/ca-chain.pem ldapsearch -x -D "cn=Directory Manager" -H ldaps://rhds11.example.com:22636 -b "dc=example,dc=com" -w SECret.123
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
7.9.2. Install the KRA instance Copiar o linkLink copiado para a área de transferência!
To install the KRA, use either the single-step method or the two-step method. The following procedure describes the single-step method. If you wish to install using the two-step method, please refer to ] as well as xref:_rootca_two_step[.
BEFORE you install the KRA, if you intend the AIA extension to point to the external OCSP instance instead of the CA’s internal OCSP, make sure you first follow the steps under Section 7.7.4, “Set the default AIA extension to point to this OCSP”.
Prerequisites
- You are logged in to rhcs10.example.com as root user.
- You have Section 7.1.2.5, “Installing a DS instance for the KRA”, in our example, CC-RSA-KRA-LDAP is the KRA’s internal database.
Procedure
Create a KRA installation file at a chosen location (e.g.
/root/pki_rsa
):cd /root/pki_rsa
# cd /root/pki_rsa
Copy to Clipboard Copied! Toggle word wrap Toggle overflow vi kra_inst.cfg
# vi kra_inst.cfg
Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteUnless explicitly specified, system certificate nicknames are automatically named bearing the value specified for
pki_instance_name
. To avoid certificate nickname conflicts on a shared HSM, use a unique instance name for each instance creation.
The values specified in the installation file below are examples. In addition to changing the HSM password, edit the values accordingly, for example ports, directories, nicknames, domains…
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Run the
pkispawn
tool to install the KRA subsystem:pkispawn -s KRA -f kra_inst.cfg --debug
# pkispawn -s KRA -f kra_inst.cfg --debug
Copy to Clipboard Copied! Toggle word wrap Toggle overflow This will create the KRA instance in
/var/lib/pki/rhcs10-RSA-KRA
.
For ease of reference, if you wanted to install the KRA using the two-step method:
First run the
pkispawn
tool with the--skip-configuration
option to install the RHCS KRA instance:pkispawn -s KRA -f kra_inst.cfg --skip-configuration --debug
# pkispawn -s KRA -f kra_inst.cfg --skip-configuration --debug
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Customize the configuration files between the two installation steps
Run the
pkispawn
tool to configure the KRA:pkispawn -s KRA -f kra_inst.cfg --skip-installation --debug
# pkispawn -s KRA -f kra_inst.cfg --skip-installation --debug
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
Show the status of the installed KRA instance:
pki-server status rhcs10-RSA-KRA
# pki-server status rhcs10-RSA-KRA
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Note down the Secure Agent, Admin and pkiconsole URLs.
- Verify that the KRA agent web page is accessible.
Import the KRA bootstrap administrator certificate into the nssdb:
pki -d /root/.dogtag/pki_rsa_bootstrap/certs_db client-cert-import --pkcs12 /opt/pki_rsa/rhcs10-RSA-KRA/kra_admin_cert.p12 --pkcs12-password SECret.123
# pki -d /root/.dogtag/pki_rsa_bootstrap/certs_db client-cert-import --pkcs12 /opt/pki_rsa/rhcs10-RSA-KRA/kra_admin_cert.p12 --pkcs12-password SECret.123
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Verify the sanity of the KRA by running the
kra-key-request-find
command. It should display certificates:pki -p 28443 -d /root/.dogtag/pki_rsa_bootstrap/certs_db -n “PKI Bootstrap Administrator for RSA-KRA” kra-key-request-find
# pki -p 28443 -d /root/.dogtag/pki_rsa_bootstrap/certs_db -n “PKI Bootstrap Administrator for RSA-KRA” kra-key-request-find
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
You can only perform the actual key archival and recovery tests after you complete the setup procedures detailed in the next subsections.
7.9.3. Configure OAEP support for the KRA Copiar o linkLink copiado para a área de transferência!
Configuring the KRA to use the OAEP (Optimal Asymmetric Encryption Padding) key transport algorithm is done by editing the KRA’s CS.cfg
configuration file.
This section is for a HSM that supports AES key wrapping/unwrapping, such as an Entrust nShield Connect XC unit with firmware v12.72.1.
Prerequisite
- You are logged onto rhcs10.example.com as root user.
Procedure
Stop the KRA:
pki-server stop rhcs10-RSA-KRA
# pki-server stop rhcs10-RSA-KRA
Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Edit the
/var/lib/pki/rhcs10-RSA-KRA/kra/conf/CS.cfg
configuration file and add the following three lines:
keyWrap.useOAEP=true
kra.legacyPKCS12=false
kra.nonLegacyAlg=AES/None/PKCS5Padding/Kwp/256
Start the KRA:
pki-server start rhcs10-RSA-KRA
# pki-server start rhcs10-RSA-KRA
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Restart the SubCA:
pki-server restart rhcs10-RSA-SubCA
# pki-server restart rhcs10-RSA-SubCA
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
7.9.4. Create KRA role users Copiar o linkLink copiado para a área de transferência!
- Create single-role admin, agent, audit users in the KRA by following the steps in Section 7.12, “Create PKI role users”.
7.9.5. Test key archival Copiar o linkLink copiado para a área de transferência!
This example demonstrates how a regular user without any pki role privilege could create a certificate enrollment request and have it automatically issued (= self-signed CMC enrollment), while having the private key archived by the KRA.
Please make sure the SubCA is configured to handle self-signed CMC enrollment by following the instructions in ] and xref:_install_add-issuance-protection-certificate[
Prerequisite configuration
In case you have not done this previously, please follow the steps under Section 7.8.4.3, “Test the CMC Shared Token” to set up a shared secret for your test user (in this example, FooUser123).
Procedure
This procedure provides steps that the regular (non-pki-role) user (e.g. FooUser123) is to perform in order to conduct self-signed CMC certificate enrollment for themselves. This can be done in any of FooUser123’s home directory, e.g. /home/FooUser123/certs_db
.
Create a client nssdb if it does not already exist:
pki -d /home/FooUser123/certs_db -c SECret.123 client-init
$ pki -d /home/FooUser123/certs_db -c SECret.123 client-init
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create a CRMF request using the KRA transport certificate:
Find the KRA transport certificate serial number in the SubCA’s EE page (in this example, 0x555251b).
Alternatively, you can also find its serial number if you know the certificate’s common name, for example:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Export the KRA transport certificate using its serial number:
pki -d /home/FooUser123/certs_db -c SECret.123 -p 31443 ca-cert-export 0x555251b --output-file /home/FooUser123/certs_db/kra_transport.txt
# pki -d /home/FooUser123/certs_db -c SECret.123 -p 31443 ca-cert-export 0x555251b --output-file /home/FooUser123/certs_db/kra_transport.txt
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create the CRMF request using the transport certificate:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Generate a CMC request:
Create a
CMCRequest
configuration file, using the CRMF request and private key id you obtained from the previous step. For example:vi /home/FooUser123/certs_db/cmc-crmf-self.cfg
# vi /home/FooUser123/certs_db/cmc-crmf-self.cfg
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Copy to Clipboard Copied! Toggle word wrap Toggle overflow Generate the request using the
CMCRequest
command:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Submit the CMC request:
Create a
HttpClient
configuration file. For example:vim /home/FooUser123/certs_db/HttpClient-cmc-crmf.self.cfg
# vim /home/FooUser123/certs_db/HttpClient-cmc-crmf.self.cfg
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Copy to Clipboard Copied! Toggle word wrap Toggle overflow Submit the request using the
HttpClient
command:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Process the response using the
CMCResponse
command:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification:
-
To verify the sanity of the KRA UI, access the KRA agent page and List the requests by selecting the request type Show key archival requests and the status Show completed requests. This should display the archived key information for
CN=FooUser123, UID=FooUser123
.
7.9.6. Test key recovery Copiar o linkLink copiado para a área de transferência!
Test the key recovery process with the following steps:
- As a KRA agent, go to the KRA’s agent services page in the browser, and click the Recover Keys link.
Tick the Certificate checkbox in order to search for the key by certificate:
Parse the earlier response file to display the leaf certificate in base64 format, for example:
CMCResponse -d /home/FooUser123/certs_db -i /home/FooUser123/certs_db/cmc.self.Resp -v
# CMCResponse -d /home/FooUser123/certs_db -i /home/FooUser123/certs_db/cmc.self.Resp -v
Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Copy and paste the base64-encoded leaf certificate into the text field (e.g.
cert0
: make sure that the "Subject" of the certificate has UID=FooUser123,DC=example,DC=com), validate with Show Key.
Click Recover. Make sure that the Async Recovery checkbox is selected to allow the browser session to be closed while recovery is ongoing.
NoteAsynchronous recovery is the default way to perform a key recovery. Synchronous key recovery is no longer supported.
- Click Recover. Depending on the agent scheme, a specified number of agents must authorize this key recovery. Have the agents search for the key to recover and then to approve the initiated recovery.
-
Once all the agents have authorized the recovery, select List Requests on the left side of the agent page, then select Request type
show key recovery requests
and Request statusshow all requests
. - Click the request number corresponding to the recovery request that was approved, enter the PKCS #12 password twice as requested, and click Retrieve PKCS#12.
- A dialog pops up. Click on Save File to download the PKCS #12 file for the owner of the private key certificate.
After receiving the PKCS #12 file, the certificate/keys owner can then restore the key into their Firefox nssdb. For example:
pk12util -d ~/.mozilla/firefox/’1234gggg.Default User’ -n "FooUser123 cert" -i getAsyncPk12
# pk12util -d ~/.mozilla/firefox/’1234gggg.Default User’ -n "FooUser123 cert" -i getAsyncPk12
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - You can now use the certificate again.
7.9.7. Increase the KRA pkiconsole timeout Copiar o linkLink copiado para a área de transferência!
Stop the KRA:
pki-server stop rhcs10-RSA-KRA
# pki-server stop rhcs10-RSA-KRA
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Increase the timeout period by editing the
/var/lib/pki/rhcs10-RSA-KRA/conf/server.xml
file:<Connector name="Secure" port="28443" … connectionTimeout="3000000"
<Connector name="Secure" port="28443" … connectionTimeout="3000000"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Then restart the KRA:
pki-server start rhcs10-RSA-KRA
# pki-server start rhcs10-RSA-KRA
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
7.9.8. Login to the KRA pkiconsole with client authentication Copiar o linkLink copiado para a área de transferência!
-
Configure the KRA with
authType=sslclientauth
and import the role user certificate by following Section 7.13.6, “Configure pkiconsole login with client authentication”. Login to pkiconsole with the client auth certificate of the role user:
pkiconsole -d <home .redhat-idm-console dir> -n <client cert> https://rhcs10.example.com:28443/kra
# pkiconsole -d <home .redhat-idm-console dir> -n <client cert> https://rhcs10.example.com:28443/kra
Copy to Clipboard Copied! Toggle word wrap Toggle overflow And select the role user certificate nickname from the list, for example KRA adminV. Login to the console should be successful.
7.9.9. Post-installation Copiar o linkLink copiado para a área de transferência!
If you wish to install additional RHCS instances, please continue with the next relevant section. Once you have completed the installation of all of the RHCS instances you need, please go to Section 7.13, “Post-installation” to complete additional setup.
7.10. Create and configure the TKS instance Copiar o linkLink copiado para a área de transferência!
This section describes installing and configuring a TKS instance against the SubCA .
The TKS system certificates will be issued by the SubCA, and the TKS will join the SubCA security domain.
In this example, the TKS is installed on rhcs10.example.com, with its internal directory server on rhds11.example.com.
Make sure that the file /opt/pki_rsa/ca-chain.pem
contains the complete CA certificate chain (SubCA and RootCA certificates):
ls -l /opt/pki_rsa/ca-chain.pem cat /opt/pki_rsa/ca-chain.pem
# ls -l /opt/pki_rsa/ca-chain.pem
# cat /opt/pki_rsa/ca-chain.pem
7.10.1. Replace the temporary DS certificate (TKS) Copiar o linkLink copiado para a área de transferência!
Prior to installing the TKS, we are issuing an official SSL server certificate for the TKS' Directory Server to replace the temporary bootstrap one. To do that, we first create a certificate signing request (CSR) for the Directory Server certificate, then submit this request to the CA.
Ensure that you use the FQDN of the DS server, e.g. cn=rhds11.example.com
/ host=rhds11.example.com
.
Generate a CSR for the real DS certificate
On rhds11.example.com, generate a PKCS10 certificate signing request for the real DS certificate:
Stop DS:
dsctl slapd-CC-RSA-TKS-LDAP stop
# dsctl slapd-CC-RSA-TKS-LDAP stop
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Use the
certutil
tool to generate the CSR:certutil -R -d /etc/dirsrv/slapd-CC-RSA-TKS-LDAP -s "CN=rhds11.example.com" -g 2048 -f /etc/dirsrv/slapd-CC-RSA-TKS-LDAP/pwdfile.txt -a -o /etc/dirsrv/slapd-CC-RSA-TKS-LDAP/Server-Cert-tks.csr -z /etc/dirsrv/slapd-CC-RSA-TKS-LDAP/noise.txt
# certutil -R -d /etc/dirsrv/slapd-CC-RSA-TKS-LDAP -s "CN=rhds11.example.com" -g 2048 -f /etc/dirsrv/slapd-CC-RSA-TKS-LDAP/pwdfile.txt -a -o /etc/dirsrv/slapd-CC-RSA-TKS-LDAP/Server-Cert-tks.csr -z /etc/dirsrv/slapd-CC-RSA-TKS-LDAP/noise.txt
Copy to Clipboard Copied! Toggle word wrap Toggle overflow ImportantEdit the
Server-Cert-tks.csr
output file obtained above to remove the few lines before "Begin Certificate Request". For example:
vi /etc/dirsrv/slapd-CC-RSA-TKS-LDAP/Server-Cert-tks.csr
# vi /etc/dirsrv/slapd-CC-RSA-TKS-LDAP/Server-Cert-tks.csr
Copy to Clipboard Copied! Toggle word wrap Toggle overflow The CSR file must start with the line "-----BEGIN CERTIFICATE REQUEST-----" and end with the line "-----END CERTIFICATE REQUEST-----".
Remote copy the
Server-Cert-tks.csr
file to the system where the CA resides. For example:scp /etc/dirsrv/slapd-CC-RSA-TKS-LDAP/Server-Cert-tks.csr root@rhcs10.example.com:/root/.dogtag/pki_rsa_bootstrap/certs_db/Server-Cert-tks.csr
# scp /etc/dirsrv/slapd-CC-RSA-TKS-LDAP/Server-Cert-tks.csr root@rhcs10.example.com:/root/.dogtag/pki_rsa_bootstrap/certs_db/Server-Cert-tks.csr
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Issue the real DS certificate
On rhcs10.example.com, issue the actual SSL server certificate:
Generate a CMC request:
Create a
CMCRequest
configuration file. For example:vim /root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.dirsrv-tks_pkcs10.cfg
# vim /root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.dirsrv-tks_pkcs10.cfg
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Copy to Clipboard Copied! Toggle word wrap Toggle overflow Generate the request using the
CMCRequest
command:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Submit the CMC request:
Create a
HttpClient
configuration file. For example:vim /root/.dogtag/pki_rsa_bootstrap/certs_db/HttpClient_dirsrv-tks.cfg
# vim /root/.dogtag/pki_rsa_bootstrap/certs_db/HttpClient_dirsrv-tks.cfg
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Copy to Clipboard Copied! Toggle word wrap Toggle overflow Submit the request using the
HttpClient
command:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Process the CMC Response:
Process the response using
CMCResponse
to display all certificates in chain individually in PEM format:ImportantRunning CMCResponse with the "-v" option returns the PEM of each certificate in the chain as Cert:0, Cert:1 etc. Below all the PEMs, the output also displays each certificate in the chain in pretty print format. Since the certificates are not displayed in a fixed order, in order to determine their position in the chain, you must examine the "Subject:" under each "Certificate". The corresponding PEM is displayed in the same position above.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Save the new
Server-Cert
DS certificate into a file in the bootstrap certificate directory (e.g./root/.dogtag/pki_rsa_bootstrap/certs_db/
) named accordingly. The.pem
file must start with the header-----BEGIN CERTIFICATE-----
and end with the footer-----END CERTIFICATE-----
. For example:vi /root/.dogtag/pki_rsa_bootstrap/certs_db/Server-Cert-tks.pem
# vi /root/.dogtag/pki_rsa_bootstrap/certs_db/Server-Cert-tks.pem
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Where
Server-Cert-tks.pem
is the newServer-Cert
certificate of the Directory Server instance that serves as the internaldb of the TKS.NoteThe RootCA’s signing certificate should match with the output from the following command:
certutil -L -d /var/lib/pki/rhcs10-RSA-RootCA/alias/ -n "CA Signing Cert - rhcs10-RSA-RootCA" -a
# certutil -L -d /var/lib/pki/rhcs10-RSA-RootCA/alias/ -n "CA Signing Cert - rhcs10-RSA-RootCA" -a
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Remote copy the new
Server-Cert
certificate to rhds11.example.com. For example:scp /root/.dogtag/pki_rsa_bootstrap/certs_db/Server-Cert-tks.pem root@rhds11.example.com:/etc/dirsrv/slapd-CC-RSA-TKS-LDAP/
# scp /root/.dogtag/pki_rsa_bootstrap/certs_db/Server-Cert-tks.pem root@rhds11.example.com:/etc/dirsrv/slapd-CC-RSA-TKS-LDAP/
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Replace the temporary DS certificate
On rhds11.example.com, replace the temporary DS certificate with the actual DS certificate:
Save the contents of the
dirsrv
directory into a backup directory:cp -r /etc/dirsrv/slapd-CC-RSA-TKS-LDAP/ /etc/dirsrv/save-rsa/slapd-CC-RSA-TKS-LDAP/
# cp -r /etc/dirsrv/slapd-CC-RSA-TKS-LDAP/ /etc/dirsrv/save-rsa/slapd-CC-RSA-TKS-LDAP/
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Delete the old DS certificates:
certutil -D -d /etc/dirsrv/slapd-CC-RSA-TKS-LDAP/ -f /etc/dirsrv/slapd-CC-RSA-TKS-LDAP/pwdfile.txt -n "Server-Cert"
# certutil -D -d /etc/dirsrv/slapd-CC-RSA-TKS-LDAP/ -f /etc/dirsrv/slapd-CC-RSA-TKS-LDAP/pwdfile.txt -n "Server-Cert"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow certutil -D -d /etc/dirsrv/slapd-CC-RSA-TKS-LDAP/ -f /etc/dirsrv/slapd-CC-RSA-TKS-LDAP/pwdfile.txt -n "Self-Signed-CA"
# certutil -D -d /etc/dirsrv/slapd-CC-RSA-TKS-LDAP/ -f /etc/dirsrv/slapd-CC-RSA-TKS-LDAP/pwdfile.txt -n "Self-Signed-CA"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Import the newly created DS certificate and the CA certificates in its chain one by one. For example:
certutil -d /etc/dirsrv/slapd-CC-RSA-TKS-LDAP/ -f /etc/dirsrv/slapd-CC-RSA-TKS-LDAP/pwdfile.txt -A -t "CT,C,C" -n "CA Signing Cert - rhcs10-RSA-RootCA" -i /opt/pki_rsa/rootCA.pem
# certutil -d /etc/dirsrv/slapd-CC-RSA-TKS-LDAP/ -f /etc/dirsrv/slapd-CC-RSA-TKS-LDAP/pwdfile.txt -A -t "CT,C,C" -n "CA Signing Cert - rhcs10-RSA-RootCA" -i /opt/pki_rsa/rootCA.pem
Copy to Clipboard Copied! Toggle word wrap Toggle overflow certutil -d /etc/dirsrv/slapd-CC-RSA-TKS-LDAP/ -f /etc/dirsrv/slapd-CC-RSA-TKS-LDAP/pwdfile.txt -A -t "CT,C,C" -n "CA Signing Cert - rhcs10-RSA-SubCA" -i /opt/pki_rsa/subCA.pem
# certutil -d /etc/dirsrv/slapd-CC-RSA-TKS-LDAP/ -f /etc/dirsrv/slapd-CC-RSA-TKS-LDAP/pwdfile.txt -A -t "CT,C,C" -n "CA Signing Cert - rhcs10-RSA-SubCA" -i /opt/pki_rsa/subCA.pem
Copy to Clipboard Copied! Toggle word wrap Toggle overflow certutil -d /etc/dirsrv/slapd-CC-RSA-TKS-LDAP/ -f /etc/dirsrv/slapd-CC-RSA-TKS-LDAP/pwdfile.txt -A -t "u,u,u" -n "Server-Cert" -i /etc/dirsrv/slapd-CC-RSA-TKS-LDAP/Server-Cert-tks.pem
# certutil -d /etc/dirsrv/slapd-CC-RSA-TKS-LDAP/ -f /etc/dirsrv/slapd-CC-RSA-TKS-LDAP/pwdfile.txt -A -t "u,u,u" -n "Server-Cert" -i /etc/dirsrv/slapd-CC-RSA-TKS-LDAP/Server-Cert-tks.pem
Copy to Clipboard Copied! Toggle word wrap Toggle overflow List the certificates:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Start DS:
dsctl slapd-CC-RSA-TKS-LDAP start
# dsctl slapd-CC-RSA-TKS-LDAP start
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Test to confirm that the LDAP server is up and running (in case of a separate system, test on the CA host as well):
ldapsearch -x -D "cn=Directory Manager" -H ldaps://rhds11.example.com:16636 -b "dc=example,dc=com" -w SECret.123
# ldapsearch -x -D "cn=Directory Manager" -H ldaps://rhds11.example.com:16636 -b "dc=example,dc=com" -w SECret.123
Copy to Clipboard Copied! Toggle word wrap Toggle overflow If testing on a separate system, include the CA certificate chain in front of the
ldapsearch
command, for example:LDAPTLS_CACERT=/opt/pki_rsa/ca-chain.pem ldapsearch -x -D "cn=Directory Manager" -H ldaps://rhds11.example.com:16636 -b "dc=example,dc=com" -w SECret.123
# LDAPTLS_CACERT=/opt/pki_rsa/ca-chain.pem ldapsearch -x -D "cn=Directory Manager" -H ldaps://rhds11.example.com:16636 -b "dc=example,dc=com" -w SECret.123
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
7.10.2. Install the TKS instance Copiar o linkLink copiado para a área de transferência!
To install the TKS, use either the single-step method or the two-step method. The following procedure describes the single-step method. If you wish to install using the two-step method, please refer to ] as well as xref:_rootca_two_step[.
BEFORE you install the TKS, if you intend the AIA extension to point to the external OCSP instance instead of the CA’s internal OCSP, make sure you first follow the steps under Section 7.7.4, “Set the default AIA extension to point to this OCSP”.
Prerequisites
- You are logged in to rhcs10.example.com as root user.
- You have Section 7.1.2.6, “Installing a DS instance for the TKS”, in our example, CC-RSA-TKS-LDAP is the TKS' internal database.
Procedure
Create a TKS installation file at a chosen location (e.g.
/root/pki_rsa
):cd /root/pki_rsa
# cd /root/pki_rsa
Copy to Clipboard Copied! Toggle word wrap Toggle overflow vi tks_inst.cfg
# vi tks_inst.cfg
Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteUnless explicitly specified, system certificate nicknames are automatically named bearing the value specified for
pki_instance_name
. To avoid certificate nickname conflicts on a shared HSM, use a unique instance name for each instance creation.
The values specified in the installation file below are examples. In addition to changing the HSM password, edit the values accordingly, for example ports, directories, nicknames, domains…
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Run the
pkispawn
tool to install the TKS subsystem:pkispawn -s TKS -f tks_inst.cfg --debug
# pkispawn -s TKS -f tks_inst.cfg --debug
Copy to Clipboard Copied! Toggle word wrap Toggle overflow This will create the TKS instance in
/var/lib/pki/rhcs10-RSA-TKS
.
For ease of reference, if you wanted to install the TKS using the two-step method:
First run the
pkispawn
tool with the--skip-configuration
option to install the RHCS TKS instance:pkispawn -s TKS -f tks_inst.cfg --skip-configuration --debug
# pkispawn -s TKS -f tks_inst.cfg --skip-configuration --debug
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Customize the configuration files between the two installation steps
Run the
pkispawn
tool to configure the KRA:pkispawn -s TKS -f tks_inst.cfg --skip-installation --debug
# pkispawn -s TKS -f tks_inst.cfg --skip-installation --debug
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
Show the status of the installed TKS instance:
pki-server status rhcs10-RSA-TKS
# pki-server status rhcs10-RSA-TKS
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Note down the Secure Agent, Admin and pkiconsole URLs.
7.10.3. Configure OAEP support for the TKS Copiar o linkLink copiado para a área de transferência!
Configuring the TKS to use the OAEP (Optimal Asymmetric Encryption Padding) key transport algorithm is done by editing the TKS’s CS.cfg
configuration file.
This section is for a HSM that supports AES key wrapping/unwrapping, such as an Entrust nShield Connect XC unit with firmware v12.72.1.
Prerequisite
- You are logged onto rhcs10.example.com as root user.
Procedure
Stop the TKS:
pki-server stop rhcs10-RSA-TKS
# pki-server stop rhcs10-RSA-TKS
Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Edit the
/var/lib/pki/rhcs10-RSA-TKS/tks/conf/CS.cfg
configuration file and add the following line:
keyWrap.useOAEP=true
Start the TKS:
pki-server start rhcs10-RSA-TKS
# pki-server start rhcs10-RSA-TKS
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
7.10.4. Create TKS Role users Copiar o linkLink copiado para a área de transferência!
- Create single-role admin, agent, audit users in the TKS by following the steps in Section 7.12, “Create PKI role users”.
7.10.5. Post-installation Copiar o linkLink copiado para a área de transferência!
If you wish to install additional RHCS instances, please continue with the next relevant section. Once you have completed the installation of all of the RHCS instances you need, please go to Section 7.13, “Post-installation” to complete additional setup.
7.11. Create and configure the TPS instance Copiar o linkLink copiado para a área de transferência!
This section describes installing and configuring a TPS instance against the SubCA.
The TPS system certificates will be issued by the SubCA, and the TPS will join the SubCA security domain.
In this example, the TPS is installed on rhcs10.example.com, with its internal directory server on rhds11.example.com.
Make sure that the file /opt/pki_rsa/ca-chain.pem
contains the complete CA certificate chain (SubCA and RootCA certificates):
ls -l /opt/pki_rsa/ca-chain.pem cat /opt/pki_rsa/ca-chain.pem
# ls -l /opt/pki_rsa/ca-chain.pem
# cat /opt/pki_rsa/ca-chain.pem
7.11.1. Replace the temporary DS certificate (TPS) Copiar o linkLink copiado para a área de transferência!
Prior to installing the TPS, we are issuing an official SSL server certificate for the TPS' Directory Server to replace the temporary bootstrap one. To do that, we first create a certificate signing request (CSR) for the Directory Server certificate, then submit this request to the CA.
Ensure that you use the FQDN of the DS server, e.g. cn=rhds11.example.com
/ host=rhds11.example.com
.
Generate a CSR for the real DS certificate
On rhds11.example.com, generate a PKCS10 certificate signing request for the real DS certificate:
Stop DS:
dsctl slapd-CC-RSA-TPS-LDAP stop
# dsctl slapd-CC-RSA-TPS-LDAP stop
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Use the
certutil
tool to generate the CSR:certutil -R -d /etc/dirsrv/slapd-CC-RSA-TPS-LDAP -s "CN=rhds11.example.com" -g 2048 -f /etc/dirsrv/slapd-CC-RSA-TPS-LDAP/pwdfile.txt -a -o /etc/dirsrv/slapd-CC-RSA-TPS-LDAP/Server-Cert-tps.csr -z /etc/dirsrv/slapd-CC-RSA-TPS-LDAP/noise.txt
# certutil -R -d /etc/dirsrv/slapd-CC-RSA-TPS-LDAP -s "CN=rhds11.example.com" -g 2048 -f /etc/dirsrv/slapd-CC-RSA-TPS-LDAP/pwdfile.txt -a -o /etc/dirsrv/slapd-CC-RSA-TPS-LDAP/Server-Cert-tps.csr -z /etc/dirsrv/slapd-CC-RSA-TPS-LDAP/noise.txt
Copy to Clipboard Copied! Toggle word wrap Toggle overflow ImportantEdit the
Server-Cert-tps.csr
output file obtained above to remove the few lines before "Begin Certificate Request". For example:
vi /etc/dirsrv/slapd-CC-RSA-TPS-LDAP/Server-Cert-tps.csr
# vi /etc/dirsrv/slapd-CC-RSA-TPS-LDAP/Server-Cert-tps.csr
Copy to Clipboard Copied! Toggle word wrap Toggle overflow The CSR file must start with the line "-----BEGIN CERTIFICATE REQUEST-----" and end with the line "-----END CERTIFICATE REQUEST-----".
Remote copy the
Server-Cert-tps.csr
file to the system where the CA resides. For example:scp /etc/dirsrv/slapd-CC-RSA-TPS-LDAP/Server-Cert-tps.csr root@rhcs10.example.com:/root/.dogtag/pki_rsa_bootstrap/certs_db/Server-Cert-tps.csr
# scp /etc/dirsrv/slapd-CC-RSA-TPS-LDAP/Server-Cert-tps.csr root@rhcs10.example.com:/root/.dogtag/pki_rsa_bootstrap/certs_db/Server-Cert-tps.csr
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Issue the real DS certificate
On rhcs10.example.com, issue the actual SSL server certificate:
Generate a CMC request:
Create a
CMCRequest
configuration file. For example:vim /root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.dirsrv-tps_pkcs10.cfg
# vim /root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.dirsrv-tps_pkcs10.cfg
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Copy to Clipboard Copied! Toggle word wrap Toggle overflow Generate the request using the
CMCRequest
command:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Submit the CMC request:
Create a
HttpClient
configuration file. For example:vim /root/.dogtag/pki_rsa_bootstrap/certs_db/HttpClient_dirsrv-tps.cfg
# vim /root/.dogtag/pki_rsa_bootstrap/certs_db/HttpClient_dirsrv-tps.cfg
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Copy to Clipboard Copied! Toggle word wrap Toggle overflow Submit the request using the
HttpClient
command:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Process the CMC Response:
Process the response using
CMCResponse
to display all certificates in chain individually in PEM format:ImportantRunning CMCResponse with the "-v" option returns the PEM of each certificate in the chain as Cert:0, Cert:1 etc. Below all the PEMs, the output also displays each certificate in the chain in pretty print format. Since the certificates are not displayed in a fixed order, in order to determine their position in the chain, you must examine the "Subject:" under each "Certificate". The corresponding PEM is displayed in the same position above.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Save the new
Server-Cert
DS certificate into a file in the bootstrap certificate directory (e.g./root/.dogtag/pki_rsa_bootstrap/certs_db/
) named accordingly. The.pem
file must start with the header-----BEGIN CERTIFICATE-----
and end with the footer-----END CERTIFICATE-----
. For example:vi /root/.dogtag/pki_rsa_bootstrap/certs_db/Server-Cert-tps.pem
# vi /root/.dogtag/pki_rsa_bootstrap/certs_db/Server-Cert-tps.pem
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Where
Server-Cert-tps.pem
is the newServer-Cert
certificate of the Directory Server instance that serves as the internaldb of the TPS.NoteThe RootCA’s signing certificate should match with the output from the following command:
certutil -L -d /var/lib/pki/rhcs10-RSA-RootCA/alias/ -n "CA Signing Cert - rhcs10-RSA-RootCA" -a
# certutil -L -d /var/lib/pki/rhcs10-RSA-RootCA/alias/ -n "CA Signing Cert - rhcs10-RSA-RootCA" -a
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Remote copy the new
Server-Cert
certificate to rhds11.example.com. For example:scp /root/.dogtag/pki_rsa_bootstrap/certs_db/Server-Cert-tps.pem root@rhds11.example.com:/etc/dirsrv/slapd-CC-RSA-TPS-LDAP/
# scp /root/.dogtag/pki_rsa_bootstrap/certs_db/Server-Cert-tps.pem root@rhds11.example.com:/etc/dirsrv/slapd-CC-RSA-TPS-LDAP/
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Replace the temporary DS certificate
On rhds11.example.com, replace the temporary DS certificate with the actual DS certificate:
Save the contents of the
dirsrv
directory into a backup directory:cp -r /etc/dirsrv/slapd-CC-RSA-TPS-LDAP/ /etc/dirsrv/save-rsa/slapd-CC-RSA-TPS-LDAP/
# cp -r /etc/dirsrv/slapd-CC-RSA-TPS-LDAP/ /etc/dirsrv/save-rsa/slapd-CC-RSA-TPS-LDAP/
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Delete the old DS certificates:
certutil -D -d /etc/dirsrv/slapd-CC-RSA-TPS-LDAP/ -f /etc/dirsrv/slapd-CC-RSA-TPS-LDAP/pwdfile.txt -n "Server-Cert"
# certutil -D -d /etc/dirsrv/slapd-CC-RSA-TPS-LDAP/ -f /etc/dirsrv/slapd-CC-RSA-TPS-LDAP/pwdfile.txt -n "Server-Cert"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow certutil -D -d /etc/dirsrv/slapd-CC-RSA-TPS-LDAP/ -f /etc/dirsrv/slapd-CC-RSA-TPS-LDAP/pwdfile.txt -n "Self-Signed-CA"
# certutil -D -d /etc/dirsrv/slapd-CC-RSA-TPS-LDAP/ -f /etc/dirsrv/slapd-CC-RSA-TPS-LDAP/pwdfile.txt -n "Self-Signed-CA"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Import the newly created DS certificate and the CA certificates in its chain one by one. For example:
certutil -d /etc/dirsrv/slapd-CC-RSA-TPS-LDAP/ -f /etc/dirsrv/slapd-CC-RSA-TPS-LDAP/pwdfile.txt -A -t "CT,C,C" -n "CA Signing Cert - rhcs10-RSA-RootCA" -i /opt/pki_rsa/rootCA.pem
# certutil -d /etc/dirsrv/slapd-CC-RSA-TPS-LDAP/ -f /etc/dirsrv/slapd-CC-RSA-TPS-LDAP/pwdfile.txt -A -t "CT,C,C" -n "CA Signing Cert - rhcs10-RSA-RootCA" -i /opt/pki_rsa/rootCA.pem
Copy to Clipboard Copied! Toggle word wrap Toggle overflow certutil -d /etc/dirsrv/slapd-CC-RSA-TPS-LDAP/ -f /etc/dirsrv/slapd-CC-RSA-TPS-LDAP/pwdfile.txt -A -t "CT,C,C" -n "CA Signing Cert - rhcs10-RSA-SubCA" -i /opt/pki_rsa/subCA.pem
# certutil -d /etc/dirsrv/slapd-CC-RSA-TPS-LDAP/ -f /etc/dirsrv/slapd-CC-RSA-TPS-LDAP/pwdfile.txt -A -t "CT,C,C" -n "CA Signing Cert - rhcs10-RSA-SubCA" -i /opt/pki_rsa/subCA.pem
Copy to Clipboard Copied! Toggle word wrap Toggle overflow certutil -d /etc/dirsrv/slapd-CC-RSA-TPS-LDAP/ -f /etc/dirsrv/slapd-CC-RSA-TPS-LDAP/pwdfile.txt -A -t "u,u,u" -n "Server-Cert" -i /etc/dirsrv/slapd-CC-RSA-TPS-LDAP/Server-Cert-tps.pem
# certutil -d /etc/dirsrv/slapd-CC-RSA-TPS-LDAP/ -f /etc/dirsrv/slapd-CC-RSA-TPS-LDAP/pwdfile.txt -A -t "u,u,u" -n "Server-Cert" -i /etc/dirsrv/slapd-CC-RSA-TPS-LDAP/Server-Cert-tps.pem
Copy to Clipboard Copied! Toggle word wrap Toggle overflow List the certificates:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Start DS:
dsctl slapd-CC-RSA-TPS-LDAP start
# dsctl slapd-CC-RSA-TPS-LDAP start
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Test to confirm that the LDAP server is up and running (in case of a separate system, test on the CA host as well):
ldapsearch -x -D "cn=Directory Manager" -H ldaps://rhds11.example.com:17636 -b "dc=example,dc=com" -w SECret.123
# ldapsearch -x -D "cn=Directory Manager" -H ldaps://rhds11.example.com:17636 -b "dc=example,dc=com" -w SECret.123
Copy to Clipboard Copied! Toggle word wrap Toggle overflow If testing on a separate system, include the CA certificate chain in front of the
ldapsearch
command, for example:LDAPTLS_CACERT=/opt/pki_rsa/ca-chain.pem ldapsearch -x -D "cn=Directory Manager" -H ldaps://rhds11.example.com:17636 -b "dc=example,dc=com" -w SECret.123
# LDAPTLS_CACERT=/opt/pki_rsa/ca-chain.pem ldapsearch -x -D "cn=Directory Manager" -H ldaps://rhds11.example.com:17636 -b "dc=example,dc=com" -w SECret.123
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
7.11.2. Configuring a TPS authentication database Copiar o linkLink copiado para a área de transferência!
TPS relies on an authentication database to authenticate smartcard tokens.
For more information, please see Section 2.5.2.4, “Token database”.
7.11.2.1. Setting up a LDAP server for the TPS authentication database Copiar o linkLink copiado para a área de transferência!
Prior to installing the TPS, we are installing a Directory Server instance that will host the TPS AuthDB.
The TPS authentication database mentioned in this section is created with simplified steps for demonstration purposes only.
On rhds11.example.com as root:
Install a Directory Server instance, which the CA will use to authenticate tokens. Red Hat Directory Server is listening over the LDAP/LDAPS ports, 9389 and 9636 respectively.
Create the TPS AuthDB Directory Server installation file at a chosen location (e.g.
/root/pki_rsa
):vim /root/pki_rsa/tps-auth-db-ldap.cfg
# vim /root/pki_rsa/tps-auth-db-ldap.cfg
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Edit the
.cfg
file created in the previous step. Uncomment the below parameters and set them to customize the installation:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Install the Directory Server instance:
dscreate from-file /root/pki_rsa/tps-auth-db-ldap.cfg
# dscreate from-file /root/pki_rsa/tps-auth-db-ldap.cfg Starting installation... Completed installation for CC-RSA-TPS-AUTH-DB
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Add an ACI (Access Control Instruction) rule to allow anonymous bind access. By default, this is disabled.
Create the
ldapaci.ldif
file at a chosen location (e.g./root/pki_rsa/dirsrv/
) with the following content:dn: dc=example,dc=com changetype: modify add: aci aci: (targetattr!="userPassword || aci")(version 3.0; acl "Enable anonymous access"; allow (read, search, compare) userdn="ldap:///anyone";)
dn: dc=example,dc=com changetype: modify add: aci aci: (targetattr!="userPassword || aci")(version 3.0; acl "Enable anonymous access"; allow (read, search, compare) userdn="ldap:///anyone";)
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Run the
ldapmodify
command to add the ACI:ldapmodify -x -h rhds11.example.com -p 9389 -D 'cn=Directory Manager' -W -f /root/pki_rsa/dirsrv/ldapaci.ldif
# ldapmodify -x -h rhds11.example.com -p 9389 -D 'cn=Directory Manager' -W -f /root/pki_rsa/dirsrv/ldapaci.ldif
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
7.11.2.2. Replace the temporary DS certificate (TPS AuthDB) Copiar o linkLink copiado para a área de transferência!
Prior to installing the TPS, we are issuing an official SSL server certificate for the TPS Authentication Database to replace the temporary bootstrap certificate. To do that, we first create a certificate signing request (CSR) for the Directory Server certificate, then submit this request to the CA.
Ensure that you use the FQDN of the DS server, e.g. cn=rhds11.example.com
/ host=rhds11.example.com
.
Generate a CSR for the real DS certificate
On rhds11.example.com, generate a PKCS10 certificate signing request for the real DS certificate:
Stop DS:
dsctl slapd-CC-RSA-TPS-AUTH-DB stop
# dsctl slapd-CC-RSA-TPS-AUTH-DB stop
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Use the
certutil
tool to generate the CSR:certutil -R -d /etc/dirsrv/slapd-CC-RSA-TPS-AUTH-DB -s "CN=rhds11.example.com" -g 2048 -f /etc/dirsrv/slapd-CC-RSA-TPS-AUTH-DB/pwdfile.txt -a -o /etc/dirsrv/slapd-CC-RSA-TPS-AUTH-DB/Server-Cert-tps-auth.csr -z /etc/dirsrv/slapd-CC-RSA-TPS-AUTH-DB/noise.txt
# certutil -R -d /etc/dirsrv/slapd-CC-RSA-TPS-AUTH-DB -s "CN=rhds11.example.com" -g 2048 -f /etc/dirsrv/slapd-CC-RSA-TPS-AUTH-DB/pwdfile.txt -a -o /etc/dirsrv/slapd-CC-RSA-TPS-AUTH-DB/Server-Cert-tps-auth.csr -z /etc/dirsrv/slapd-CC-RSA-TPS-AUTH-DB/noise.txt
Copy to Clipboard Copied! Toggle word wrap Toggle overflow ImportantEdit the
Server-Cert-tps-auth.csr
output file obtained above to remove the few lines before "Begin Certificate Request". For example:
vi /etc/dirsrv/slapd-CC-RSA-TPS-AUTH-DB/Server-Cert-tps-auth.csr
# vi /etc/dirsrv/slapd-CC-RSA-TPS-AUTH-DB/Server-Cert-tps-auth.csr
Copy to Clipboard Copied! Toggle word wrap Toggle overflow The CSR file must start with the line "-----BEGIN CERTIFICATE REQUEST-----" and end with the line "-----END CERTIFICATE REQUEST-----".
Remote copy the
Server-Cert-tps-auth.csr
file to the system where the CA resides. For example:scp /etc/dirsrv/slapd-CC-RSA-TPS-AUTH-DB/Server-Cert-tps-auth.csr root@rhcs10.example.com:/root/.dogtag/pki_rsa_bootstrap/certs_db/Server-Cert-tps-auth.csr
# scp /etc/dirsrv/slapd-CC-RSA-TPS-AUTH-DB/Server-Cert-tps-auth.csr root@rhcs10.example.com:/root/.dogtag/pki_rsa_bootstrap/certs_db/Server-Cert-tps-auth.csr
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Issue the real DS certificate
On rhcs10.example.com, issue the actual SSL server certificate:
Generate a CMC request:
Create a
CMCRequest
configuration file. For example:vim /root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.dirsrv-tps-auth_pkcs10.cfg
# vim /root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.dirsrv-tps-auth_pkcs10.cfg
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Copy to Clipboard Copied! Toggle word wrap Toggle overflow Generate the request using the
CMCRequest
command:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Submit the CMC request:
Create a
HttpClient
configuration file. For example:vim /root/.dogtag/pki_rsa_bootstrap/certs_db/HttpClient_dirsrv-tps-auth.cfg
# vim /root/.dogtag/pki_rsa_bootstrap/certs_db/HttpClient_dirsrv-tps-auth.cfg
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Copy to Clipboard Copied! Toggle word wrap Toggle overflow Submit the request using the
HttpClient
command:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Process the CMC Response:
Process the response using
CMCResponse
to display all certificates in chain individually in PEM format:ImportantRunning CMCResponse with the "-v" option returns the PEM of each certificate in the chain as Cert:0, Cert:1 etc. Below all the PEMs, the output also displays each certificate in the chain in pretty print format. Since the certificates are not displayed in a fixed order, in order to determine their position in the chain, you must examine the "Subject:" under each "Certificate". The corresponding PEM is displayed in the same position above.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Save the new
Server-Cert
DS certificate into a file in the bootstrap certificate directory (e.g./root/.dogtag/pki_rsa_bootstrap/certs_db/
) named accordingly. The.pem
file must start with the header-----BEGIN CERTIFICATE-----
and end with the footer-----END CERTIFICATE-----
. For example:vi /root/.dogtag/pki_rsa_bootstrap/certs_db/Server-Cert-tps-auth.pem
# vi /root/.dogtag/pki_rsa_bootstrap/certs_db/Server-Cert-tps-auth.pem
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Where
Server-Cert-tps-auth.pem
is the newServer-Cert
certificate of the Directory Server instance that serves as the authentication db of the TPS.NoteThe RootCA’s signing certificate should match with the output from the following command:
certutil -L -d /var/lib/pki/rhcs10-RSA-RootCA/alias/ -n "CA Signing Cert - rhcs10-RSA-RootCA" -a
# certutil -L -d /var/lib/pki/rhcs10-RSA-RootCA/alias/ -n "CA Signing Cert - rhcs10-RSA-RootCA" -a
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Remote copy the new
Server-Cert
certificate to rhds11.example.com. For example:scp /root/.dogtag/pki_rsa_bootstrap/certs_db/Server-Cert-tps-auth.pem root@rhds11.example.com:/etc/dirsrv/slapd-CC-RSA-TPS-AUTH-DB/
# scp /root/.dogtag/pki_rsa_bootstrap/certs_db/Server-Cert-tps-auth.pem root@rhds11.example.com:/etc/dirsrv/slapd-CC-RSA-TPS-AUTH-DB/
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Replace the temporary DS certificate
On rhds11.example.com, replace the temporary DS certificate with the actual DS certificate:
Save the contents of the
dirsrv
directory into a backup directory:cp -r /etc/dirsrv/slapd-CC-RSA-TPS-AUTH-DB/ /etc/dirsrv/save-rsa/slapd-CC-RSA-TPS-AUTH-DB/
# cp -r /etc/dirsrv/slapd-CC-RSA-TPS-AUTH-DB/ /etc/dirsrv/save-rsa/slapd-CC-RSA-TPS-AUTH-DB/
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Delete the old DS certificates:
certutil -D -d /etc/dirsrv/slapd-CC-RSA-TPS-AUTH-DB/ -f /etc/dirsrv/slapd-CC-RSA-TPS-AUTH-DB/pwdfile.txt -n "Server-Cert"
# certutil -D -d /etc/dirsrv/slapd-CC-RSA-TPS-AUTH-DB/ -f /etc/dirsrv/slapd-CC-RSA-TPS-AUTH-DB/pwdfile.txt -n "Server-Cert"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow certutil -D -d /etc/dirsrv/slapd-CC-RSA-TPS-AUTH-DB/ -f /etc/dirsrv/slapd-CC-RSA-TPS-AUTH-DB/pwdfile.txt -n "Self-Signed-CA"
# certutil -D -d /etc/dirsrv/slapd-CC-RSA-TPS-AUTH-DB/ -f /etc/dirsrv/slapd-CC-RSA-TPS-AUTH-DB/pwdfile.txt -n "Self-Signed-CA"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Import the newly created DS certificate and the CA certificates in its chain one by one. For example:
certutil -d /etc/dirsrv/slapd-CC-RSA-TPS-AUTH-DB/ -f /etc/dirsrv/slapd-CC-RSA-TPS-AUTH-DB/pwdfile.txt -A -t "CT,C,C" -n "CA Signing Cert - rhcs10-RSA-RootCA" -i /opt/pki_rsa/rootCA.pem
# certutil -d /etc/dirsrv/slapd-CC-RSA-TPS-AUTH-DB/ -f /etc/dirsrv/slapd-CC-RSA-TPS-AUTH-DB/pwdfile.txt -A -t "CT,C,C" -n "CA Signing Cert - rhcs10-RSA-RootCA" -i /opt/pki_rsa/rootCA.pem
Copy to Clipboard Copied! Toggle word wrap Toggle overflow certutil -d /etc/dirsrv/slapd-CC-RSA-TPS-AUTH-DB/ -f /etc/dirsrv/slapd-CC-RSA-TPS-AUTH-DB/pwdfile.txt -A -t "CT,C,C" -n "CA Signing Cert - rhcs10-RSA-SubCA" -i /opt/pki_rsa/subCA.pem
# certutil -d /etc/dirsrv/slapd-CC-RSA-TPS-AUTH-DB/ -f /etc/dirsrv/slapd-CC-RSA-TPS-AUTH-DB/pwdfile.txt -A -t "CT,C,C" -n "CA Signing Cert - rhcs10-RSA-SubCA" -i /opt/pki_rsa/subCA.pem
Copy to Clipboard Copied! Toggle word wrap Toggle overflow certutil -d /etc/dirsrv/slapd-CC-RSA-TPS-AUTH-DB/ -f /etc/dirsrv/slapd-CC-RSA-TPS-AUTH-DB/pwdfile.txt -A -t "u,u,u" -n "Server-Cert" -i /etc/dirsrv/slapd-CC-RSA-TPS-AUTH-DB/Server-Cert-tps-auth.pem
# certutil -d /etc/dirsrv/slapd-CC-RSA-TPS-AUTH-DB/ -f /etc/dirsrv/slapd-CC-RSA-TPS-AUTH-DB/pwdfile.txt -A -t "u,u,u" -n "Server-Cert" -i /etc/dirsrv/slapd-CC-RSA-TPS-AUTH-DB/Server-Cert-tps-auth.pem
Copy to Clipboard Copied! Toggle word wrap Toggle overflow List the certificates:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Start DS:
dsctl slapd-CC-RSA-TPS-AUTH-DB start
# dsctl slapd-CC-RSA-TPS-AUTH-DB start
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Test to confirm that the LDAP server is up and running (in case of a separate system, test on the CA host as well):
ldapsearch -x -D "cn=Directory Manager" -H ldaps://rhds11.example.com:9636 -b "dc=example,dc=com" -w SECret.123
# ldapsearch -x -D "cn=Directory Manager" -H ldaps://rhds11.example.com:9636 -b "dc=example,dc=com" -w SECret.123
Copy to Clipboard Copied! Toggle word wrap Toggle overflow If testing on a separate system, include the CA certificate chain in front of the
ldapsearch
command, for example:LDAPTLS_CACERT=/opt/pki_rsa/ca-chain.pem ldapsearch -x -D "cn=Directory Manager" -H ldaps://rhds11.example.com:9636 -b "dc=example,dc=com" -w SECret.123
# LDAPTLS_CACERT=/opt/pki_rsa/ca-chain.pem ldapsearch -x -D "cn=Directory Manager" -H ldaps://rhds11.example.com:9636 -b "dc=example,dc=com" -w SECret.123
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
7.11.3. Install the TPS instance Copiar o linkLink copiado para a área de transferência!
To install the TPS, use either the single-step method or the two-step method. The following procedure describes the single-step method. If you wish to install using the two-step method, please refer to ] as well as xref:_rootca_two_step[.
BEFORE you install the TPS, if you intend the AIA extension to point to the external OCSP instance instead of the CA’s internal OCSP, make sure you first follow the steps under Section 7.7.4, “Set the default AIA extension to point to this OCSP”.
Prerequisites
- You are logged in to rhcs10.example.com as root user.
- You have Section 7.1.2.7, “Installing a DS instance for the TPS”, in our example, CC-RSA-TPS-LDAP is the TPS’s internal database.
Procedure
Create a TPS installation file at a chosen location (e.g.
/root/pki_rsa
):cd /root/pki_rsa
# cd /root/pki_rsa
Copy to Clipboard Copied! Toggle word wrap Toggle overflow vi tps_inst.cfg
# vi tps_inst.cfg
Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteUnless explicitly specified, system certificate nicknames are automatically named bearing the value specified for
pki_instance_name
. To avoid certificate nickname conflicts on a shared HSM, use a unique instance name for each instance creation.
The values specified in the installation file below are examples. In addition to changing the HSM password, edit the values accordingly, for example ports, directories, nicknames, domains…
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Run the
pkispawn
tool to install the TPS subsystem:pkispawn -s TPS -f tps_inst.cfg --debug
# pkispawn -s TPS -f tps_inst.cfg --debug
Copy to Clipboard Copied! Toggle word wrap Toggle overflow This will create the TPS instance in
/var/lib/pki/rhcs10-RSA-TPS
.
For ease of reference, if you wanted to install the TPS using the two-step method:
First run the
pkispawn
tool with the--skip-configuration
option to install the RHCS TPS instance:pkispawn -s TPS -f tps_inst.cfg --skip-configuration --debug
# pkispawn -s TPS -f tps_inst.cfg --skip-configuration --debug
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Customize the configuration files between the two installation steps
Run the
pkispawn
tool to configure the TPS:pkispawn -s TPS -f tps_inst.cfg --skip-installation --debug
# pkispawn -s TPS -f tps_inst.cfg --skip-installation --debug
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
Show the status of the installed TPS instance:
pki-server status rhcs10-RSA-TPS
# pki-server status rhcs10-RSA-TPS
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Note down the Secure Agent, Admin and pkiconsole URLs.
- Verify that the TPS agent web page is accessible.
Import the TPS bootstrap administrator certificate into the nssdb:
pki -d /root/.dogtag/pki_rsa_bootstrap/certs_db client-cert-import --pkcs12 /opt/pki_rsa/rhcs10-RSA-TPS/tps_admin_cert.p12 --pkcs12-password SECret.123
# pki -d /root/.dogtag/pki_rsa_bootstrap/certs_db client-cert-import --pkcs12 /opt/pki_rsa/rhcs10-RSA-TPS/tps_admin_cert.p12 --pkcs12-password SECret.123 ---------------------------------------- Imported certificates from PKCS #12 file ----------------------------------------
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
You can only perform the actual smartcard token enrollment tests after you complete the setup procedures detailed in the next subsections.
7.11.4. Testing token-side key generation Copiar o linkLink copiado para a área de transferência!
This section presents a simple demonstration of a token key enrollment using token-side key generation (as opposed to server-side key generation). In order to test token-side key generation, we are going to create a new test user, then format and enroll a token for this user via the tpsclient
tool.
Prepare for testing token-side key generation
Temporarily update the
userKey
profile to only generate signing certificates:Stop the TPS:
pki-server stop rhcs10-RSA-TPS
# pki-server stop rhcs10-RSA-TPS
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Edit the
/var/lib/pki/rhcs10-RSA-TPS/tps/conf/CS.cfg
configuration file and change theop.enroll.userKey.keyGen.keyType.num
parameter from 2 to 1. E.g:op.enroll.userKey.keyGen.keyType.num=1
op.enroll.userKey.keyGen.keyType.num=1
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Start the TPS:
pki-server start rhcs10-RSA-TPS
# pki-server start rhcs10-RSA-TPS
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Create a new user for testing token enrollment, e.g. jdoe:
First check if the TPS WebUI is up:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create a .cfg file for a POSIX user as follows:
vi ldap_user1_add.cfg
# vi ldap_user1_add.cfg
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Add the following content to the file and save:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Configure anonymous bind access:
Create an ldif file containing the following:
dn: ou=People,dc=example,dc=com changetype: modify add: aci aci: (targetattr!="userPassword || aci")(version 3.0; acl "Enable anonymous access"; allow (read, search, compare) userdn="ldap:///anyon e";)
dn: ou=People,dc=example,dc=com changetype: modify add: aci aci: (targetattr!="userPassword || aci")(version 3.0; acl "Enable anonymous access"; allow (read, search, compare) userdn="ldap:///anyon e";)
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Run the following to enable anonymous bind access:
ldapadd -h rhds11-5.example.com -p 389 -c -D "cn=Directory Manager" -w SECret.123 -f ldapci.ldif
ldapadd -h rhds11-5.example.com -p 389 -c -D "cn=Directory Manager" -w SECret.123 -f ldapci.ldif
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Run the
ldapadd
command with the previously created.cfg
file to add the jdoe user:LDAPTLS_CACERT=/opt/pki_rsa/ca-chain.pem ldapadd -x -D 'cn=directory manager' -H ldaps://rhds11.example.com:9636 -w SECret.123 -f ldap_user1_add.cfg
# LDAPTLS_CACERT=/opt/pki_rsa/ca-chain.pem ldapadd -x -D 'cn=directory manager' -H ldaps://rhds11.example.com:9636 -w SECret.123 -f ldap_user1_add.cfg
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Test token-side key generation
Test token-side key generation using the tpsclient
tool to format and enroll a token.
On a separate non-FIPS-enabled system, install the
tpsclient
package. For example:dnf install -y redhat-pki-tps
# dnf install -y redhat-pki-tps
Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteIf you are testing on a Fedora system, the corresponding package providing the
tpsclient
tool would bedogtag-pki-tools
.Add the TPS server hostname and IP address to the
/etc/hosts
file:echo "<TPS server IP> rhcs10.example.com" >> /etc/hosts
# echo "<TPS server IP> rhcs10.example.com" >> /etc/hosts
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Test the format and enrollment for the newly created user:
Prepare to format a token for jdoe. Create a
.txt
file:vi token_format.txt
# vi token_format.txt
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Add the following content. The host and port values should match your own; the port should be a non-SSL port.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Prepare to enroll a token for jdoe. Create a
.txt
file:vi token_enroll.txt
# vi token_enroll.txt
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Add the following content. The host and port values should match your own; the port should be a non-SSL port.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Format jdoe’s token. The operation should succeed.:
tpsclient < token_format.txt
# tpsclient < token_format.txt
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Enroll jdoe’s token. The operation should succeed:
tpsclient < token_enroll.txt
# tpsclient < token_enroll.txt
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Revert the changes after testing
To delete the added test token after verification:
-
Log in to the TPS WebUI at
https://rhcs10.example.com:25443/tps/ui/
- Click Tokens and select the token in check box.
- Click Remove, then confirm.
-
Log in to the TPS WebUI at
Alternatively, you can use CLI commands to delete the test token. For example:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow pki -d /root/.dogtag/pki_rsa_bootstrap/certs_db/ -n "PKI Bootstrap Administrator for RSA-TPS" -c SECret.123 -p 25443 tps-token-del 40906145C76224192D2B
# pki -d /root/.dogtag/pki_rsa_bootstrap/certs_db/ -n "PKI Bootstrap Administrator for RSA-TPS" -c SECret.123 -p 25443 tps-token-del 40906145C76224192D2B ------------------------------------ Deleted token "40906145C76224192D2B" ------------------------------------
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Revert
op.enroll.userKey.keyGen.keyType.num
back to 2:Stop the TPS:
pki-server stop rhcs10-RSA-TPS
# pki-server stop rhcs10-RSA-TPS
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Edit the
/var/lib/pki/rhcs10-RSA-TPS/tps/conf/CS.cfg
configuration file and change back theop.enroll.userKey.keyGen.keyType.num
parameter from 1 to 2. E.g.:op.enroll.userKey.keyGen.keyType.num=2
op.enroll.userKey.keyGen.keyType.num=2
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Start the TPS:
pki-server start rhcs10-RSA-TPS
# pki-server start rhcs10-RSA-TPS
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
7.11.5. Configure OAEP support for the TPS Copiar o linkLink copiado para a área de transferência!
Configuring the TPS to use the OAEP (Optimal Asymmetric Encryption Padding) key transport algorithm is done by editing the TPS’s CS.cfg
configuration file.
This section is for a HSM that supports AES key wrapping/unwrapping, such as an Entrust nShield Connect XC unit with firmware v12.72.1.
Prerequisite
- You are logged onto rhcs10.example.com as root user.
Procedure
Stop the TPS:
pki-server stop rhcs10-RSA-TPS
# pki-server stop rhcs10-RSA-TPS
Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Edit the
/var/lib/pki/rhcs10-RSA-TPS/tps/conf/CS.cfg
configuration file and add the following line:
keyWrap.useOAEP=true
Start the TPS:
pki-server start rhcs10-RSA-TPS
# pki-server start rhcs10-RSA-TPS
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
7.11.6. Configuring AES support for TMS Server-Side-Keygen Copiar o linkLink copiado para a área de transferência!
This version of Red Hat Certificate System, specifically the Token Management System and the JAVA applet, is enhanced to support the latest HSM to work with the Global Platform Secure Channel Protocol 3 (SCP03) smart card tokens. This is done thanks to the addition of the AES Key Wrap With Padding (KWP) mode to handle key injection, which is predominantly used in the TMS Server-Side-Keygen feature.
You can find the new JAVA applet at: /usr/share/pki/tps/applets/1.5.64260792.ijc
TPS CS.cfg
To use this applet, you must configure the TPS CS.cfg
configuration file, as follows:
For enrollment:
op.enroll.<tps profile>.update.applet.requiredVersion.prot.3=1.5.64260792
op.enroll.<tps profile>.update.applet.requiredVersion.prot.3=1.5.64260792op.enroll.<tps profile>.update.applet.requiredVersion.prot.3=1.5.64260792op.enroll.<tps profile>.update.applet.requiredVersion.prot.3=1.5.64260792
Copy to Clipboard Copied! Toggle word wrap Toggle overflow For format:
op.format.<tps profile>.update.applet.requiredVersion.prot.3=1.5.64260792
op.format.<tps profile>.update.applet.requiredVersion.prot.3=1.5.64260792op.format.<tps profile>.update.applet.requiredVersion.prot.3=1.5.64260792op.format.<tps profile>.update.applet.requiredVersion.prot.3=1.5.64260792
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Note that you must then configure any other profiles (including external registration) to use this applet.
For example:
TPS server.xml
The KWP implementation takes a bit longer to unwrap the private keys(s) onto the token than previously. It is therefore necessary to increase the connection timeout value in the server.xml
file. For example, set the following connectionTimeout
value for the Secure Connector in /var/lib/pki/rhcs10-RSA-TPS/conf/server.xml
:
connectionTimeout="300000”
connectionTimeout="300000”
The recommendation for the value to try would depend on the size of the private key being injected. A good starting point would be twice that value to make sure a wide variety of key sizes will be supported.
In case a successful enrollment is more important than the wait time, you can bypass the timeout by assigning “-1”
to connectionTimeout
:
connectionTimeout="-1”
connectionTimeout="-1”
TKS CS.cfg
tks.defKeySet.prot3.devKeyType=AES tks.defKeySet.prot3.divers=gpkmc tks.defKeySet.prot3.diversVer1Keys=none tks.defKeySet.prot3.masterKeyType=AES
tks.defKeySet.prot3.devKeyType=AES
tks.defKeySet.prot3.divers=gpkmc
tks.defKeySet.prot3.diversVer1Keys=none
tks.defKeySet.prot3.masterKeyType=AES
7.11.7. Setting key sizes Copiar o linkLink copiado para a área de transferência!
It is important to set all keysizes to be greater or equal to 2048. E.g:
op.enroll.userKey.keyGen.encryption.keySize=2048 op.enroll.userKey.keyGen.signing.keySize=2048
op.enroll.userKey.keyGen.encryption.keySize=2048
op.enroll.userKey.keyGen.signing.keySize=2048
7.11.8. Setup TPS phoneHome Copiar o linkLink copiado para a área de transferência!
Edit the
phoneHome.xml
configuration file. For example:vi /var/lib/pki/rhcs10-RSA-TPS/tps/conf/phoneHome.xml
# vi /var/lib/pki/rhcs10-RSA-TPS/tps/conf/phoneHome.xml
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Set the correct http port for the TPS. For example:
<Operation>http://rhcs10.example.com:25080/tps/tps</Operation>
<Operation>http://rhcs10.example.com:25080/tps/tps</Operation>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow It will now look like the following:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Save and restart the TPS.
7.11.9. Create TPS Role users Copiar o linkLink copiado para a área de transferência!
- Create single-role admin, agent, audit users in the TPS by following the steps in Section 7.12, “Create PKI role users”.
7.11.10. Post-installation Copiar o linkLink copiado para a área de transferência!
If you wish to install additional RHCS instances, please continue with the next relevant section. Once you have completed the installation of all of the RHCS instances you need, please go to Section 7.13, “Post-installation” to complete additional setup.
7.12. Create PKI role users Copiar o linkLink copiado para a área de transferência!
This section describes the user configuration that takes place after the subsystems installation.
Some of the examples in the previous chapters assume that some of the example non-OS-root pki role users (e.g. PKI agent jsmith) are already created and ready to perform their duty with their pki role privileges. Those example users are therefore proposed to be used for operations such as processing certificate requests.
However, the PKI bootstrap admin certificate, having been granted the privileges of all PKI roles, could be used for evaluation/testing purposes. In which case, one could simply use the bootstrap user’s certificate database directory to generate CSRs (and import certificates when issued) as root for the single-role user certificates.
For real world operations, it is highly advisable to follow the instructions in the present chapter to create roles with restricted privileges for day to day operations, once you have completed the installation. Once the real role users are created and tested to function correctly, You can then remove/disable the bootstrap certificate as described in Section 7.12.6, “Removing the bootstrap admin users from the authentication databases (optional)”.
The setup process only creates some role user accounts for demonstration purposes (specifically, setup for the SubCA role users). To manage a PKI environment in real life, a larger number of administrators, agents, and auditors are often created after the instance is set up.
Create Admin, Agent, and Audit users as appropriate for testing relevant RHCS subsystems, including CA, OCSP, and KRA. And if TMS is of interest, create Admin and Audit users for TKS and TPS, and Operator users for TPS.
The following procedures only demonstrates how to set up PKI role users (users jgenie, jsmith, and aguru created in Section 7.1.1, “Creating OS users and groups” for the subordinate CA. In these examples, the certificate requests (CSRs) are approved by using the SubCA’s bootstrap admin certificate.
7.12.1. Prerequisites Copiar o linkLink copiado para a área de transferência!
Prior to performing the recommended procedure to issue any certificate, make sure your SubCA bootstrap admin certificate/key is ready to perform the tasks.
- Login to rhcs10.example.com as root user.
Check the existence of an admin/agent certificate (in this case, the SubCA’s bootstrap admin certificate) in the nssdb (this was set up in Section 7.8.1, “Issue a non-bootstrap agent user certificate”:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
7.12.2. Admin users Copiar o linkLink copiado para a área de transferência!
- adminV (this user will have a valid certificate throughout testing)
- adminR (this user will have a revoked certificate)
- adminE (this user will have an expired certificate)
- adminTCA (this user’s certificate will be signed by a trusted CA)
- adminC (initially this user will be assigned to the administrator group; during the testing process this user will be assigned to a different group)
adminUTCA (this user’s certificate will be issued by an untrusted CA)
NoteThis last one requires a second CA setup!
7.12.2.1. Setting up certificate and role for a pki administrator Copiar o linkLink copiado para a área de transferência!
The following example procedure will create a CMC signed user certificate, rsa_SubCA_AdminV, for the OS user jgenie. This CMC request will be signed using the SubCA bootstrap administrator certificate in the next section.
7.12.2.1.1. Generating a CSR for a pki administrator Copiar o linkLink copiado para a área de transferência!
This procedure, to be performed by the would-be pki administrator (e.g. Jane Genie, jgenie), aims to create a CSR for this admin user.
- Login to rhcs10.example.com as an 'Administrator' (a non-root user), in this example jgenie.
Create a client nssdb in case it does not already exist:
pki -d /home/jgenie/certs_db -c SECret.123 client-init
$ pki -d /home/jgenie/certs_db -c SECret.123 client-init
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Use the
PKCS10Client
tool to generate a PKCS #10 certificate request:NoteChange the subjectDN and the .req file name as appropriate for each subsystem, example: OCSP_AdminV, KRA_AdminV etc.
PKCS10Client -d /home/jgenie/certs_db -p SECret.123 -n "cn=rsa_SubCA_AdminV, uid=rsa_SubCA_AdminV" -o /home/jgenie/certs_db/rsa_SubCA_AdminV.req
$ PKCS10Client -d /home/jgenie/certs_db -p SECret.123 -n "cn=rsa_SubCA_AdminV, uid=rsa_SubCA_AdminV" -o /home/jgenie/certs_db/rsa_SubCA_AdminV.req PKCS10Client: Certificate request written into /home/jgenie/certs_db/rsa_SubCA_AdminV.req PKCS10Client: PKCS#10 request key id written into /home/jgenie/certs_db/rsa_SubCA_AdminV.req.keyId
Copy to Clipboard Copied! Toggle word wrap Toggle overflow The jgenie user should send the certificate request (CSR)
/home/jgenie/certs_db/rsa_SubCA_AdminV.req
to the user who holds the SubCA’s bootstrap admin certificate, e.g. the root user, to CMC sign and approve the request.
7.12.2.1.2. Approving the CSR for a pki administrator user Copiar o linkLink copiado para a área de transferência!
This section describes the procedure to be performed by the user who holds the SubCA’s bootstrap admin certificate, e.g. the root user. It demonstrates how to process the CSR (e.g. created in the previous section by jgenie) to issue the pki admin certificate.
Prerequisites
- You are logged-in to the RHCS machine as root user.
- An admin/agent certificate (in this example the SubCA bootstrap certificate) is present in the nssdb.
Issuing the certificate via CMC
The user holding the bootstrap admin certificate/keys can now process the CSR sent from jgenie as follows:
-
Place the CSR file (rsa_SubCA_AdminV.req) received from jgenie to the
/root/.dogtag/pki_rsa_bootstrap/certs_db
directory. Generate a CMC request:
Create a
CMCRequest
configuration file. For example:vi /root/.dogtag/pki_rsa_bootstrap/certs_db/cmcRequest_p10_rsa_SubCA_AdminV.cfg
# vi /root/.dogtag/pki_rsa_bootstrap/certs_db/cmcRequest_p10_rsa_SubCA_AdminV.cfg
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Copy to Clipboard Copied! Toggle word wrap Toggle overflow NOTEFor
request.privKeyId= <private key id>
: the private key id to use here is the one generated from the previous step. See the output message :PKCS10Client: PKCS#10 request key id written into /home/jgenie/certs_db/rsa_SubCA_AdminV.req.keyId
PKCS10Client: PKCS#10 request key id written into /home/jgenie/certs_db/rsa_SubCA_AdminV.req.keyId
Copy to Clipboard Copied! Toggle word wrap Toggle overflow A quick way to do this would be something like: key_id=
cat /home/jgenie/certs_db/rsa_SubCA_AdminV.req.keyId
;sed -i 's/request.privKeyId= <private key id>/request.privKeyId='$key_id'/g' /root/.dogtag/pki_rsa_bootstrap/certs_db/cmcRequest_p10_rsa_SubCA_AdminV.cfgGenerate the request using the
CMCRequest
command:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Submit the CMC request:
Create a
HttpClient
configuration file. For example:vi /root/.dogtag/pki_rsa_bootstrap/certs_db/HttpClient_cmc_p10_rsa_SubCA_AdminV_signed.cfg
# vi /root/.dogtag/pki_rsa_bootstrap/certs_db/HttpClient_cmc_p10_rsa_SubCA_AdminV_signed.cfg
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Copy to Clipboard Copied! Toggle word wrap Toggle overflow Submit the request using the
HttpClient
command:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Process the response using
CMCResponse
to display all certificates in chain individually in PEM format:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Copy the agent certificate to
/root/.dogtag/pki_rsa_bootstrap/certs_db/rsa_SubCA_AdminV_b64.crt
:pki -p 31443 ca-cert-export <rsa_SubCA_AdminV_serial_number> --output-file /root/.dogtag/pki_rsa_bootstrap/certs_db/rsa_SubCA_AdminV_b64.crt
# pki -p 31443 ca-cert-export <rsa_SubCA_AdminV_serial_number> --output-file /root/.dogtag/pki_rsa_bootstrap/certs_db/rsa_SubCA_AdminV_b64.crt
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
7.12.2.1.3. Creating the pki admin user and associating the new certificate Copiar o linkLink copiado para a área de transferência!
This procedure is to be performed by an existing pki admin user, in this case, the root user that holds the SubCA bootstrap certificate.
To create a pki administrator user and associate the new certificate with this user:
Create a user, in this example rsa_SubCA_AdminV:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Similarly:
-
For the KRA, use the
kra-user-add
command with the KRA’s admin nick, hostname and port to create the new user, e.g. KRA_AdminV. -
For the OCSP, use the
ocsp-user-add
command with the OCSP’s admin nick, hostname and port to create the new user, e.g. OCSP_AdminV.
And if TMS is of interest:
-
For the TKS, use the
tks-user-add
command with the TKS’s admin nick, hostname and port to create the new user, e.g. TKS_AdminV. -
For the TPS, use the
tps-user-add
command with the TPS’s admin nick, hostname and port to create the new user, e.g. TPS_AdminV.
-
For the KRA, use the
Add the new user to the Administrators group:
pki -d /root/.dogtag/pki_rsa_bootstrap/certs_db -n "PKI Bootstrap Administrator for RSA-SubCA" -c SECret.123 -h "rhcs10.example.com" -p 31443 ca-group-member-add Administrators rsa_SubCA_AdminV
# pki -d /root/.dogtag/pki_rsa_bootstrap/certs_db -n "PKI Bootstrap Administrator for RSA-SubCA" -c SECret.123 -h "rhcs10.example.com" -p 31443 ca-group-member-add Administrators rsa_SubCA_AdminV ----------------------------- Added group member "rsa_SubCA_AdminV" ----------------------------- User: rsa_SubCA_AdminV
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Similarly:
-
To add newly created users (e.g. KRA_AdminV) to the KRA’s administrators group, use the
kra-group-member-add
command with the KRA’s admin nick, hostname, and port. -
To add newly created users (e.g. OCSP_AdminV) to the OCSP’s administrators group, use the
ocsp-group-member-add
command with the OCSP’s admin nick, hostname, and port.
And if TMS is of interest:
-
To add newly created users (e.g. TKS_AdminV) to the TKS’s administrators group, use the
tks-group-member-add
command with the TKs’s admin nick, hostname, and port. -
To add newly created users (e.g. TPS_AdminV) to the TPS’s administrators group, use the
tps-group-member-add
command with the TPS’s admin nick, hostname, and port.
-
To add newly created users (e.g. KRA_AdminV) to the KRA’s administrators group, use the
Verify that the user got added to the Administrators group:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Similarly:
-
To verify membership in the KRA’s administrators group, use the
kra-group-member-find
command with the KRA’s hostname and port. -
To verify membership in the OCSP’s administrators group, use the
ocsp-group-member-find
command with the OCSP’s hostname and port.
And if TMS is of interest:
-
To verify membership in the TKS’s administrators group, use the
tks-group-member-find
command with the TKS’s hostname and port. -
To verify membership in the TPS’s administrators group, use the
tps-group-member-find
command with the TPS’s hostname and port.
-
To verify membership in the KRA’s administrators group, use the
Add the rsa_SubCA_AdminV certificate to the pki role user:
pki -d /root/.dogtag/pki_rsa_bootstrap/certs_db -n "PKI Bootstrap Administrator for RSA-SubCA" -c SECret.123 -h "rhcs10.example.com" -p 31443 ca-user-cert-add rsa_SubCA_AdminV --input /root/.dogtag/pki_rsa_bootstrap/certs_db/rsa_SubCA_AdminV_b64.crt
# pki -d /root/.dogtag/pki_rsa_bootstrap/certs_db -n "PKI Bootstrap Administrator for RSA-SubCA" -c SECret.123 -h "rhcs10.example.com" -p 31443 ca-user-cert-add rsa_SubCA_AdminV --input /root/.dogtag/pki_rsa_bootstrap/certs_db/rsa_SubCA_AdminV_b64.crt ------------------------------------------------------------------------------------------------------------------------------------- Added certificate "2;258264617;CN=CA Signing Certificate,OU=rhcs10-RSA-RootCA,O=Example-rhcs10-RSA-RootCA;CN=rsa_SubCA_AdminV,UID=rsa_SubCA_AdminV"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Similarly:
-
To add certificates to users in the KRA and the OCSP, use respectively the
kra-user-cert-add
and theocsp-user-cert-add
commands with the corresponding subsystem’s hostname and port.
And if TMS is of interest:
-
To add certificates to users in the TKS and the TPS, use respectively the
tks-user-cert-add
and thetps-user-cert-add
commands with the corresponding subsystem’s hostname and port.
-
To add certificates to users in the KRA and the OCSP, use respectively the
-
Send the certificate file,
/root/.dogtag/pki_rsa_bootstrap/certs_db/rsa_SubCA_AdminV_pkcs7.crt
, to the user (e.g. jgenie). The file can then be copied to the user location/home/jgenie/certs_db/rsa_SubCA_AdminV_pkcs7.crt
to import in a later step.
7.12.2.1.4. Importing the pki admin certificate to the client nssdb Copiar o linkLink copiado para a área de transferência!
This procedure is to be performed by the new pki admin user (e.g. jgenie) who has previously received the newly issued certificate file (e.g. /home/jgenie/certs_db/rsa_SubCA_AdminV_pkcs7.crt
) from the bootstrap user, in this case, the root user.
- Login to rhcs10.example.com as the pki administrator whose certificate was issued in the previous section, e.g. jgenie.
Install the certificate, e.g. rsa_SubCA_AdminV:
pki -d /home/jgenie/certs_db -c SECret.123 pkcs7-import "rsa_SubCA_AdminV" --pkcs7 /home/jgenie/certs_db/rsa_SubCA_AdminV_pkcs7.crt
$ pki -d /home/jgenie/certs_db -c SECret.123 pkcs7-import "rsa_SubCA_AdminV" --pkcs7 /home/jgenie/certs_db/rsa_SubCA_AdminV_pkcs7.crt
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Copy to Clipboard Copied! Toggle word wrap Toggle overflow Back up the role user rsa_SubCA_AdminV certificate by creating a .p12 file, here for example with the password SECret.123:
pki -d /home/jgenie/certs_db -c SECret.123 client-cert-show "rsa_SubCA_AdminV" --pkcs12 /home/jgenie/certs_db/rsa_SubCA_AdminV.p12 --pkcs12-password SECret.123
$ pki -d /home/jgenie/certs_db -c SECret.123 client-cert-show "rsa_SubCA_AdminV" --pkcs12 /home/jgenie/certs_db/rsa_SubCA_AdminV.p12 --pkcs12-password SECret.123
Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteYou can use the .p12 file later for admin tests, for example: by importing the file to
~/.redhat-idm-console
for console client authentication.
Verification:
To test the admin operation:
pki -v -d /home/jgenie/certs_db -c SECret.123 -n "rsa_SubCA_AdminV" -p 31443 ca-user-find
$ pki -v -d /home/jgenie/certs_db -c SECret.123 -n "rsa_SubCA_AdminV" -p 31443 ca-user-find
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
7.12.3. Agent users Copiar o linkLink copiado para a área de transferência!
- agentV (this user will have a valid certificate throughout testing)
- agentR (this user will have a revoked certificate)
- agentE (this user will have an expired certificate)
- agentTCA (this user’s certificate will be signed by a trusted CA)
agentUTCA (this user’s certificate will be issued by an untrusted CA)
NoteThis last one requires a second CA setup!
7.12.3.1. Setting up certificate and role for a pki agent Copiar o linkLink copiado para a área de transferência!
The following example procedure will create a CMC signed user certificate, rsa_SubCA_AgentV, for the user agent jsmith. This CMC request will be signed using the SubCA bootstrap administrator certificate in the next section.
7.12.3.1.1. Generating a CSR for a pki agent Copiar o linkLink copiado para a área de transferência!
This section, to be performed by a pki agent (e.g. jsmith), aims to create a CSR for this user.
Login to rhcs10.example.com as an 'Agent' (a non-root user, e.g. John Smith, jsmith).
Create a client nssdb if it does not already exist:
pki -d /home/jsmith/certs_db -c SECret.123 client-init
$ pki -d /home/jsmith/certs_db -c SECret.123 client-init
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Use the
PKCS10Client
tool to generate a PKCS#10 certificate request:NoteChange the subjectDN and the .req file name as appropriate for each subsystem, example: OCSP_AgentV, KRA_AgentV etc.
PKCS10Client -d /home/jsmith/certs_db -p SECret.123 -n "cn=rsa_SubCA_AgentV, uid=rsa_SubCA_AgentV" -o /home/jsmith/certs_db/rsa_SubCA_AgentV.req
$ PKCS10Client -d /home/jsmith/certs_db -p SECret.123 -n "cn=rsa_SubCA_AgentV, uid=rsa_SubCA_AgentV" -o /home/jsmith/certs_db/rsa_SubCA_AgentV.req PKCS10Client: Certificate request written into /home/jsmith/certs_db/rsa_SubCA_AgentV.req PKCS10Client: PKCS#10 request key id written into /home/jsmith/certs_db/rsa_SubCA_AgentV.req.keyId
Copy to Clipboard Copied! Toggle word wrap Toggle overflow The jsmith user should send the certificate request (CSR)
/home/jsmith/certs_db/rsa_SubCA_AgentV.req
to the user who holds the SubCA’s bootstrap admin certificate, e.g. the root user, to CMC sign and approve the request.
7.12.3.1.2. Approving the CSR for a pki agent user Copiar o linkLink copiado para a área de transferência!
This section describes the procedure to be performed by the user who holds the SubCA’s bootstrap admin certificate, e.g. the root user. It demonstrates how to process the CSR (created by jsmith in the previous section) to issue the pki agent certificate.
Prerequisites
- You are logged-in to the RHCS machine as root user.
- An admin/agent certificate (in this example the SubCA bootstrap certificate) is present in the nssdb.
Issuing the certificate via CMC
The user holding the bootstrap admin certificate/keys can now process the CSR sent from jsmith as follows:
-
Place the CSR file (rsa_SubCA_AgentV.req) received from jsmith to the
/root/.dogtag/pki_rsa_bootstrap/certs_db
directory. Generate a CMC request:
Create a
CMCRequest
configuration file. For example:vi /root/.dogtag/pki_rsa_bootstrap/certs_db/cmcRequest_p10_rsa_SubCA_AgentV.cfg
# vi /root/.dogtag/pki_rsa_bootstrap/certs_db/cmcRequest_p10_rsa_SubCA_AgentV.cfg
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Copy to Clipboard Copied! Toggle word wrap Toggle overflow Generate the request using the
CMCRequest
command:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Submit the CMC request:
Create a
HttpClient
configuration file. For example:vi /root/.dogtag/pki_rsa_bootstrap/certs_db/HttpClient_cmc_p10_rsa_SubCA_AgentV_signed.cfg
# vi /root/.dogtag/pki_rsa_bootstrap/certs_db/HttpClient_cmc_p10_rsa_SubCA_AgentV_signed.cfg
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Copy to Clipboard Copied! Toggle word wrap Toggle overflow Submit the request using the
HttpClient
command:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Process the response using
CMCResponse
:ImportantRunning CMCResponse with the "-v" option returns the PEM of each certificate in the chain as Cert:0, Cert:1 etc. Below all the PEMs, the output also displays each certificate in the chain in pretty print format. Since the certificates are not displayed in a fixed order, in order to determine their position in the chain, you must examine the "Subject:" under each "Certificate". The corresponding PEM is displayed in the same position above.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Copy the agent certificate to
/root/.dogtag/pki_rsa_bootstrap/certs_db/rsa_SubCA_AgentV_b64.crt
.pki -p 31443 ca-cert-export <rsa_SubCA_AgentV_serial_number> --output-file /root/.dogtag/pki_rsa_bootstrap/certs_db/rsa_SubCA_AgentV_b64.crt
# pki -p 31443 ca-cert-export <rsa_SubCA_AgentV_serial_number> --output-file /root/.dogtag/pki_rsa_bootstrap/certs_db/rsa_SubCA_AgentV_b64.crt
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
7.12.3.1.3. Creating the pki agent user and associating the new certificate Copiar o linkLink copiado para a área de transferência!
Create the rsa_SubCA_AgentV user:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Similarly:
-
For the KRA, use the
kra-user-add
command with the KRA’s admin nick, hostname and port to create the new user, e.g. KRA_AgentV. -
For the OCSP, use the
ocsp-user-add
command with the OCSP’s admin nick, hostname and port to create the new user, e.g. OCSP_AgentV.
If TMS is of interest,
-
For the TKS, use the
tks-user-add
command with the TKS’s admin nick, hostname and port to create the new user, e.g. TKS_AgentV. -
For the TPS, use the
tps-user-add
command with the TPS’s admin nick, hostname and port to create the new user, e.g. TPS_AgentV.
-
For the KRA, use the
Add rsa_SubCA_AgentV to the Certificate Manager Agents group:
pki -d /root/.dogtag/pki_rsa_bootstrap/certs_db -n "PKI Bootstrap Administrator for RSA-SubCA" -c SECret.123 -h "rhcs10.example.com" -p 31443 ca-group-member-add "Certificate Manager Agents" rsa_SubCA_AgentV
# pki -d /root/.dogtag/pki_rsa_bootstrap/certs_db -n "PKI Bootstrap Administrator for RSA-SubCA" -c SECret.123 -h "rhcs10.example.com" -p 31443 ca-group-member-add "Certificate Manager Agents" rsa_SubCA_AgentV ----------------------------- Added group member "rsa_SubCA_AgentV" ----------------------------- User: rsa_SubCA_AgentV
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Similarly:
-
To add newly created users (e.g. KRA_AgentV) to the KRA’s agents group, use the
kra-group-member-add
command with the KRA’s admin nick, hostname, port and the group "Data Recovery Manager Agents". -
To add newly created users (e.g. OCSP_AgentV) to the OCSP’s agents group, use the
ocsp-group-member-add
command with the OCSP’s admin nick, hostname, port and the group "Online Certificate Status Manager Agents".
If TMS is of interest:
-
To add newly created users (e.g. TKS_AgentV) to the TKS’s agents group, use the
tks-group-member-add
command with the TKS’s admin nick, hostname, port and the group "Token Key Service Manager Agents". -
To add newly created users (e.g. TPS_AgentV) to the TPS’s agents group, use the
tps-group-member-add
command with the TPS’s admin nick, hostname, port and the group "TPS Agents".
-
To add newly created users (e.g. KRA_AgentV) to the KRA’s agents group, use the
Verify that the user rsa_SubCA_AgentV got added to the Certificate Manager Agents group.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Similarly:
-
To verify membership in the KRA’s agents group, use the
kra-group-member-find
command with the KRA’s hostname, port, and the group "Data Recovery Manager Agents". -
To verify membership in the OCSP’s agents group, use the
ocsp-group-member-find
command with the OCSP’s hostname, port, and the group "Online Certificate Status Manager Agents".
If TMS is of interest:
-
To verify membership in the TKS’s agents group, use the
tks-group-member-find
command with the KRA’s hostname and port, and the group "Token Key Service Manager Agents". -
To verify membership in the TPS’s agents group, use the
tps-group-member-find
command with the TPS’s hostname and port, and the group "TPS Agents".
-
To verify membership in the KRA’s agents group, use the
Add the rsa_SubCA_AgentV certificate to the pki role user:
pki -d /root/.dogtag/pki_rsa_bootstrap/certs_db -n "PKI Bootstrap Administrator for RSA-SubCA" -c SECret.123 -h "rhcs10.example.com" -p 31443 ca-user-cert-add rsa_SubCA_AgentV --input /root/.dogtag/pki_rsa_bootstrap/certs_db/rsa_SubCA_AgentV_b64.crt
# pki -d /root/.dogtag/pki_rsa_bootstrap/certs_db -n "PKI Bootstrap Administrator for RSA-SubCA" -c SECret.123 -h "rhcs10.example.com" -p 31443 ca-user-cert-add rsa_SubCA_AgentV --input /root/.dogtag/pki_rsa_bootstrap/certs_db/rsa_SubCA_AgentV_b64.crt ------------------------------------------------------------------------------------------------------------------------------------- Added certificate "2;236851028;CN=CA Signing Certificate,OU=rhcs10-RSA-SubCA,O=Example-rhcs10-RSA-RootCA;CN=rsa_SubCA_AgentV,UID=rsa_SubCA_AgentV"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Similarly:
-
To add certificates to users in the KRA and the OCSP, use respectively the
kra-user-cert-add
and theocsp-user-cert-add
commands with the corresponding subsystem’s hostname and port.
If TMS is of interest:
-
To add certificates to users in the TKS and the TPS, use respectively the
tks-user-cert-add
and thetps-user-cert-add
commands with the corresponding subsystem’s hostname and port.
-
To add certificates to users in the KRA and the OCSP, use respectively the
-
Send the certificate file,
/root/.dogtag/pki_rsa_bootstrap/certs_db/rsa_SubCA_AgentV_pkcs7.crt
, to the user (e.g. jsmith). The file can then be copied to the user location/home/jsmith/certs_db/rsa_SubCA_AgentV_pkcs7.crt
to import in a later step.
7.12.3.1.4. Importing the pki agent certificate to the client nssdb Copiar o linkLink copiado para a área de transferência!
This procedure is to be performed by the new pki agent user (e.g. jsmith) who has received the newly issued certificate file (e.g. /home/jsmith/certs_db/rsa_SubCA_AgentV_pkcs7.crt
) from the bootstrap user, in this case, the root user.
- Login to rhcs10.example.com as an 'Agent' (a non-root user, for example jsmith).
Install the rsa_SubCA_AgentV certificate:
pki -d /home/jsmith/certs_db -c SECret.123 pkcs7-import "rsa_SubCA_AgentV" --pkcs7 /home/jsmith/certs_db/rsa_SubCA_AgentV_pkcs7.crt
$ pki -d /home/jsmith/certs_db -c SECret.123 pkcs7-import "rsa_SubCA_AgentV" --pkcs7 /home/jsmith/certs_db/rsa_SubCA_AgentV_pkcs7.crt
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Copy to Clipboard Copied! Toggle word wrap Toggle overflow Backup the role user rsa_SubCA_AgentV certificate by creating a .p12 file, here for example with the password SECret.123:
pki -d /home/jsmith/certs_db -c SECret.123 client-cert-show "rsa_SubCA_AgentV" --pkcs12 /home/jsmith/certs_db/rsa_SubCA_AgentV.p12 --pkcs12-password SECret.123
$ pki -d /home/jsmith/certs_db -c SECret.123 client-cert-show "rsa_SubCA_AgentV" --pkcs12 /home/jsmith/certs_db/rsa_SubCA_AgentV.p12 --pkcs12-password SECret.123
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
7.12.3.1.5. Initializing Browser for TLS mutual authentication Copiar o linkLink copiado para a área de transferência!
Refer to section 2.4.1 "Browser Initialization" of the Administration Guide for importing the PKCS#12 file in order to initialize a Firefox browser for doing TLS mutual authentication.
7.12.4. Audit users Copiar o linkLink copiado para a área de transferência!
- auditV (this user will have a valid certificate throughout testing)
7.12.4.1. Setting up certificate and role for a pki auditor Copiar o linkLink copiado para a área de transferência!
The following example procedure will create a CMC signed user certificate, rsa_SubCA_AuditV, for the auditor user aguru. This CMC request will be signed using the SubCA bootstrap administrator certificate in the next section.
7.12.4.1.1. Generating a CSR for a pki auditor Copiar o linkLink copiado para a área de transferência!
This procedure, to be performed by a pki auditor, (e.g. Astrid Guru, aguru), aims to create a CSR for this user.
Login to rhcs10.example.com as an 'Auditor' (a non-root user, for example aguru).
Create a client nssdb if it does not already exist:
pki -d /home/aguru/certs_db -c SECret.123 client-init
$ pki -d /home/aguru/certs_db -c SECret.123 client-init
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Use the
PKCS10Client
tool to generate a PKCS#10 Certificate Request:NoteChange the subjectDN and the .req file name as appropriate for each subsystem, example: OCSP_AuditV, KRA_AuditV etc.
PKCS10Client -d /home/aguru/certs_db -p SECret.123 -n "cn=rsa_SubCA_AuditV, uid=rsa_SubCA_AuditV" -o /home/aguru/certs_db/rsa_SubCA_AuditV.req
$ PKCS10Client -d /home/aguru/certs_db -p SECret.123 -n "cn=rsa_SubCA_AuditV, uid=rsa_SubCA_AuditV" -o /home/aguru/certs_db/rsa_SubCA_AuditV.req PKCS10Client: Certificate request written into /home/aguru/certs_db/rsa_SubCA_AuditV.req PKCS10Client: PKCS#10 request key id written into /home/aguru/certs_db/rsa_SubCA_AuditV.req.keyId
Copy to Clipboard Copied! Toggle word wrap Toggle overflow The aguru user should send the certificate request (CSR)
/home/aguru/certs_db/rsa_SubCA_AuditV.req
to a pki agent user to CMC sign and approve the request. You could use the newly appointed example pki agent jsmith or the root user that holds the bootstrap certificate/keys; in this example we will just use the root user.
7.12.4.1.2. Approving the CSR for a pki audit user Copiar o linkLink copiado para a área de transferência!
This section describes the procedure to be performed by the user who holds the SubCA’s bootstrap admin certificate, e.g. the root user. It demonstrates how to process the CSR (created by aguru in the previous section) to issue the pki auditor certificate.
Prerequisites
- You are logged-in to the RHCS machine as root user.
- An admin/agent certificate (in this example the SubCA bootstrap certificate) is present in the nssdb.
Issuing the certificate via CMC
-
Place the CSR file (
rsa_SubCA_AuditV.req
) received from aguru to the/root/.dogtag/pki_rsa_bootstrap/certs_db
directory. Generate a CMC request:
Create a
CMCRequest
configuration file. For example:vi /root/.dogtag/pki_rsa_bootstrap/certs_db/cmcRequest_p10_rsa_SubCA_AuditV.cfg
# vi /root/.dogtag/pki_rsa_bootstrap/certs_db/cmcRequest_p10_rsa_SubCA_AuditV.cfg
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Copy to Clipboard Copied! Toggle word wrap Toggle overflow Generate the request using the
CMCRequest
command:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Submit the CMC request:
Create a
HttpClient
configuration file. For example:vi /root/.dogtag/pki_rsa_bootstrap/certs_db/HttpClient_cmc_p10_rsa_SubCA_AuditV_signed.cfg
# vi /root/.dogtag/pki_rsa_bootstrap/certs_db/HttpClient_cmc_p10_rsa_SubCA_AuditV_signed.cfg
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Copy to Clipboard Copied! Toggle word wrap Toggle overflow Submit the request using the
HttpClient
command:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Process the response using
CMCResponse
to display all certificates in chain individually in PEM format:ImportantRunning CMCResponse with the "-v" option returns the PEM of each certificate in the chain as Cert:0, Cert:1 etc. Below all the PEMs, the output also displays each certificate in the chain in pretty print format. Since the certificates are not displayed in a fixed order, in order to determine their position in the chain, you must examine the "Subject:" under each "Certificate". The corresponding PEM is displayed in the same position above.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Copy the auditor certificate to
/root/.dogtag/pki_rsa_bootstrap/certs_db/rsa_SubCA_AuditV_b64.crt
:pki -p 31443 ca-cert-export <rsa_SubCA_AuditV_serial_number> --output-file /root/.dogtag/pki_rsa_bootstrap/certs_db/rsa_SubCA_AuditV_b64.crt
# pki -p 31443 ca-cert-export <rsa_SubCA_AuditV_serial_number> --output-file /root/.dogtag/pki_rsa_bootstrap/certs_db/rsa_SubCA_AuditV_b64.crt
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
7.12.4.1.3. Creating the pki auditor user and associating the new certificate Copiar o linkLink copiado para a área de transferência!
This procedure is to be performed by an existing pki admin user, in this case, the root user that holds the SubCA bootstrap certificate.
Create the rsa_SubCA_AuditV user:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Similarly:
-
For the KRA, use the
kra-user-add
command with the KRA’s admin nick, hostname and port to create the new user, e.g. KRA_AuditV. -
For the OCSP, use the
ocsp-user-add
command with the OCSP’s admin nick, hostname and port to create the new user, e.g. OCSP_AuditV.
If TMS is of interest:
-
For the TKS, use the
tks-user-add
command with the TKS’s admin nick, hostname and port to create the new user, e.g. TKS_AuditV. -
For the TPS, use the
tps-user-add
command with the TPS’s admin nick, hostname and port to create the new user, e.g. TPS_AuditV.
-
For the KRA, use the
Add rsa_SubCA_AuditV to the Auditors group:
pki -d /root/.dogtag/pki_rsa_bootstrap/certs_db -n "PKI Bootstrap Administrator for RSA-SubCA" -c SECret.123 -h "rhcs10.example.com" -p 31443 ca-group-member-add "Auditors" rsa_SubCA_AuditV
# pki -d /root/.dogtag/pki_rsa_bootstrap/certs_db -n "PKI Bootstrap Administrator for RSA-SubCA" -c SECret.123 -h "rhcs10.example.com" -p 31443 ca-group-member-add "Auditors" rsa_SubCA_AuditV ----------------------------- Added group member "rsa_SubCA_AuditV" ----------------------------- User: rsa_SubCA_AuditV
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Similarly:
-
To add newly created users (e.g. KRA_AuditV) to the KRA’s auditors group, use the
kra-group-member-add
command with the KRA’s admin nick, hostname, and port. -
To add newly created users (e.g. OCSP_AuditV) to the OCSP’s auditors group, use the
ocsp-group-member-add
command with the OCSP’s admin nick, hostname, and port.
If TMS is of interest:
-
To add newly created users (e.g. TKS_AuditV) to the TKS’s auditors group, use the
tks-group-member-add
command with the TKS’s admin nick, hostname, and port. -
To add newly created users (e.g. TPS_AuditV) to the TPS’s auditors group, use the
tps-group-member-add
command with the TPS’s admin nick, hostname, and port.
-
To add newly created users (e.g. KRA_AuditV) to the KRA’s auditors group, use the
Verify that the user rsa_SubCA_AuditV got added to the Auditors group.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Similarly:
-
To verify membership in the KRA’s auditors group, use the
kra-group-member-find
command with the KRA’s hostname and port. -
To verify membership in the OCSP’s auditors group, use the
ocsp-group-member-find
command with the OCSP’s hostname and port.
If TMS is of interest:
-
To verify membership in the TKS’s auditors group, use the
tks-group-member-find
command with the TKS’s hostname and port. -
To verify membership in the TPS’s auditors group, use the
tps-group-member-find
command with the TPS’s hostname and port.
-
To verify membership in the KRA’s auditors group, use the
Add the rsa_SubCA_AuditV certificate to the pki role user:
pki -d /root/.dogtag/pki_rsa_bootstrap/certs_db -n "PKI Bootstrap Administrator for RSA-SubCA" -c SECret.123 -h "rhcs10.example.com" -p 31443 ca-user-cert-add rsa_SubCA_AuditV --input /root/.dogtag/pki_rsa_bootstrap/certs_db/rsa_SubCA_AuditV_b64.crt
# pki -d /root/.dogtag/pki_rsa_bootstrap/certs_db -n "PKI Bootstrap Administrator for RSA-SubCA" -c SECret.123 -h "rhcs10.example.com" -p 31443 ca-user-cert-add rsa_SubCA_AuditV --input /root/.dogtag/pki_rsa_bootstrap/certs_db/rsa_SubCA_AuditV_b64.crt ------------------------------------------------------------------------------------------------------------------------------------- Added certificate "2;236851028;CN=CA Signing Certificate,OU=rhcs10-RSA-RootCA,O=Example-rhcs10-RSA-RootCA;CN=rsa_SubCA_AuditV,UID=rsa_SubCA_AuditV"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Similarly:
-
To add certificates to users in the KRA and the OCSP, use respectively the
kra-user-cert-add
and theocsp-user-cert-add
commands with the corresponding subsystem’s hostname and port.
If TMS is of interest:
-
To add certificates to users in the TKS and the TPS, use respectively the
tks-user-cert-add
and thetps-user-cert-add
commands with the corresponding subsystem’s hostname and port.
-
To add certificates to users in the KRA and the OCSP, use respectively the
-
Send the certificate file
/root/.dogtag/pki_rsa_bootstrap/certs_db/rsa_SubCA_AuditV_pkcs7.crt
, to the user (e.g. aguru). The file can then be copied to the user location/home/aguru/certs_db/rsa_SubCA_AuditV_pkcs7.crt
to import in a later step.
7.12.4.1.4. Importing the pki audit certificate to the client nssdb Copiar o linkLink copiado para a área de transferência!
This section is to be performed by the new pki auditor user (e.g. aguru) who has received the newly issued certificate file (e.g. /home/aguru/certs_db/rsa_SubCA_AuditV_pkcs7.crt
) from the bootstrap user, in this case, the root user.
- Login to rhcs10.example.com as an 'Auditor' (a non-root user, for example aguru).
Install the rsa_SubCA_AuditV certificate:
pki -d /home/aguru/certs_db -c SECret.123 pkcs7-import "rsa_SubCA_AuditV" --pkcs7 /home/aguru/certs_db/rsa_SubCA_AuditV_pkcs7.crt
$ pki -d /home/aguru/certs_db -c SECret.123 pkcs7-import "rsa_SubCA_AuditV" --pkcs7 /home/aguru/certs_db/rsa_SubCA_AuditV_pkcs7.crt
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Copy to Clipboard Copied! Toggle word wrap Toggle overflow Backup the role user rsa_SubCA_AuditV certificate by creating a .p12 file, here for example with the password SECret.123:
pki -d /home/aguru/certs_db -c SECret.123 client-cert-show "rsa_SubCA_AuditV" --pkcs12 /home/aguru/certs_db/rsa_SubCA_AuditV.p12 --pkcs12-password SECret.123
$ pki -d /home/aguru/certs_db -c SECret.123 client-cert-show "rsa_SubCA_AuditV" --pkcs12 /home/aguru/certs_db/rsa_SubCA_AuditV.p12 --pkcs12-password SECret.123
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
7.12.5. TPS operators Copiar o linkLink copiado para a área de transferência!
The process for TPS operators is similar to the process for Auditors.
7.12.6. Removing the bootstrap admin users from the authentication databases (optional) Copiar o linkLink copiado para a área de transferência!
Follow the instructions in this section only when you are certain that for each RHCS subsystem, at least one admin user has been created and successfully tested to be able to perform administrator functions.
List the certificates in the authentication nssdb to determine the installed bootstrap admin certificates for the SubCA, KRA and OCSP. For example:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Delete the SubCA, OCSP and KRA bootstrap admin user certificates:
pki -d /root/.dogtag/pki_rsa_bootstrap/certs_db -c SECret.123 client-cert-del "PKI Bootstrap Administrator for RSA-SubCA"
# pki -d /root/.dogtag/pki_rsa_bootstrap/certs_db -c SECret.123 client-cert-del "PKI Bootstrap Administrator for RSA-SubCA"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow pki -d /root/.dogtag/pki_rsa_bootstrap/certs_db -c SECret.123 client-cert-del "PKI Bootstrap Administrator for RSA-OCSP-rootca"
# pki -d /root/.dogtag/pki_rsa_bootstrap/certs_db -c SECret.123 client-cert-del "PKI Bootstrap Administrator for RSA-OCSP-rootca"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow pki -d /root/.dogtag/pki_rsa_bootstrap/certs_db -c SECret.123 client-cert-del "PKI Bootstrap Administrator for RSA-OCSP-subca"
# pki -d /root/.dogtag/pki_rsa_bootstrap/certs_db -c SECret.123 client-cert-del "PKI Bootstrap Administrator for RSA-OCSP-subca"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow pki -d /root/.dogtag/pki_rsa_bootstrap/certs_db -c SECret.123 client-cert-del "PKI Bootstrap Administrator for RSA-KRA"
# pki -d /root/.dogtag/pki_rsa_bootstrap/certs_db -c SECret.123 client-cert-del "PKI Bootstrap Administrator for RSA-KRA"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Optional: If TMS is of interest, you can remove the TKS and TPS bootstrap admin users in the same manner.
pki -d /root/.dogtag/pki_rsa_bootstrap/certs_db -c SECret.123 client-cert-del "PKI Bootstrap Administrator for RSA-TKS"
# pki -d /root/.dogtag/pki_rsa_bootstrap/certs_db -c SECret.123 client-cert-del "PKI Bootstrap Administrator for RSA-TKS"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow pki -d /root/.dogtag/pki_rsa_bootstrap/certs_db -c SECret.123 client-cert-del "PKI Bootstrap Administrator for RSA-TPS"
# pki -d /root/.dogtag/pki_rsa_bootstrap/certs_db -c SECret.123 client-cert-del "PKI Bootstrap Administrator for RSA-TPS"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Disabling multi-role support
The bootstrap user came with multiple roles (admin, agent, and auditor). Now that you have replaced the bootstrap user with single-role privileged users, you can safely disable the multi-roles ability by following Section 15.1, “Disabling multi-roles support”.
7.13. Post-installation Copiar o linkLink copiado para a área de transferência!
This chapter describes the post-installation tasks that take place after the subsystems installation.
Once you have completed the installation using the pkispawn
utility, certain actions are then either required or strongly recommended. In addition, some optional actions would also be helpful, depending on the site’s preferences.
For optional procedures, see Part III, “Part III: Configuring Red Hat Certificate System”. Useful post-installation-step procedures include:
- Configuring or adding certificate enrollment profiles (CA). For details, see Chapter 11, Configuring certificate profiles.
For required or strongly recommended procedures, perform the actions described below.
The configuration changes will not take effect until the you start or restart the instance. In general, you should make sure all CS instances are stopped before performing all the OS file system level post-installation configuration. Once done, you can then restart the instances.
7.13.1. Setting date and time for RHCS Copiar o linkLink copiado para a área de transferência!
It is important to have the time set up correctly for running RHCS. The system time is always kept in Coordinated Universal Time (UTC) and converted in applications to local time as needed. Local time is the actual time in your current time zone, taking into account daylight saving time (DST).
The timedatectl
utility is distributed as part of the systemd
system and service manager and allows you to review and change the configuration of the system clock.
To change the current time:
timedatectl set-time HH:MM:SS
# timedatectl set-time HH:MM:SS
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace HH with an hour, MM with a minute, and SS with a second, all typed in two-digit form.
To change the current date:
timedatectl set-time YYYY-MM-DD
# timedatectl set-time YYYY-MM-DD
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace YYYY with a four-digit year, MM with a two-digit month, and DD with a two-digit day of the month.
To set the time zone:
First, display the list of available time zones:
timedatectl list-timezones
# timedatectl list-timezones
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Based on the above list, set your desired time zone with this command:
timedatectl set-timezone <your_preferred_timezone>
# timedatectl set-timezone <your_preferred_timezone>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
The time change is audited by the operating system. For more information see Section 13.2.1.3, “Auditing time change events”.
7.13.2. Configuring session timeout Copiar o linkLink copiado para a área de transferência!
Various timeout configurations exist on the system that could affect how long a TLS session is allowed to remain idle before termination. For details, see Section 9.4.2, “Session timeout”.
7.13.3. Setting non-SHA1 message digest algorithm for SubjectKeyIdentifier extension in a certificate Copiar o linkLink copiado para a área de transferência!
By default, the SubjectKeyIdentifier
extension, when set in the enrollment profile, is computed by using SHA-1
. To set it to another algorithm, you will need to edit the enrollment profile. For example:
Open the enrollment profile for the certificate:
vi /var/lib/pki/rhcs10-RSA-SubCA/ca/profiles/ca/caCMCcaCert.cfg
# vi /var/lib/pki/rhcs10-RSA-SubCA/ca/profiles/ca/caCMCcaCert.cfg
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Add the following parameter:
policyset.caCertSet.8.default.params.messageDigest=SHA-256
policyset.caCertSet.8.default.params.messageDigest=SHA-256
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Save the file and restart the CA.
Make sure the SubjectKeyIdentifierExtension
comes before the AuthorityKeyIdentifierExtension
. If not, just adjust the position in the list
parameter, e.g. if 8
is the SubjectKeyIdentifierExtension
, and 4
is the AuthorityKeyIdentifierExtension
, then the following would place 8
before 4
in the list:
policyset.caCertSet.list=1,2,3,8,4,5,6,9,10
policyset.caCertSet.list=1,2,3,8,4,5,6,9,10
7.13.4. Configuration for CMC enrollment and revocation (CA) Copiar o linkLink copiado para a área de transferência!
You can do certificate enrollments and revocation via CMC. The configuration is described in Section 9.6, “Configuration for CMC”. Specifically:
- For details about enabling the CMC Shared Token Feature, see Section 9.6.3, “Enabling the CMC Shared Secret feature”.
-
For details about enabling the PopLinkWitness feature, see Section 9.6.2, “Enabling the
PopLinkWitnessV2
feature”. - For details about enabling CMCRevoke for the web user interface, see Section 9.6.4, “Enabling CMCRevoke for the Web User Interface”.
7.13.5. Enable Nuxwdog (watchdog service) Copiar o linkLink copiado para a área de transferência!
The watchdog (nuxwdog) service provides secure system password management. For more details, see Section 9.3.2.1, “Enabling the watchdog service”. This section describes how to enable the Nuxwdog watchdog for each instance.
7.13.5.1. Enable Nuxwdog for the RootCA Copiar o linkLink copiado para a área de transferência!
The following procedure provides the steps required to enable Nuxwdog on the RootCA instance.
Prerequisites
- You are logged in to rhcs10.example.com as root.
-
Make sure the instance is stopped. If not, stop it using the
systemctl stop pki-tomcatd@rhcs10-RSA-RootCA.service
command.
Procedure
Add the
cms.tokenList=<HSM_TOKEN_NAME>
parameter toCS.cfg
, for example:cat /var/lib/pki/rhcs10-RSA-RootCA/ca/conf/CS.cfg | grep cms.tokenList cms.tokenList=NHSM-CONN-XC
# cat /var/lib/pki/rhcs10-RSA-RootCA/ca/conf/CS.cfg | grep cms.tokenList cms.tokenList=NHSM-CONN-XC
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Move the password file to another directory:
mv /var/lib/pki/rhcs10-RSA-RootCA/conf/password.conf ~/<YOUR_PREFERRED_DIR>/
# mv /var/lib/pki/rhcs10-RSA-RootCA/conf/password.conf ~/<YOUR_PREFERRED_DIR>/
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Enable the Nuxwdog service:
pki-server instance-nuxwdog-enable rhcs10-RSA-RootCA
# pki-server instance-nuxwdog-enable rhcs10-RSA-RootCA --------------------------- Nuxwdog enabled for instance rhcs10-RSA-RootCA. ---------------------------
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Start the instance using the Nuxwdog service. You will be prompted for passwords, which can be found in the
password.conf
file that you were instructed to save (~/<YOUR_PREFERRED_DIR>/
) in an earlier step. Note that once you have successfully enabled Nuxwdog, the CS instance start/stop/restart/status command differs:systemctl start pki-tomcatd-nuxwdog@rhcs10-RSA-RootCA.service
# systemctl start pki-tomcatd-nuxwdog@rhcs10-RSA-RootCA.service [rhcs10-RSA-RootCA] Please provide the password for internal: ***** [rhcs10-RSA-RootCA] Please provide the password for hardware-NHSM-CONN-XC: *****
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification steps:
Check the status of the RootCA instance using Nuxwdog:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
7.13.5.2. Enable Nuxwdog for the SubCA Copiar o linkLink copiado para a área de transferência!
The following procedure provides the steps required to enable Nuxwdog on the SubCA instance.
Prerequisites
- You are logged in to rhcs10.example.com as root.
-
Make sure the instance is stopped. If not, stop it using the
systemctl stop pki-tomcatd@rhcs10-RSA-SubCA.service
command.
Procedure
Add the
cms.tokenList=<HSM_TOKEN_NAME>
parameter toCS.cfg
, for example:cat /var/lib/pki/rhcs10-RSA-SubCA/ca/conf/CS.cfg | grep cms.tokenList cms.tokenList=NHSM-CONN-XC
# cat /var/lib/pki/rhcs10-RSA-SubCA/ca/conf/CS.cfg | grep cms.tokenList cms.tokenList=NHSM-CONN-XC
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Move the password file to another directory:
mv /var/lib/pki/rhcs10-RSA-SubCA/conf/password.conf ~/<YOUR_PREFERRED_DIR>/
# mv /var/lib/pki/rhcs10-RSA-SubCA/conf/password.conf ~/<YOUR_PREFERRED_DIR>/
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Enable the Nuxwdog service:
pki-server instance-nuxwdog-enable rhcs10-RSA-SubCA
# pki-server instance-nuxwdog-enable rhcs10-RSA-SubCA --------------------------- Nuxwdog enabled for instance rhcs10-RSA-SubCA. ---------------------------
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Start the instance using the Nuxwdog service. Note that once you have successfully enabled Nuxwdog, the CS instance start/stop/restart/status command differs:
systemctl start pki-tomcatd-nuxwdog@rhcs10-RSA-SubCA.service
# systemctl start pki-tomcatd-nuxwdog@rhcs10-RSA-SubCA.service [rhcs10-RSA-SubCA] Please provide the password for internal: ***** [rhcs10-RSA-SubCA] Please provide the password for hardware-NHSM-CONN-XC: ***** [rhcs10-RSA-SubCA] Please provide the password for Rule SharedToken: ******
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification steps:
Check the status of the SubCA instance using Nuxwdog:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
7.13.5.3. Enable Nuxwdog for the OCSPs Copiar o linkLink copiado para a área de transferência!
The following procedure provides the steps required to enable Nuxwdog on the OCSP instances.
Prerequisites
- You are logged in to rhcs10.example.com as root.
-
Make sure the instance is stopped. If not, stop it, for example using
systemctl stop pki-tomcatd@rhcs10-RSA-OCSP-rootca.service
orsystemctl stop pki-tomcatd@rhcs10-RSA-OCSP-subca.service
for the relevant instance.
Procedure
For example, for the RootCA’s OCSP:
Add the
cms.tokenList=<TOKEN_NAME>
parameter toCS.cfg
, for example:cat /var/lib/pki/rhcs10-RSA-OCSP-rootca/ocsp/conf/CS.cfg | grep cms.tokenList cms.tokenList=NHSM-CONN-XC
# cat /var/lib/pki/rhcs10-RSA-OCSP-rootca/ocsp/conf/CS.cfg | grep cms.tokenList cms.tokenList=NHSM-CONN-XC
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Move the password file to another directory:
mv /var/lib/pki/rhcs10-RSA-OCSP-rootca/conf/password.conf ~/<YOUR_PREFERRED_DIR>/
# mv /var/lib/pki/rhcs10-RSA-OCSP-rootca/conf/password.conf ~/<YOUR_PREFERRED_DIR>/
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Enable the Nuxwdog service:
pki-server instance-nuxwdog-enable rhcs10-RSA-OCSP-rootca/
# pki-server instance-nuxwdog-enable rhcs10-RSA-OCSP-rootca/ --------------------------- Nuxwdog enabled for instance rhcs10-RSA-OCSP-rootca/. ---------------------------
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Start the instance using the Nuxwdog service:
systemctl start pki-tomcatd-nuxwdog@rhcs10-RSA-OCSP-rootca.service
# systemctl start pki-tomcatd-nuxwdog@rhcs10-RSA-OCSP-rootca.service [rhcs10-RSA-OCSP-rootca/] Please provide the password for internal: ***** [rhcs10-RSA-OCSP-rootca/] Please provide the password for hardware-NHSM-CONN-XC: *****
Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Repeat the above procedure for the SubCA’s OCSP by adapting the instance’s name, e.g. using
rhcs10-RSA-OCSP-subca
.
Verification
Check the status of the OCSP instances using Nuxwdog:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Copy to Clipboard Copied! Toggle word wrap Toggle overflow
7.13.5.4. Enable Nuxwdog for the KRA Copiar o linkLink copiado para a área de transferência!
The following procedure provides the steps required to enable Nuxwdog on the KRA instance.
Prerequisites
- You are logged in to rhcs10.example.com as root.
-
Make sure the instance is stopped. If not, stop it using the
systemctl stop pki-tomcatd@rhcs10-RSA-KRA.service
command.
Procedure
Add the
cms.tokenList=<TOKEN_NAME>
parameter to theCS.cfg
file, for example:cat /var/lib/pki/rhcs10-RSA-KRA/kra/conf/CS.cfg | grep cms.tokenList cms.tokenList=NHSM-CONN-XC
# cat /var/lib/pki/rhcs10-RSA-KRA/kra/conf/CS.cfg | grep cms.tokenList cms.tokenList=NHSM-CONN-XC
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Move the password file to another directory:
mv /var/lib/pki/rhcs10-RSA-KRA/conf/password.conf ~/<YOUR_PREFERRED_DIR>/
# mv /var/lib/pki/rhcs10-RSA-KRA/conf/password.conf ~/<YOUR_PREFERRED_DIR>/
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Enable the Nuxwdog service:
pki-server instance-nuxwdog-enable rhcs10-RSA-KRA
# pki-server instance-nuxwdog-enable rhcs10-RSA-KRA --------------------------- Nuxwdog enabled for instance rhcs10-RSA-KRA. ---------------------------
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Start the instance using the Nuxwdog service:
systemctl start pki-tomcatd-nuxwdog@rhcs10-RSA-KRA.service
# systemctl start pki-tomcatd-nuxwdog@rhcs10-RSA-KRA.service [rhcs10-RSA-KRA] Please provide the password for internal: ***** [rhcs10-RSA-KRA] Please provide the password for hardware-NHSM-CONN-XC: *****
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification steps:
Check the status of the KRA instance using Nuxwdog:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
7.13.5.5. Enable Nuxwdog for the TKS Copiar o linkLink copiado para a área de transferência!
The following procedure provides the steps required to enable Nuxwdog on the TKS instance.
Prerequisites
- You are logged in to rhcs10.example.com as root.
-
Make sure the instance is stopped. If not, stop it using the
systemctl stop pki-tomcatd@rhcs10-RSA-TKS.service
command.
Procedure
Add the
cms.tokenList=<TOKEN_NAME>
parameter to theCS.cfg
file, for example:cat /var/lib/pki/rhcs10-RSA-TKS/TKS/conf/CS.cfg | grep cms.tokenList cms.tokenList=NHSM-CONN-XC
# cat /var/lib/pki/rhcs10-RSA-TKS/TKS/conf/CS.cfg | grep cms.tokenList cms.tokenList=NHSM-CONN-XC
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Move the password file to another directory:
mv /var/lib/pki/rhcs10-RSA-TKS/conf/password.conf ~/<YOUR_PREFERRED_DIR>/
# mv /var/lib/pki/rhcs10-RSA-TKS/conf/password.conf ~/<YOUR_PREFERRED_DIR>/
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Enable the Nuxwdog service:
pki-server instance-nuxwdog-enable rhcs10-RSA-TKS
# pki-server instance-nuxwdog-enable rhcs10-RSA-TKS --------------------------- Nuxwdog enabled for instance rhcs10-RSA-TKS. ---------------------------
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Start the instance using the Nuxwdog service:
systemctl start pki-tomcatd-nuxwdog@rhcs10-RSA-TKS.service
# systemctl start pki-tomcatd-nuxwdog@rhcs10-RSA-TKS.service [rhcs10-RSA-TKS] Please provide the password for internal: ***** [rhcs10-RSA-TKS] Please provide the password for hardware-NHSM-CONN-XC: *****
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification steps:
Check the status of the TKS instance using Nuxwdog:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
7.13.5.6. Enable Nuxwdog for the TPS Copiar o linkLink copiado para a área de transferência!
The following procedure provides the steps required to enable Nuxwdog on the TPS instance.
Prerequisites
- You are logged in to rhcs10.example.com as root.
-
Make sure the instance is stopped. If not, stop it using the
systemctl stop pki-tomcatd@rhcs10-RSA-TPS.service
command.
Procedure
Add the
cms.tokenList=<TOKEN_NAME>
parameter to theCS.cfg
file, for example:cat /var/lib/pki/rhcs10-RSA-TPS/TPS/conf/CS.cfg | grep cms.tokenList cms.tokenList=NHSM-CONN-XC
# cat /var/lib/pki/rhcs10-RSA-TPS/TPS/conf/CS.cfg | grep cms.tokenList cms.tokenList=NHSM-CONN-XC
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Move the password file to another directory:
mv /var/lib/pki/rhcs10-RSA-TPS/conf/password.conf ~/<YOUR_PREFERRED_DIR>/
# mv /var/lib/pki/rhcs10-RSA-TPS/conf/password.conf ~/<YOUR_PREFERRED_DIR>/
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Enable the Nuxwdog service:
pki-server instance-nuxwdog-enable rhcs10-RSA-TPS
# pki-server instance-nuxwdog-enable rhcs10-RSA-TPS --------------------------- Nuxwdog enabled for instance rhcs10-RSA-TPS. ---------------------------
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Start the instance using the Nuxwdog service:
systemctl start pki-tomcatd-nuxwdog@rhcs10-RSA-TPS.service
# systemctl start pki-tomcatd-nuxwdog@rhcs10-RSA-TPS.service [rhcs10-RSA-TPS] Please provide the password for internal: ***** [rhcs10-RSA-TPS] Please provide the password for hardware-NHSM-CONN-XC: *****
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification steps:
Check the status of the TPS instance using Nuxwdog:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
7.13.6. Configure pkiconsole login with client authentication Copiar o linkLink copiado para a área de transferência!
This section describes configuring pkiconsole
login with client authentication. In the following configuration, the instance can be either CA, OCSP, KRA or TKS.
Prerequisite configuration
You must configure each CS instance to allow for pkiconsole
TLS connections.
- Login to rhcs10.example.com as root.
Stop the server that needs a console login with client authentication.
pki-server stop rhcs10-<INSTANCE>
# pki-server stop rhcs10-<INSTANCE>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow OR if using the Nuxwdog watchdog:
systemctl stop pki-tomcatd-nuxwdog@rhcs10-<INSTANCE>.service
# systemctl stop pki-tomcatd-nuxwdog@rhcs10-<INSTANCE>.service
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Change directory at
/var/lib/pki/<instance name>/<subsystem>/conf
. For example, if changing to the RootCA conf directory:cd /var/lib/pki/rhcs10-RSA-RootCA/ca/conf
# cd /var/lib/pki/rhcs10-RSA-RootCA/ca/conf
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Modify the
CS.cfg
file to change theauthType
frompwd
tosslclientauth
, e.g.:authType=sslclientauth
authType=sslclientauth
Copy to Clipboard Copied! Toggle word wrap Toggle overflow NOTEAlternatively, you can add the line
authType=sslclientauth
to theCS.cfg
using theconfig-set
commands. For example, useca-config-set
to add to the RootCA:pki-server ca-config-set -i rhcs10-RSA-RootCA authType sslclientauth
# pki-server ca-config-set -i rhcs10-RSA-RootCA authType sslclientauth
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Start the server:
pki-server start rhcs10-<INSTANCE>
# pki-server start rhcs10-<INSTANCE>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow OR if using the Nuxwdog watchdog:
systemctl start pki-tomcatd-nuxwdog@rhcs10-<INSTANCE>.service
# systemctl start pki-tomcatd-nuxwdog@rhcs10-<INSTANCE>.service
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Procedure
Each RHCS administrator needs to perform some setup prior to using pkiconsole
with TLS connections.
- Login to rhcs10.example.com as a non-root admin user (for example: jgenie).
-
The bootstrap admin user should provide the SubCA and RootCA signing certificates to jgenie. After receiving the contents of
/opt/pki_rsa/subCA.pem
and/opt/pki_rsa/rootCA.pem
on rhcs10.example.com, jgenie should copy them into/home/jgenie/certs_db/rsa_subCA.pem
and/home/jgenie/certs_db/rsa_rootCA.pem
respectively. Create a nssdb, if it does not already exist:
pki -d /home/jgenie/.redhat-idm-console -c SECret.123 client-init
$ pki -d /home/jgenie/.redhat-idm-console -c SECret.123 client-init
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Import the role user certificate (e.g.
/home/jgenie/certs_db/rsa_SubCA_AdminV.p12
):pki -d /home/jgenie/.redhat-idm-console -c SECret.123 client-cert-import --pkcs12 /home/jgenie/certs_db/rsa_SubCA_AdminV.p12 --pkcs12-password SECret.123
$ pki -d /home/jgenie/.redhat-idm-console -c SECret.123 client-cert-import --pkcs12 /home/jgenie/certs_db/rsa_SubCA_AdminV.p12 --pkcs12-password SECret.123
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Import the CA certificates:
pki -d /home/jgenie/.redhat-idm-console -c SECret.123 client-cert-import "CA Signing Cert - rhcs10-RSA-SubCA" --ca-cert /home/jgenie/certs_db/rsa_subCA.pem
$ pki -d /home/jgenie/.redhat-idm-console -c SECret.123 client-cert-import "CA Signing Cert - rhcs10-RSA-SubCA" --ca-cert /home/jgenie/certs_db/rsa_subCA.pem ------------------------------------- Imported certificate "CA Signing Cert - rhcs10-RSA-SubCA" -------------------------------------
Copy to Clipboard Copied! Toggle word wrap Toggle overflow pki -d /home/jgenie/.redhat-idm-console -c SECret.123 client-cert-import "CA Signing Cert - rhcs10-RSA-RootCA" --ca-cert /home/jgenie/certs_db/rsa_rootCA.pem
$ pki -d /home/jgenie/.redhat-idm-console -c SECret.123 client-cert-import "CA Signing Cert - rhcs10-RSA-RootCA" --ca-cert /home/jgenie/certs_db/rsa_rootCA.pem ------------------------------------- Imported certificate "CA Signing Cert - rhcs10-RSA-RootCA" -------------------------------------
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification:
Verify the admin user certificate for authentication against the server. For example:
pki -U https://rhcs10.example.com:31443 -d /home/jgenie/.redhat-idm-console -c SECret.123 -n rsa_SubCA_AdminV ca-user-find
$ pki -U https://rhcs10.example.com:31443 -d /home/jgenie/.redhat-idm-console -c SECret.123 -n rsa_SubCA_AdminV ca-user-find
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Verify that
pkiconsole
can connect to the ca using client authentication:Login as a pki admin user (e.g. jgenie), for example:
ssh -X jgenie@rhcs10.example.com
$ ssh -X jgenie@rhcs10.example.com
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Run
pkiconsole
. For example:pkiconsole -d /home/jgenie/.redhat-idm-console -n rsa_SubCA_AdminV https://rhcs10.example.com:31443/ca
$ pkiconsole -d /home/jgenie/.redhat-idm-console -n rsa_SubCA_AdminV https://rhcs10.example.com:31443/ca
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
If you see the error No X11 DISPLAY variable was set, but this program performed an operation which requires it
upon launching pkiconsole
, try the following steps:
Install
xauth
as a root user on rhcs10.example.com:dnf install xauth
# dnf install xauth
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Login again as a RHCS admin user to run
pkiconsole
. For example:ssh -X jgenie@rhcs10.example.com
# ssh -X jgenie@rhcs10.example.com
Copy to Clipboard Copied! Toggle word wrap Toggle overflow pkiconsole -d /home/jgenie/.redhat-idm-console -n rsa_SubCA_AdminV https://rhcs10.example.com:31443/ca
# pkiconsole -d /home/jgenie/.redhat-idm-console -n rsa_SubCA_AdminV https://rhcs10.example.com:31443/ca
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
7.13.7. Enable signed audit Logging Copiar o linkLink copiado para a área de transferência!
Prerequisite
- You are logged onto rhcs10.example.com as root user.
Procedure
Stop the instance. For example, for the KRA:
pki-server stop rhcs10-RSA-KRA
# pki-server stop rhcs10-RSA-KRA
Copy to Clipboard Copied! Toggle word wrap Toggle overflow OR if using the Nuxwdog watchdog:
systemctl stop pki-tomcatd-nuxwdog@rhcs10-KRA.service
# systemctl stop pki-tomcatd-nuxwdog@rhcs10-KRA.service
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Set the
log.instance.SignedAudit.logSigning
attribute totrue
in theCS.cfg
file (false
by default). For example:vi /var/lib/pki/rhcs10-RSA-KRA/kra/conf/CS.cfg
# vi /var/lib/pki/rhcs10-RSA-KRA/kra/conf/CS.cfg
Copy to Clipboard Copied! Toggle word wrap Toggle overflow log.instance.SignedAudit.logSigning=true
log.instance.SignedAudit.logSigning=true
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Start the instance. For example:
pki-server start rhcs10-RSA-KRA
# pki-server start rhcs10-RSA-KRA
Copy to Clipboard Copied! Toggle word wrap Toggle overflow OR if using the Nuxwdog watchdog:
systemctl start pki-tomcatd-nuxwdog@rhcs10-KRA.service
# systemctl start pki-tomcatd-nuxwdog@rhcs10-KRA.service
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
You can also do audit log signing via CLI. See "Enabling signed audit logging" in the Installation Guide.
7.13.8. Retrieve the audit log file (Auditors) Copiar o linkLink copiado para a área de transferência!
Auditors (e.g - rsa_SubCA_AuditV) can access the signed audit logs using the following procedure.
Procedure
Login to rhcs10.example.com as an Auditor (a non-root user, e.g. - aguru).
Copy to Clipboard Copied! Toggle word wrap Toggle overflow List the available audit log files:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow In this example, there is only one file,
ca_audit
, but you can have multiple audit log files.As an Auditor, retrieve the audit log file and store it locally:
pki -d /home/aguru/certs_db -n "rsa_SubCA_AuditV" -c SECret.123 -p 31443 -h `hostname` ca-audit-file-retrieve ca_audit --output /home/aguru/certs_db/ca_audit
$ pki -d /home/aguru/certs_db -n "rsa_SubCA_AuditV" -c SECret.123 -p 31443 -h `hostname` ca-audit-file-retrieve ca_audit --output /home/aguru/certs_db/ca_audit
Copy to Clipboard Copied! Toggle word wrap Toggle overflow If you have multiple log files, retrieve them one by one.
Verify the signed audit logs using the
AuditVerify
tool:Import the SubCA audit signing certificate to the nssdb:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow pki -d /home/aguru/certs_db -c SECret.123 -p 31443 -h hostname client-cert-import "SubCA Audit Signing Certificate" --serial 0xe8e47bf --trust ",,P"
$ pki -d /home/aguru/certs_db -c SECret.123 -p 31443 -h hostname client-cert-import "SubCA Audit Signing Certificate" --serial 0xe8e47bf --trust ",,P" --------------------------------------------------- Imported certificate "SubCA Audit Signing Certificate" ---------------------------------------------------
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create a file containing a list of audit log files in chronological order:
cat > /home/aguru/certs_db/audit.txt << EOF ca_audit EOF
$ cat > /home/aguru/certs_db/audit.txt << EOF ca_audit EOF
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Run the AuditVerify tool:
cd /home/aguru/certs_db/
$ cd /home/aguru/certs_db/
Copy to Clipboard Copied! Toggle word wrap Toggle overflow AuditVerify -d /home/aguru/certs_db -n "SubCA Audit Signing Certificate" -a audit.txt
$ AuditVerify -d /home/aguru/certs_db -n "SubCA Audit Signing Certificate" -a audit.txt
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
7.13.9. Enable OS-level (Operational Environment) audit logs Copiar o linkLink copiado para a área de transferência!
The auditd
logging framework provides many additional audit capabilities. These OS-level (Operational Environment) audit logs complement functionality provided by Certificate System directly.
Prerequisites
Before performing any of the steps in this section, make sure the
audit
package is installed:dnf install audit
# dnf install audit
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Make sure the file /etc/audit/rules.d/audit.rules
remains present on the system with the following content:
Auditing Certificate System audit log deletion
To receive audit events for when audit logs are deleted, you need to audit system calls whose targets are Certificate System logs.
Create the file
/etc/audit/rules.d/rhcs-audit-log-deletion.rules
with the following contents:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Then restart the
auditd
service:service auditd restart
# service auditd restart
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Auditing unauthorized Certificate System use of secret keys
To receive audit events for all access to Certificate System Secret or Private keys, you need to audit the file system access to the nssdb.
Create the
/etc/audit/rules.d/rhcs-audit-nssdb-access.rules
file with the following contents, replacing <instance name> with the current instance:-w /etc/pki/<instance name>/alias -p warx -k rhcs_audit_nssdb
-w /etc/pki/<instance name>/alias -p warx -k rhcs_audit_nssdb
Copy to Clipboard Copied! Toggle word wrap Toggle overflow For each file (<file>) in
/etc/pki/<instance name>/alias
, add the following line to/etc/audit/rules.d/rhcs-audit-nssdb-access.rules
:-w /etc/pki/<instance name>/alias/<file> -p warx -k rhcs_audit_nssdb
-w /etc/pki/<instance name>/alias/<file> -p warx -k rhcs_audit_nssdb
Copy to Clipboard Copied! Toggle word wrap Toggle overflow For example, if files on the
rhcs10-RSA-SubCA
instance arecert8.db
,key3.db
,NHSM-CONN-XCcert8.db
,NHSM-CONN-XCkey3.db
, andsecmod.db
, then the configuration file would contain:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Then restart
auditd
:service auditd restart
# service auditd restart
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Whenever adding new instances to the same system, expand /etc/audit/rules.d/rhcs-audit-nssdb-access.rules
to include the new instance files in the same manner.
Auditing time change events
To receive audit events for time changes, you need to audit a system call access which could modify the system time.
Create the
/etc/audit/rules.d/rhcs-audit-rhcs_audit_time_change.rules
file with the following contents:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Then restart
auditd
:service auditd restart
# service auditd restart
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Auditing access to Certificate System configuration
To receive audit events for all modifications to the Certificate System instance configuration files, audit the file system access for these files.
Create the
/etc/audit/rules.d/rhcs-audit-config-access.rules
file with the following contents:-w /etc/pki/instance_name/server.xml -p wax -k rhcs_audit_config
-w /etc/pki/instance_name/server.xml -p wax -k rhcs_audit_config
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Additionally, add for each subsystem in the
/etc/pki/instance_name/
directory the following contents:-w /etc/pki/instance name/subsystem/CS.cfg -p wax -k rhcs_audit_config
-w /etc/pki/instance name/subsystem/CS.cfg -p wax -k rhcs_audit_config
Copy to Clipboard Copied! Toggle word wrap Toggle overflow For example, if only a CA is installed on the rhcs10-RSA-SubCA instance, the
/etc/audit/rules.d/rhcs-audit-config-access.rules
file would contain:-w /etc/pki/rhcs10-RSA-SubCA/server.xml -p wax -k rhcs_audit_config -w /etc/pki/rhcs10-RSA-SubCA/ca/CS.cfg -p wax -k rhcs_audit_config
-w /etc/pki/rhcs10-RSA-SubCA/server.xml -p wax -k rhcs_audit_config -w /etc/pki/rhcs10-RSA-SubCA/ca/CS.cfg -p wax -k rhcs_audit_config
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Note that access to the RHCS NSS database is already audited under
rhcs_audit_nssdb
.
Whenever adding new instances to the same system, expand /etc/audit/rules.d/rhcs-audit-nssdb-access.rules
to include the new instance files in the same manner.
Verifying audit rules
After adding each audit rule and restarting the auditd service, you can validate that the new rules were added:
auditctl -l
# auditctl -l
Copy to Clipboard Copied! Toggle word wrap Toggle overflow The contents of the new rules should be visible in the output.
Verifying auditing
You can verify that the rule for rhcs_audit_nssdb
works with a simple test, for example:
Access the SubCA alias directory:
cd /etc/pki/rhcs10-RSA-SubCA/alias/
# cd /etc/pki/rhcs10-RSA-SubCA/alias/
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Check for the audit event:
ausearch -k rhcs_audit_nssdb
# ausearch -k rhcs_audit_nssdb
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
7.13.10. Verifying peer certificate for RHCS subsystems Copiar o linkLink copiado para a área de transferência!
RHCS 10.4 provides different mechanisms for RHCS subsystems to verify their peer certificates, whether it is acting as a client or as a server in establishing a TLS session. The mechanisms employed are either OCSP or CRL.
The following provides details on how to enable them for each type of RHCS subsystem.
7.13.10.1. Enabling peer certificate status check for OCSP Copiar o linkLink copiado para a área de transferência!
This section describes an alternative method for enabling revocation checks in an OCSP subsystem. For the preferred method, see the next section: Section 7.13.10.2, “Enabling OCSP for the CA / KRA / TKS / TPS”.
Enabling OCSP for the OCSP system itself would create a chicken and egg phenomenon (in the case if the peer AIA points to the OCSP system itself before it starts up completely). Fortunately, the OCSP subsystem has the advantage of having the frequently updated CRL to verify its peer’s certificate without reaching out to another OCSP system. To enable such special feature, set the following two parameters in the OCSP’s CS.cfg
:
ocsp.store.ldapStore.validateConnCertWithCRL=true auths.revocationChecking.enabled=true
ocsp.store.ldapStore.validateConnCertWithCRL=true
auths.revocationChecking.enabled=true
In addition to enabling the two parameters in the CS.cfg
, the enableOCSP
parameter should remain to be “false”
in its server.xml
file, e.g. /var/lib/pki/rhcs10-RSA-OCSP-rootca/conf/server.xml
and /var/lib/pki/rhcs10-RSA-OCSP-subca/conf/server.xml
in our example:
enableOCSP=”false”
enableOCSP=”false”
7.13.10.2. Enabling OCSP for the CA / KRA / TKS / TPS Copiar o linkLink copiado para a área de transferência!
The instructions provided in this section also apply to an OCSP subsystem, as long as the peer certificate’s AIA does not point to the same OCSP subsystem during the startup of the OCSP system.
For instance, earlier in this chapter, in the installation procedures (7.4.1 and 7.7.1), the internal directory server’s server-certs for the OCSP servers were reissued with their AIA’s pointing to their corresponding CA’s internal OCSP service.
The following procedure aims to configure your CA, OCSP, KRA, TKS and TPS instances to verify the revocation status of their peer certificates according to the following extensions in the peer certificates:
The OCSP AIA extension (also known as the ocsp-aia in this document).
Note that in most cases, OCSP-aia is the recommended method over CRL Distribution Points.
The CRL Distribution Point extension.
Note that in general CRL Distribution Point is only recommended to be used in the case when OCSP is not usable. See Section 7.13.10.3, “Enabling peer certificate status check without OCSP on the CA” for more information
Prerequisite
- You are logged onto rhcs10.example.com as root user.
Procedure
This procedure uses the KRA as an example. Similar steps apply to the CA, OCSP, TKS and TPS instances as well, adjust the commands for the appropriate instance.
Stop the KRA:
pki-server stop rhcs10-RSA-KRA
# pki-server stop rhcs10-RSA-KRA
Copy to Clipboard Copied! Toggle word wrap Toggle overflow OR if using the Nuxwdog watchdog:
systemctl stop pki-tomcatd-nuxwdog@rhcs10-KRA.service
# systemctl stop pki-tomcatd-nuxwdog@rhcs10-KRA.service
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Edit the
/var/lib/pki/rhcs10-RSA-KRA/conf/server.xml
file to configure theConnector name="Secure"
section:-
Set the
enableRevocationCheck
parameter totrue
. Note thatenableRevocationCheck
is also known asenableOCSP
. Only set one and not both. Make sure you remove these two parameters and their assigned values:
-
ocspResponderURL
-
ocspResponderCertNickname
For example:
-
Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Set the
Start the KRA:
pki-server start rhcs10-RSA-KRA
# pki-server start rhcs10-RSA-KRA
Copy to Clipboard Copied! Toggle word wrap Toggle overflow OR if using the Nuxwdog watchdog:
systemctl start pki-tomcatd-nuxwdog@rhcs10-KRA.service
# systemctl start pki-tomcatd-nuxwdog@rhcs10-KRA.service
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
By default, all RHCS system certificates created during installation are generated with an AIA (Authority Information Access) extension pointing to its issuing CA’s internal OCSP service, such as http://rhcs10.example.com:31080/ca/ocsp
.
If you followed the steps in Set the default AIA extension to point to this OCSP, to point to the external OCSP prior to installing the KRA, then all the KRA systems certificates (and all other certificates issued by its CA thereon) should bear the correct AIA pointing to the external OCSP instead.
In an environment where OCSP is depended upon (enabled by setting the enableRevocationCheck
or enableOCSP
parameter in server.xml
mentioned above), the OCSP instance needs to be up and running prior to the start of any of the instances that rely on it, such as KRA, TKS, and TPS in our installation example.
Likewise, the CA needs to be up and running before its external OCSP is started.
7.13.10.3. Enabling peer certificate status check without OCSP on the CA Copiar o linkLink copiado para a área de transferência!
CAs can be configured to have the certificates needed (for example, CA’s LDAP server-cert) during startup to use CRL Distribution Points to avoid the chicken and egg issue during startup (see Configure Support for CRL Distribution Point under Section 9.4.1.2, “Enabling automatic revocation checking on the CA” for more details).
Once started, CAs can rely on OCSP to support revocation checks just like other CS subsystems.
Certificate Revocation Validation Order and Expectations
CRL Distribution Point and OCSP-aia extensions are processed during revocation validation of the peer certificate on a CS subsystem as follows:
If only CRL Distribution Point is present in the certificate:
It is validated per CRL retrieved/associated with the CRL Distribution Point
- If the certificate is in the CRL: fail/revoked
- If the certificate is not in the CRL: good
If the URL in the CRL Distribution Point is unreachable, it is considered bad
-
Fail/revoked (versus another option not chosen: Ignored/unknown)
Note how this is slightly different from when ocsp-aia is unreachable
-
Fail/revoked (versus another option not chosen: Ignored/unknown)
If only OCSP-aia is present in the certificate:
It is validated per the OCSP response from the OCSP pointed to by the OCSP-aia
- If the certificate is found in the CRL by the OCSP Responder: fail/revoked
- If the certificate is not found in the CRL by the OCSP Responder: good
If the URL in the OCSP-aia is unreachable, it is considered bad
-
Bad Certificate
Note how this is slightly different from when the CRL Distribution Point is unreachable
-
Bad Certificate
If both the OCSP-aia and the CRL Distribution Point are present in the certificate:
- OCSP-aia takes precedence: that is, Good or Bad
If the URL in the OCSP-aia is unreachable, CRL Distribution takes over
- If the URL in the CRL Distribution Point is unreachable, it is considered Fail/revoked
7.13.11. Update the ciphers list Copiar o linkLink copiado para a área de transferência!
Red Hat Certificate System allows to set restrictions on acceptable ciphers when acting as a server or as a client. These cipher controls are configured at different locations.
An RHCS instance is acting as a server when it is accepting requests from another entity. For example:
- When a RHCS cli talks to a CA for certificate enrollment (in this case, the CA is the server)
- When a RHCS administrator uses the pkiconsole to talk to a CA (in this case, the CA is the server)
- When a CA talks to a KRA for key archival (in this case, the KRA is the server, and the CA is the client)
An RHCS instance is acting as a client when it attempts to reach out to another server. For example:
- When a CA talks to a KRA for key archival (in this case, the CA is the client while the KRA is the server)
- When a CA talks to its internal LDAP database (in this case, the CA is the client while Directory Server is the server)
The following sections provide instructions on how to configure the ciphers for these different scenarios.
7.13.11.1. Configuring the ciphers for a CS instance acting as a server Copiar o linkLink copiado para a área de transferência!
The desired set of ciphers for a given instance is defined by the SSLHostConfig element in the <CS instance directory>/conf/server.xml
file.
Follow the instructions below to configure each CS instance.
Back up the original server.xml
file before editing, for example to server.xml.orig
.
-
Edit the
server.xml
file, navigate to the main SSL port’s Connector declaration and find the SSLHostConfig element. Modify the SSLHostConfig element with the following configuration:
<SSLHostConfig sslProtocol="TLS" protocols="TLSv1.2" certificateVerification="optional" ciphers="ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA384">
<SSLHostConfig sslProtocol="TLS" protocols="TLSv1.2" certificateVerification="optional" ciphers="ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA384">
Copy to Clipboard Copied! Toggle word wrap Toggle overflow The above cipher list represents the set of ciphers claimed in this RHCS release in OpenSSL format, where:
-
ciphers=" … "
: establishes the restricted ciphers desired (for example TLS). In this format, cipher names are separated by a colon. -
protocols=" … "
: establishes which TLS version you want (for example, 1.2).
-
7.13.11.2. Configuring the ciphers for a CS instance acting as a client Copiar o linkLink copiado para a área de transferência!
When a CS instance acts as a client, add the desired list of ciphers in the instance’s CS.cfg
configuration file. Configure all the client instances as relevant based on their roles.
Back up the original CS.cfg
file before editing, for example to CS.cfg.orig
.
When a CS instance is acting as a client to its internal LDAP database.
Add the following line to the<instance directory>/<instance type>/conf/CS.cfg
file:tcp.clientCiphers=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
tcp.clientCiphers=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteTo ensure that the internal LDAP database has the desired ciphers enabled, please follow Configuring the ciphers for a DS instance.
When a CA instance is acting as a client to the KRA.
Add the following line to the<instance directory>/ca/conf/CS.cfg
file:ca.connector.KRA.clientCiphers=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
ca.connector.KRA.clientCiphers=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
Copy to Clipboard Copied! Toggle word wrap Toggle overflow When a TPS instance is acting as a client to the CA, KRA, or TKS.
Add the following line to the<instance directory>/tps/conf/CS.cfg
file:tps.connector.<ca|kra|tks id>.clientCiphers=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
tps.connector.<ca|kra|tks id>.clientCiphers=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
You must restart each server instance for the modifications to take effect, e.g.:
pki-server restart rhcs10-RSA-RootCA
# pki-server restart rhcs10-RSA-RootCA
pki-server restart rhcs10-RSA-SubCA
# pki-server restart rhcs10-RSA-SubCA
pki-server restart rhcs10-RSA-OCSP-rootca
# pki-server restart rhcs10-RSA-OCSP-rootca
pki-server restart rhcs10-RSA-OCSP-subca
# pki-server restart rhcs10-RSA-OCSP-subca
pki-server restart rhcs10-RSA-KRA
# pki-server restart rhcs10-RSA-KRA
OR if using the Nuxwdog watchdog:
systemctl restart rhcs10-RSA-RootCA
# systemctl restart rhcs10-RSA-RootCA
systemctl restart pki-tomcatd-nuxwdog@rhcs10-RSA-SubCA.service
# systemctl restart pki-tomcatd-nuxwdog@rhcs10-RSA-SubCA.service
systemctl restart pki-tomcatd-nuxwdog@rhcs10-RSA-OCSP-rootca.service
# systemctl restart pki-tomcatd-nuxwdog@rhcs10-RSA-OCSP-rootca.service
systemctl restart pki-tomcatd-nuxwdog@rhcs10-RSA-OCSP-subca.service
# systemctl restart pki-tomcatd-nuxwdog@rhcs10-RSA-OCSP-subca.service
systemctl restart pki-tomcatd-nuxwdog@rhcs10-RSA-KRA.service
# systemctl restart pki-tomcatd-nuxwdog@rhcs10-RSA-KRA.service
…
7.13.11.3. Configuring the ciphers for a DS instance Copiar o linkLink copiado para a área de transferência!
By default, a Directory Server instance inherits the ciphers enabled on the OS. If you wish to set it so that the cipher list matches that of the Certificate System, proceed with the following steps for each DS instance:
On the DS host rhds11.example.com:
Enable the intended ciphers (use the non-SSL port of the DS instance):
dsconf -D "cn=Directory Manager" ldap://rhds11.example.com:7389 security ciphers set "+TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,+TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,+TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,+TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384"
# dsconf -D "cn=Directory Manager" ldap://rhds11.example.com:7389 security ciphers set "+TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,+TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,+TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,+TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Restart the DS instance:
dsctl slapd-CC-RSA-SubCA-LDAP stop
# dsctl slapd-CC-RSA-SubCA-LDAP stop
Copy to Clipboard Copied! Toggle word wrap Toggle overflow dsctl slapd-CC-RSA-SubCA-LDAP start
# dsctl slapd-CC-RSA-SubCA-LDAP start
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Verify by listing the enabled ciphers:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
7.13.12. Requiring TLS mutual authentication for connections to CS Copiar o linkLink copiado para a área de transferência!
By default, Red Hat Certificate System already requires role user operations to go through TLS mutual authentication by way of conducting client certificate verification in the RHCS authentication plugin, while at the same time allows some of the non-role operations to be processed via TLS server authentication only. TLS mutual authentication provides stronger authentication for the server connectors. The following procedure allows sites to make the Certificate System instances inaccessible to clients that are unable to present their certificate for TLS handshake.
Do not execute the steps in this section until you have installed all desired Certificate System instances. Once you have executed the steps in this section, you will need to revert the change in case you later wish to install more Certificate System instances.
Procedure
Enabling TLS mutual authentication is done by modifying the server.xml
configuration file.
Back up the original server.xml
file before editing, for example to server.xml.orig
.
-
Edit the
server.xml
file and search for thecertificateVerification=
parameter. Change the parameter value from
optional
torequired
:certificateVerification=required
certificateVerification=required
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Save and restart each server instance for the modifications to take effect.
Once you have strengthened the CS instances, it is important to note that operations that normally do not require TLS mutual authentication will now require to present a valid client certificate at time of TLS handshake. Example operations affected by this are enrollments using CMCSharedToken
and some of the pki
commands that ordinarily do not require TLS mutual authentication.
To get
CMCSharedToken
to work, you will need to pre-issue a certificate to the user, then at time ofHttpClient
call, edit theHttpClient
configuration file so that it contains the following:clientmode=true nickname=<client cert that was issued and imported>
clientmode=true nickname=<client cert that was issued and imported>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow In order to work,
pki
commands now require to present a valid client certificate:For example, originally, the
ca-cert-find
command does not require mutual authentication:pki -d /root/.dogtag/pki_rsa_bootstrap/certs_db/ -c SECret.123 -p 31443 ca-cert-find
# pki -d /root/.dogtag/pki_rsa_bootstrap/certs_db/ -c SECret.123 -p 31443 ca-cert-find
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Now, with the new restriction, you will need to do the following:
pki -d /root/.dogtag/pki_rsa_bootstrap/certs_db/ -c SECret.123 -p 31443 -n 'SubCA_AdminV' ca-cert-find
# pki -d /root/.dogtag/pki_rsa_bootstrap/certs_db/ -c SECret.123 -p 31443 -n 'SubCA_AdminV' ca-cert-find
Copy to Clipboard Copied! Toggle word wrap Toggle overflow The following list shows
pki
commands that fall into this category:-
pki client-cert-request
-
pki ca-authority-find
-
pki ca-authority-show
-
pki ca-cert-find
-
pki ca-cert-show
-
pki ca-cert-export
-
pki ca-cert-status
-
pki ca-cert-request-show
-
pki ca-cert-request-submit
-
pki ca-cert-request-profile-find
-
pki ca-cert-request-profile-show
-
pki ca-cert-signing-show
-
pki ca-cert-signing-export
-
pki ca-cert-transport-show
-
pki ca-cert-transport-export
-
pki ca-feature-find
-
pki ca-feature-show
-
There may be other commands that fall into the same category and require similar treatment.
7.13.13. Enabling TLS mutual authentication from CS to DS Copiar o linkLink copiado para a área de transferência!
After you have configured the basic TLS server authentication when installing the CS subsystem, you must choose to enable TLS mutual authentication (also called client authentication) from a given subsystem to the LDAP server.
This section requires the CS instance installed and running. If you used a temporary LDAP server certificate (in the case of a CA), replace it first by following :
- Section 7.5.1, “Replace the temporary DS certificate (RootCA)” for the RootCA.
- Section 7.8.2, “Replace the temporary DS certificate (SubCA)” for the SubCA.
These steps are to be performed once the installation is complete.
There are two parts to setting up mutual authentication, first on the DS side, second on the CS side.
Configuration on DS
As a first part, we need to configure the LDAP directory to require TLS mutual authentication.
Note the following:
-
pkispawn
already automatically created apkidbuser
on its internal Directory Server, where the CS instance’s "subsystem certificate" (for examplesubsystemCert cert-pki-ca
) that is used for outbound TLS mutual authentication is stored in the user entry. Therefore, there is no need to create another LDAP user or another certificate for the TLS client-authentication. When creating content for
/etc/dirsrv/slapd-instance_name/certmap.conf
, use the following format:certmap rhcs <certificate issuer DN> rhcs:CmapLdapAttr seeAlso rhcs:verifyCert on
certmap rhcs <certificate issuer DN> rhcs:CmapLdapAttr seeAlso rhcs:verifyCert on
Copy to Clipboard Copied! Toggle word wrap Toggle overflow For example
certmap rhcs CN=CA Signing Certificate,OU=pki-tomcat-ca,O=pki-tomcat-ca-SD rhcs:CmapLdapAttr seeAlso rhcs:verifyCert on
certmap rhcs CN=CA Signing Certificate,OU=pki-tomcat-ca,O=pki-tomcat-ca-SD rhcs:CmapLdapAttr seeAlso rhcs:verifyCert on
Copy to Clipboard Copied! Toggle word wrap Toggle overflow After configuring, restart the Directory Server. For example:
dsctl slapd-CC-RSA-SubCA-LDAP restart
# dsctl slapd-CC-RSA-SubCA-LDAP restart
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Configuration on CS
As a second part, we need to configure the Red Hat Certificate System instance so that it knows to use the correct authentication type (i.e. SslClientAuth
instead of BasicAuth
), as well as which port and certificate is to be used to communicate with its internal LDAP server using TLS mutual authentication. This involves editing the RHCS instance’s CS.cfg
file located at <instance directory>/<subsystem type>/conf/CS.cfg
. For example /var/lib/pki/instance_name/ca/conf/CS.cfg
Stop the CS instance you want to configure:
pki-server stop rhcs10-<INSTANCE>
# pki-server stop rhcs10-<INSTANCE>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow OR if using the Nuxwdog watchdog:
systemctl stop pki-tomcatd-nuxwdog@rhcs10-<INSTANCE>.service
# systemctl stop pki-tomcatd-nuxwdog@rhcs10-<INSTANCE>.service
Copy to Clipboard Copied! Toggle word wrap Toggle overflow In the
CS.cfg
, please add the RHCS instance’s subsystem certificate nickname tointernaldb.ldapauth.clientCertNickname
, and remove the two unused entries:internaldb.ldapauth.bindDN internaldb.ldapauth.bindPWPrompt
internaldb.ldapauth.bindDN internaldb.ldapauth.bindPWPrompt
Copy to Clipboard Copied! Toggle word wrap Toggle overflow As shown below:
Restart the CS instance:
pki-server start rhcs10-<INSTANCE>
# pki-server start rhcs10-<INSTANCE>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow OR if using the Nuxwdog watchdog:
systemctl start pki-tomcatd-nuxwdog@rhcs10-<INSTANCE>.service
# systemctl start pki-tomcatd-nuxwdog@rhcs10-<INSTANCE>.service
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
You must configure the internaldb.basedn
and internaldb.database
parameters to match your specific LDAP instance.
For compliance, internaldb.ldapauth.authtype=SslClientAuth
and internaldb.ldapconn.secureConn=true
must be set, and the value of the internaldb.ldapauth.clientCertNickname
must match the nickname of the TLS client certificate to authenticate against LDAP with in the nssdb.
All other values can be changed as desired to reflect your environment or availability needs.
7.13.14. Update the supported_groups TLS extension Copiar o linkLink copiado para a área de transferência!
The Protection Profile for Certification Authorities Version 2.1 does not allow the newer (and more secure) named groups for TLS key exchange. In order to meet this requirement, the below procedure describes how to disable these groups:
-
First by constructing a set of policies based on an existing one (
/usr/share/crypto-policies/FIPS.pol
) with the necessary modifications. This will result in updates to another configuration file (/etc/crypto-policies/back-ends/nss.config
) accordingly. -
Followed by instructions on how to further tailor the resulting changed configuration file (
/etc/crypto-policies/back-ends/nss.config
) to achieve the needed result.
Do not execute the steps in this section until you have installed all desired CS instances. Once you have executed the steps in this section, if more CS instances are to be installed later, you will need to revert the changes before proceeding:
update-crypto-policies --set FIPS
# update-crypto-policies --set FIPS
Procedure
Shut down all Certificate System servers. For example:
pki-server stop rhcs10-<INSTANCE>
# pki-server stop rhcs10-<INSTANCE>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow OR if using the Nuxwdog watchdog:
systemctl stop pki-tomcatd-nuxwdog@rhcs10-<INSTANCE>.service
# systemctl stop pki-tomcatd-nuxwdog@rhcs10-<INSTANCE>.service
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Find out which file the system is basing its policies on:
update-crypto-policies --show
# update-crypto-policies --show
Copy to Clipboard Copied! Toggle word wrap Toggle overflow If you followed the installation procedure, you should see "FIPS" as the command output.
Copy the current policies to our new custom policy file, for modifications:
cp /usr/share/crypto-policies/policies/FIPS.pol /etc/crypto-policies/policies/CC-FIPS.pol
# cp /usr/share/crypto-policies/policies/FIPS.pol /etc/crypto-policies/policies/CC-FIPS.pol
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Edit the custom policy file, for example:
vi /etc/crypto-policies/policies/CC-FIPS.pol
# vi /etc/crypto-policies/policies/CC-FIPS.pol
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Make the following modifications, then save the file:
Change the assignment of the
groups
parameter from:group = SECP256R1 SECP384R1 SECP521R1 \ FFDHE-2048 FFDHE-3072 FFDHE-4096 FFDHE-6144 FFDHE-8192
group = SECP256R1 SECP384R1 SECP521R1 \ FFDHE-2048 FFDHE-3072 FFDHE-4096 FFDHE-6144 FFDHE-8192
Copy to Clipboard Copied! Toggle word wrap Toggle overflow to
group = SECP256R1 SECP384R1 SECP521R1
group = SECP256R1 SECP384R1 SECP521R1
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Change the assignment of the
key_exchange
parameter from:key_exchange = ECDHE DHE DHE-RSA PSK DHE-PSK ECDHE-PSK
key_exchange = ECDHE DHE DHE-RSA PSK DHE-PSK ECDHE-PSK
Copy to Clipboard Copied! Toggle word wrap Toggle overflow to
key_exchange = ECDHE DHE PSK DHE-PSK ECDHE-PSK
key_exchange = ECDHE DHE PSK DHE-PSK ECDHE-PSK
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Change the assignment of the
min_dh_size
parameter frommin_dh_size = 2048
min_dh_size = 2048
Copy to Clipboard Copied! Toggle word wrap Toggle overflow to
min_dh_size = 176384
min_dh_size = 176384
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Register the custom site policy:
update-crypto-policies --set CC-FIPS
# update-crypto-policies --set CC-FIPS
Copy to Clipboard Copied! Toggle word wrap Toggle overflow The
nss.config
file will reflect the changes after theupdate_crypto-policies -set
call to the custom policy file.
The second part of this procedure consists in further required changes to thenss.config
file.Edit the
nss.config
file, for example:vi /etc/crypto-policies/back-ends/nss.config
# vi /etc/crypto-policies/back-ends/nss.config
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Under the assignment for the
config
parameter, in theallow=
string, insert the following string directly after thedtls-version-min=dtls1.2
setting:tls-version-max=tls1.2:dtls-version-max=dtls1.2
tls-version-max=tls1.2:dtls-version-max=dtls1.2
Copy to Clipboard Copied! Toggle word wrap Toggle overflow The resulting
config
line should look like the following:config="disallow=ALL allow=HMAC-SHA256:HMAC-SHA1:HMAC-SHA384:HMAC-SHA512:SECP256R1:SECP384R1:SECP521R1:aes256-gcm:aes256-cbc:aes128-gcm:aes128-cbc:SHA256:SHA384:SHA512:SHA224:ECDHE-RSA:ECDHE-ECDSA:tls-version-min=tls1.2:dtls-version-min=dtls1.2:tls-version-max=tls1.2:dtls-version-max=dtls1.2:DH-MIN=176384:DSA-MIN=2048:RSA-MIN=2048"
config="disallow=ALL allow=HMAC-SHA256:HMAC-SHA1:HMAC-SHA384:HMAC-SHA512:SECP256R1:SECP384R1:SECP521R1:aes256-gcm:aes256-cbc:aes128-gcm:aes128-cbc:SHA256:SHA384:SHA512:SHA224:ECDHE-RSA:ECDHE-ECDSA:tls-version-min=tls1.2:dtls-version-min=dtls1.2:tls-version-max=tls1.2:dtls-version-max=dtls1.2:DH-MIN=176384:DSA-MIN=2048:RSA-MIN=2048"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Start or restart any nss-based applications / servers / clients to see the changes apply. For example:
pki-server start rhcs10-RSA-RootCA
# pki-server start rhcs10-RSA-RootCA
Copy to Clipboard Copied! Toggle word wrap Toggle overflow pki-server restart rhcs10-RSA-SubCA
# pki-server restart rhcs10-RSA-SubCA
Copy to Clipboard Copied! Toggle word wrap Toggle overflow …
OR if using the Nuxwdog Watchdog:
systemctl start pki-tomcatd-nuxwdog@rhcs10-RSA-RootCA.service
# systemctl start pki-tomcatd-nuxwdog@rhcs10-RSA-RootCA.service
Copy to Clipboard Copied! Toggle word wrap Toggle overflow systemctl restart pki-tomcatd-nuxwdog@rhcs10-RSA-SubCA.service
# systemctl restart pki-tomcatd-nuxwdog@rhcs10-RSA-SubCA.service
Copy to Clipboard Copied! Toggle word wrap Toggle overflow systemctl restart pki-tomcatd-nuxwdog@rhcs10-RSA-OCSP-rootca.service
# systemctl restart pki-tomcatd-nuxwdog@rhcs10-RSA-OCSP-rootca.service
Copy to Clipboard Copied! Toggle word wrap Toggle overflow systemctl restart pki-tomcatd-nuxwdog@rhcs10-RSA-OCSP-subca.service
# systemctl restart pki-tomcatd-nuxwdog@rhcs10-RSA-OCSP-subca.service
Copy to Clipboard Copied! Toggle word wrap Toggle overflow systemctl restart pki-tomcatd-nuxwdog@rhcs10-RSA-KRA.service
# systemctl restart pki-tomcatd-nuxwdog@rhcs10-RSA-KRA.service
Copy to Clipboard Copied! Toggle word wrap Toggle overflow …
7.13.15. Enabling the access banner Copiar o linkLink copiado para a área de transferência!
To enable or disable the access banner on rhcs10.example.com:
-
Enable the banner by creating the
/etc/pki/instance_name/banner.txt
file and entering the text to be displayed. The banner text must use the UTF-8 format. If you need to disable the existing access banner, either delete or rename the
/etc/pki/instance_name/banner.txt
file. For example:mv /etc/pki/instance_name/banner.txt /etc/pki/instance_name/banner.txt.UNUSED
# mv /etc/pki/instance_name/banner.txt /etc/pki/instance_name/banner.txt.UNUSED
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification:
Validate that the banner does not contain invalid characters:
pki-server banner-validate -i instance_name
# pki-server banner-validate -i instance_name --------------- Banner is valid ---------------
Copy to Clipboard Copied! Toggle word wrap Toggle overflow To display the currently configured banner:
pki-server banner-show -i instance_name
# pki-server banner-show -i instance_name
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
7.13.16. Determining the product version Copiar o linkLink copiado para a área de transferência!
The Red Hat Certificate System product version is stored in the /usr/share/pki/CS_SERVER_VERSION
file.
To display the version of an installed Red Hat Certificate System server:
cat /usr/share/pki/CS_SERVER_VERSION Red Hat Certificate System 10.4.3
# cat /usr/share/pki/CS_SERVER_VERSION
Red Hat Certificate System 10.4.3
Once you have a server installed and running, you can find the product version for each instance by accessing the following URLs from your browser:
-
http://host_name:port_number/ca/admin/ca/getStatus
-
http://host_name:port_number/kra/admin/kra/getStatus
-
http://host_name:port_number/ocsp/admin/ocsp/getStatus
-
http://host_name:port_number/tks/admin/tks/getStatus
-
http://host_name:port_number/tps/admin/tps/getStatus
Note that each component is a separate package and thus could have a separate version number. The above will show the version number for each currently running component.