Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.
13.5. Configuring the LDAP Database
The Certificate System performs certificate- and key-management functions in response to the requests it receives. These functions include the following:
- Storing and retrieving certificate requests
- Storing and retrieving certificate records
- Storing CRLs
- Storing ACLs
- Storing privileged user and role information
- Storing and retrieving end users' encryption private key records
To fulfill these functions, the Certificate System is incorporated with a Red Hat Directory Server, referred to as the internal database or local database. The Directory Server is referenced as part of the Certificate System configuration; when the Certificate System subsystem is configured, a new database is created within the Directory Server. This database is used as an embedded database exclusively by the Certificate System instance and can be managed using directory management tools that come with the Directory Server.
The Certificate System instance database is listed with the other Directory Server databases in the serverRoot
/slapd-
DS_name/db/
directory. These databases are named by the value determined by the value of the pki_ds_database
variable under the specified subsystem section within the /etc/pki/default.cfg
file (CS_instance_name-CA, CS_instance_name-KRA, CS_instance_name-OCSP, CS_instance_name-TKS, and CS_instance_name-TPS by default), which is the default format given during the instance configuration. For example, for a Certificate Manager named ca1
, the database name would be ca1-CA
. Similarly, the database name is determined by the value of the pki_ds_base_dn
variable under the specified subsystem section within the /etc/pki/default.cfg
file ((o=CS_instance_name-CA, o=CS_instance_name-KRA, o=CS_instance_name-OCSP, o=CS_instance_name-TKS, or o=CS_instance_name-TPS by default), and is also set during the configuration.
The subsystems use the database for storing different objects. A Certificate Manager stores all the data, certificate requests, certificates, CRLs, and related information, while a KRA only stores key records and related data.
Warning
The internal database schema are configured to store only Certificate System data. Do not make any changes to it or configure the Certificate System to use any other LDAP directory. Doing so can result in data loss.
13.5.1. Changing the Internal Database Configuration Link kopierenLink in die Zwischenablage kopiert!
Link kopierenLink in die Zwischenablage kopiert!
To change the Directory Server instance that a subsystem instance uses as its internal database:
- Log into the subsystem administrative console.
pkiconsole https://server.example.com:admin_port/subsystem_type
pkiconsole https://server.example.com:admin_port/subsystem_type
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - In the Configuration tab, select the Internal Database tab.
- Change the Directory Server instance by changing the hostname, port, and bind DN fields.The hostname is the fully qualified hostname of the machine on which the Directory Server is installed, such as
certificates.example.com
. The Certificate System uses this name to access the directory.By default, the hostname of the Directory Server instance used as the internal database is shown aslocalhost
instead of the actual hostname. This is done to insulate the internal database from being visible outside the system since a server onlocalhost
can only be accessed from the local machine. Thus, the default configuration minimizes the risk of someone connecting to this Directory Server instance from outside the local machine.The hostname can be changed to something other thanlocalhost
if the visibility of the internal database can be limited to a local subnet. For example, if the Certificate System and Directory Server are installed on separate machines for load balancing, specify the hostname of the machine in which the Directory Server is installed.The port number is the TCP/IP port used for non-SSL communications with the Directory Server.The DN should be the Directory Manager DN. The Certificate System subsystem uses this DN when it accesses the directory tree to communicate with the directory. - Click.The configuration is modified. If the changes require restarting the server, a prompt appears with that message. In that case, restart the server.
13.5.2. Using a Certificate Issued by Certificate System in Directory Server Link kopierenLink in die Zwischenablage kopiert!
Link kopierenLink in die Zwischenablage kopiert!
To use an encrypted connection to Directory Server when you installed Certificate System, it was necessary to either use a certificate issued by an external Certificate Authority (CA) or a self-signed certificate. However, after setting up the Certificate System CA, administrators often want to replace this certificate with one issued by Certificate System.
To replace the TLS certificate used by Directory Server with a certificate issued by Certificate System:
- On the Directory Server host:
- Stop the Directory Server instance:
systemctl stop dirsrv@instance_name
# systemctl stop dirsrv@instance_name
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Generate a Certificate Signing Request (CSR).For example, to generate a CSR which uses 2048 bit RSA encryption, and to store it in the
~/ds.csr
file:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Start the Directory Server instance to enable the CA to process the request:
systemctl start dirsrv@instance_name
# systemctl start dirsrv@instance_name
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Submit the CSR to the Certificate System's CA. For example:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
- On the Certificate System host:
- Import the CA agent certificate into a Network Security Services (NSS) database to sign the CMC full request:
- Create a new directory. For example:
mkdir ~/certs_db/
# mkdir ~/certs_db/
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Initialize the database in the newly created directory:
certutil -N -d ~/certs_db/
# certutil -N -d ~/certs_db/
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Display the serial number of the CA signing certificate:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Use the serial number from the previous step to download the CA signing certificate into the
~/certs_db/CA.pem
file:pki -p 8080 ca-cert-show 0x87bbe2d --output ~/certs_db/CA.pem
# pki -p 8080 ca-cert-show 0x87bbe2d --output ~/certs_db/CA.pem
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Import the CA signing certificate into the NSS database:
pki -d ~/certs_db/ -c password client-cert-import "CA Certificate" --ca-cert ~/certs_db/CA.pem
# pki -d ~/certs_db/ -c password client-cert-import "CA Certificate" --ca-cert ~/certs_db/CA.pem
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Import the agent certificate:
pk12util -d ~/certs_db/ -i ~/.dogtag/instance_name/ca_admin_cert.p12
# pk12util -d ~/certs_db/ -i ~/.dogtag/instance_name/ca_admin_cert.p12 Enter Password or Pin for "NSS FIPS 140-2 Certificate DB": password Enter password for PKCS12 file: password pk12util: PKCS12 IMPORT SUCCESSFUL
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
- Create the Certificate Management over CMS (CMC) request:
- Create a configuration file, such as
~/sslserver-cmc-request.cfg
, with the following content:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Create the CMC request:
CMCRequest ~/sslserver-cmc-request.cfg
# CMCRequest ~/sslserver-cmc-request.cfg ... The CMC enrollment request in base-64 encoded format: ... The CMC enrollment request in binary format is stored in ~/sslserver-cmc-request.bin
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
- Submit the CMC request:
- Create a configuration file, such as
~/sslserver-cmc-submit.cfg
, with the following content:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Submit the request:
HttpClient sslserver-cmc-submit.cfg
# HttpClient sslserver-cmc-submit.cfg ... The response in binary format is stored in ~/sslserver-cmc-response.bin
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Optionally, verify the result:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
- Display the serial number of the Directory Server certificate:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Use the serial number from the previous step to download the certificate:
pki -p 8080 ca-cert-show 0xc3eeb0c --output ~/ds.crt
# pki -p 8080 ca-cert-show 0xc3eeb0c --output ~/ds.crt
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Copy the certificate for Directory Server and the CA certificate to the Directory Server host. For example:
scp ~/ds.crt ~/certs_db/CA.pem ds.example.com:~/
# scp ~/ds.crt ~/certs_db/CA.pem ds.example.com:~/
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Stop Certificate System:
systemctl stop pki-tomcatd@instance_name.service
# systemctl stop pki-tomcatd@instance_name.service
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
- On the Directory Server host:
- Stop the Directory Server instance:
systemctl stop dirsrv@instance_name
# systemctl stop dirsrv@instance_name
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Replace the certificates. For details, see the corresponding sections in the Red Hat Directory Server Administration Guide:
- Remove the old certificate and CA certificate. See Removing a Certificate.
- Install the CA certificate issued by Certificate System. See Installing a CA Certificate.
- Install the certificate for Directory Server issued by Certificate System. See Installing a Certificate.
- Start the Directory Server instance:
systemctl start dirsrv@instance_name
# systemctl start dirsrv@instance_name
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
- Start Certificate System:
systemctl stop pki-tomcatd@instance_name.service
# systemctl stop pki-tomcatd@instance_name.service
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Optionally, configure certificate-based authentication. For details, see Section 13.5.3, “Enabling SSL/TLS Client Authentication with the Internal Database”.
13.5.3. Enabling SSL/TLS Client Authentication with the Internal Database Link kopierenLink in die Zwischenablage kopiert!
Link kopierenLink in die Zwischenablage kopiert!
Client authentication allows one entity to authenticate to another entity by presenting a certificate. This method of authentication is used by Certificate System agents to log into agent services pages, for example.
To use an SSL/TLS connection between a Certificate System instance and the LDAP directory instance that it uses as its internal database, client authentication must be enabled to allow the Certificate System instance to authenticate and bind to the LDAP directory.
There are two parts to setting up client authentication. The first is configuring the LDAP directory, such as setting up SSL/TLS and setting ACIs to control the Certificate System instance access. The second is creating a user on the Certificate System instance which it will use to bind to the LDAP directory and setting up its certificate.
To configure LDAPS for a PKI instance, see the pkispawn(8) man page (Example: Installing a PKI subsystem with a secure LDAP connection).
13.5.4. Restricting Access to the Internal Database Link kopierenLink in die Zwischenablage kopiert!
Link kopierenLink in die Zwischenablage kopiert!
The Red Hat Directory Server Console displays an entry or icon for the Directory Server instance that the Certificate System uses as its internal database.
Unlike the Certificate System Console, in which access is restricted to users with Certificate System administrator privileges, the Directory Server Console can be accessed by any user. The user can open the Directory Server Console for the internal database and change to the data stored there, such as deleting users from the Certificate System administrators group or adding his own entry to the group.
Access can be restricted to the internal database to only those users who know the Directory Manager DN and password. This password can be changed by modifying the single sign-on password cache.
- Log into the Directory Server Console.
- Select the Certificate System internal database entry, and click.
- Select the Configuration tab.
- In the navigation tree, expand Plug-ins, and select Pass-Through Authentication.
- In the right pane, deselect the Enable plugin checkbox.
- Click.The server prompts to restart the server.
- Click the Tasks tab, and click .
- Close the Directory Server Console.
- When the server is restarted, open the Directory Server Console for the internal database instance.The Login to Directory dialog box appears; the Distinguished Name field displays the Directory Manager DN; enter the password.The Directory Server Console for the internal database opens only if the correct password is entered.