Planning, Installation, and Deployment Guide (Common Criteria Edition)


Red Hat Certificate System 10

Red Hat Certificate System 10.4 Common Criteria Edition

Red Hat Customer Content Services

Abstract

This guide contains documentation about understanding, installing, and configuring Red Hat Certificate System 10.4 in a Common Criteria environment.

Preface

Copyright © 2024 Red Hat, Inc.

The text of and illustrations in this document are licensed by Red Hat under a Creative Commons Attribution–Share Alike 3.0 Unported license ("CC-BY-SA"). An explanation of CC-BY-SA is available at http://creativecommons.org/licenses/by-sa/3.0/. In accordance with CC-BY-SA, if you distribute this document or an adaptation of it, you must provide the URL for the original version.

Red Hat, as the licensor of this document, waives the right to enforce, and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent permitted by applicable law.

Red Hat, Red Hat Enterprise Linux, the Shadowman logo, the Red Hat logo, JBoss, OpenShift, Fedora, the Infinity logo, and RHCE are trademarks of Red Hat, Inc., registered in the United States and other countries.

Linux ® is the registered trademark of Linus Torvalds in the United States and other countries.

Java ® is a registered trademark of Oracle and/or its affiliates.

XFS ® is a trademark of Silicon Graphics International Corp. or its subsidiaries in the United States and/or other countries.

MySQL ® is a registered trademark of MySQL AB in the United States, the European Union and other countries.

Node.js ® is an official trademark of Joyent. Red Hat is not formally related to or endorsed by the official Joyent Node.js open source or commercial project.

The OpenStack ® Word Mark and OpenStack logo are either registered trademarks/service marks or trademarks/service marks of the OpenStack Foundation, in the United States and other countries and are used with the OpenStack Foundation’s permission. We are not affiliated with, endorsed or sponsored by the OpenStack Foundation, or the OpenStack community.

All other trademarks are the property of their respective owners.

Abstract

This guide contains documentation about understanding, installing, and configuring Red Hat Certificate System 10.4.3 in a Common Criteria environment.

This part provides an overview of Certificate System, including general PKI principles and specific features of Certificate System and its subsystems. Planning a deployment is vital to designing a PKI infrastructure that adequately meets the needs of your organization.

Chapter 1. About this guidance document

This guide contains documentation about understanding, installing, and configuring Red Hat Certificate System. It is structured into the following parts:

Part I, “Part I: Planning how to deploy Red Hat Certificate System”

Part II, “Part II: Installing Red Hat Certificate System”

Part III, “Part III: Configuring Red Hat Certificate System”

Chapter 16, Uninstalling Certificate System subsystems

Note

Administrators not familiar with Red Hat Certificate System are strongly encouraged to read Part I, “Part I: Planning how to deploy Red Hat Certificate System” for a good understanding of Certificate System and plan ahead accordingly before following Part II, “Part II: Installing Red Hat Certificate System”.

Chapter 2, Introduction to Red Hat Certificate System provides a topical overview of several different parts of Certificate System. Chapter 4, Supported platforms lists various components and their supported version by Red Hat. Chapter 5, Planning the Certificate System contains helpful information for planning a Red Hat Certificate System installation.

Refer to Chapter 3, Supported Standards and Protocols for a list of compliant and supported standards and protocols.

To install Red Hat Certificate System in a compliant manner, follow the instructions in Part II, “Part II: Installing Red Hat Certificate System”. Begin with Chapter 6, Prerequisites for installation to prepare the base operating system. Follow Section 7.2, “Installing RHCS using the pkispawn utility”. Afterwards, follow the required post-installation steps in Section 7.13, “Post-installation” to ensure the complete installation is compliant. This last section links you to relevant parts of the guide which explains the steps to perform for full compliance.

Important

If installation fails during the pkispawn phase (discussed in Section 7.2, “Installing RHCS using the pkispawn utility”), it is suggested to check your configuration carefully for mistakes and refer to the error logs. Prior to re-running the pkispawn utility to retry the installation, it is necessary to fully remove the old instance. Refer to Section 16.1, “Removing a subsystem” for information about removing subsystems.

For a more complete list of configuration options that are supported and compliant, refer to Part III, “Part III: Configuring Red Hat Certificate System”. This part can only be followed after the installation is complete.

Every common PKI operation, such as issuing, renewing, and revoking certificates; archiving and recovering keys; publishing CRLs and verifying certificate status, is carried out by interoperating subsystems within Red Hat Certificate System. The functions of each individual subsystem and the way that they work together to establish a robust and local PKI is described in this chapter.

2.1. A review of Certificate System subsystems

Red Hat Certificate System provides five different subsystems, each focusing on different aspects of a PKI deployment:

  • A certificate authority called Certificate Manager. The CA is the core of the PKI; it issues and revokes all certificates. The Certificate Manager is also the core of the Certificate System. By establishing a security domain of trusted subsystems, it establishes and manages relationships between the other subsystems.
  • A key recovery authority (KRA). Certificates are created based on a specific and unique key pair. If a private key is ever lost, then the data which that key was used to access (such as encrypted emails) is also lost because it is inaccessible. The KRA stores key pairs, so that a new, identical certificate can be generated based on recovered keys, and all of the encrypted data can be accessed even after a private key is lost or damaged.

    Note

    In previous versions of Certificate System, KRA was also referred to as the data recovery manager (DRM). Some code, configuration file entries, web panels, and other resources might still use the term DRM instead of KRA.

  • An online certificate status protocol (OCSP) responder. The OCSP verifies whether a certificate is valid and not expired. This function can also be done by the CA, which has an internal OCSP service, but using an external OCSP responder lowers the load of the issuing CA.
  • A token key service (TKS). The TKS derives keys based on the token CCID, private information, and a defined algorithm. These derived keys are used by the TPS to format tokens and enroll certificates on the token.
  • A token processing system (TPS). The TPS interacts directly with external tokens, like smart cards, and manages the keys and certificates on those tokens through a local client, the Enterprise Security Client (ESC). The ESC contacts the TPS when there is a token operation, and the TPS interacts with the CA, KRA, or TKS, as required, then send the information back to the token by way of the Enterprise Security Client.

Even with all possible subsystems installed, the core of the Certificate System is still the CA (or CAs), since they ultimately process all certificate-related requests. The other subsystems connect to the CA or CAs likes spokes in a wheel. These subsystems work together, in tandem, to create a public key infrastructure (PKI). Depending on what subsystems are installed, a PKI can function in one (or both) of two ways:

  • A token management system or TMS environment, which manages smart cards. This requires a CA, TKS, and TPS, with an optional KRA for server-side key generation.
  • A traditional non token management system or non-TMS environment, which manages certificates used in an environment other than smart cards, usually in software databases. At a minimum, a non-TMS requires only a CA, but a non-TMS environment can use OCSP responders and KRA instances as well.
Note

Red Hat Certificate System includes Technology Preview code (e.g., EST). This early access to upcoming product functionality is not evaluated and not to be used in the evaluated configuration.

2.2. Overview of Certificate System subsystems

2.2.1. Separate versus shared instances

Red Hat Certificate System supports deployment of separate PKI instances for all subsystems:

  • Separate PKI instances run as a single Java-based Apache Tomcat instance.
  • Separate PKI instances contain a single PKI subsystem (CA, KRA, OCSP, TKS, or TPS).
  • Separate PKI instances must utilize unique ports if co-located on the same physical machine or virtual machine (VM).

Alternatively, Certificate System supports deployment of a shared PKI instance:

  • Shared PKI instances also run as a single Java-based Apache Tomcat instance.
  • Shared PKI instances that contain a single PKI subsystem are identical to a separate PKI instance.
  • Shared PKI instances may contain any combination of up to one of each type of PKI subsystem:

    • CA only
    • TKS only
    • CA and KRA
    • CA and OCSP
    • TKS and TPS
    • CA, KRA, TKS, and TPS
    • CA, KRA, OCSP, TKS, and TPS
    • etc.
  • Shared PKI instances allow all of their subsystems contained within that instance to share the same ports.
  • Shared PKI instances must utilize unique ports if more than one is co-located on the same physical machine or VM.

2.2.2. Instance installation prerequisites

2.2.2.1. Directory Server instance availability

Prior to installation of a Certificate System instance, a local or remote Red Hat Directory Server LDAP instance must be available. For instructions on installing Red Hat Directory Server, see the Red Hat Directory Server Installation Guide.

2.2.2.2. PKI packages

Red Hat Certificate System is composed of packages listed below:

  • The following base packages form the core of Certificate System and are available in base Red Hat Enterprise Linux repositories:

    • pki-core

      • pki-base
      • pki-base-java
      • pki-ca
      • pki-javadoc
      • pki-kra
      • pki-server
      • pki-symkey
      • pki-tools
  • The packages listed below are not available in the base Red Hat Enterprise Linux subscription channel. To install these packages, you must attach a Red Hat Certificate System subscription pool and enable the RHCS repository. For more information, see Section 6.2, “Enabling the repositories”.

    • pki-core

      • pki-console
      • pki-ocsp
      • pki-tks
      • pki-tps
    • redhat-pki

      • redhat-pki: contains all the packages of the pki-core module. If you wish to pick redhat-pki packages individually, it is advised to disable the pki-core module.
      • redhat-pki-console-theme
      • redhat-pki-server-theme

Use a Red Hat Enterprise Linux 8 system (optionally, use one that has been configured with a supported Hardware Security Module listed in Chapter 4, Supported platforms), and make sure that all packages are up to date before installing Red Hat Certificate System.

To install all Certificate System packages (with the exception of pki-javadoc), use dnf to install the redhat-pki metapackage:

# dnf install redhat-pki

Alternatively, you can install one or more of the top level PKI subsystem packages as required; see the list above for exact package names. If you use this approach, make sure to also install the redhat-pki-server-theme package, and optionally redhat-pki-console-theme and pki-console to use the PKI Console.

Finally, developers and administrators may also want to install the JSS and PKI javadocs (the jss-javadoc and pki-javadoc).

Note

The jss-javadoc package requires you to enable the Server-Optional repository in Subscription Manager.

2.2.2.3. Instance installation and configuration

The pkispawn command line tool is used to install and configure a new PKI instance. It eliminates the need for separate installation and configuration steps, and may be run either interactively, as a batch process, or a combination of both (batch process with prompts for passwords). The utility does not provide a way to install or configure the browser-based graphical interface.

For usage information, use the pkispawn --help command.

The pkispawn command:

  1. Reads in its default name=value pairs from a plain text configuration file (/etc/pki/default.cfg).
  2. Interactively or automatically overrides any pairs as specified and stores the final result as a Python dictionary.
  3. Executes an ordered series of scriptlets to perform subsystem and instance installation.
  4. The configuration scriptlet packages the Python dictionary as a JavaScript Object Notation (JSON) data object, which is then passed to the Java-based configuration servlet.
  5. The configuration servlet utilizes this data to configure a new PKI subsystem, and then passes control back to the pkispawn executable, which finalizes the PKI setup. A copy of the final deployment file is stored in /var/lib/pki/instance_name/<subsystem>/registry/<subsystem>/deployment.cfg

See the pkispawn man page for additional information.

The default configuration file, /etc/pki/default.cfg, is a plain text file containing the default installation and configuration values which are read at the beginning of the process described above. It consists of name=value pairs divided into [DEFAULT], [Tomcat], [CA], [KRA], [OCSP], [TKS], and [TPS] sections.

If you use the -s option with pkispawn and specify a subsystem name, then only the section for that subsystem will be read.

The sections have a hierarchy: a name=value pair specified in a subsystem section will override the pair in the [Tomcat] section, which in turn override the pair in the [DEFAULT] section. Default pairs can further be overriden by interactive input, or by pairs in a specified PKI instance configuration file.

Note

Whenever non-interactive files are used to override default name=value pairs, they may be stored in any location and specified at any time. These files are referred to as myconfig.txt in the pkispawn man pages, but they are also often referred to as .ini files, or more generally as PKI instance configuration override files.

See the pki_default.cfg man page for more information.

The Configuration Servlet consists of Java bytecode stored in /usr/share/java/pki/pki-certsrv.jar as com/netscape/certsrv/system/ConfigurationRequest.class. The servlet processes data passed in as a JSON object from the configuration scriptlet using pkispawn, and then returns to pkispawn using Java bytecode served in the same file as com/netscape/certsrv/system/ConfigurationResponse.class.

An example of an interactive installation only involves running the pkispawn command on a command line as root:

# pkispawn
Important

Interactive installation currently only exists for very basic deployments. For example, deployments intent upon using advanced features such as cloning, Elliptic Curve Cryptography (ECC), external CA, Hardware Security Module (HSM), subordinate CA, and others, must provide the necessary override parameters in a separate configuration file.

A non-interactive installation requires a PKI instance configuration override file, and the process may look similar to the following example:

  1. Create the pki directory:

    # mkdir -p /root/pki
  2. Use a text editor such as vim to create a configuration file named /root/pki/ca.cfg with the following contents:

    [DEFAULT]
    pki_admin_password=<password>
    pki_client_pkcs12_password=<password>
    pki_ds_password=<password>
  3. # pkispawn -s CA -f /root/pki/ca.cfg

See the pkispawn man page for various configuration examples.

2.2.2.4. Instance removal

To remove an existing PKI instance, use the pkidestroy command. It can be run interactively or as a batch process. Use pkidestroy -h to display detailed usage inforamtion on the command line.

The pkidestroy command reads in a PKI subsystem deployment configuration file which was stored when the subsystem was created (/var/lib/pki/instance_name/<subsystem>/registry/<subsystem>/deployment.cfg), uses the read-in file in order to remove the PKI subsystem, and then removes the PKI instance if it contains no additional subsystems. See the pkidestroy man page for more information.

An interactive removal procedure using pkidestroy may look similar to the following:

# pkidestroy

Subsystem (CA/KRA/OCSP/TKS/TPS) [CA]:
Instance [pki-tomcat]:

Begin uninstallation (Yes/No/Quit)? Yes

Log file: /var/log/pki/pki-ca-destroy.20150928183547.log
Loading deployment configuration from /var/lib/pki/pki-tomcat/ca/registry/ca/deployment.cfg.
Uninstalling CA from /var/lib/pki/pki-tomcat.
rm '/etc/systemd/system/multi-user.target.wants/pki-tomcatd.target'

Uninstallation complete.

A non-interactive removal procedure may look similar to the following example:

# pkidestroy -s CA -i pki-tomcat

Log file: /var/log/pki/pki-ca-destroy.20150928183159.log
Loading deployment configuration from /var/lib/pki/pki-tomcat/ca/registry/ca/deployment.cfg.
Uninstalling CA from /var/lib/pki/pki-tomcat.
rm '/etc/systemd/system/multi-user.target.wants/pki-tomcatd.target'

Uninstallation complete.

2.2.3. Execution management (systemctl)

Red Hat Certificate System subsystem instances can be stopped and started using the systemctl execution management system tool on Red Hat Enterprise Linux 8:

# systemctl start <unit-file>@instance_name.service
# systemctl status <unit-file>@instance_name.service
# systemctl stop <unit-file>@instance_name.service
# systemctl restart <unit-file>@instance_name.service

<unit-file> has one of the following values:

pki-tomcatd 			With watchdog disabled
pki-tomcatd-nuxwdog 		With watchdog enabled

For more details on the watchdog service, refer to Section 2.3.10, “Passwords and watchdog (nuxwdog)” and Section 9.3.2, “Using the Certificate System watchdog service”.

Note

In RHCS 10, these systemctl actions support the pki-server alias: pki-server <command> subsystem_instance_name is the alias for systemctl <command> pki-tomcatd@<instance>.service.

2.2.3.2. Starting the instance automatically

The systemctl utility in Red Hat Enterprise Linux manages the automatic startup and shutdown settings for each process on the server. This means that when a system reboots, some services can be automatically restarted. System unit files control service startup to ensure that services are started in the correct order. The systemd service and systemctl utility are described in the Configuring basic system settings guide for Red Hat Enterprise Linux 8.

Certificate System instances can be managed by systemctl, so this utility can set whether to restart instances automatically. After a Certificate System instance is created, it is enabled on boot. This can be changed by using systemctl:

# systemctl disable pki-tomcatd@instance_name.service

To re-enable the instance:

# systemctl enable pki-tomcatd@instance_name.service
Note

The systemctl enable and systemctl disable commands do not immediately start or stop Certificate System.

2.2.4.1. The pki-server command line tool

The primary process management tool for Red Hat Certificate System is pki-server. Use the pki-server --help command and see the pki-server man page for usage information.

The pki-server command-line interface (CLI) manages local server instances (for example server configuration or system certificates). Invoke the CLI as follows:

$ pki-server [CLI options] <command> [command parameters]

The CLI uses the configuration files and NSS database of the server instance, therefore the CLI does not require any prior initialization. Since the CLI accesses the files directly, it can only be executed by the root user, and it does not require client certificate. Also, the CLI can run regardless of the status of the server; it does not require a running server.

The CLI supports a number of commands organized in a hierarchical structure. To list the top-level commands, execute the CLI without any additional commands or parameters:

$ pki-server

Some commands have subcommands. To list them, execute the CLI with the command name and no additional options. For example:

$ pki-server ca
$ pki-server ca-audit

To view command usage information, use the --help option:

$ pki-server --help
$ pki-server ca-audit-event-find --help

To enable or disable an installed subsystem, use the pki-server utility.

# pki-server subsystem-disable -i instance_id subsystem_id
# pki-server subsystem-enable -i instance_id subsystem_id

Replace subsystem_id with a valid subsystem identifier: ca, kra, tks, ocsp, or tps.

Note

One instance can have only one of each type of subsystem.

For example, to disable the OCSP subsystem on an instance named pki-tomcat:

# pki-server subsystem-disable -i pki-tomcat ocsp

To list the installed subsystems for an instance:

# pki-server subsystem-find -i instance_id

To show the status of a particular subsystem:

# pki-server subsystem-find -i instance_id subsystem_id
2.2.4.3. The pkidaemon command line tool

Another process management tool for Red Hat Certificate System is the pkidaemon tool:

# pkidaemon {start|status} instance-type [instance_name]
  • pkidaemon status tomcat - Provides status information such as on/off, ports, URLs of each PKI subsystem of all PKI instances on the system.
  • pkidaemon status tomcat instance_name - Provides status information such as on/off, ports, URLs of each PKI subsystem of a specific instance.
  • pkidaemon start tomcat instance_name.service - Used internally using systemctl.

See the pkidaemon man page for additional information.

2.2.4.4. Finding the subsystem web services URLs

The CA, KRA, OCSP, TKS, and TPS subsystems have web services pages for agents, as well as regular users and administrators, when appropriate. These web services can be accessed by opening the URL to the subsystem host over the subsystem’s secure end user’s port. For example, for the CA:

https://server.example.com:8443/ca/services
Note

To get a complete list of all of the interfaces, URLs, and ports for an instance, check the status of the service. For example:

pkidaemon status instance_name

The main web services page for each subsystem has a list of available services pages; these are summarized in the below table. To access any service specifically, access the appropriate port and append the appropriate directory to the URL. For example, to access the CA’s end entities (regular users) web services:

https://server.example.com:8443/ca/ee/ca

If DNS is not configured, then an IPv4 or IPv6 address can be used to connect to the services pages. For example:

https://192.0.2.1:8443/ca/services
https://[2001:DB8::1111]:8443/ca/services
Note

Anyone can access the end user pages for a subsystem. However, accessing agent or admin web services pages requires that an agent or administrator certificate be issued and installed in the web browser. Otherwise, authentication to the web services fails.

Expand
Table 2.1. Default web services pages
PortUsed for SSL/TLSUsed for Client Authentication [a]Web ServicesWeb Service Location

Certificate Manager

8080

No

 

End Entities

ca/ee/ca

8443

Yes

No

End Entities

ca/ee/ca

8443

Yes

Yes

Agents

ca/agent/ca

8443

Yes

No

Services

ca/services

8443

Yes

No

Console

pkiconsole https://host:port/ca

Key Recovery Authority

8080

No

 

End Entities

kra/ee/kra

8443

Yes

No

End Entities

kra/ee/kra

8443

Yes

Yes

Agents

kra/agent/kra

8443

Yes

No

Services

kra/services

8443

Yes

No

Console

pkiconsole https://host:port/kra

Online Certificate Status Manager

8080

No

 

End Entities

ocsp/ee/ocsp

8443

Yes

No

End Entities

ocsp/ee/ocsp

8443

Yes

Yes

Agents

ocsp/agent/ocsp

8443

Yes

No

Services

ocsp/services

8443

Yes

No

Console

pkiconsole https://host:port/ocsp

Token Key Service

8080

No

 

End Entities

tks/ee/tks

8443

Yes

No

End Entities

tks/ee/tks

8443

Yes

Yes

Agents

tks/agent/tks

8443

Yes

No

Services

tks/services

8443

Yes

No

Console

pkiconsole https://host:port/tks

Token Processing System

8080

No

 

Unsecure Services

tps/tps

8443

Yes

 

Secure Services

tps/tps

8080

No

 

Enterprise Security Client Phone Home

tps/phoneHome

8443

Yes

 

Enterprise Security Client Phone Home

tps/phoneHome

8443

Yes

Yes

Admin, Agent, and Operator Services [b]

tps/ui

[a] Services with a client authentication value of No can be reconfigured to require client authentication. Services which do not have either a Yes or No value cannot be configured to use client authentication.
[b] The agent, admin, and operator services are all accessed through the same web services page. Each role can only access specific sections which are only visible to the members of that role.
2.2.4.5. Starting the Certificate System console
Important

This console is being deprecated.

The CA, KRA, OCSP, and TKS subsystems have a Java interface which can be accessed to perform administrative functions. For the KRA, OCSP, and TKS, this includes very basic tasks like configuring logging and managing users and groups. For the CA, this includes other configuration settings such as creating certificate profiles and configuring publishing.

The Console is opened by connecting to the subsystem instance over its SSL/TLS port using the pkiconsole utility. This utility uses the format:

# pkiconsole -d nssdb -n 'optional client cert nickname' https://server.example.com:admin_port/subsystem_type

The subsystem_type can be ca, kra, ocsp, or tks. For example, this opens the KRA console:

# pkiconsole -d nssdb -n 'optional client cert nickname' https://server.example.com:8443/kra

If DNS is not configured, then an IPv4 or IPv6 address can be used to connect to the console. For example:

https://192.0.2.1:8443/ca
https://[2001:DB8::1111]:8443/ca

2.3. Certificate System architecture overview

Although each provides a different service, all Red Hat Certificate System subsystems (CA, KRA, OCSP, TKS, TPS) share a common architecture. The following architectural diagram shows the common architecture shared by all of these subsystems.

2.3.1. Java application server

Java application server is a Java framework to run server applications. The Certificate System is designed to run within a Java application server. Currently the only Java application server supported is Tomcat 8. Support for other application servers may be added in the future. More information can be found at http://tomcat.apache.org/.

Each Certificate System instance is a Tomcat server instance. The Tomcat configuration is stored in server.xml. The following link provides more information about Tomcat configuration: https://tomcat.apache.org/tomcat-8.0-doc/config/.

Each Certificate System subsystem (such as CA or KRA) is deployed as a web application in Tomcat. The web application configuration is stored in a web.xml file, which is defined in Java Servlet 3.1 specification. See https://www.jcp.org/en/jsr/detail?id=340 for details.

The Certificate System configuration itself is stored in CS.cfg.

See Section 2.3.16, “Instance layout” for the actual locations of these files.

2.3.2. Java security manager

recommended box java security manager

Java services have the option of having a Security Manager which defines unsafe and safe operations for applications to perform. When the subsystems are installed, they have the Security Manager enabled automatically, meaning each Tomcat instance starts with the Security Manager running.

The Security Manager is disabled if the instance is created by running pkispawn and using an override configuration file which specifies the pki_security_manager=false option under its own Tomcat section.

The Security Manager can be disabled from an installed instance using the following procedure:

  1. First stop the instance:

    # pki-server stop instance_name

    OR if using the Nuxwdog watchdog:

    # systemctl stop pki-tomcatd-nuxwdog@instance_name.service
  2. Open the /etc/sysconfig/instance_name file, and set SECURITY_MANAGER="false"
  3. After saving, restart the instance:

    # pki-server start instance_name

    OR if using the Nuxwdog watchdog:

    # systemctl start pki-tomcatd-nuxwdog@instance_name.service

When you start or restart an instance, a Java security policy is constructed or reconstructed by pkidaemon from the following files:

/usr/share/pki/server/conf/catalina.policy
/usr/share/tomcat/conf/catalina.policy
/var/lib/pki/$PKI_INSTANCE_NAME/conf/pki.policy
/var/lib/pki/$PKI_INSTANCE_NAME/conf/custom.policy

Then, it is saved into /var/lib/pki/instance_name/conf/catalina.policy.

2.3.3. Interfaces

This section describes the various interfaces of Red Hat Certificate System.

2.3.3.1. Servlet interface

Each subsystem contains interfaces allowing interaction with various portions of the subsystem. All subsystems share a common administrative interface and have an agent interface that allows for agents to perform the tasks assigned to them. A CA Subsystem has an end-entity interface that allows end-entities to enroll in the PKI. An OCSP Responder subsystem has an end-entity interface allowing end-entities and applications to check for current certificate revocation status. Finally, a TPS has an operator interface.

While the application server provides the connection entry points, Certificate System completes the interfaces by providing the servlets specific to each interface.

The servlets for each subsystem are defined in the corresponding web.xml file. The same file also defines the URL of each servlet and the security requirements to access the servlets. See Section 2.3.1, “Java application server” for more information.

2.3.3.2. Administrative interface
recommended box administrative interface

The agent interface provides Java servlets to process HTML form submissions coming from the agent entry point. Based on the information given in each form submission, the agent servlets allow agents to perform agent tasks, such as editing and approving requests for certificate approval, certificate renewal, and certificate revocation, approving certificate profiles. The agent interfaces for a KRA subsystem, or a TKS subsystem, or an OCSP Responder are specific to the subsystems.

In the non-TMS setup, the agent interface is also used for inter-CIMC boundary communication for the CA-to-KRA trusted connection. This connection is protected by SSL client-authentication and differentiated by separate trusted roles called Trusted Managers. Like the agent role, the Trusted Managers (pseudo-users created for inter-CIMC boundary connection only) are required to be SSL client-authenticated. However, unlike the agent role, they are not offered any agent capability.

In the TMS setup, inter-CIMC boundary communication goes from TPS-to-CA, TPS-to-KRA, and TPS-to-TKS.

2.3.3.3. End-entity interface
recommended box end entity interface

For the CA subsystem, the end-entity interface provides Java servlets to process HTML form submissions coming from the end-entity entry point. Based on the information received from the form submissions, the end-entity servlets allow end-entities to enroll, renew certificates, revoke their own certificates, and pick up issued certificates. The OCSP Responder subsystem’s End-Entity interface provides Java servlets to accept and process OCSP requests. The KRA, TKS, and TPS subsystems do not offer any End-Entity services.

2.3.3.4. Operator interface
recommended box operator interface

The operator interface is only found in the TPS subsystem.

2.3.4. REST interface

Representational state transfer (REST) is a way to use HTTP to define and organize web services which will simplify interoperability with other applications. Red Hat Certificate System provides a REST interface to access various services on the server.

The REST services in Red Hat Certificate System are implemented using the RESTEasy framework. RESTEasy is actually running as a servlet in the web application, so the RESTEasy configuration can also be found in the web.xml of the corresponding subsystem. More information about RESTEasy can be found at http://resteasy.jboss.org/.

Each REST service is defined as a separate URL. For example:

  • CA certificate service: http://<host_name>:_<port>_/ca/rest/certs/
  • KRA key service: http://<host_name>:_<port>_/kra/rest/agent/keys/
  • TKS user service: http://<host_name>:_<port>_/tks/rest/admin/users/
  • TPS group service: http://<host_name>:_<port>_/tps/rest/admin/groups/

Some services can be accessed using plain HTTP connection, but some others may require HTTPS connection for security.

The REST operation is specified as HTTP method (for example, GET, PUT, POST, DELETE). For example, to get the CA users the client will send a GET /ca/rest/users request.

The REST request and response messages can be sent in XML or JSON format. For example:

{
	"id":"admin",
	"UserID":"admin",
	"FullName":"Administrator",
	"Email":"admin@example.com",
	...
}

The REST interface can be accessed using tools such as CLI, Web UI, or generic REST client. Certificate System also provides Java, Python, and JavaScript libraries to access the services programmatically.

The REST interface supports two types of authentication methods:

  • user name and password
  • client certificate

The authentication method required by each service is defined in /usr/share/pki/ca/conf/auth-method.properties.

The REST interface may require certain permissions to access the service. The permissions are defined in the ACL resources in LDAP. The REST interface are mapped to the ACL resources in the /usr/share/pki/<subsystem>/conf/acl.properties.

For more information about the REST interface, see http://www.dogtagpki.org/wiki/REST.

2.3.5. JSS

Java Security Services (JSS) provides a Java interface for cryptographic operations performed by NSS. JSS and higher levels of the Certificate System architecture are built with Java Native Interface (JNI), which provides access to native system libraries from within the Java Virtual Machine (JVM). This design allows us to use FIPS approved cryptographic providers such as NSS which are distributed as part of the system. JSS supports most of the security standards and encryption technologies supported by NSS. JSS also provides a pure Java interface for ASN.1 types and BER-DER encoding.

2.3.6. Tomcatjss

Java-based subsystems in Red Hat Certificate System use a single JAR file called tomcatjss as a bridge between the Tomcat Server HTTP engine and JSS, the Java interface for security operations performed by NSS. Tomcatjss is a Java Secure Socket Extension (JSSE) implementation using Java Security Services (JSS) for Tomcat.

Tomcatjss implements the interfaces needed to use TLS and to create TLS sockets. The socket factory, which tomcatjss implements, makes use of the various properties listed below to create a TLS server listening socket and return it to tomcat. Tomcatjss itself, makes use of our java JSS system to ultimately communicate with the native NSS cryptographic services on the machine.

Tomcatjss is loaded when the Tomcat server and the Certificate System classes are loaded. The load process is described below:

  1. The server is started.
  2. Tomcat gets to the point where it needs to create the listening sockets for the Certificate System installation.
  3. The server.xml file is processed. Configuration in this file tells the system to use a socket factory implemented by Tomcatjss.
  4. For each requested socket, Tomcajss reads and processes the included attributes when it creates the socket. The resulting socket will behave as it has been asked to by those parameters.
  5. Once the server is running, we have the required set of listening sockets waiting for incoming connections to the Tomcat-based Certificate System.

Note that when the sockets are created at startup, Tomcatjss is the first entity in Certificate System that actually deals with the underlying JSS security services. Once the first listening socket is processed, an instance of JSS is created for use going forward.

For further details about the server.xml file, see Section 9.4, “Configuration files for the tomcat engine and web services”.

2.3.7. PKCS #11

Public-Key Cryptography Standard (PKCS) #11 specifies an API used to communicate with devices that hold cryptographic information and perform cryptographic operations. Because it supports PKCS #11, Certificate System is compatible with a wide range of hardware and software devices.

At least one PKCS #11 module must be available to any Certificate System subsystem instance. A PKCS #11 module (also called a cryptographic module or cryptographic service provider) manages cryptographic services such as encryption and decryption. PKCS #11 modules are analogous to drivers for cryptographic devices that can be implemented in either hardware or software. Certificate System contains a built-in PKCS #11 module and can support third-party modules.

A PKCS #11 module always has one or more slots which can be implemented as physical hardware slots in a physical reader such as smart cards or as conceptual slots in software. Each slot for a PKCS #11 module can in turn contain a token, which is a hardware or software device that actually provides cryptographic services and optionally stores certificates and keys.

pkcs11

The Certificate System defines two types of tokens, the internal and the external. The internal token is used for storing certificate trust anchors. The external token is used for storing key pairs and certificates that belong to the Certificate System subsystems.

2.3.7.1. NSS soft token (internal token)
Note

Certificate System uses an NSS soft token for storing certificate trust anchors.

NSS Soft Token is also called an internal token or a software token. The software token consists of two files, which are usually called the certificate database (cert9.db) and key database (key4.db). The files are created during the Certificate System subsystem configuration. These security databases are located in the /var/lib/pki/instance_name/alias directory.

Two cryptographic modules provided by the NSS soft token are included in the Certificate System:

  • The default internal PKCS #11 module, which comes with two tokens:

    • The internal crypto services token, which performs all cryptographic operations such as encryption, decryption, and hashing.
    • The internal key storage token ("Certificate DB token"), which handles all communication with the certificate and key database files that store certificates and keys.
  • The FIPS 140 module. This module complies with the FIPS 140 government standard for cryptographic module implementations. The FIPS 140 module includes a single, built-in FIPS 140 certificate database token, which handles both cryptographic operations and communication with the certificate and key database files.

Specific instructions on how to import certificates onto the NSS soft token are in Chapter 10, Managing certificate/key crypto token.

For more information on the Network Security Services (NSS), see Mozilla Developer web pages of the same name.

Note

Certificate System uses an HSM for storing key pairs and certificates that belong to the Certificate System subsystems.

Any PKCS #11 module can be used with the Certificate System. To use an external hardware token with a subsystem, load its PKCS #11 module before the subsystem is configured, and the new token is available to the subsystem.

Available PKCS #11 modules are tracked in the pkcs11.txt database for the subsystem. The modutil utility is used to modify this file when there are changes to the system, such as installing a hardware accelerator to use for signing operations. For more information on modutil, see Network Security Services (NSS) at Mozilla Developer webpage.

PKCS #11 hardware devices also provide key backup and recovery features for the information stored on hardware tokens. Refer to the PKCS #11 vendor documentation for information on retrieving keys from the tokens.

Specific instructions on how to import certificates and to manage the HSM are in Chapter 10, Managing certificate/key crypto token.

Supported Hardware Security Modules are located in Section 4.4, “Supported Hardware Security Modules”.

2.3.8.1. Serial number ranges

Certificate request and serial numbers are represented by Java’s big integers

By default, due to their efficiency, certificate request numbers, certificate serial numbers, and replica IDs are assigned sequentially for CA subsystems.

Serial number ranges are specifiable for requests, certificates, and replica IDs:

  • Current serial number management is based on assigning ranges of sequential serial numbers.
  • Instances request new ranges when crossing below a defined threshold.
  • Instances store information about a newly acquired range once it is assigned to the instance.
  • Instances continue using old ranges until all numbers are exhausted from it, and then it moves to the new range.
  • Cloned subsystems synchronize their range assignment through replication conflicts.

For new clones:

  • Part of the current range of the master is transferred to a new clone in the process of cloning.
  • New clones may request a new range if the transferred range is below the defined threshold.

All ranges are configurable at CA instance installation time by adding a [CA] section to the PKI instance override configuration file, and adding the following name=value pairs under that section as needed. Default values which already exist in /etc/pki/default.cfg are shown in the following example:

[CA]
pki_serial_number_range_start=1
pki_serial_number_range_end=10000000
pki_request_number_range_start=1
pki_request_number_range_end=10000000
pki_replica_number_range_start=1
pki_replica_number_range_end=100
2.3.8.2. Random serial number management

In addition to sequential serial number management, Red Hat Certificate System provides optional random serial number management. Using random serial numbers is selectable at CA instance installation time by adding a [CA] section to the PKI instance override file and adding the following name=value pair under that section:

[CA]
pki_random_serial_numbers_enable=True

If selected, certificate request numbers and certificate serial numbers will be selected randomly within the specified ranges.

2.3.9. Security domain

A security domain is a registry of PKI services. Services such as CAs register information about themselves in these domains so users of PKI services can find other services by inspecting the registry. The security domain service in RHCS manages both the registration of PKI services for Certificate System subsystems and a set of shared trust policies.

See Section 5.3, “Planning security domains” for further details.

2.3.10. Passwords and watchdog (nuxwdog)

In the default setup, an RHCS subsystem instance needs to act as a client and authenticate to some other services, such as an LDAP internal database (unless TLS mutual authentication is set up, where a certificate will be used for authentication instead), the NSS token database, or sometimes an HSM with a password. The administrator is prompted to set up this password at the time of installation configuration. This password is then written to the file <instance_dir>/conf/password.conf. At the same time, an identifying string is stored in the main configuration file CS.cfg as part of the parameter cms.passwordlist.

The configuration file, CS.cfg, is protected by Red Hat Enterprise Linux, and only accessible by the PKI administrators. No passwords are stored in CS.cfg.

During installation, the installer will select and log into either the internal software token or a hardware cryptographic token. The login passphrase to these tokens is also written to password.conf.

Configuration at a later time can also place passwords into password.conf. LDAP publishing is one example where the newly configured Directory Manager password for the publishing directory is entered into password.conf.

Nuxwdog (watchdog) is a lightweight auxiliary daemon process that is used to start, stop, monitor the status of, and reconfigure server programs. It is most useful when users need to be prompted for passwords to start a server, because it caches these passwords securely in the kernel keyring, so that restarts can be done automatically in the case of a server crash.

Note

Nuxwdog is the only allowed watchdog service.

Once installation is complete, it is possible to remove the password.conf file altogether. On restart, the nuxwdog watchdog program will prompt the administrator for the required passwords, using the parameter cms.passwordlist (and cms.tokenList if an HSM is used) as a list of passwords for which to prompt. The passwords are then cached by nuxwdog in the kernel keyring to allow automated recovery from a server crash. This automated recovery (automatic subsystem restart) happens in case of uncontrolled shutdown (crash). In case of a controlled shutdown by the administrator, administrators are prompted for passwords again.

When using the watchdog service, starting and stopping an RHCS instance are done differently. For details, see Section 9.3.2, “Using the Certificate System watchdog service”.

For further information, see Section 9.3, “Managing system passwords”.

2.3.11. Internal LDAP database

Red Hat Certificate System employs Red Hat Directory Server (RHDS) as its internal database for storing information such as certificates, requests, users, roles, ACLs, as well as other miscellaneous internal information. Certificate System communicates with the internal LDAP database either with a password, or securely by means of SSL authentication.

If certificate-based authentication is required between a Certificate System instance and Directory Server, it is important to follow instruction to set up trust between these two entities. Proper pkispawn options will also be needed for installing such Certificate System instance.

For details, see Section 7.1.2, “Installing and configuring the DS instances”.

2.3.12. Security-enhanced Linux (SELinux)

SELinux is a collection of mandatory access control rules which are enforced across a system to restrict unauthorized access and tampering. SELinux is described in more detail in Using SELinux guide for Red Hat Enterprise Linux 8.

Basically, SELinux identifies objects on a system, which can be files, directories, users, processes, sockets, or any other resource on a Linux host. These objects correspond to the Linux API objects. Each object is then mapped to a security context, which defines the type of object and how it is allowed to function on the Linux server.

Objects can be grouped into domains, and then each domain is assigned the proper rules. Each security context has rules which set restrictions on what operations it can perform, what resources it can access, and what permissions it has.

SELinux policies for the Certificate System are incorporated into the standard system SELinux policies. These SELinux policies apply to every subsystem and service used by Certificate System. By running Certificate System with SELinux in enforcing mode, the security of the information created and maintained by Certificate System is enhanced.

Figure 2.1. CA SELinux port policy

selinux port

The Certificate System SELinux policies define the SELinux configuration for every subsystem instance:

  • Files and directories for each subsystem instance are labeled with a specific SELinux context.
  • The ports for each subsystem instance are labeled with a specific SELinux context.
  • All Certificate System processes are constrained within a subsystem-specific domain.
  • Each domain has specific rules that define what actions that are authorized for the domain.
  • Any access not specified in the SELinux policy is denied to the Certificate System instance.

For Certificate System, each subsystem is treated as an SELinux object, and each subsystem has unique rules assigned to it. The defined SELinux policies allow Certificate System objects run with SELinux set in enforcing mode.

Every time pkispawn is run to configure a Certificate System subsystem, files and ports associated with that subsystem are labeled with the required SELinux contexts. These contexts are removed when the particular subsystems are removed using pkidestroy.

The central definition in an SELinux policy is the pki_tomcat_t domain. Certificate System instances are Tomcat servers, and the pki_tomcat_t domain extends the policies for a standard tomcat_t Tomcat domain. All Certificate System instances on a server share the same domain.

When each Certificate System process is started, it initially runs in an unconfined domain (unconfined_t) and then transitions into the pki_tomcat_t domain. This process then has certain access permissions, such as write access to log files labeled pki_tomcat_log_t, read and write access to configuration files labeled pki_tomcat_etc_rw_t, or the ability to open and write to http_port_t ports.

The SELinux mode can be changed from enforcing to permissive, or even off, though this is not recommended.

2.3.13. Self-tests

Red Hat Certificate System provides a Self-Test framework which allows the PKI system integrity to be checked during startup or on demand or both. In the event of a non-critical self test failure, the message will be stored in the log file, while in the event of a critical self test failure, the Certificate System subsystem will record the reasons in the logs and shut down gracefully. The administrator is expected to watch the self-test log during the startup of the subsystem if they wish to see the self-test report during startup. They can also view the log after startup.

When a subsystem is shut down due to a self-test failure, it will also be automatically disabled. This is done to ensure that the subsystem does not partially run and produce misleading responses. Once the issue is resolved, the subsystem can be re-enabled by running the following command on the server:

# pki-server subsystem-enable <subsystem>

For details on how to configure self-tests, see Section 13.3.2, “Configuring self-tests”.

2.3.14. Logs

The Certificate System subsystems create log files that record events related to activities, such as administration, communications using any of the protocols the server supports, and various other processes employed by the subsystems. While a subsystem instance is running, it keeps a log of information and error messages on all the components it manages. Additionally, the Apache and Tomcat web servers generate error and access logs.

Each subsystem instance maintains its own log files for installation, audit, and other logged functions.

Log plugin modules are listeners which are implemented as #Java™ classes and are registered in the configuration framework.

All the log files and rotated log files, except for audit logs, are located in whatever directory was specified in pki_subsystem_log_path when the instance was created with pkispawn. Regular audit logs are located in the log directory with other types of logs, while signed audit logs are written to /var/log/pki/instance_name/subsystem_name/signedAudit. The default location for logs can be changed by modifying the configuration.

For details about log configuration during the installation and additional information, see Chapter 13, Configuring logs.

For details about log administration after the installation, see Chapter 12 Configuring Subsystem Logs in the Administration Guide (Common Criteria Edition).

2.3.14.1. Audit log

The audit log contains records for selectable events that have been set up as recordable events. You can configure audit logs also to be signed for integrity-checking purposes.

Note

Audit records should be kept according to the audit retention rules specified in -Section 13.4, “Audit retention”.

2.3.15. Signed Audit Logs

The Certificate System maintains audit logs for all events, such as requesting, issuing and revoking certificates and publishing CRLs. These logs are then signed. This allows authorized access or activity to be detected. An outside auditor can then audit the system if required. The assigned auditor user account is the only account which can view the signed audit logs. This user’s certificate is used to sign and encrypt the logs. Audit logging is configured to specify the events that are logged.

Signed audit logs are written to /var/log/pki/instance_name/subsystem_name/signedAudit. However, you can change the default location for logs by modifying the configuration.

For more information, see the "Displaying and verifying signed audit logs" in the Planning, Installation and Deployment Guide (Common Criteria Edition).

2.3.15.1. Debug logs

Debug logs, which are enabled by default, are maintained for all subsystems, with varying degrees and types of information.

Debug logs for each subsystem record much more detailed information than system, transaction, and access logs. Debug logs contain very specific information for every operation performed by the subsystem, including plugins and servlets which are run, connection information, and server request and response messages.

Services which are recorded to the debug log include authorization requests, processing certificate requests, certificate status checks, and archiving and recovering keys, and access to web services.

The debug logs record detailed information about the processes for the subsystem. Each log entry has the following format:

date time [processor] LogLevel: servlet: message

The message can be a return message from the subsystem or contain values submitted to the subsystem.

For example, the TKS records this message for connecting to an LDAP server:

{YY-MM-DD} [main] INFO: TKS engine started

The processor is main, and the message is the message from the server about TKS engine status, and there is no servlet. The INFO is LogLevel, its value could be INFO, WARNING, SEVERE, depending on the log level.

The CA, on the other hand, records information about certificate operations as well as subsystem connections:

{YY-MM-DD}[http-8443;-Processor24]{LogLevel}: ProfileSubmitServlet: key=$request.requestowner$ value=KRA-server.example.com-8443

In this case, the processor is the HTTP protocol over the CA’s agent port, while it specifies the servlet for handling profiles and contains a message giving a profile parameter (the subsystem owner of a request) and its value (that the KRA initiated the request).

Example 2.1. CA Certificate request log messages

				{YY-MM-DD}[http-8443;-Processor24]{LogLevel}: ProfileSubmitServlet: key=$request.profileapprovedby$ value=admin
				{YY-MM-DD}[http-8443;-Processor24]{LogLevel}: ProfileSubmitServlet: key=$request.cert_request$ value=MIIBozCCAZ8wggEFAgQqTfoHMIHHgAECpQ4wDDEKMAgGA1UEAxMBeKaBnzANBgkqhkiG9w0BAQEFAAOB...
				{YY-MM-DD}[http-8443;-Processor24]{LogLevel}: ProfileSubmitServlet: key=$request.profile$ value=true
				{YY-MM-DD}[http-8443;-Processor24]{LogLevel}: ProfileSubmitServlet: key=$request.cert_request_type$ value=crmf
				{YY-MM-DD}[http-8443;-Processor24]{LogLevel}: ProfileSubmitServlet: key=$request.requestversion$ value=1.0.0
				{YY-MM-DD}[http-8443;-Processor24]{LogLevel}: ProfileSubmitServlet: key=$request.req_locale$ value=en
				{YY-MM-DD}[http-8443;-Processor24]{LogLevel}: ProfileSubmitServlet: key=$request.requestowner$ value=KRA-server.example.com-8443
				{YY-MM-DD}[http-8443;-Processor24]{LogLevel}: ProfileSubmitServlet: key=$request.dbstatus$ value=NOT_UPDATED
				{YY-MM-DD}[http-8443;-Processor24]{LogLevel}: ProfileSubmitServlet: key=$request.subject$ value=uid=jsmith, e=jsmith@example.com
				{YY-MM-DD}[http-8443;-Processor24]{LogLevel}: ProfileSubmitServlet: key=$request.requeststatus$ value=begin
				{YY-MM-DD}[http-8443;-Processor24]{LogLevel}: ProfileSubmitServlet: key=$request.auth_token.user$ value=uid=KRA-server.example.com-8443,ou=People,dc=example,dc=com
				{YY-MM-DD}[http-8443;-Processor24]{LogLevel}: ProfileSubmitServlet: key=$request.req_key$ value=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDreuEsBWq9WuZ2MaBwtNYxvkLP^M
				HcN0cusY7gxLzB+XwQ/VsWEoObGldg6WwJPOcBdvLiKKfC605wFdynbEgKs0fChV^M
				k9HYDhmJ8hX6+PaquiHJSVNhsv5tOshZkCfMBbyxwrKd8yZ5G5I+2gE9PUznxJaM^M
				HTmlOqm4HwFxzy0RRQIDAQAB
				{YY-MM-DD}[http-8443;-Processor24]{LogLevel}: ProfileSubmitServlet: key=$request.auth_token.authmgrinstname$ value=raCertAuth
				{YY-MM-DD}[http-8443;-Processor24]{LogLevel}: ProfileSubmitServlet: key=$request.auth_token.uid$ value=KRA-server.example.com-8443
				{YY-MM-DD}[http-8443;-Processor24]{LogLevel}: ProfileSubmitServlet: key=$request.auth_token.userid$ value=KRA-server.example.com-8443
				{YY-MM-DD}[http-8443;-Processor24]{LogLevel}: ProfileSubmitServlet: key=$request.requestor_name$ value=
				{YY-MM-DD}[http-8443;-Processor24]{LogLevel}: ProfileSubmitServlet: key=$request.profileid$ value=caUserCert
				{YY-MM-DD}[http-8443;-Processor24]{LogLevel}: ProfileSubmitServlet: key=$request.auth_token.userdn$ value=uid=KRA-server.example.com-4747,ou=People,dc=example,dc=com
				{YY-MM-DD}[http-8443;-Processor24]{LogLevel}: ProfileSubmitServlet: key=$request.requestid$ value=20
				{YY-MM-DD}[http-8443;-Processor24]{LogLevel}: ProfileSubmitServlet: key=$request.auth_token.authtime$ value=1212782378071
				{YY-MM-DD}[http-8443;-Processor24]{LogLevel}: ProfileSubmitServlet: key=$request.req_x509info$ value=MIICIKADAgECAgEAMA0GCSqGSIb3DQEBBQUAMEAxHjAcBgNVBAoTFVJlZGJ1ZGNv^M
				bXB1dGVyIERvbWFpbjEeMBwGA1UEAxMVQ2VydGlmaWNhdGUgQXV0aG9yaXR5MB4X^M
				DTA4MDYwNjE5NTkzOFoXDTA4MTIwMzE5NTkzOFowOzEhMB8GCSqGSIb3DQEJARYS^M
				anNtaXRoQGV4YW1wbGUuY29tMRYwFAYKCZImiZPyLGQBARMGanNtaXRoMIGfMA0G^M
				CSqGSIb3DQEBAQUAA4GNADCBiQKBgQDreuEsBWq9WuZ2MaBwtNYxvkLPHcN0cusY^M
				7gxLzB+XwQ/VsWEoObGldg6WwJPOcBdvLiKKfC605wFdynbEgKs0fChVk9HYDhmJ^M
				8hX6+PaquiHJSVNhsv5tOshZkCfMBbyxwrKd8yZ5G5I+2gE9PUznxJaMHTmlOqm4^M
				HwFxzy0RRQIDAQABo4HFMIHCMB8GA1UdIwQYMBaAFG8gWeOJIMt+aO8VuQTMzPBU^M
				78k8MEoGCCsGAQUFBwEBBD4wPDA6BggrBgEFBQcwAYYuaHR0cDovL3Rlc3Q0LnJl^M
				ZGJ1ZGNvbXB1dGVyLmxvY2FsOjkwODAvY2Evb2NzcDAOBgNVHQ8BAf8EBAMCBeAw^M
				HQYDVR0lBBYwFAYIKwYBBQUHAwIGCCsGAQUFBwMEMCQGA1UdEQQdMBuBGSRyZXF1^M
				ZXN0LnJlcXVlc3Rvcl9lbWFpbCQ=

Likewise, the OCSP shows OCSP request information:

{YY-MM-DD}[http-11180-Processor25]: OCSPServlet: OCSP Request:
{YY-MM-DD}[http-11180-Processor25]{LogLevel}: OCSPServlet:
MEUwQwIBADA+MDwwOjAJBgUrDgMCGgUABBSEWjCarLE6/BiSiENSsV9kHjqB3QQU
2.3.15.2. Installation logs

All subsystems keep an install log.

Every time a subsystem is created either through the initial installation or creating additional instances with pkispawn, an installation file with the complete debug output from the installation, including any errors and, if the installation is successful, the URL and PIN to the configuration interface for the instance. The file is created in the /var/log/pki/ directory for the instance with a name in the form pki-subsystem_name-spawn.timestamp.log.

Each line in the install log follows a step in the installation process.

Example 2.2. CA install log

    ==========================================================================
                                INSTALLATION SUMMARY
    ==========================================================================

      Administrator's username:             caadmin
      Administrator's PKCS #12 file:
            /root/.dogtag/pki-tomcat/ca_admin_cert.p12

      Administrator's certificate nickname:
            caadmin
      Administrator's certificate database:
            /root/.dogtag/pki-tomcat/ca/alias

      To check the status of the subsystem:
            systemctl status pki-tomcatd@pki-tomcat.service

      To restart the subsystem:
            systemctl restart pki-tomcatd@pki-tomcat.service

      The URL for the subsystem is:
            https://localhost.localdomain:8443/ca

      PKI instances will be enabled upon system boot

    ==========================================================================
2.3.15.3. Tomcat error and access logs

The CA, KRA, OCSP, TKS, and TPS subsystems use a Tomcat web server instance for their agent and end-entities' interfaces.

Error and access logs are created by the Tomcat web server, which are installed with the Certificate System and provide HTTP services. The error log contains the HTTP error messages the server has encountered. The access log lists access activity through the HTTP interface.

Logs created by Tomcat:

  • admin.timestamp
  • catalina.timestamp
  • catalina.out
  • host-manager.timestamp
  • localhost.timestamp
  • localhost_access_log.timestamp
  • manager.timestamp

These logs are not available or configurable within the Certificate System; they are only configurable within Apache or Tomcat. See the Apache documentation for information about configuring these logs.

2.3.15.4. Self-tests log

The self-tests log records information obtained during the self-tests run when the server starts or when the self-tests are manually run. The tests can be viewed by opening this log. This log is not configurable through the Console. This log can only be configured by changing settings in the CS.cfg file. The information about logs in this section does not pertain to this log. See Section 2.3.13, “Self-tests” for more information about self-tests.

2.3.15.5. journalctl logs

When starting a Certificate System instance, there is a short period of time before the logging subsystem is set up and enabled. During this time, log contents are written to standard out, which is captured by systemd and exposed via the journalctl utility.

To view these logs, run the following command:

# journalctl -u pki-tomcatd@instance_name.service

OR if using the Nuxwdog watchdog:

# journalctl -u pki-tomcatd-nuxwdog@instance_name.service

Often it is helpful to watch these logs as the instance is starting (for example, in the event of a self-test failure on startup). To do this, run these commands in a separate console prior to starting the instance:

# journalctl -f -u pki-tomcatd@instance_name.service

OR if using the Nuxwdog watchdog:

# journalctl -f -u pki-tomcatd-nuxwdog@instance_name.service

2.3.16. Instance layout

Each Certificate System instance depends on a number of files. Some of them are located in instance-specific folders, while some others are located in a common folder which is shared with other server instances.

For example, the server configuration files are stored in /etc/pki/instance_name/server.xml, which is instance-specific, but the CA servlets are defined in /usr/share/pki/ca/webapps/ca/WEB-INF/web.xml, which is shared by all server instances on the system.

Certificate System servers are Tomcat instances which consist of one or more Certificate System subsystems. Certificate System subsystems are web applications that provide specific type of PKI functions. General, shared subsystem information is contained in non-relocatable, RPM-defined shared libraries, Java archive files, binaries, and templates. These are stored in a fixed location.

The directories are instance specific, tied to the instance name. In these examples, the instance name is pki-tomcat; the true value is whatever is specified at the time the subsystem is created with pkispawn.

The directories contain customized configuration files and templates, profiles, certificate databases, and other files for the subsystem.

Expand
Table 2.2. Tomcat instance information
SettingValue

Main Directory

/var/lib/pki/pki-tomcat

Configuration Directory

/etc/pki/pki-tomcat

Configuration File

/etc/pki/pki-tomcat/server.xml

/etc/pki/pki-tomcat/password.conf

Security Databases

/var/lib/pki/pki-tomcat/alias

Subsystem Certificates

SSL server certificate

Subsystem certificate [a]

Log Files

/var/log/pki/pki-tomcat

Web Services Files

/usr/share/pki/server/webapps/ROOT - Main page

/usr/share/pki/server/webapps/pki/admin - Admin templates

/usr/share/pki/server/webapps/pki/js - JavaScript libraries

[a] The subsystem certificate is always issued by the security domain so that domain-level operations that require client authentication are based on this subsystem certificate.
Note

The /var/lib/pki/instance_name/conf/ directory is a symbolic link to the /etc/pki/instance_name/ directory.

2.3.16.2. CA subsystem information

The directories are instance specific, tied to the instance name. In these examples, the instance name is pki-tomcat; the true value is whatever is specified at the time the subsystem is created with pkispawn.

Expand
Table 2.3. CA subsystem information
SettingValue

Main Directory

/var/lib/pki/pki-tomcat/ca

Configuration Directory

/etc/pki/pki-tomcat/ca

Configuration File

/etc/pki/pki-tomcat/ca/CS.cfg

Subsystem Certificates

CA signing certificate

OCSP signing certificate (for the CA’s internal OCSP service)

Audit log signing certificate

Log Files

/var/log/pki/pki-tomcat/ca

Install Logs

/var/log/pki/pki-ca-spawn.YYYYMMDDhhmmss.log

Profile Files

/var/lib/pki/pki-tomcat/ca/profiles/ca

Email Notification Templates

/var/lib/pki/pki-tomcat/ca/emails

Web Services Files

/usr/share/pki/ca/webapps/ca/agent - Agent services

/usr/share/pki/ca/webapps/ca/admin - Admin services

/usr/share/pki/ca/webapps/ca/ee - End user services

2.3.16.3. KRA subsystem information

The directories are instance specific, tied to the instance name. In these examples, the instance name is pki-tomcat; the true value is whatever is specified at the time the subsystem is created with pkispawn.

Expand
Table 2.4. KRA subsystem information
SettingValue

Main Directory

/var/lib/pki/pki-tomcat/kra

Configuration Directory

/etc/pki/pki-tomcat/kra

Configuration File

/etc/pki/pki-tomcat/kra/CS.cfg

Subsystem Certificates

Transport certificate

Storage certificate

Audit log signing certificate

Log Files

/var/log/pki/pki-tomcat/kra

Install Logs

/var/log/pki/pki-kra-spawn.YYYYMMDDhhmmss.log

Web Services Files

/usr/share/pki/kra/webapps/kra/agent - Agent services

/usr/share/pki/kra/webapps/kra/admin - Admin services

2.3.16.4. OCSP subsystem information

The directories are instance specific, tied to the instance name. In these examples, the instance name is pki-tomcat; the true value is whatever is specified at the time the subsystem is created with pkispawn.

Expand
Table 2.5. OCSP subsystem information
SettingValue

Main Directory

/var/lib/pki/pki-tomcat/ocsp

Configuration Directory

/etc/pki/pki-tomcat/ocsp

Configuration File

/etc/pki/pki-tomcat/ocsp/CS.cfg

Subsystem Certificates

OCSP signing certificate

Audit log signing certificate

Log Files

/var/log/pki/pki-tomcat/ocsp

Install Logs

/var/log/pki/pki-ocsp-spawn.YYYYMMDDhhmmss.log

Web Services Files

/usr/share/pki/ocsp/webapps/ocsp/agent - Agent services

/usr/share/pki/ocsp/webapps/ocsp/admin - Admin services

2.3.16.5. TKS subsystem information

The directories are instance specific, tied to the instance name. In these examples, the instance name is pki-tomcat; the true value is whatever is specified at the time the subsystem is created with pkispawn.

Expand
Table 2.6. TKS subsystem information
SettingValue

Main Directory

/var/lib/pki/pki-tomcat/tks

Configuration Directory

/etc/pki/pki-tomcat/tks

Configuration File

/etc/pki/pki-tomcat/tks/CS.cfg

Subsystem Certificates

Audit log signing certificate

Log Files

/var/log/pki/pki-tomcat/tks

Install Logs

/var/log/pki/pki-tomcat/pki-tks-spawn.YYYYMMDDhhmmss.log

2.3.16.6. TPS subsystem information

The directories are instance specific, tied to the instance name. In these examples, the instance name is pki-tomcat; the true value is whatever is specified at the time the subsystem is created with pkispawn.

Expand
Table 2.7. TPS subsystem information
SettingValue

Main Directory

/var/lib/pki/pki-tomcat/tps

Configuration Directory

/etc/pki/pki-tomcat/tps

Configuration File

/etc/pki/pki-tomcat/tps/CS.cfg

Subsystem Certificates

Audit log signing certificate

Log Files

/var/log/pki/pki-tomcat/tps

Install Logs

/var/log/pki/pki-tps-spawn.YYYYMMDDhhhmmss.log

Web Services Files

/usr/share/pki/tps/webapps/tps - TPS services

There are some directories used by or common to all Certificate System subsystem instances for general server operations, listed in Table 2.8, “Subsystem file locations”.

Expand
Table 2.8. Subsystem file locations
Directory LocationContents

/usr/share/pki

Contains common files and templates used to create Certificate System instances. Along with shared files for all subsystems, there are subsystem-specific files in subfolders:

  • pki/ca (CA)
  • pki/kra (KRA)
  • pki/ocsp (OCSP)
  • pki/tks (TKS)
  • pki/tps (TPS)

/usr/bin

Contains the pkispawn and pkidestroy instance configuration scripts and tools (Java, native, and security) shared by the Certificate System subsystems.

/usr/share/java/pki

Contains Java archive files shared by local Tomcat web applications and shared by the Certificate System subsystems.

2.4. PKI with Certificate System

The Certificate System is comprised of subsystems which each contribute different functions of a public key infrastructure. A PKI environment can be customized to fit individual needs by implementing different features and functions for the subsystems.

Note

A conventional PKI environment provides the basic framework to manage certificates stored in software databases. This is a non-TMS environment, since it does not manage certificates on smart cards. A TMS environment manages the certificates on smart cards.

At a minimum, a non-TMS requires only a CA, but a non-TMS environment can use OCSP responders and KRA instances as well.

2.4.1. Issuing certificates

As stated, the Certificate Manager is the heart of the Certificate System. It manages certificates at every stage, from requests through enrollment (issuing), renewal, and revocation.

The Certificate System supports enrolling and issuing certificates and processing certificate requests from a variety of end entities, such as web browsers, servers, and virtual private network (VPN) clients. Issued certificates conform to X.509 version 3 standards.

For more information, see 5.1 About Enrolling and Renewing Certificates in the Administration Guide (Common Criteria Edition).

2.4.1.1. The enrollment process

An end entity enrolls in the PKI environment by submitting an enrollment request through the end-entity interface. There can be many kinds of enrollment that use different enrollment methods or require different authentication methods. Different interfaces can also accept different types of Certificate Signing Requests (CSR).

The Certificate Manager supports different ways to submit CSRs, such as using the graphical interface and command-line tools.

2.4.1.1.1. Enrollment using the user interface

For each enrollment through the user interface, there is a separate enrollment page created that is specific to the type of enrollment, type of authentication, and the certificate profiles associated with the type of certificate. The forms associated with enrollment can be customized for both appearance and content. Alternatively, the enrollment process can be customized by creating certificate profiles for each enrollment type. Certificate profiles dynamically-generate forms which are customized by configuring the inputs associated with the certificate profile. Different interfaces can also accept different types of Certificate Signing Requests (CSR).

When an end entity enrolls in a PKI by requesting a certificate, the following events can occur, depending on the configuration of the PKI and the subsystems installed:

  1. The end entity provides the information in one of the enrollment forms and submits a request.

    The information gathered from the end entity is customizable in the form depending on the information collected to store in the certificate or to authenticate against the authentication method associated with the form. The form creates a request that is then submitted to the Certificate Manager.

  2. The enrollment form triggers the creation of the public and private keys or for dual-key pairs for the request.
  3. The end entity provides authentication credentials before submitting the request, depending on the authentication type. This can be LDAP authentication, PIN-based authentication, or certificate-based authentication.
  4. The request is submitted either to an agent-approved enrollment process or an automated process.

    • The agent-approved process, which involves no end-entity authentication, sends the request to the request queue in the agent services interface, where an agent must processes the request. An agent can then modify parts of the request, change the status of the request, reject the request, or approve the request.

      Automatic notification can be set up so an email is sent to an agent any time a request appears in the queue. Also, an automated job can be set to send a list of the contents of the queue to agents on a pre configured schedule.

    • The automated process, which involves end-entity authentication, processes the certificate request as soon as the end entity successfully authenticates.
  5. The form collects information about the end entity from an LDAP directory when the form is submitted. For certificate profile-based enrollment, the defaults for the form can be used to collect the user LDAP ID and password.
  6. The certificate profile associated with the form determine aspects of the certificate that is issued. Depending on the certificate profile, the request is evaluated to determine if the request meets the constraints set, if the required information is provided, and the contents of the new certificate.
  7. The form can also request that the user export the private encryption key. If the KRA subsystem is set up with this CA, the end entity’s key is requested, and an archival request is sent to the KRA. This process generally requires no interaction from the end entity.
  8. The certificate request is either rejected because it did not meet the certificate profile or authentication requirements, or a certificate is issued.
  9. The certificate is delivered to the end entity.

    • In automated enrollment, the certificate is delivered to the user immediately. Since the enrollment is normally through an HTML page, the certificate is returned as a response on another HTML page.
    • In agent-approved enrollment, the certificate can be retrieved by serial number or request Id in the end-entity interface.
    • If the notification feature is set up, the link where the certificate can be obtained is sent to the end user.
  10. An automatic notice can be sent to the end entity when the certificate is issued or rejected.
  11. The new certificate is stored in the Certificate Manager’s internal database.
  12. If publishing is set up for the Certificate Manager, the certificate is published to a file or an LDAP directory.
  13. The internal OCSP service checks the status of certificates in the internal database when a certificate status request is received.

The end-entity interface has a search form for certificates that have been issued and for the CA certificate chain.

By default, the user interface supports CSR in the PKCS #10 and Certificate Request Message Format (CRMF).

2.4.1.1.2. Enrollment using the command line

This section describes the general workflows when enrolling certificates using the command line.

2.4.1.1.2.1. Enrolling using the pki utility

For details, see:

2.4.1.1.2.2. Enrolling with CMC

To enroll a certificate with CMC, proceed as follows:

  1. Generate a PKCS #10 or CRMF certificate signing request (CSR) using a utility, such as certutil, PKCS10Client, CRMFPopClient, or pki client-cert-request. For details, see 5.2 Creating certificate signing requests in the Administration Guide (Common Criteria Edition).

    Note

    If key archival is enabled in the Key Recovery Agent (KRA), use the CRMFPopClient utility with the KRA’s transport certificate in Privacy Enhanced Mail (PEM) format set in the kra.transport file.

  2. Use the CMCRequest utility to convert the CSR into a CMC request. The CMCRequest utility uses a configuration file as input. This file specifies, for example, the input path to the CSR, the CSR’s format, the output CMC request file, or nickname of the signing certificate.

    For further details and examples, see the CMCRequest(1) man page.

  3. Use the HttpClient utility to send the CMC request to the CA. HttpClient uses a configuration file with settings, such as the path to the input CMC request file, the path to the output CMC response file, the nickname of the TLS mutual authentication certificate, and the servlet complete with the enrollment profile. If the HttpClient command succeeds, the utility receives a PKCS #7 chain with CMC status controls in a CMC response from the CA.

    For details about what parameters the utility provides, enter the HttpClient command without any parameters.

  4. Use the CMCResponse utility to check the issuance result of the CMC response file generated by HttpClient. If the request is successful, CMCResponse displays the certificate chain in a readable format along with status information. You can also display the PEM of each certificate in chain using the -v option.

    For further details, see the CMCResponse(1) man page.

  5. Import the new certificate into the application. For details, follow the instructions of the application to which you want to import the certificate.
Note

The certificate retrieved by HttpClient is in CMC response format that contains PKCS #7. If the application supports only Base64-encoded certificates, use the -v option to show the PEM of each certificate in the chain.

Additionally, certain applications require a header and footer for certificates in Privacy Enhanced Mail (PEM) format. If these are required, add them manually to the PEM file.

2.4.1.1.2.2.1. CMC Enrollment without POP

In situations when Proof Of Possession (POP) is missing, the HttpClient utility receives an EncryptedPOP CMC status, which is displayed by the CMCResponse command. In this case, enter the CMCRequest command again with different parameters in the configuration file.

For details, see 5.3.1 CMC Enrollment Process in the Administration Guide (Common Criteria Edition).

2.4.1.1.2.2.2. Signed CMC requests

CMC requests can either be signed by a user or a CA agent:

  • If an agent signs the request, set the authentication method in the profile to CMCAuth.
  • If a user signs the request, set the authentication method in the profile to CMCUserSignedAuth.

For details, see 8.3 CMC Authentication Plugins in the Administration Guide (Common Criteria Edition).

2.4.1.1.2.2.3. Unsigned CMC requests

When the CMCUserSignedAuth authentication plugin is configured in the profile, you must use an unsigned CMC request in combination with the Shared Secret authentication mechanism.

Note

Unsigned CMC requests are also called self-signed CMC requests.

For details, see 8.3 CMC Authentication Plugins in the Administration Guide (Common Criteria Edition), and Section 9.6.3, “Enabling the CMC Shared Secret feature”.

2.4.1.1.2.2.4. The Shared Secret workflow

Certificate System provides the Shared Secret authentication mechanism for CMC requests according to RFC 5272. In order to protect the passphrase, an issuance protection certificate must be provided when using the CMCSharedToken command. The issuance protection certificate works similar to the KRA transport certificate.

Note

This section assumes that you have enabled the CMC Shared Secret feature, by following Section 9.6.3, “Enabling the CMC Shared Secret feature”.

Shared Secret created by the end entity user (preferred)

The following describes the workflow, if the user generates the shared secret:

  1. The end entity user obtains the issuance protection certificate from the CA administrator.
  2. The end entity user uses the CMCSharedToken utility to generate a shared secret token. See 8.4.1 Creating a Shared Secret token in the Administration Guide (Common Criteria Edition).

    Note

    The -p option sets the passphrase that is shared between the CA and the user, not the password of the token.

  3. The end entity user sends the encrypted shared token generated by the CMCSharedToken utility to the administrator.
  4. The administrator adds the shared token into the shrTok attribute in the user’s LDAP entry. See 8.4.2 Setting a CMC Shared Secret in the Administration Guide (Common Criteria Edition).
  5. The end entity user uses the passphrase to set the witness.sharedSecret parameter in the configuration file passed to the CMCRequest utility. See 5.2.2.2 Using PKCS10Client to create a CSR for SharedSecret-based CMC and 5.2.3.2 Using CRMFPopClient to create a CSR for SharedSecret-based CMC in the Administration Guide (Common Criteria Edition).

For further details, see the CMCSharedToken(1) man page.

Shared Secret created by the CA administrator

The following describes the workflow, if the CA administrator generates the shared secret for a user:

  1. The administrator uses the CMCSharedToken utility to generate a shared secret token for the user. See 8.4.1 Creating a Shared Secret token in the Administration Guide (Common Criteria Edition).

    Note

    The -p option sets the passphrase that is shared between the CA and the user, not the password of the token.

  2. The administrator adds the shared token into the shrTok attribute in the user’s LDAP entry. See 8.4.2 Setting a CMC Shared Secret in the Administration Guide (Common Criteria Edition).
  3. The administrator shares the passphrase with the user.
  4. The end entity user uses the passphrase to set the witness.sharedSecret parameter in the configuration file passed to the CMCRequest utility. See 5.2.2.2 Using PKCS10Client to create a CSR for SharedSecret-based CMC and 5.2.3.2 Using CRMFPopClient to create a CSR for SharedSecret-based CMC in the Administration Guide (Common Criteria Edition).
2.4.1.1.2.2.5. Simple CMC requests

Certificate System allows simple CMC requests. However, this process does not support the same level of security requirements as full CMC requests and, therefore, must only be used in a secure environment.

When using simple CMC requests, set the following in the HttpClient utility’s configuration file:

servlet=/ca/ee/ca/profileSubmitCMCSimple?profileId=caECSimpleCMCUserCert
2.4.1.2. Certificate profiles

The Certificate System uses certificate profiles to configure the content of the certificate, the constraints for issuing the certificate, the enrollment method used, and the input and output forms for that enrollment. A single certificate profile is associated with issuing a particular type of certificate.

A set of certificate profiles is included for the most common certificate types; the profile settings can be modified. Certificate profiles are configured by an administrator, and then sent to the agent services page for agent approval. Once a certificate profile is approved, it is enabled for use. In case of a UI-enrollment, a dynamically-generated HTML form for the certificate profile is used in the end-entities page for certificate enrollment, which calls on the certificate profile. In case of a command line-based enrollment, the certificate profile is called upon to perform the same processing, such as authentication, authorization, input, output, defaults, and constraints. The server verifies that the defaults and constraints set in the certificate profile are met before acting on the request and uses the certificate profile to determine the content of the issued certificate.

The Certificate Manager can issue certificates with any of the following characteristics, depending on the configuration in the profiles and the submitted certificate request:

  • Certificates that are X.509 version 3-compliant
  • Unicode support for the certificate subject name and issuer name
  • Support for empty certificate subject names
  • Support for customized subject name components
  • Support for customized extensions

By default, the certificate enrollment profiles are stored in <instance directory>/ca/profiles/ca with names in the format of <profile id>.cfg. LDAP-based profiles are possible with proper pkispawn configuration parameters.

2.4.1.3. Authentication for certificate enrollment

Certificate System provides authentication options for certificate enrollment. These include agent-approved enrollment, in which an agent processes the request, and automated enrollment, in which an authentication method is used to authenticate the end entity and then the CA automatically issues a certificate. CMC enrollment is also supported, which automatically processes a request approved by an agent.

2.4.1.4. Cross-pair certificates

It is possible to create a trusted relationship between two separate CAs by issuing and storing cross-signed certificates between these two CAs. By using cross-signed certificate pairs, certificates issued outside the organization’s PKI can be trusted within the system.

2.4.2. Renewing certificates

When certificates reach their expiration date, they can either be allowed to lapse, or they can be renewed.

Renewal regenerates a certificate request using the existing key pairs for that certificate, and then resubmits the request to Certificate Manager. The renewed certificate is identical to the original (since it was created from the same profile using the same key material) with one exception - it has a different, later expiration date.

Renewal can make managing certificates and relationships between users and servers much smoother, because the renewed certificate functions precisely as the old one. For user certificates, renewal allows encrypted data to be accessed without any loss.

2.4.3. Publishing certificates and CRLs

Certificates can be published to files and an LDAP directory, and CRLs to files, an LDAP directory, and an OCSP responder. The publishing framework provides a robust set of tools to publish to all three places and to set rules to define with more detail which types of certificates or CRLs are published where.

2.4.4. Revoking certificates and checking status

End entities can request that their own certificates be revoked. When an end entity makes the request, the certificate has to be presented to the CA. If the certificate and the keys are available, the request is processed and sent to the Certificate Manager, and the certificate is revoked. The Certificate Manager marks the certificate as revoked in its database and adds it to any applicable CRLs.

An agent can revoke any certificate issued by the Certificate Manager by searching for the certificate in the agent services interface and then marking it revoked. Once a certificate is revoked, it is marked revoked in the database and in the publishing directory, if the Certificate is set up for publishing.

If the internal OCSP service has been configured, the service determines the status of certificates by looking them up in the internal database.

Automated notifications can be set to send email messages to end entities when their certificates are revoked by enabling and configuring the certificate revoked notification message.

2.4.4.1. Revoking certificates

Users can revoke their certificates using:

  • The end-entity pages. For details, see 6.1.7 Certificate Revocation Pages in the Administration Guide (Common Criteria Edition).
  • The CMCRequest utility on the command line. For details, see 6.2.1 Performing a CMC Revocation in the Administration Guide (Common Criteria Edition).
  • The pki utility on the command line. For details, see pki-cert(1) man page.
2.4.4.2. Certificate status
2.4.4.2.1. CRLs

The Certificate System can create certificate revocation lists (CRLs) from a configurable framework which allows user-defined issuing points so a CRL can be created for each issuing point. Delta CRLs can also be created for any issuing point that is defined. CRLs can be issued for each type of certificate, for a specific subset of a type of certificate, or for certificates generated according to a profile or list of profiles. The extensions used and the frequency and intervals when CRLs are published can all be configured.

The Certificate Manager issues X.509-standard CRLs. A CRL can be automatically updated whenever a certificate is revoked or at specified intervals.

2.4.4.2.2. OCSP services

The Certificate System CA supports the Online Certificate Status Protocol (OCSP) as defined in PKIX standard RFC 6960. The OCSP protocol enables OCSP-compliant applications to determine the state of a certificate, including the revocation status, without having to directly check a CRL published by a CA to the validation authority. The validation authority, which is also called an OCSP responder, checks for the application.

  1. A CA is set up to issue certificates that include the Authority Information Access extension, which identifies an OCSP responder that can be queried for the status of the certificate.
  2. The CA periodically publishes CRLs to an OCSP responder.
  3. The OCSP responder maintains the CRL it receives from the CA.
  4. An OCSP-compliant client sends requests containing all the information required to identify the certificate to the OCSP responder for verification. The applications determine the location of the OCSP responder from the value of the Authority Information Access extension in the certificate being validated.
  5. The OCSP responder determines if the request contains all the information required to process it. If it does not or if it is not enabled for the requested service, a rejection notice is sent. If it does have enough information, it processes the request and sends back a report stating the status of the certificate.
2.4.4.2.2.1. OCSP response signing

Every response that the client receives, including a rejection notification, is digitally signed by the responder; the client is expected to verify the signature to ensure that the response came from the responder to which it submitted the request. The key the responder uses to sign the message depends on how the OCSP responder is deployed in a PKI setup. RFC 6960 recommends that the key used to sign the response belong to one of the following:

  • The CA that issued the certificate whose status is being checked.
  • A responder with a public key trusted by the client. Such a responder is called a trusted responder.
  • A responder that holds a specially marked certificate issued to it directly by the CA that revokes the certificates and publishes the CRL. Possession of this certificate by a responder indicates that the CA has authorized the responder to issue OCSP responses for certificates revoked by the CA. Such a responder is called a CA-designated responder or a CA-authorized responder.

The end-entities page of a Certificate Manager includes a form for manually requesting a certificate for the OCSP responder. The default enrollment form includes all the attributes that identify the certificate as an OCSP responder certificate. The required certificate extensions, such as OCSPNoCheck and Extended Key Usage, can be added to the certificate when the certificate request is submitted.

2.4.4.2.2.2. OCSP responses

The OCSP response that the client receives indicates the current status of the certificate as determined by the OCSP responder. The response could be any of the following:

  • Good or Verified . Specifies a positive response to the status inquiry, meaning the certificate has not been revoked. It does not necessarily mean that the certificate was issued or that it is within the certificate’s validity interval. Response extensions may be used to convey additional information on assertions made by the responder regarding the status of the certificate.
  • Revoked . Specifies that the certificate has been revoked, either permanently or temporarily.

Based on the status, the client decides whether to validate the certificate.

Note

The OCSP responder will never return a response of Unknown. The response will always be either Good or Revoked.

2.4.4.2.2.3. OCSP services

There are two ways to set up OCSP services:

  • The OCSP built into the Certificate Manager
  • The Online Certificate Status Manager subsystem

In addition to the built-in OCSP service, the Certificate Manager can publish CRLs to an OCSP-compliant validation authority. CAs can be configured to publish CRLs to the Certificate System Online Certificate Status Manager. The Online Certificate Status Manager stores each Certificate Manager’s CRL in its internal database and uses the appropriate CRL to verify the revocation status of a certificate when queried by an OCSP-compliant client.

The Certificate Manager can generate and publish CRLs whenever a certificate is revoked and at specified intervals. Because the purpose of an OCSP responder is to facilitate immediate verification of certificates, the Certificate Manager should publish the CRL to the Online Certificate Status Manager every time a certificate is revoked. Publishing only at intervals means that the OCSP service is checking an outdated CRL.

Note

If the CRL is large, the Certificate Manager can take a considerable amount of time to publish the CRL.

The Online Certificate Status Manager stores each Certificate Manager’s CRL in its internal database and uses it as the CRL to verify certificates. The Online Certificate Status Manager can also use the CRL published to an LDAP directory, meaning the Certificate Manager does not have to update the CRLs directly to the Online Certificate Status Manager.

2.4.5. Archiving, recovering, and rotating keys

In the world of PKI, private key archival allows parties the possibility to recover the encrypted data in case the private key is lost. Private keys can be lost due to various reasons such as hardware failure, forgotten passwords, lost smartcards, incapacitated password holder, et caetera. Such archival and recovery feature is offered by the Key Recovery Authority (KRA) subsystem of RHCS.

Only keys that are used exclusively for encrypting data should be archived; signing keys in particular should never be archived. Having two copies of a signing key makes it impossible to identify with certainty who used the key; a second archived copy could be used to impersonate the digital identity of the original key owner.

2.4.5.1. Archiving keys

There are two types of key archival mechanisms provided by KRA:

  • Client-side key generation: With this mechanism, clients are to generate CSRs in CRMF format, and submit the requests to the CA (with proper KRA setup) for enrollment and key archival. See 5.2.3 Creating a CSR Using CRMFPopClient in the Administration Guide (Common Criteria Edition).
  • Server-side key generation: With this mechanism, the properly equipped certificate enrollment profiles would trigger the PKI keys to be generated on KRA and thereby optionally archived along with newly issued certificates. See 5.2.3 Generating CSRs Using Server-Side Key Generation in the Administration Guide (Common Criteria Edition).

The KRA automatically archives private encryption keys if archiving is configured.

The KRA stores private encryption keys in a secure key repository; each key is encrypted and stored as a key record and is given a unique key identifier.

The archived copy of the key remains wrapped with the KRA’s storage key. It can be decrypted, or unwrapped, only by using the corresponding private key pair of the storage certificate. A combination of one or more key recovery (or KRA) agents' certificates authorizes the KRA to complete the key recovery to retrieve its private storage key and use it to decrypt/recover an archived private key. See Section 12.3.1, “Configuring agent-approved key recovery in the command line”.

The KRA indexes stored keys by key number, owner name, and a hash of the public key, allowing for highly efficient searching. The key recovery agents have the privilege to insert, delete, and search for key records.

  • When the key recovery agents search by the key ID, only the key that corresponds to that ID is returned.
  • When the agents search by username, all stored keys belonging to that owner are returned.
  • When the agents search by the public key in a certificate, only the corresponding private key is returned.

When a Certificate Manager receives a certificate request that contains the key archival option, it automatically forwards the request to the KRA to archive the encryption key. The private key is encrypted by the transport key, and the KRA receives the encrypted copy and stores the key in its key repository. To archive the key, the KRA uses two special key pairs:

  • A transport key pair and corresponding certificate.
  • A storage key pair.

Figure 2.2, “How the Key Archival Process works in client-side key generation” illustrates how the key archival process occurs when an end entity requests a certificate in the case of client-side key generation.

Figure 2.2. How the Key Archival Process works in client-side key generation

kra arc
  1. The client generates a CRMF request and submits it through the CA’s enrollment portal.

    1. The client’s private key is wrapped within the CRMF request and can only be unwrapped by the KRA.
  2. Detecting that it’s a CRMF request with key archival option, CA forwards the request to KRA for private key archival.
  3. The KRA decrypts / unwraps the user private key, and after confirming that the private key corresponds to the public key, the KRA encrypts / wraps it again before storing it in its internal LDAP database.
  4. Once the private encryption key has been successfully stored, the KRA responds to CA confirming that the key has been successfully archived.
  5. The CA sends the request down its Enrollment Profile Framework for certificate information content creation as well as validation. When everything passes, it then issues the certificate and sends it back to the end entity in its response.
2.4.5.2. Recovering keys

The KRA supports agent-initiated key recovery. Agent-initiated recovery is when designated recovery agents use the key recovery form on the KRA agent services portal to process and approve key recovery requests. With the approval of a specified number of agents, an organization can recover keys when the key’s owner is unavailable or when keys have been lost.

Through the KRA agent services portal, key recovery agents can collectively authorize and retrieve private encryption keys and associated certificates into a PKCS #12 package, which can then be imported into the client.

In key recovery authorization, one of the key recovery agents informs all required recovery agents about an impending key recovery. All recovery agents access the KRA key recovery portal. One of the agents initiates the key recovery process. The KRA returns a notification to the agent includes a recovery authorization reference number identifying the particular key recovery request that the agent is required to authorize. Each agent uses the reference number and authorizes key recovery separately.

KRA supports Asynchronous recovery, meaning that each step of the recovery process — the initial request and each subsequent approval or rejection — is stored in the KRA’s internal LDAP database, under the key entry. The status data for the recovery process can be retrieved even if the original browser session is closed or the KRA is shut down. Agents can search for the key to recover, without using a reference number.

This asynchronous recovery option is illustrated in Figure 2.3, “Asynchronous recovery”.

Figure 2.3. Asynchronous recovery

recovery options

The KRA informs the agent who initiated the key recovery process of the status of the authorizations.

When all of the authorizations are entered, the KRA checks the information. If the information presented is correct, it retrieves the requested key and returns it along with the corresponding certificate in the form of a PKCS #12 package to the agent who initiated the key recovery process.

Warning

The PKCS #12 package contains the encrypted private key. To minimize the risk of key compromise, the recovery agent must use a secure method to deliver the PKCS #12 package and password to the key recipient. The agent should use a good password to encrypt the PKCS #12 package and set up an appropriate delivery mechanism.

The key recovery agent scheme configures the KRA to recognize to which group the key recovery agents belong and specifies how many of these recovery agents are required to authorize a key recovery request before the archived key is restored.

Important

The above information refers to using a web browser, such as Firefox. However, functionality critical to KRA usage is no longer newer versions of browsers. In such cases, it is necessary to use the pki utility to replicate this behavior. For more information, see the pki(1) and pki-key(1) man pages or run CRMFPopClient --help and man CMCRequest.

Apart from storing asymmetric keys, KRA can also store symmetric keys or secrets similar to symmetric keys, such as volume encryption secrets, or even passwords and passphrases. The pki utility supports options that enable storing and retrieving these other types of secrets.

2.4.5.3. KRA transport key rotation

KRA transport rotation allows for seamless transition between CA and KRA subsystem instances using a current and a new transport key. This allows KRA transport keys to be periodically rotated for enhanced security by allowing both old and new transport keys to operate during the time of the transition; individual subsystem instances take turns being configured while other clones continue to serve with no downtime.

In the KRA transport key rotation process, a new transport key pair is generated, a certificate request is submitted, and a new transport certificate is retrieved. The new transport key pair and certificate have to be included in the KRA configuration to provide support for the second transport key. Once KRA supports two transport keys, administrators can start transitioning CAs to the new transport key. KRA support for the old transport key can be removed once all CAs are moved to the new transport key.

To configure KRA transport key rotation:

  1. Generate a new KRA transport key and certificate
  2. Transfer the new transport key and certificate to KRA clones
  3. Update the CA configuration with the new KRA transport certificate
  4. Update the KRA configuration to use only the new transport key and certificate

After this, the rotation of KRA transport certificates is complete, and all the affected CAs and KRAs use the new KRA certificate only. For more information on how to perform the above steps, see the procedures below.

Generating the new KRA transport key and certificate
  1. Request the KRA transport certificate.

    • Stop the KRA:

      # pki-server stop pki-kra

      OR if using the Nuxwdog watchdog:

      # systemctl stop pki-tomcatd-nuxwdog@pki-kra.service
    • Go to the KRA NSS database directory:

      # cd /etc/pki/pki-kra/alias
    • Create a subdirectory and save all the NSS database files into it. For example:

      # mkdir nss_db_backup
      # cp *.db nss_db_backup
    • Create a new request by using the PKCS10Client utility. For example:

      # PKCS10Client -p password -d '.' -o 'req.txt' -n 'CN=KRA Transport 2 Certificate,O=example.com Security Domain'

      Alternatively, use the certutil utility. For example:

      # certutil -d . -R -k rsa -g 2048 -s 'CN=KRA Transport 2 Certificate,O=example.com Security Domain' -f password-file -a -o transport-certificate-request-file
    • Submit the transport certificate request on the Manual Data Recovery Manager Transport Certificate Enrollment page of the CA End-Entity page.
    • Wait for the agent approval of the submitted request to retrieve the certificate by checking the request status on the End-Entity retrieval page.
  2. Approve the KRA transport certificate through the CA Agent Services interface.
  3. Retrieve the KRA transport certificate.

    • Go to the KRA NSS database directory:

      # cd /etc/pki/pki-kra/alias
    • Wait for the agent approval of the submitted request to retrieve the certificate by checking the request status on the End-Entity retrieval page.
    • Once the new KRA transport certificate is available, paste its Base64-encoded value into a text file, for example a file named cert-serial_number.txt. Do not include the header (-----BEGIN CERTIFICATE-----) or the footer (-----END CERTIFICATE-----).
  4. Import the KRA transport certificate.

    • Go to the KRA NSS database directory:

      # cd /etc/pki/pki-kra/alias
    • Import the transport certificate into the KRA NSS database:

      # certutil -d . -A -n 'transportCert-serial_number cert-pki-kra KRA' -t 'u,u,u' -a -i cert-serial_number.txt
  5. Update the KRA transport certificate configuration.

    • Go to the KRA NSS database directory:

      # cd /etc/pki/pki-kra/alias
    • Verify that the new KRA transport certificate is imported:

      # certutil -d . -L
      # certutil -d . -L -n 'transportCert-serial_number cert-pki-kra KRA'
    • Open the /var/lib/pki/pki-kra/kra/conf/CS.cfg file and add the following line:

      kra.transportUnit.newNickName=transportCert-serial_number cert-pki-kra KRA
Propagating the new transport key and certificate to KRA clones
  1. Start the KRA:
# pki-server start pki-kra

OR if using the Nuxwdog watchdog:

# systemctl start pki-tomcatd-nuxwdog@pki-kra.service
  1. Extract the new transport key and certificate for propagation to clones.

    • Go to the KRA NSS database directory:

      # cd /etc/pki/pki-kra/alias
    • Stop the KRA:

      # pki-server stop pki-kra

      OR if using the Nuxwdog watchdog:

      # systemctl stop pki-tomcatd-nuxwdog@pki-kra.service
    • Verify that the new KRA transport certificate is present:

      # certutil -d . -L
      # certutil -d . -L -n 'transportCert-serial_number cert-pki-kra KRA'
    • Export the KRA new transport key and certificate:

      # pk12util -o transport.p12 -d . -n 'transportCert-serial_number cert-pki-kra KRA'
    • Verify the exported KRA transport key and certificate:

      # pk12util -l transport.p12
  2. Perform these steps on each KRA clone:

    • Copy the transport.p12 file, including the transport key and certificate, to the KRA clone location.
    • Go to the clone NSS database directory:

      # cd /etc/pki/pki-kra/alias
    • Stop the KRA clone:

      # pki-server stop pki-kra

      OR if using the Nuxwdog watchdog:

      # systemctl stop pki-tomcatd-nuxwdog@pki-kra.service
    • Check the content of the clone NSS database:

      # certutil -d . -L
    • Import the new transport key and certificate of the clone:

      # pk12util -i transport.p12 -d .
    • Add the following line to the /var/lib/pki/pki-kra/kra/conf/CS.cfg file on the clone:

      kra.transportUnit.newNickName=transportCert-serial_number cert-pki-kra KRA
    • Start the KRA clone:

      # pki-server start pki-kra

      OR if using the Nuxwdog watchdog:

      # systemctl start pki-tomcatd-nuxwdog@pki-kra.service
Updating the CA configuration with the new KRA transport certificate
  1. Format the new KRA transport certificate for inclusion in the CA.

    • Obtain the cert-serial_number.txt KRA transport certificate file created when retrieving the KRA transport certificate in the previous procedure.
    • Convert the Base64-encoded certificate included in cert-serial_number.txt to a single-line file:

      # tr -d '\n' < cert-serial_number.txt > cert-one-line-serial_number.txt
  2. Do the following for the CA and all its clones corresponding to the KRA above:

    • Stop the CA:

      # pki-server stop pki-ca

      OR if using the Nuxwdog watchdog:

      # systemctl stop pki-tomcatd-nuxwdog@pki-ca.service
    • In the /var/lib/pki/pki-ca/ca/conf/CS.cfg file, locate the certificate included in the following line:

      ca.connector.KRA.transportCert=certificate

      Replace that certificate with the one contained in cert-one-line-serial_number.txt.

    • Start the CA:

      # pki-server start pki-ca

      OR if using the Nuxwdog watchdog:

      # systemctl start pki-tomcatd-nuxwdog@pki-ca.service
Note

While the CA and all its clones are being updated with the new KRA transport certificate, the CA instances that have completed the transition use the new KRA transport certificate, and the CA instances that have not yet been updated continue to use the old KRA transport certificate. Because the corresponding KRA and its clones have already been updated to use both transport certificates, no downtime occurs.

Updating the KRA configuration to use only the new transport key and certificate

For the KRA and each of its clones, do the following:

  1. Go to the KRA NSS database directory:

    # cd /etc/pki/pki-kra/alias
  2. Stop the KRA:

    # pki-server stop pki-kra

    OR if using the Nuxwdog watchdog:

    # systemctl stop pki-tomcatd-nuxwdog@pki-kra.service
  3. Verify that the new KRA transport certificate is imported:

    # certutil -d . -L
    # certutil -d . -L -n 'transportCert-serial_number cert-pki-kra KRA'
  4. Open the /var/lib/pki/pki-kra/kra/conf/CS.cfg file, and look for the nickName value included in the following line:

    kra.transportUnit.nickName=transportCert cert-pki-kra KRA

    Replace the nickName value with the newNickName value included in the following line:

    kra.transportUnit.newNickName=transportCert-serial_number cert-pki-kra KRA

    As a result, the CS.cfg file includes this line:

    kra.transportUnit.nickName=transportCert-serial_number cert-pki-kra KRA
  5. Remove the following line from /var/lib/pki/pki-kra/kra/conf/CS.cfg:

    kra.transportUnit.newNickName=transportCert-serial_number cert-pki-kra KRA
  6. Start the KRA:

    # pki-server start pki-kra

    OR if using the Nuxwdog watchdog:

    # systemctl start pki-tomcatd-nuxwdog@pki-kra.service

A smart card is a hardware cryptographic device containing cryptographic certificates and keys. It can be employed by the user to participate in operations such as secure website access and secure mail. It can also serve as an authentication device to log in to various operating systems such as Red Hat Enterprise Linux. The management of these cards or tokens throughout their entire lifetime in service is accomplished by the Token Management System (TMS).

A TMS environment requires a Certificate Authority (CA), Token Key Service (TKS), and Token Processing System (TPS), with an optional Key Recovery Authority (KRA) for server-side key generation and key archival and recovery. Online Certificate Status Protocol (OCSP) can also be used to work with the CA to serve online certificate status requests. This chapter provides an overview of the TKS and TPS systems, which provide the smart card management functions of Red Hat Certificate System, as well as Enterprise Security Client (ESC), that works with TMS from the user end.

Figure 2.4. How the TMS manages smart cards

tms

2.5.1. Token Key Service (TKS)

The Token Key Service (TKS) is responsible for managing one or more master keys. It maintains the master keys and is the only entity within the TMS that has access to the key materials. In an operational environment, each valid smart card token contains a set of symmetric keys that are derived from both the master key and the ID that is unique to the card (CUID).

Initially, a default (unique only per manufacturer master key) set of symmetric keys is initialized on each smart card by the manufacturer. This default set should be changed at the deployment site by going through a Key Changeover operation to generate the new master key on TKS. As the sole owner to the master key, when given the CUID of a smart card, TKS is capable of deriving the set of symmetric keys residing on that particular smart card, which would then allow TKS to establish a session-based Secure Channel for secure communication between TMS and each individual smart card.

Note

Because of the sensitivity of the data that the TKS manages, the TKS should be set behind the firewall with restricted access.

2.5.1.1. Master keys and key sets

The TKS supports multiple smart card key sets. Each smart card vendor creates different default (developer) static key sets for their smart card token stocks, and the TKS is equipped with the static key set (per manufacturer) to kickstart the format process of a blank token.

During the format process of a blank smart card token, a Java applet and the uniquely derived symmetric key set are injected into the token. Each master key (in some cases referred to as keySet) that the TKS supports is to have a set of entries in the TKS configuration file (CS.cfg). Each TPS profile contains a configuration to direct its enrollment to the proper TKS keySet for the matching key derivation process that would essentially be responsible for establishing the Secure Channel secured by a set of session-specific keys between TMS and the smart card token.

On TKS, master keys are defined by named keySets for references by TPS. On TPS, depending on the enrollment type (internal or external registration), The keySet is either specified in the TPS profile, or determined by the keySet Mapping Resolver.

2.5.1.2. Key ceremony (shared key transport)

A Key Ceremony is a process for transporting highly sensitive keys in a secure way from one location to another. In one scenario, in a highly secure deployment environment, the master key can be generated in a secure vault with no network to the outside. Alternatively, an organization might want to have TKS and TPS instances on different physical machines. In either case, under the assumption that no one single person is to be trusted with the key, Red Hat Certificate System TMS provides a utility called tkstool to manage the secure key transportation.

2.5.1.3. Key update (key changeover)

When Global Platform-compliant smart cards are created at the factory, the manufacturer will burn a set of default symmetric keys onto the token. The TKS is initially configured to use these symmetric keys (one KeySet entry per vendor in the TKS configuration). However, since these symmetric keys are not unique to the smart cards from the same stock, and because these are well-known keys, it is strongly encouraged to replace these symmetric keys with a set that is unique per token, not shared by the manufacturer, to restrict the set of entities that can manipulate the token.

The changing over of the keys takes place with the assistance of the Token Key Service subsystem. One of the functions of the TKS is to oversee the Master Keys from which the previously discussed smart card token keys are derived. There can be more than one master key residing under the control of the TKS.

Important

When this key changeover process is done on a token, the token may become unusable in the future since it no longer has the default key set enabled. The key is essentially only as good as long as the TPS and TKS system that provisioned the token is valid. Because of this, it is essential to keep all the master keys, even if any of them are outdated.

You can disable the old master keys in TKS for better control, but do not delete them unless disabled tokens are part of your plan. There is support to revert the token keys back to the original key set, which is viable if the token is to be reused again in some sort of a testing scenario.

2.5.1.4. APDUs and secure channels

The Red Hat Certificate System Token Management System (TMS) supports the GlobalPlatform smart card specification, in which the Secure Channel implementation is done with the Token Key System (TKS) managing the master key and the Token Processing System (TPS) communicating with the smart card (tokens) with Application Protocol Data Units (APDUs).

There are two types of APDUs:

  • Command APDUs, sent by the TPS to smart cards
  • Response APDUs, sent by smart cards to the TPS as response to command APDUs

The initiation of the APDU commands may be triggered when clients take action and connect to the Certificate System server for requests. A secure channel begins with an InitializeUpdate APDU sent from TPS to the smart card token, and is fully established with the ExternalAuthenticate APDU. Then, both the token and TMS would have established a set of shared secrets, called session keys, which are used to encrypt and authenticate the communication. This authenticated and encrypted communication channel is called Secure Channel.

Because TKS is the only entity that has access to the master key which is capable of deriving the set of unique symmetric on-token smart card keys, the Secure Channel provides the adequately safeguarded communication between TMS and each individual token. Any disconnection of the channel will require reestablishment of new session keys for a new channel.

2.5.2. Token Processing System (TPS)

The Token Processing System (TPS) is a registration authority for smart card certificate enrollment. It acts as a conduit between the user-centered Enterprise Security Client (ESC), which interacts with client side smart card tokens, and the Certificate System back end subsystems, such as the Certificate Authority (CA) and the Key Recovery Authority (KRA).

In TMS, the TPS is required in order to manage smart cards, as it is the only TMS entity that understands the APDU commands and responses. TPS sends commands to the smart cards to help them generate and store keys and certificates for a specific entity, such as a user or device. Smart card operations go through the TPS and are forwarded to the appropriate subsystem for action, such as the CA to generate certificates or the KRA to generate, archive, or recover keys.

2.5.2.1. Coolkey applet

Red Hat Certificate System includes the Coolkey Java applet, written specifically to run on TMS-supported smart card tokens. The Coolkey applet connects to a PKCS#11 module that handles the certificate and key related operations. During a token format operation, this applet is injected onto the smart card token using the Secure Channel protocol, and can be updated per configuration.

2.5.2.2. Token operations

The TPS in Red Hat Certificate System is available to provision smart cards on the behalf of end users of the smart cards. The Token Processing System provides support for the following major token operations:

  • Token Format - The format operation is responsible for installing the proper Coolkey applet onto the token. The applet provides a platform where subsequent cryptographic keys and certificates can be later placed.
  • Token Enrollment - The enrollment operation results in a smart card populated with required cryptographic keys and cryptographic certificates. This material allows the user of the smart card to participate in operations such as secure web site access and secure mail. Two types of enrollments are supported, which is configured globally:

    • Internal Registration - Enrollment by TPS profiles determined by the profile Mapping Resolver.
    • External Registration - Enrollment by TPS profiles determined by the entries in the user’s LDAP record.
  • Token PIN Reset - The token PIN reset operation allows the user of the token to specify a new PIN that is used to log into the token, making it available for performing cryptographic operations.

The following other operations can be considered supplementary or inherent operations to the main ones listed above. They can be triggered per relevant configuration or by the state of the token.

  • Key Generation - Each PKI certificate is comprised of a public/private key pair. In Red Hat Certificate System, the generation of the keys can be done in two ways, depending on the TPS profile configuration:

    • Token Side Key Generation - The PKI key pairs are generated on the smart card token. Generating the key pairs on the token side does not allow for key archival.
    • Server Side Key Generation - The PKI key pairs are generated on the TMS server side. The key pairs are then sent back to the token using Secure Channel. Generating the key pairs on the server side allows for key archival.
  • Certificate Renewal - This operation allows a previously enrolled token to have the certificates currently on the token reissued while reusing the same keys. This is useful in situations where the old certificates are due to expire and you want to create new ones but maintain the original key material.
  • Certificate Revocation - Certificate revocation can be triggered based on TPS profile configuration or based on token state.

    Normally, only the CA which issued a certificate can revoke it, which could mean that retiring a CA would make it impossible to revoke certain certificates. However, it is possible to route revocation requests for tokens to the retired CA while still routing all other requests such as enrollment to a new, active CA. This mechanism is called Revocation Routing.

  • Token Key Changeover - The key changeover operation, triggered by a format operation, results in the ability to change the internal keys of the token from the default developer key set to a new key set controlled by the deployer of the Token Processing System. This is usually done in any real deployment scenario since the developer key set is better suited to testing situations.
  • Applet Update - During the course of a TMS deployment, the Coolkey smart card applet can be updated or downgraded if required.
2.5.2.3. TPS profiles

The Certificate System Token Processing System subsystem facilitates the management of smart card tokens. Tokens are provisioned by the TPS such that they are taken from a blank state to either a Formatted or Enrolled condition. A Formatted token is one that contains the CoolKey applet supported by TPS, while an Enrolled token is personalized (a process called binding) to an individual with the requisite certificates and cryptographic keys. This fully provisioned token is ready to use for crytptographic operations.

The TPS can also manage Profiles. The notion of a token Profile is related to:

  • The steps taken to Format or Enroll a token.
  • The attributes contained within the finished token after the operation has been successfully completed.

The following list contains some of the quantities that make up a unique token profile:

  • How does the TPS connect to the user’s authentication LDAP database?
  • Will user authentication be required for this token operation? If so, what authentication manager will be used?
  • How does the TPS connect to a Certificate System CA from which it will obtain certificates?
  • How are the private and public keys generated on this token? Are they generated on the token side or on the server side?
  • What key size (in bits) is to be used when generating private and public keys?
  • Which certificate enrollment profile (provisioned by the CA) is to be used to generate the certificates on this token?

    Note

    This setting will determine the final structure of the certificates to be written to the token. Different certificates can be created for different uses, based on extensions included in the certificate. For example, one certificate can specialize in data encryption, and another one can be used for signature operations.

  • What version of the Coolkey applet will be required on the token?
  • How many certificates will be placed on this token for an enrollment operation?

These above and many others can be configured for each token type or profile. A full list of available configuration options is available in the Red Hat Certificate System Administration Guide.

Another question to consider is how a given token being provisioned by a user will be mapped to an individual token profile. There are two types of registration:

  • Internal Registration - In this case, the TPS profile (tokenType) is determined by the profile Mapping Resolver. This filter-based resolver can be configured to take any of the data provided by the token into account and determine the target profile.
  • External Registration - When using external registration, the profile (in name only - actual profiles are still defined in the TPS in the same fashion as those used by the internal registration) is specified in each user’s LDAP record, which is obtained during authentication. This allows the TPS to obtain key enrollment and recovery information from an external registration Directory Server where user information is stored. This gives you the control to override the enrollment, revocation, and recovery policies that are inherent to the TPS internal registration mechanism. The user LDAP record attribute names relevant to external registration are configurable.

    External registration can be useful when the concept of a "group certificate" is required. In that case, all users within a group can have a special record configured in their LDAP profiles for downloading a shared certificate and keys.

The registration to be used is configured globally per TPS instance.

2.5.2.4. Token database

The Token Processing System makes use of the LDAP token database store, which is used to keep a list of active tokens and their respective certificates, and to keep track of the current state of each token. A brand new token is considered Uninitialized, while a fully enrolled token is Enrolled. This data store is constantly updated and consulted by the TPS when processing tokens.

2.5.2.4.1. Token states and transitions

The Token Processing System stores states in its internal database in order to determine the current token status as well as actions which can be performed on the token.

2.5.2.4.1.1. Token states

The following table lists all possible token states:

Expand
Table 2.9. Possible token states
NameCodeLabel

FORMATTED

0

Formatted (uninitialized)

DAMAGED

1

Physically damaged

PERM_LOST

2

Permanently lost

SUSPENDED

3

Suspended (temporarily lost)

ACTIVE

4

Active

TERMINATED

6

Terminated

UNFORMATTED

7

Unformatted

The command line interface displays token states using the Name listed above. The graphical interface uses the Label instead.

Note

The above table contains no state with code 5, which previously belonged to a state that was removed.

Each token state has a limited amount of next states it can transition into. For example, a token can change state from FORMATTED to ACTIVE or DAMAGED, but it can never transition from FORMATTED to UNFORMATTED.

Furthermore, the list of states a token can transition into is different depending on whether the transition is triggered manually using a command line or the graphical interface, or automatically using a token operation. The list of allowed manual transitions is stored in the tokendb.allowedTransitions property, and the tps.operations.allowedTransitions property controls allowed transitions triggered by token operations.

The default configurations for both manual and token operation-based transitions are stored in the /usr/share/pki/tps/conf/CS.cfg configuration file.

All possible transitions allowed in the command line or graphical interface are described in the TPS configuration file using the tokendb.allowedTransitions property:

tokendb.allowedTransitions=0:1,0:2,0:3,0:6,3:2,3:6,4:1,4:2,4:3,4:6,6:7

The property contains a comma-separated list of transitions. Each transition is written in the format of <current code>:_<new code>_. The codes are described in Table 2.10, “Possible manual token state transitions”. The default configuration is preserved in /usr/share/pki/tps/conf/CS.cfg.

The following table describes each possible transition in more detail:

Expand
Table 2.10. Possible manual token state transitions
TransitionCurrent StateNext StateDescription

0:1

FORMATTED

DAMAGED

This token has been physically damaged.

0:2

FORMATTED

PERM_LOST

This token has been permanently lost.

0:3

FORMATTED

SUSPENDED

This token has been suspended (temporarily lost).

0:6

FORMATTED

TERMINATED

This token has been terminated.

3:2

SUSPENDED

PERM_LOST

This suspended token has been permanently lost.

3:6

SUSPENDED

TERMINATED

This suspended token has been terminated.

4:1

ACTIVE

DAMAGED

This token has been physically damaged.

4:2

ACTIVE

PERM_LOST

This token has been permanently lost.

4:3

ACTIVE

SUSPENDED

This token has been suspended (temporarily lost).

4:6

ACTIVE

TERMINATED

This token has been terminated.

6:7

TERMINATED

UNFORMATTED

Reuse this token.

The following transitions are generated automatically depending on the token’s original state. If a token was originally FORMATTED and then became SUSPENDED, it can only return to the FORMATTED state. If a token was originally ACTIVE and then became SUSPENDED, it can only return to the ACTIVE state.

Expand
Table 2.11. Token state transitions triggered automatically
TransitionCurrent StateNext StateDescription

3:0

SUSPENDED

FORMATTED

This suspended (temporarily lost) token has been found.

3:4

SUSPENDED

ACTIVE

This suspended (temporarily lost) token has been found.

All possible transitions that can be done using token operations are described in the TPS configuration file using the tokendb.allowedTransitions property:

tps.operations.allowedTransitions=0:0,0:4,4:4,4:0,7:0

The property contains a comma-separated list of transitions. Each transition is written in the format of <current code>:_<new code>_. The codes are described in Table 2.10, “Possible manual token state transitions”. The default configuration is preserved in /usr/share/pki/tps/conf/CS.cfg.

The following table describes each possible transition in more detail:

Expand
Table 2.12. Possible token state transitions using token operations
TransitionCurrent StateNext StateDescription

0:0

FORMATTED

FORMATTED

This allows reformatting a token or upgrading applet/key in a token.

0:4

FORMATTED

ACTIVE

This allows enrolling a token.

4:4

ACTIVE

ACTIVE

This allows re-enrolling an active token. May be useful for external registration.

4:0

ACTIVE

FORMATTED

This allows formatting an active token.

7:0

UNFORMATTED

FORMATTED

This allows formatting a blank or previously used token.

2.5.2.4.1.4. Token state and transition labels

The default labels for token states and transitions are stored in the /usr/share/pki/tps/conf/token-states.properties configuration file. By default, the file has the following contents:

# Token states
UNFORMATTED         = Unformatted
FORMATTED           = Formatted (uninitialized)
ACTIVE              = Active
SUSPENDED           = Suspended (temporarily lost)
PERM_LOST           = Permanently lost
DAMAGED             = Physically damaged
TEMP_LOST_PERM_LOST = Temporarily lost then permanently lost
TERMINATED          = Terminated

# Token state transitions
FORMATTED.DAMAGED        = This token has been physically damaged.
FORMATTED.PERM_LOST      = This token has been permanently lost.
FORMATTED.SUSPENDED      = This token has been suspended (temporarily lost).
FORMATTED.TERMINATED     = This token has been terminated.
SUSPENDED.ACTIVE         = This suspended (temporarily lost) token has been found.
SUSPENDED.PERM_LOST      = This suspended (temporarily lost) token has become permanently lost.
SUSPENDED.TERMINATED     = This suspended (temporarily lost) token has been terminated.
SUSPENDED.FORMATTED      = This suspended (temporarily lost) token has been found.
ACTIVE.DAMAGED           = This token has been physically damaged.
ACTIVE.PERM_LOST         = This token has been permanently lost.
ACTIVE.SUSPENDED         = This token has been suspended (temporarily lost).
ACTIVE.TERMINATED        = This token has been terminated.
TERMINATED.UNFORMATTED   = Reuse this token.

To customize the list of token state transition, edit the following properties in /var/lib/pki/instance_name/tps/conf/CS.cfg:

  • tokendb.allowedTransitions to customize the list of allowed transitions performed using the command line or graphical interface
  • tps.operations.allowedTransitions to customize the list of allowed transitions using token operations

Transitions can be removed from the default list if necessary, but new transitions cannot be added unless they were in the default list. The defaults are stored in /usr/share/pki/tps/conf/CS.cfg.

To customize token state and transition labels, copy the default /usr/share/pki/tps/conf/token-states.properties into your instance folder (/var/lib/pki/instance_name/tps/conf/CS.cfg), and change the labels listed inside as needed.

Changes will be effective immediately, the server does not need to be restarted. The TPS user interface may require a reload.

To revert to default state and label names, delete the edited token-states.properties file from your instance folder.

2.5.2.4.1.7. Token activity log

Certain TPS activities are logged. Possible events in the log file are listed in the table below.

Expand
Table 2.13. TPS activity log events
ActivityDescription

add

A token was added.

format

A token was formatted.

enrollment

A token was enrolled.

recovery

A token was recovered.

renewal

A token was renewed.

pin_reset

A token PIN was reset.

token_status_change

A token status was changed using the command line or graphical interface.

token_modify

A token was modified.

delete

A token was deleted.

cert_revocation

A token certificate was revoked.

cert_unrevocation

A token certificate was unrevoked.

2.5.2.4.2. Token policies

In case of internal registration, each token can be governed by a set of token policies. The default policies are:

RE_ENROLL=YES;RENEW=NO;FORCE_FORMAT=NO;PIN_RESET=NO;RESET_PIN_RESET_TO_NO=NO;RENEW_KEEP_OLD_ENC_CERTS=YES

All TPS operations under internal registration are subject to the policies specified in the token’s record. If no policies are specified for a token, the TPS uses the default set of policies.

2.5.2.5. Mapping resolver

The Mapping Resolver is an extensible mechanism used by the TPS to determine which token profile to assign to a specific token based on configurable criteria. Each mapping resolver instance can be uniquely defined in the configuration, and each operation can point to various defined mapping resolver instance.

Note

The mapping resolver framework provides a platform for writing custom plugins. However instructions on how to write a plugin is outside the scope of this document.

FilterMappingResolver is the only mapping resolver implementation provided with the TPS by default. It allows you to define a set of mappings and a target result for each mapping. Each mapping contains a set of filters, where:

  • If the input filter parameters pass all filters within a mapping, the target value is assigned.
  • If the input parameters fail a filter, that mapping is skipped and the next one in order is tried.
  • If a filter has no specified value, it always passes.
  • If a filter does have a specified value, then the input parameters must match exactly.
  • The order in which mappings are defined is important. The first mapping which passes is considered resolved and is returned to the caller.

The input filter parameters are information received from the smart card token with or without extensions. They are run against the FilterMappingResolver according to the above rules. The following input filter parameters are supported by FilterMappingResolver:

  • appletMajorVersion - The major version of the Coolkey applet on the token.
  • appletMinorVersion - The minor version of the Coolkey applet on the token.
  • keySet or tokenType

    • keySet - can be set as an extension in the client request. Must match the value in the filter if the extension is specified. The keySet mapping resolver is meant for determining keySet value when using external registration. The Key Set Mapping Resolver is necessary in the external registration environment when multiple key sets are supported (for example, different smart card token vendors). The keySet value is needed for identifying the master key on TKS, which is crucial for establishing Secure Channel. When a user’s LDAP record is populated with a set tokenType (TPS profile), it does not know which card will end up doing the enrollment, and therefore keySet cannot be predetermined. The keySetMappingResolver helps solve the issue by allowing the keySet to be resolved before authentication.
    • tokenType - okenType can be set as an extension in the client request. It must match the value in the filter if the extension is specified. tokenType (also referred to as TPS Profile) is determined at this time for the internal registration environment.
  • tokenATR - The token’s Answer to Reset (ATR).
  • tokenCUID - "start" and "end" define the range the Card Unique IDs (CUID) of the token must fall in to pass this filter.
2.5.2.6. TPS roles

The TPS supports the following roles by default:

  • TPS Administrator - this role is allowed to:

    • Manage TPS tokens
    • View TPS certificates and activities
    • Manage TPS users and groups
    • Change general TPS configuration
    • Manage TPS authenticators and connectors
    • Configure TPS profiles and profile mappings
    • Configure TPS audit logging
  • TPS Agent - this role is allowed to:

    • Configure TPS tokens
    • View TPS certificates and activities
    • Change the status of TPS profiles
  • TPS Operator - this role is allowed to:

    • View TPS tokens, certificates, and activities

2.5.3. TKS/TPS shared secret

During TMS installation, a shared symmetric key is established between the Token Key Service and the Token Processing System. The purpose of this key is to wrap and unwrap session keys which are essential to Secure Channels.

Note

The shared secret key is currently only kept in a software cryptographical database. There are plans to support keeping the key on a Hardware Security Module (HSM) devices in a future release of Red Hat Certificate System. Once this functionality is implemented, you will be instructed to run a Key Ceremony using tkstool to transfer the key to the HSM.

2.5.4. Enterprise Security Client (ESC)

The Enterprise Security Client is an HTTP client application, similar to a web browser, that communicates with the TPS and handles smart card tokens from the client side. While an HTTPS connection is established between the ESC and the TPS, an underlying Secure Channel is also established between the token and the TMS within each TLS session.

2.6. Red Hat Certificate System services

Certificate System has a number of different features for administrators to use which makes it easier to maintain the individual subsystems and the PKI as a whole.

2.6.1. Notifications

When a particular event occurs, such as when a certificate is issued or revoked, then a notification can be sent directly to a specified email address. The notification framework comes with default modules that can be enabled and configured.

2.6.2. Jobs

Automated jobs run at defined intervals.

2.6.3. Logging

The Certificate System and each subsystem produce extensive system and error logs that record system events so that the systems can be monitored and debugged. All log records are stored in the local file system for quick retrieval. Logs are configurable, so logs can be created for specific types of events and at the required logging level.

Certificate System allows logs to be signed digitally before archiving them or distributing them for auditing. This feature enables log files to be checked for tampering after being signed.

2.6.4. Auditing

The Certificate System maintains audit logs for all events, such as requesting, issuing and revoking certificates and publishing CRLs. These logs are then signed. This allows authorized access or activity to be detected. An outside auditor can then audit the system if required. The assigned auditor user account is the only account which can view the signed audit logs. This user’s certificate is used to sign and encrypt the logs. Audit logging is configured to specify the events that are logged.

2.6.5. Self-tests

The Certificate System provides the framework for system self-tests that are automatically run at startup and can be run on demand. A set of configurable self-tests are already included with the Certificate System. See Section 2.3.13, “Self-tests” for more information about self-tests.

2.6.6. Users, authorization, and access controls

Certificate System users can be assigned to groups, which are also known as roles, and they then have the privileges of whichever group they are members. A user only has privileges for the instance of the subsystem in which the user is created and the privileges of the group to which the user is a member.

Authentication is the means that Certificate System subsystems use to verify the identity of clients, whether they are authenticating to a certificate profile or to one of the services interfaces. There are a number of different ways for a client to perform authentication, including simple user name/password, SSL/TLS mutual authentication, LDAP authentication, NIS authentication, or CMC. Authentication can be performed for any access to the subsystem; for certificate enrollments, for example, the profile defines how the requestor authenticates to the CA.

Once the client is identified and authenticated, then the subsystems perform an authorization check to determine what level of access to the subsystem that particular user is allowed.

Authorization is tied to group, or role, permissions, rather than directly to individual users. The Certificate System provides an authorization framework for creating groups and assigning access control to those groups. The default access control on preexisting groups can be modified, and access control can be assigned to individual users and IP addresses. Access points for authorization have been created for the major portions of the system, and access control rules can be set for each point.

2.6.6.1. Default administrative roles
Note

Red Hat Certificate System uses the words roles and groups interchangeably in the context of the permissions given to users.

The Certificate System is configured by default with three user types with different access levels to the system:

  • Administrators, who can perform any administrative or configuration task for a subsystem.
  • Agents, who perform PKI management tasks, like approving certificate requests, managing token enrollments, or recovering keys.
  • Auditors, who can view and configure audit logs.
Note

By default, for bootstrapping purposes, an administrative user processing both Administrator and Agent privileges is created during the Red Hat Certificate System instance creation, when running the pkispawn utility. This bootstrap administrator uses the caadmin user name by default but can be overridden by the pki_admin_uid parameter in the configuration file passed to the pkispawn command. The purpose of the bootstrap administrator is to create the first administrator and agent user. This operation requires the administrator privilege to mange user and groups, and the agent privilege to issue certificates.

2.6.6.2. Built-in subsystem trust roles

Additionally, when a security domain is created, the CA subsystem which hosts the domain is automatically granted the special role of Security Domain Administrator, which gives the subsystem the ability to manage the security domain and the subsystem instances within it. Other security domain administrator roles can be created for the different subsystem instances. These special roles should not have actual users as members.

Chapter 3. Supported Standards and Protocols

Red Hat Certificate System is based on many public and standard protocols and RFCs, to ensure the best possible performance and interoperability. The major standards and protocols used or supported by Certificate System 10 are outlined in this chapter, to help administrators plan their client services effectively.

3.1. TLS, ECC, and RSA

The Transport Layer Security (TLS) protocol is an universally accepted standard for authenticated and encrypted communication between clients and servers. Both client and server authentication occur over TLS.

TLS uses a combination of public-key and symmetric-key encryption. Symmetric-key encryption is much faster than public-key encryption, but public-key encryption provides better authentication techniques. An TLS session always begins with an exchange of messages called handshake, initial communication between the server and client. The handshake allows the server to authenticate itself to the client using public-key techniques, optionally allows the client to authenticate to the server, then allows the client and the server to cooperate in the creation of symmetric keys used for rapid encryption, decryption, and integrity verification during the session that follows.

TLS supports a variety of different cryptographic algorithms, or ciphers, for operations such as authenticating the server and client, transmitting certificates, and establishing session keys. Clients and servers may support different cipher suites, or sets of ciphers. Among other functions, the handshake determines how the server and client negotiate which cipher suite is used to authenticate each other, to transmit certificates, and to establish session keys.

Key-exchange algorithms like RSA and Elliptic Curve Diffie-Hellman (ECDH) govern the way the server and client determine the symmetric keys to use during an TLS session. TLS supports ECC (Elliptic Curve Cryptography) cipher suites, as well as RSA. The Certificate System supports both RSA and ECC public-key cryptographic systems natively.

In more recent practise, key-exchange algorithms are being superseded by key-agreement protocols where each of the two or more parties can influence the outcome when establishing a common key for secure communication. Key agreement is preferrable to key exchange because it allows for Perfect Forward Secrecy (PFS) to be implemented. When PFS is used, random public keys (also called temporary cipher parameters or ephemeral keys) are generated for each session by a non-deterministic algorithm for the purposes of key agreement. As a result, there is no single secret value which could lead to the compromise of multiple messages, protecting past and future communication alike.

3.1.1. Supported cipher suites

Cipher and hashing algorithms are in a constant flux with regard to various vulnerabilities and security strengths. As a general rule, Red Hat Certificate System follows the NIST guideline and supports TLS 1.2 cipher suites.

Warning

for a Common Criteria setup, ONLY the ciphers listed under the following section are allowed.

3.2. Allowed key algorithms and their sizes

Red Hat Certificate System supports the following key algorithms and sizes if they are provided by the underlying PKCS #11 module.

  • Allowed RSA key sizes:

    • 2048 bits or greater
  • Allowed EC curves or equivalent as defined in the FIPS PUB 186-4 standard:

    • nistp256
    • nistp384
    • nistp521

3.3. Allowed hash functions

The following keyed hash messages authentication (HMAC) are allowed:

  • SHA-256
  • SHA-384
  • SHA-512

The following cryptographic hashing functions are allowed:

  • SHA-256
  • SHA-384
  • SHA-512

3.4. IPv4 and IPv6 addresses

Certificate System supports both IPv4 addresses and IPv6 addresses. In a very wide variety of circumstances, Certificate System subsystems or operations reference a host name or IP address; supporting both IPv4- and IPv6-style addresses ensures forward compatibility with network protocols. The operations that support IPv6 connections include the following:

  • Communications between subsystems, including between the TPS, TKS, and CA and for joining security domains
  • Token operations between the TPS and the Enterprise Security Client
  • Subsystem logging
  • Access control instructions
  • Operations performed with Certificate System tools, including the pki utility, the Subject Alt Name Extension tool, HttpClient, and the Bulk Issuance Tool
  • Client communications, including both the pkiconsole utility and IPv6-enabled browsers for web services
  • Certificate request names and certificate subject names, including user, server, and router certificates
  • Publishing
  • Connecting to LDAP databases for internal databases and authentication directories

Any time a host name or URL is referenced, an IP address can be used:

  • An IPv4 address must be in the format n.n.n.n or n.n.n.n,m.m.m.m. For example, 128.21.39.40 or 128.21.39.40,255.255.255.00.
  • An IPv6 address uses a 128-bit namespace, with the IPv6 address separated by colons and the netmask separated by periods. For example, 0:0:0:0:0:0:13.1.68.3, FF01::43, or 0:0:0:0:0:0:13.1.68.3,FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:255.255.255.0.

If DNS is properly configured, then an IPv4 or IPv6 address can be used to connect to the web services pages and to the subsystem Java consoles. The most common method is to use fully-qualified domain names:

https://ipv6host.example.com:8443/ca/services
pkiconsole https://ipv6host.example.com:8443/ca

To use IPv6 numeric addresses, replace the fully-qualified domain name in the URL with the IPv6 address, enclosed in brackets: [<IPv6_address>]. For example:

https://[00:00:00:00:123:456:789:00:]:8443/ca/services
pkiconsole https://[00:00:00:00:123:456:789:00:]:8443/ca

3.5. Supported PKIX formats and protocols

The Certificate System supports many of the protocols and formats defined in Public-Key Infrastructure (X.509) by the IETF. In addition to the PKIX standards listed here, other PKIX-listed standards are available at the IETF Datatracker website.

Expand
Table 3.1. PKIX standards supported in Certificate System 10
Format or ProtocolRFC or DraftDescription

X.509 version 1 and version 3

 

Digital certificate formats recommended by the International Telecommunications Union (ITU).

Certificate Request Message Format (CRMF)

RFC 4211

A message format to send a certificate request to a CA.

Certificate Management Message Formats (CMMF)

 

Message formats to send certificate requests and revocation requests from end entities to a CA and to return information to end entities. CMMF has been subsumed by another standard, CMC.

Certificate Management Messages over CS (CMC)

RFC 5274

A general interface to public-key certification products based on CS and PKCS #10, including a certificate enrollment protocol for RSA-signed certificates with Diffie-Hellman public-keys. CMC incorporates CRMF and CMMF.

Cryptographic Message Syntax (CMS)

RFC 2630

A superset of PKCS #7 syntax used for digital signatures and encryption.

PKIX Certificate and CRL Profile

RFC 5280

A standard developed by the IETF for a public-key infrastructure for the Internet. It specifies profiles for certificates and CRLs.

Online Certificate Status Protocol (OCSP)

RFC 6960

A protocol useful in determining the current status of a digital certificate without requiring CRLs.

Chapter 4. Supported platforms

This section describes the different server platforms, hardware, tokens, and software supported by Red Hat Certificate System 10.

4.1. General requirements

The minimal and recommended hardware for Red Hat Certificate System 10 are as follows:

Minimal requirements

  • CPU: 2 threads
  • RAM: 2 GB
  • Disk space: 20 GB

The minimal requirements are based on the Red Hat Enterprise Linux 8 minimal requirements. For more information, see Red Hat Enterprise Linux technology capabilities and limits.

Recommended requirements

  • CPU: 4 or more threads, AES-NI support
  • RAM: 8 GB or more
  • Disk space: 80 GB or more

4.2. Server support

See Chapter 6, Prerequisites for installation for supported system information.

4.3. Supported web browsers

The only fully-tested browser is Mozilla Firefox, and to some extent, Chrome. However, in general, newer versions of browsers on major OS platforms are likely to work.

4.4. Supported Hardware Security Modules

The following table lists Hardware Security Modules (HSM) supported by Red Hat Certificate System:

Expand
HSMFirmwareAppliance SoftwareClient Software

nCipher nShield Connect XC

nShield_HSM_Firmware-12.72.1

12.71.0

SecWorld_Lin64-12.71.0

Thales TCT Luna Network HSM T-5000 with Luna-T7 internal card

lunafw_update-7.11.1-4

7.11.0-25

LunaClient-7.11.1-5

Note

While the Common Criteria evaluation tested using this Entrust HSM, any HSM is considered equivalent when it is at least FIPS 140-2 validated, provides PKCS#11 3.0 cryptographic services or higher, hardware protection for keys and supports the required algorithms. Some tokens that do not follow the PKCS #11 3.0 semantics will fail. For instance, some tokens do not properly support CKA_ID, which is a requirement for RHCS certificate and key provisioning of the token.

NOTE

Limited support for Thales Luna: Red Hat was not able to confirm that the Thales HSM unit supports AES key wrapping/unwrapping via OAEP. Please be aware that those features requiring support of this algorithm will not function without such support. These features include:

  • KRA: key archival and recovery
  • CMC SharedToken authentication mechanism for enrollments
  • TKS → TPS shared secret automatic transport during installation

It is, however, observed that workarounds may be employed for some of these features, but at the cost of degraded security level or operational inconvenience.

Another example is that a certain Safenet Luna model supports PKI private key extraction in its CKE - Key Export model, and only in non-FIPS mode. The Luna Cloning model and the CKE model in FIPS mode do not support PKI private key extraction.

Chapter 5. Planning the Certificate System

Each Red Hat Certificate System subsystem can be installed on the same server machine, installed on separate servers, or have multiple instances installed across an organization. Before installing any subsystem, it is important to plan the deployment out: what kind of PKI services do you need? What are the network requirements? What people need to access the Certificate System, what are their roles, and what are their physical locations? What kinds of certificates do you want to issue and what constraints or rules need to be set for them?

This chapter covers some basic questions for planning a Certificate System deployment. Many of these decisions are interrelated; one choice impacts another, like deciding whether to use smart cards determines whether to install the TPS and TKS subsystems.

5.1. Deciding on the required subsystems

The Certificate System subsystems cover different aspects of managing certificates. Planning which subsystems to install is one way of defining what PKI operations the deployment needs to perform.

Certificates, like software or equipment, have a lifecycle with defined stages. At its most basic, there are three steps:

  • It is requested and issued.
  • It is valid.
  • It expires.

However, this simplified scenario does not cover a lot of common issues with certificates:

  • What if an employee leaves the company before the certificate expires?
  • When a CA signing certificate expires, all of the certificates issued and signed using that certificate also expire. So will the CA signing certificate be renewed, allowing its issued certificates to remain valid, or will it be reissued?
  • What if an employee loses a smart card or leaves it at home. Will a replacement certificate be issued using the original certificates keys? Will the other certificates be suspended or revoked? Are temporary certificates allowed?
  • When a certificate expires, will a new certificate be issued or will the original certificate be renewed?

This introduces three other considerations for managing certificates: revocation, renewal, and replacements.

Other considerations are the loads on the certificate authority. Are there a lot of issuance or renewal requests? Is there a lot of traffic from clients trying to validate whether certificates are valid? How are people requesting certificates supposed to authenticate their identity, and does that process slow down the issuance process?

5.1.1. Using a single Certificate Manager

The core of the Certificate System PKI is the Certificate Manager, a certificate authority. The CA receives certificate requests and issues all certificates.

Figure 5.1. CA only Certificate System

ca basic

All of the basic processing for requests and issuing certificates can be handled by the Certificate Manager, and it is the only required subsystem. There can be a single Certificate Manager or many Certificate Managers, arranged in many different relationships, depending on the demands of the organization.

Along with issuing certificates, a Certificate Manager can also revoke certificates. One question for administrators is how to handle certificates if they are lost, compromised, or if the person or equipment for which they are issued leaves the company. Revoking a certificate invalidates it before its expiration date, and a list of revoked certificates is compiled and published by the issuing CA so that clients can verify the certificate status.

cm single

One operation the CA cannot perform, though, is key archival and recovery. A very real scenario is that a user is going to lose his private key -for instance, the keys could be deleted from a browser database or a smart card could be left at home. Many common business operations use encrypted data, like encrypted email, and losing the keys which unlock that data means the data itself is lost. Depending on the policies in the company, there probably has to be a way to recover the keys in order to regenerate or reimport a replacement certificate, and both operations require the private key.

That requires a KRA, the subsystem which specially archives and retrieves keys.

Figure 5.2. CA and KRA

ca drm

The Key Recovery Authority stores encryption keys (key archival) and can retrieve those keys so that the CA can reissue a certificate (key recovery). A KRA can store keys for any certificate generated by Certificate System, whether it is done for a regular certificate or when enrolling a smart card.

The key archival and recovery process is explained in more detail in Section 2.4.5, “Archiving, recovering, and rotating keys”.

Note

The KRA is intended for archival and recovery of private encryption keys only. Therefore, end users must use a browser that supports dual-key generation to store their public-private key pairs.

5.1.3. Balancing certificate request processing

Another aspect of how the subsystems work together is load balancing. If a site has high traffic, then it is possible to simply install a lot of CAs, as clones of each other or in a flat hierarchy (where each CA is independent) or in a tree hierarchy (where some CAs are subordinate to other CAs); this is covered more in Section 5.2, “Defining the Certificate Authority hierarchy”.

5.1.4. Balancing client OCSP requests

If a certificate is within its validity period but needs be invalidated, it can be revoked. A Certificate Manager can publish lists of revoked certificates, so that when a client needs to verify that a certificate is still valid, it can check the list. These requests are online certificate status protocol requests, meaning that they have a specific request and response format. The Certificate Manager has a built-in OCSP responder so that it can verify OCSP requests by itself.

However, as with certificate request traffic, a site may have a significant number of client requests to verify certificate status. Example Corp. has a large web store, and each customer’s browser tries to verify the validity of their SSL/TLS certificates. Again, the CA can handle issuing the number of certificates, but the high request traffic affects its performance. In this case, Example Corp. uses the external OCSP Manager subsystem to verify certificate statuses, and the Certificate Manager only has to publish updated CRLs every so often.

Figure 5.3. CA and OCSP

ca ocsp

5.1.5. Using smart cards

Smart cards usually require in-person enrollment and approval processes, since they use a physical medium to store key and certificate data. That means that multiple agents need to have access to the TPS and, possibly, multiple TPS subsystems in different offices or geographic locations.

The token management system is very scalable. Multiple TPSs can be configured to work with a single CA, TKS, or KRA instance, while multiple Enterprise Security Clients can communicate with a single TPS. As additional clients are installed, they can point back to the TPS instance without having to reconfigure the TPS; likewise, as TPSs are added, they can point to the same CA, TKS, and KRA instances without having to reconfigure those subsystems.

tms2

After installation, the TPS configuration can be edited to use additional CA, KRA, and TKS instances for failover support, so if the primary subsystem is unavailable, the TPS can switch to the next available system without interrupting its token services.

5.2. Defining the Certificate Authority hierarchy

The CA is the center of the PKI, so the relationship of CA systems, both to each other (CA hierarchy) and to other subsystems (security domain) is vital to planning a Certificate System PKI.

When there are multiple CAs in a PKI, the CAs are structured in a hierarchy or chain. The CA above another CA in a chain is called an root CA; a CA below another CA in the chain is called a subordinate CA. A CA can also be subordinate to a root outside of the Certificate System deployment; for example, a CA which functions as a root CA within the Certificate System deployment can be subordinate to a third-party CA.

A Certificate Manager (or CA) is subordinate to another CA because its CA signing certificate, the certificate that allows it to issue certificates, is issued by another CA. The CA that issued the subordinate CA signing certificate controls the CA through the contents of the CA signing certificate. The CA can constrain the subordinate CA through the kinds of certificates that it can issue, the extensions that it is allowed to include in certificates, the number of levels of subordinate CAs the subordinate CA can create, and the validity period of certificates it can issue, as well as the validity period of the subordinate CAs signing certificate.

Note

Although a subordinate CA can create certificates that violate these constraints, a client authenticating a certificate that violates those constraints will not accept that certificate.

A self-signed root CA signs its own CA signing certificate and sets its own constraints as well as setting constraints on the subordinate CA signing certificates it issues.

A Certificate Manager can be configured as either a root CA or a subordinate CA. It is easiest to make the first CA installed a self-signed root, so that it is not necessary to apply to a third party and wait for the certificate to be issued. Before deploying the full PKI, however, consider whether to have a root CA, how many to have, and where both root and subordinate CAs will be located.

5.2.1. Subordination to a public CA

Chaining the Certificate System CA to a third-party public CA introduces the restrictions that public CAs place on the kinds of certificates the subordinate CA can issue and the nature of the certificate chain. For example, a CA that chains to a third-party CA might be restricted to issuing only Secure Multipurpose Internet Mail Extensions (S/MIME) and SSL/TLS mutual authentication certificates, but not SSL/TLS server certificates. There are other possible restrictions with using a public CA. This may not be acceptable for some PKI deployments.

One benefit of chaining to a public CA is that the third party is responsible for submitting the root CA certificate to a web browser or other client software. This can be a major advantage for an extranet with certificates that are accessed by different companies with browsers that cannot be controlled by the administrator. Creating a root CA in the CA hierarchy means that the local organization must get the root certificate into all the browsers which will use the certificates issued by the Certificate System. There are tools to do this within an intranet, but it can be difficult to accomplish with an extranet.

5.2.2. Subordination to a Certificate System CA

The Certificate System CA can function as a root CA, meaning that the server signs its own CA signing certificate as well as other CA signing certificates, creating an organization-specific CA hierarchy. The server can alternatively be configured as a subordinate CA, meaning the server’s CA signing key is signed by another CA in an existing CA hierarchy.

Setting up a Certificate System CA as the root CA means that the Certificate System administrator has control over all subordinate CAs by setting policies that control the contents of the CA signing certificates issued. A subordinate CA issues certificates by evaluating its own authentication and certificate profile configuration, without regard for the root CA’s configuration.

5.2.3. Linked CA

The Certificate System Certificate Manager can function as a linked CA, chaining up to many third-party or public CAs for validation; this provides cross-company trust, so applications can verify certificate chains outside the company certificate hierarchy. A Certificate Manager is chained to a third-party CA by requesting the Certificate Manager’s CA signing certificate from the third-party CA.

Related to this, the Certificate Manager also can issue cross-pair or cross-signed certificates. Cross-pair certificates create a trusted relationship between two separate CAs by issuing and storing cross-signed certificates between these two CAs. By using cross-signed certificate pairs, certificates issued outside the organization’s PKI can be trusted within the system.

These are also called bridge certificates, related to the Federal Bridge Certification Authority (FBCA) definition.

5.2.4. CA cloning

Instead of creating a hierarchy of root and subordinate CAs, it is possible to create multiple clones of a Certificate Manager and configure each clone to issue certificates within a range of serial numbers.

A cloned Certificate Manager uses the same CA signing key and certificate as another Certificate Manager, the master Certificate Manager.

Note

If there is a chance that a subsystem will be cloned, then it is easiest to export its key pairs during the configuration process and save them to a secure location. The key pairs for the original Certificate Manager have to be available when the clone instance is configured, so that the clone can generate its certificates from the original Certificate Manager’s keys.

It is also possible to export the keys from the security databases at a later time, using the pk12util or the PKCS12Export commands.

Because clone CAs and original CAs use the same CA signing key and certificate to sign the certificates they issue, the issuer name in all the certificates is the same. Clone CAs and the original Certificate Managers issue certificates as if they are a single CA. These servers can be placed on different hosts for high availability failover support.

The advantage of cloning is that it distributes the Certificate Manager’s load across several processes or even several physical machines. For a CA with a high enrollment demand, the distribution gained from cloning allows more certificates to be signed and issued in a given time interval.

A cloned Certificate Manager has the same features, such as agent and end-entity gateway functions, of a regular Certificate Manager.

The serial numbers for certificates issued by clones are distributed dynamically. The databases for each clone and master are replicated, so all of the certificate requests and issued certificates, both, are also replicated. This ensures that there are no serial number conflicts while serial number ranges do not have to be manually assigned to the cloned Certificate Managers.

5.3. Planning security domains

A security domain is a registry of PKI services. PKI services, such as CAs, register information about themselves in these domains so users of PKI services can find other services by inspecting the registry. The security domain service in Certificate System manages both the registration of PKI services for Certificate System subsystems and a set of shared trust policies.

The registry provides a complete view of all PKI services provided by the subsystems within that domain. Each Certificate System subsystem must be either a host or a member of a security domain.

A CA subsystem is the only subsystem which can host a security domain. The security domain shares the CA internal database for privileged user and group information to determine which users can update the security domain, register new PKI services, and issue certificates.

A security domain is created during CA configuration, which automatically creates an entry in the security domain CA’s LDAP directory. Each entry contains all the important information about the domain. Every subsystem within the domain, including the CA registering the security domain, is recorded under the security domain container entry.

The URL to the CA uniquely identifies the security domain. The security domain is also given a friendly name, such as Example Corp Intranet PKI. All other subsystems - KRA, TPS, TKS, OCSP, and other CAs - must become members of the security domain by supplying the security domain URL when configuring the subsystem.

Each subsystem within the security domain shares the same trust policies and trusted roots which can be retrieved from different servers and browsers. The information available in the security domain is used during configuration of a new subsystem, which makes the configuration process streamlined and automated. For example, when a TPS needs to connect to a CA, it can consult the security domain to get a list of available CAs.

Each CA has its own LDAP entry. The security domain is an organizational group underneath that CA entry:

ou=Security Domain,dc=server.example.com-pki-ca

Then there is a list of each subsystem type beneath the security domain organizational group, with a special object class (pkiSecurityGroup) to identify the group type:

cn=KRAList,ou=Security Domain,o=pki-tomcat-CA
objectClass: top
objectClass: pkiSecurityGroup
cn: KRAList

Each subsystem instance is then stored as a member of that group, with a special pkiSubsystem object class to identify the entry type:

dn: cn=kra.example.com:8443,cn=KRAList,ou=Security Domain,o=pki-tomcat-CA
objectClass: top
objectClass: pkiSubsystem
cn: kra.example.com:8443
host: server.example.com
UnSecurePort: 8080
SecurePort: 8443
SecureAdminPort: 8443
SecureAgentPort: 8443
SecureEEClientAuthPort: 8443
DomainManager: false
Clone: false
SubsystemName: KRA kra.example.com 8443

If a subsystem needs to contact another subsystem to perform an operation, it contacts the CA which hosts the security domain (by invoking a servlet which connects over the administrative port of the CA). The security domain CA then retrieves the information about the subsystem from its LDAP database, and returns that information to the requesting subsystem.

The subsystem authenticates to the security domain using a subsystem certificate.

Consider the following when planning the security domain:

  • The CA hosting the security domain can be signed by an external authority.
  • Multiple security domains can be set up within an organization. However, each subsystem can belong to only one security domain.
  • Subsystems within a domain can be cloned. Cloning subsystem instances distributes the system load and provides failover points.
  • The security domain streamlines configuration between the CA and KRA; the KRA can push its KRA connector information and transport certificates automatically to the CA instead of administrators having to manually copy the certificates over to the CA.
  • The Certificate System security domain allows an offline CA to be set up. In this scenario, the offline root has its own security domain. All online subordinate CAs belong to a different security domain.
  • The security domain streamlines configuration between the CA and OCSP. The OCSP can push its information to the CA for the CA to set up OCSP publishing and also retrieve the CA certificate chain from the CA and store it in the internal database.

The CA configuration determines many of the characteristics of the certificates which it issues, regardless of the actual type of certificate being issued. Constraints on the CA’s own validity period, distinguished name, and allowed encryption algorithms impact the same characteristics in their issued certificates. Additionally, the Certificate Managers have predefined profiles that set rules for different kinds of certificates that they issue, and additional profiles can be added or modified. These profile configurations also impact issued certificates.

5.4.1. Determining which certificates to install

When a Certificate System subsystem is first installed and configured, the certificates necessary to access and administer it are automatically created. These include an agent’s certificate, server certificate, and subsystem-specific certificates. These initial certificates are shown in Table 5.1, “Initial subsystem certificates”.

Expand
Table 5.1. Initial subsystem certificates
SubsystemCertificates

Certificate Manager

  • CA signing certificate
  • OCSP signing certificate
  • SSL/TLS server certificate
  • Subsystem certificate
  • User’s bootstrap (agent/administrator) certificate
  • Audit log signing certificate

OCSP

  • OCSP signing certificate
  • SSL/TLS server certificate
  • Subsystem certificate
  • User’s bootstrap (agent/administrator) certificate
  • Audit log signing certificate

KRA

  • Transport certificate
  • Storage certificate
  • SSL/TLS server certificate
  • Subsystem certificate
  • User’s bootstrap (agent/administrator) certificate
  • Audit log signing certificate

TKS

  • SSL/TLS server certificate
  • User’s bootstrap (agent/administrator) certificate
  • Audit log signing certificate

TPS

  • SSL/TLS server certificate
  • User’s bootstrap (agent/administrator) certificate
  • Audit log signing certificate

There are some cautionary considerations about replacing existing subsystem certificates.

  • Generating new key pairs when creating a new self-signed CA certificate for a root CA will invalidate all certificates issued under the previous CA certificate.

    This means none of the certificates issued or signed by the CA using its old key will work; subordinate Certificate Managers, KRAs, OCSPs, TKSs, and TPSs will no longer function, and agents can no longer to access agent interfaces.

    This same situation occurs if a subordinate CA’s CA certificate is replaced by one with a new key pair; all certificates issued by that CA are invalidated and will no longer work.

    Instead of creating new certificates from new key pairs, consider renewing the existing CA signing certificate.

  • If the CA is configured to publish to the OCSP and it has a new CA signing certificate or a new CRL signing certificate, the CA must be identified again to the OCSP.
  • If a new transport certificate is created for the KRA, the KRA information must be updated in the CA’s configuration file, CS.cfg. The existing transport certificate must be replaced with the new one in the ca.connector.KRA.transportCert parameter.
  • If a CA is cloned, then when creating a new SSL/TLS server certificate for the master Certificate Manager, the clone CAs' certificate databases all need updated with the new SSL/TLS server certificate.
  • If the Certificate Manager is configured to publish certificates and CRLs to an LDAP directory and uses the SSL/TLS server certificate for SSL/TLS mutual authentication, then the new SSL/TLS server certificate must be requested with the appropriate extensions. After installing the certificate, the publishing directory must be configured to use the new server certificate.
  • Any number of SSL/TLS server certificates can be issued for a subsystem instance, but it really only needs one SSL/TLS certificate. This certificate can be renewed or replaced as many times as necessary.

5.4.2. Planning the CA distinguished name

The core elements of a CA are a signing unit and the Certificate Manager identity. The signing unit digitally signs certificates requested by end entities. A Certificate Manager must have its own distinguished name (DN), which is listed in every certificate it issues.

Like any other certificate, a CA certificate binds a DN to a public key. A DN is a series of name-value pairs that in combination uniquely identify an entity. For example, the following DN identifies a Certificate Manager for the Engineering department of a corporation named Example Corporation:

cn=demoCA, o=Example Corporation, ou=Engineering, c=US

Many combinations of name-value pairs are possible for the Certificate Manager’s DN. The DN must be unique and readily identifiable, since any end entity can examine it.

Every certificate, including a Certificate Manager signing certificate, must have a validity period. The Certificate System does not restrict the validity period that can be specified. Set as long a validity period as possible, depending on the requirements for certificate renewal, the place of the CA in the certificate hierarchy, and the requirements of any public CAs that are included in the PKI.

A Certificate Manager cannot issue a certificate that has a validity period longer than the validity period of its CA signing certificate. If a request is made for a period longer than the CA certificate’s validity period, the requested validity date is ignored and the CA signing certificate validity period is used.

5.4.4. Choosing the signing key type and length

A signing key is used by a subsystem to verify and "seal" something. CAs use a CA signing certificate to sign certificates or CRLs that it issues; OCSPs use signing certificates to verify their responses to certificate status requests; all subsystems use log file signing certificates to sign their audit logs.

The signing key must be cryptographically strong to provide protection and security for its signing operations. The following signing algorithms are considered secure:

  • SHA256withRSA
  • SHA512withRSA
  • SHA256withEC
  • SHA512withEC
Note

Certificate System includes native ECC support. It is also possible to load and use a third-party PKCS #11 module with ECC-enabled.

Along with a key type, each key has a specific bit length. Longer keys are considered cryptographically stronger than shorter keys. However, longer keys require more time for signing operations.

The default RSA key length in the configuration wizard is 2048 bits; for certificates that provide access to highly sensitive data or services, consider increasing the length to 4096 bits. ECC keys are much stronger than RSA keys, so the recommended length for ECC keys is 256 bits, which is equivalent in strength to a 2048-bit RSA key.

5.4.5. Using certificate extensions

An X.509 v3 certificate contains an extension field that permits any number of additional fields to be added to the certificate. Certificate extensions provide a way of adding information such as alternative subject names and usage restrictions to certificates. Older Netscape servers, such as Red Hat Directory Server and Red Hat Certificate System, require Netscape-specific extensions because they were developed before PKIX part 1 standards were defined.

The X.509 v1 certificate specification was originally designed to bind public keys to names in an X.500 directory. As certificates began to be used on the Internet and extranets and directory lookups could not always be performed, problem areas emerged that were not covered by the original specification.

  • Trust. The X.500 specification establishes trust by means of a strict directory hierarchy. By contrast, Internet and extranet deployments frequently involve distributed trust models that do not conform to the hierarchical X.500 approach.
  • Certificate use. Some organizations restrict how certificates are used. For example, some certificates may be restricted to client authentication only.
  • Multiple certificates. It is not uncommon for certificate users to possess multiple certificates with identical subject names but different key material. In this case, it is necessary to identify which key and certificate should be used for what purpose.
  • Alternate names. For some purposes, it is useful to have alternative subject names that are also bound to the public key in the certificate.
  • Additional attributes. Some organizations store additional information in certificates, such as when it is not possible to look up information in a directory.
  • Relationship with CA. When certificate chaining involves intermediate CAs, it is useful to have information about the relationships among CAs embedded in their certificates.
  • CRL checking. Since it is not always possible to check a certificate’s revocation status against a directory or with the original certificate authority, it is useful for certificates to include information about where to check CRLs.

The X.509 v3 specification addressed these issues by altering the certificate format to include additional information within a certificate by defining a general format for certificate extensions and specifying extensions that can be included in the certificate. The extensions defined for X.509 v3 certificates enable additional attributes to be associated with users or public keys and manage the certification hierarchy. The Internet X.509 Public Key Infrastructure Certificate and CRL Profile recommends a set of extensions to use for Internet certificates and standard locations for certificate or CA information. These extensions are called standard extensions.

Note

For more information on standard extensions, see RFC 2459, RFC 3280, and RFC 3279.

The X.509 v3 standard for certificates allows organizations to define custom extensions and include them in certificates. These extensions are called private, proprietary, or custom extensions, and they carry information unique to an organization or business. Applications may not able to validate certificates that contain private critical extensions, so it not recommended that these be used in wide-spread situations.

The X.500 and X.509 specifications are controlled by the International Telecommunication Union (ITU), an international organization that primarily serves large telecommunication companies, government organizations, and other entities concerned with the international telecommunications network. The Internet Engineering Task Force (IETF), which controls many of the standards that underlie the Internet, is currently developing public-key infrastructure X.509 (PKIX) standards. These proposed standards further refine the X.509 v3 approach to extensions for use on the Internet. The recommendations for certificates and CRLs have reached proposed standard status and are in a document referred to as PKIX Part 1.

Two other standards, Abstract Syntax Notation One (ASN.1) and Distinguished Encoding Rules (DER), are used with Certificate System and certificates in general. These are specified in the CCITT Recommendations X.208 and X.209. For a quick summary of ASN.1 and DER, see A Layman’s Guide to a Subset of ASN.1, BER, and DER, which is available at RSA Laboratories' web site, http://www.rsa.com.

5.4.5.1. Structure of certificate extensions

In RFC 3280, an X.509 certificate extension is defined as follows:

Extension  ::=  SEQUENCE  {

extnID OBJECT IDENTIFIER,
critical BOOLEAN DEFAULT FALSE,
extnValue OCTET STRING  }

The means a certificate extension consists of the following:

  • The object identifier (OID) for the extension. This identifier uniquely identifies the extension. It also determines the ASN.1 type of value in the value field and how the value is interpreted. When an extension appears in a certificate, the OID appears as the extension ID field (extnID) and the corresponding ASN.1 encoded structure appears as the value of the octet string (extnValue).
  • A flag or Boolean field called critical.

    The value, which can be either true or false, assigned to this field indicates whether the extension is critical or noncritical to the certificate. If the extension is critical and the certificate is sent to an application that does not understand the extension based on the extension’s ID, the application must reject the certificate. If the extension is not critical and the certificate is sent to an application that does not understand the extension based on the extension’s ID, the application can ignore the extension and accept the certificate.

  • An octet string containing the DER encoding of the value of the extension.

Typically, the application receiving the certificate checks the extension ID to determine if it can recognize the ID. If it can, it uses the extension ID to determine the type of value used.

Some of the standard extensions defined in the X.509 v3 standard include the following:

  • Authority Key Identifier extension, which identifies the CA’s public key, the key used to sign the certificate.
  • Subject Key Identifier extension, which identifies the subject’s public key, the key being certified.
Note

Not all applications support certificates with version 3 extensions. Applications that do support these extensions may not be able to interpret some or all of these specific extensions.

5.4.6. Using and customizing certificate profiles

Certificates have different types and different applications. They can be used to establish a single sign-on environment for a corporate network, to set up VPNs, to encrypt email, or to authenticate to a website. The requirements for all of these certificates can be different, just as there may also be different requirements for the same type of certificate for different kinds of users. These certificate characteristics are set in certificate profiles. The Certificate Manager defines a set of certificate profiles that it uses as enrollment forms when users or machines request certificates.

Certificate profiles

A certificate profile defines everything associated with issuing a particular type of certificate, including the authentication method, the certificate content (defaults), constraints for the values of the content, and the contents of the input and output for the certificate profile. Enrollment requests are submitted to a certificate profile and are then subject to the defaults and constraints set in that certificate profile. These constraints are in place whether the request is submitted through the input form associated with the certificate profile or through other means. The certificate that is issued from a certificate profile request contains the content required by the defaults with the information required by the default parameters. The constraints provide rules for what content is allowed in the certificate.

For example, a certificate profile for user certificates defines all aspects of that certificate, including the validity period of the certificate. The default validity period can be set to two years, and a constraint can be set on the profile that the validity period for certificates requested through this certificate profile cannot exceed two years. When a user requests a certificate using the input form associated with this certificate profile, the issued certificate contains the information specified in the defaults and will be valid for two years. If the user submits a pre-formatted request for a certificate with a validity period of four years, the request is rejected since the constraints allow a maximum of two years validity period for this type of certificate.

A set of certificate profiles have been predefined for the most common certificates issued. These certificate profiles define defaults and constraints, associate the authentication method, and define the needed inputs and outputs for the certificate profile.

Modifying the certificate profile parameters

The parameters of the default certificate profiles can be modified; this includes the authentication method, the defaults, the constraints used in each profile, the values assigned to any of the parameters in a profile, the input, and the output. It is also possible to create new certificate profiles for other types of certificates or for creating more than one certificate profile for a certificate type. There can be multiple certificate profiles for a particular type of certificate to issue the same type of certificate with a different authentication method or different definitions for the defaults and constraints. For example, there can be two certificate profiles for enrollment of SSL/TLS server certificates where one certificate profile issues certificates with a validity period of six months and another certificate profile issues certificates with a validity period of two years.

An input sets a text field in the enrollment form and what kind of information needs gathered from the end entity; this includes setting the text area for a certificate request to be pasted, which allows a request to be created outside the input form with any of the request information required. The input values are set as values in the certificate. The default inputs are not configurable in the Certificate System.

An output specifies how the response page to a successful enrollment is presented. It usually displays the certificate in a user-readable format. The default output shows a printable version of the resultant certificate; other outputs set the type of information generated at the end of the enrollment, such as PKCS #7.

Policy sets are sets of constraints and default extensions attached to every certificate processed through the profile. The extensions define certificate content such as validity periods and subject name requirements. A profile handles one certificate request, but a single request can contain information for multiple certificates. A PKCS#10 request contains a single public key. One CRMF request can contain multiple public keys, meaning multiple certificate requests. A profile may contain multiple sets of policies, with each set specifying how to handle one certificate request within a CRMF request.

Certificate Profile Administration

An administrator sets up a certificate profile by associating an existing authentication plugin, or method, with the certificate profile; enabling and configuring defaults and constraints; and defining inputs and outputs. The administrator can use the existing certificate profiles, modify the existing certificate profiles, create new certificate profiles, and delete any certificate profile that will not be used in this PKI.

Once a certificate profile is set up, it appears on the Manage Certificate Profiles page of the agent services page where an agent can approve, and thus enable, a certificate profile. Once the certificate profile is enabled, it appears on the Certificate Profile tab of the end-entities page where end entities can enroll for a certificate using the certificate profile.

The certificate profile enrollment page in the end-entities interface contains links to each certificate profile that has been enabled by the agents. When an end entity selects one of those links, an enrollment page appears containing an enrollment form specific to that certificate profile. The enrollment page is dynamically generated from the inputs defined for the profile. If an authentication plugin is configured, additional fields may be added to authenticate the user.

When an end entity submits a certificate profile request that is associated with an agent-approved (manual) enrollment, an enrollment where no authentication plugin is configured, the certificate request is queued in the agent services interface. The agent can change some aspects of the enrollment, request, validate it, cancel it, reject it, update it, or approve it. The agent is able to update the request without submitting it or validate that the request adheres to the profile’s defaults and constraints. This validation procedure is only for verification and does not result in the request being submitted. The agent is bound by the constraints set; they cannot change the request in such a way that a constraint is violated. The signed approval is immediately processed, and a certificate is issued.

When a certificate profile is associated with an authentication method, the request is approved immediately and generates a certificate automatically if the user successfully authenticates, all the information required is provided, and the request does not violate any of the constraints set up for the certificate profile. There are profile policies which allow user-supplied settings like subject names or validity periods. The certificate profile framework can also preserve user-defined content set in the original certificate request in the issued certificate.

The issued certificate contains the content defined in the defaults for this certificate profile, such as the extensions and validity period for the certificate. The content of the certificate is constrained by the constraints set for each default. Multiple policies (defaults and constraints) can be set for one profile, distinguishing each set by using the same value in the policy set ID. This is particularly useful for dealing with dual keys enrollment where encryption keys and signing keys are submitted to the same profile. The server evaluates each set with each request it receives. When a single certificate is issued, one set is evaluated, and any other sets are ignored. When dual-key pairs are issued, the first set is evaluated with the first certificate request, and the second set is evaluated with the second certificate request. There is no need for more than one set for issuing a single certificate or more than two sets for issuing dual-key pairs.

Guidelines for customizing certificate profiles

Tailor the profiles for the organization to the real needs and anticipated certificate types used by the organization:

  • Decide which certificate profiles are needed in the PKI. There should be at least one profile for each type of certificate issued. There can be more than one certificate profile for each type of certificate to set different authentication methods or different defaults and constraints for a particular type of certificate type. Any certificate profile available in the administrative interface can be approved by an agent and then used by an end entity to enroll.
  • Delete any certificate profiles that will not be used.
  • Modify the existing certificate profiles for specific characteristics for the company’s certificates.

    • Change the defaults set up in the certificate profile, the values of the parameters set in the defaults, or the constraints that control the certificate content.
    • Change the constraints set up by changing the value of the parameters.
    • Change the authentication method.
    • Change the inputs by adding or deleting inputs in the certificate profile, which control the fields on the input page.
    • Add or delete the output.

Certificate System enables adding Subject Alternative Name (SAN) extensions to the SSL server certificate during the installation of non-root CA or other Certificate System instances. To do so, follow the instructions in the /usr/share/pki/ca/profiles/ca/caInternalAuthServerCert.cfg file and add the following parameters to the configuration file supplied to the pkispawn utility:

pki_san_inject
Set the value of this parameter to True.
pki_san_for_server_cert
Provide a list of the required SAN extensions separated by commas (,).

For example:

pki_san_inject=True
pki_san_for_server_cert=intca01.example.com,intca02.example.com,intca.example.com

5.4.7. Planning authentication methods

As implied in Section 5.4.6, “Using and customizing certificate profiles”, authentication for the certificate process means the way that a user or entity requesting a certificate proves that they are who they say they are. There are three ways that the Certificate System can authenticate an entity:

  • In agent-approved enrollment, end-entity requests are sent to an agent for approval. The agent approves the certificate request.
  • In automatic enrollment, end-entity requests are authenticated using a plugin, and then the certificate request is processed; an agent is not involved in the enrollment process.
  • In CMC enrollment, a third party application can create a request that is signed by an agent and then automatically processed.

A Certificate Manager is initially configured for agent-approved enrollment and for CMC authentication. Automated enrollment is enabled by configuring one of the authentication plugin modules. More than one authentication method can be configured in a single instance of a subsystem. The HTML registration pages contain hidden values specifying the method used. With certificate profiles, the end-entity enrollment pages are dynamically-generated for each enabled profile. The authentication method associated with this certificate profile is specified in the dynamically-generated enrollment page.

The authentication process is simple.

  1. An end entity submits a request for enrollment. The form used to submit the request identifies the method of authentication and enrollment. All HTML forms are dynamically-generated by the profiles, which automatically associate the appropriate authentication method with the form.
  2. If the authentication method is an agent-approved enrollment, the request is sent to the request queue of the CA agent. If the automated notification for a request in queue is set, an email is sent to the appropriate agent that a new request has been received. The agent can modify the request as allowed for that form and the profile constraints. Once approved, the request must pass the certificate profiles set for the Certificate Manager, and then the certificate is issued. When the certificate is issued, it is stored in the internal database and can be retrieved by the end entity from the end-entities page by serial number or by request ID.
  3. If the authentication method is automated, the end entity submits the request along with required information to authenticate the user, such as an LDAP user name and password. When the user is successfully authenticated, the request is processed without being sent to an agent’s queue. If the request passes the certificate profile configuration of the Certificate Manager, the certificate is issued and stored in the internal database. It is delivered to the end entity immediately through the HTML forms.

The requirements for how a certificate request is authenticated can have a direct impact on the necessary subsystems and profile settings. For example, if an agent-approved enrollment requires that an agent meet the requester in person and verify their identity through supported documentation, the authentication process can be time-intensive, as well as constrained by the physical availability of both the agent and the requester.

5.4.8. Publishing certificates and CRLs

A CA can publish both certificates and CRLs. Certificates can be published to a plain file or to an LDAP directory; CRLs can be published to file or an LDAP directory, as well, and can also be published to an OCSP responder to handle certificate verification.

Configuring publishing is fairly straightforward and is easily adjusted. For continuity and accessibility, though, it is good to plan out where certificates and CRLs need to be published and what clients need to be able to access them.

Publishing to an LDAP directory requires special configuration in the directory for publishing to work:

  • If certificates are published to the directory, than every user or server to which a certificate is issued must have a corresponding entry in the LDAP directory.
  • If CRLs are published to the directory, than they must be published to an entry for the CA which issued them.
  • For SSL/TLS, the directory service has to be configured in SSL/TLS and, optionally, be configured to allow the Certificate Manager to use certificate-based authentication.
  • The directory administrator should configure appropriate access control rules to control DN (entry name) and password based authentication to the LDAP directory.

When a CA signing certificate expires, all certificates signed with the CA’s corresponding signing key become invalid. End entities use information in the CA certificate to verify the certificate’s authenticity. If the CA certificate itself has expired, applications cannot chain the certificate to a trusted CA.

There are two ways of resolving CA certificate expiration:

  • Renewing a CA certificate involves issuing a new CA certificate with the same subject name and public and private key material as the old CA certificate, but with an extended validity period. As long as the new CA certificate is distributed to all users before the old CA certificate expires, renewing the certificate allows certificates issued under the old CA certificate to continue working for the full duration of their validity periods.
  • Reissuing a CA certificate involves issuing a new CA certificate with a new name, public and private key material, and validity period. This avoids some problems associated with renewing a CA certificate, but it requires more work for both administrators and users to implement. All certificates issued by the old CA, including those that have not yet expired, must be renewed by the new CA.

There are problems and advantages with either renewing or reissuing a CA certificate. Begin planning the CA certificate renewal or re-issuance before installing any Certificate Managers, and consider the ramifications the planned procedures may have for extensions, policies, and other aspects of the PKI deployment.

Note

Correct use of extensions, for example the authorityKeyIdentifier extension, can affect the transition from an old CA certificate to a new one.

5.5. Planning for network and physical security

When deploying any Certificate System subsystem, the physical and network security of the subsystem instance has to be considered because of the sensitivity of the data generated and stored by the subsystems.

5.5.1. Considering firewalls

There are two considerations about using firewalls with Certificate System subsystems:

  • Protecting sensitive subsystems from unauthorized access
  • Allowing appropriate access to other subsystems and clients outside of the firewall

The CA, KRA, and TKS are always placed inside a firewall because they contain critical information that can cause devastating security consequences if they are compromised.

The TPS and OCSP can be placed outside the firewall. Likewise, other services and clients used by the Certificate System can be on a different machine outside the firewall. In that case, the local networks have to be configured to allow access between the subsystems behind the firewall and the services outside it.

The LDAP database can be on a different server, even on a different network, than the subsystem which uses it. In this case, all LDAP ports (389 for LDAP and 636 for LDAPS, by default) need to be open in the firewall to allow traffic to the directory service. Without access to the LDAP database, all subsystem operations can fail.

As part of configuring the firewalls, if iptables is enabled, then it must have configured policies to allow communication over the appropriate Certificate System ports. Configuring iptables is described in the Using and configuring firewalld guide.

5.5.2. Considering physical security and location

Because of the sensitive data they hold, consider keeping the CA, KRA, and TKS in a secure facility with adequate physical access restrictions. Just as network access to the systems needs to be restricted, the physical access also needs to be restricted.

Along with finding a secure location, consider the proximity to the subsystem agents and administrators. Key recovery, for example, can require multiple agents to give approval; if these agents are spread out over a large geographical area, then the time differences may negatively impact the ability to retrieve keys. Plan the physical locations of the subsystems, then according to the locations of the agents and administrators who will manage the subsystem.

5.5.3. Planning ports

Each Certificate System server uses up to four ports:

  • A non-secure HTTP port for end entity services that do not require authentication
  • A secure HTTP port for end entity services, agent services, administrative console, and admin services that require authentication
  • A Tomcat Server Management port
  • A Tomcat AJP Connector Port

All of the service pages and interfaces described in Chapter 2 User Interfaces in the Administration Guide (Common Criteria Edition) are connected to using the instance’s URL and the corresponding port number. For example:

https://server.example.com:8443/ca/ee/ca

To access the admin console, the URL specifies the admin port:

# pkiconsole -d nssdb -n 'optional client cert nickname' https://server.example.com:8443/ca

All agent and admin functions require SSL/TLS mutual authentication. For requests from end entities, the Certificate System listens on both the SSL/TLS (encrypted) port and non-SSL/TLS ports.

The ports are defined in the server.xml file. If a port is not used, it can be disabled in that file. For example:

<Service name="Catalina">
    <!--Connector port="8080" ... /-->  unused standard port
    <Connector port="8443" ... />

Whenever a new instance in installed, make sure that the new ports are unique on the host system.

To verify that a port is available for use, check the appropriate file for the operating system. Port numbers for network-accessible services are usually maintained in a file named services. On Red Hat Enterprise Linux, it is also helpful to confirm that a port is not assigned by SELinux, by running the command semanage port -l to list all ports which currently have an SELinux context.

When a new subsystem instance is created, any number between 1 and 65535 can be specified as the secure port number.

5.6. A Checklist for planning the PKI

  • How many security domains will be created, and what subsystem instances will be placed in each domain?
  • A subsystem can only communicate with another subsystem if they have a trusted relationship. Because the subsystems within a security domain have automatic trusted relationships with each other, it is important what domain a subsystem joins. Security domains can have different certificate issuing policies, different kinds of subsystems within them, or a different Directory Server database. Map out where (both on the physical machine and in relation to each other) each subsystem belongs, and assign it to the security domain accordingly.
  • What ports should be assigned for each subsystem? Is it necessary to have a single SSL/TLS port, or is it better to have port separation for extra security?
  • The most secure solution is to use separate ports for each SSL/TLS interface. However, the feasibility of implementing multiple ports may depends on your network setup, firewall rules, and other network conditions.
  • What subsystems should be placed behind firewalls? What clients or other subsystems need to access those firewall-protected subsystems and how will access be granted? Is firewall access allowed for the LDAP database?
  • The location to install a subsystem depends on the network design. The OCSP subsystem is specifically designed to operate outside a firewall for user convenience, while the CA, KRA, and TPS should all be secured behind a firewall for increased security.

    When deciding the location of the subsystems, it is critical to plan what other subsystems or services that server needs to access (including the internal database, a CA, or external users) and look at firewall, subnet, and VPN configuration.

  • What subsystems need to be physically secured? How will access be granted, and who will be granted access?
  • The CA, TKS, and KRA all store extremely sensitive key and certificate information. For some deployments, it may be necessary to limit physical access to the machines these subsystems run on. In that case, both the subsystems and their host machines must be included in the larger infrastructure inventory and security design.
  • What is the physical location of all agents and administrators? What is the physical location of the subsystems? How will administrators or agents access the subsystem services in a timely-manner? Is it necessary to have subsystems in each geographical location or time zone?
  • The physical location of Certificate System users may impact things like request approval and token enrollment, as well as system performance because of network lag time. The importance of response time for processing certificate operations should be taken into account when deciding where and how many subsystems to install.
  • How many subsystems do you need to install?
  • The primary consideration is the expected load for each subsystem and then, secondarily, geographical or departmental divisions. Subsystems with fairly low loads (like the KRA or TKS) may only require a single instance for the entire PKI. Systems with high load (the CA) or which may benefit from local instances for local agents (like the TPS) may require multiple instances.

    Subsystems can be cloned, meaning they essentially are clustered, operating as a single unit, which is good for load balancing and high availability. Cloning is especially good for CAs and KRAs, where the same key and certificate data may need to be accessed by larger numbers of users or to have reliable failover.

    When planning for multiple subsystem instances, keep in mind how the subsystems fit within the established security domains. Security domains create trusted relationships between subsystems, allowing them to work together to find available subsystems to respond to immediate needs. Multiple security domains can be used in a single PKI, with multiple instances of any kind of subsystem, or a single security domain can be used for all subsystems.

  • Will any subsystems need to be cloned and, if so, what are the methods for securely storing their key materials?
  • Cloned subsystems work together, essentially as a single instance. This can be good for high demand systems, failover, or load balancing, but it can become difficult to maintain. For example, cloned CAs have serial number ranges for the certificates they issue, and a clone could hit the end of its range.
  • Will the subsystem certificates and keys be stored on the internal software token in Certificate System or on an external hardware token?
  • Certificate System supports two hardware security modules (HSM): nShield Connect XC and Safenet Luna (see Section 4.4, “Supported Hardware Security Modules”). Using a hardware token can require additional setup and configuration before installing the subsystems, but it also adds another layer of security.
  • What are the requirements for the CA signing certificate? Does the Certificate System need control over attributes like the validity period? How will the CA certificates be distributed?
  • The real question here is, will the CA bee a root CA which sets its own rules on issuing certificates or will it be a subordinate CA where another CA (another CA in your PKI or even an external CA) sets restrictions on what kind of certificates it can issue.

    A Certificate Manager can be configured as either a root CA or a subordinate CA. The difference between a root CA and a subordinate CA is who signs the CA signing certificate. A root CA signs its own certificate. A subordinate CA has another CA (either internal or external) sign its certificate.

    A self-signing root CA issues and signs its own CA signing certificate. This allows the CA to set its own configuration rules, like validity periods and the number of allowed subordinate CAs.

    A subordinate CA has its certificates issued by a public CA or another Certificate System root CA. This CA is subordinate to the other CA’s rules about its certificate settings and how the certificate can be used, such as the kinds of certificates that it can issue, the extensions that it is allowed to include in certificates, and the levels of subordinate CAs the subordinate CA can create.

    One option is to have the Certificate manager subordinate to a public CA. This can be very restrictive, since it introduces the restrictions that public CAs place on the kinds of certificates the subordinate CA can issue and the nature of the certificate chain. On the other hand, one benefit of chaining to a public CA is that the third party is responsible for submitting the root CA certificate to a web browser or other client software, which is a major advantage for certificates that are accessed by different companies with browsers that cannot be controlled by the administrator.

    The other option is make the CA subordinate to a Certificate System CA. Setting up a Certificate System CA as the root CA means that the Certificate System administrator has control over all subordinate CAs by setting policies that control the contents of the CA signing certificates issued.

    It is easiest to make the first CA installed a self-signed root, so that it is not necessary to apply to a third party and wait for the certificate to be issued. Make sure that you determine how many root CAs to have and where both root and subordinate CAs will be located.

  • What kinds of certificates will be issued? What characteristics do they need to have, and what profile settings are available for those characteristics? What restrictions need to be placed on the certificates?
  • As touched on in Section 5.4.6, “Using and customizing certificate profiles”, the profiles (the forms which configure each type of certificate issued by a CA) can be customized. This means that the subject DN, the validity period, the type of SSL/TLS client, and other elements can be defined by an administrator for a specific purpose. For security, profiles should provide only the functionality that is required by the PKI. Any unnecessary profiles should be disabled.
  • What are the requirements for approving a certificate request? How does the requester authenticate himself, and what kind of process is required to approve the request?
  • The request approval process directly impacts the security of the certificate. Automated processes are much faster but are less secure since the identity of the requester is only superficially verified. Likewise, agent-approved enrollments are more secure (since, in the most secure scenario they can require an in-person verification and supporting identification) but they can also be the most time-consuming.

    First determine how secure the identity verification process needs to be, then determine what authentication (approval) mechanism is required to validate that identity.

  • Will many external clients need to validate certificate status? Can the internal OCSP in the Certificate Manager handle the load?
  • Publishing CRLs and validating certificates is critical. Determine what kinds of clients will be checking the certificate status (will it mainly be internal clients? external clients? will they be validating user certificates or server certificates?) and also try to determine how many OCSP checks will be run. The CA has an internal OCSP which can be used for internal checks or infrequent checks, but a large number of OCSP checks could slow down the CA performance. For a larger number of OCSP checks and especially for large CRLs, consider using a separate OCSP Manager to take the load off the CA.
  • Will the PKI allow replacement keys? Will it require key archival and recovery?
  • If lost certificates or tokens are simply revoked and replaced, then there does not need to be a mechanism to recover them. However, when certificates are used to sign or encrypt data such as emails, files, or harddrives, then the key must always be available so that the data can be recovered. In that case, use a KRA to archive the keys so the data can always be accessed.
  • Will the organization use smart cards? If so, will temporary smart cards be allowed if smart cards are mislaid, requiring key archival and recovery?
  • If no smart cards are used, then it is never necessary to configure the TPS or TKS, since those subsystems are only used for token management. However, if smart cards are used, then the TPS and TKS are required. If tokens can be lost and replaced, then it is also necessary to have a KRA to archive the keys so that the token’s certificates can be regenerated.
  • Where will certificates and CRLs be published? What configuration needs to be done on the receiving end for publishing to work? What kinds of certificates or CRLs need to be published and how frequently?
  • The important thing to determine is what clients need to be able to access the certificate or CRL information and how that access is allowed. From there, you can define the publishing policy.

This part describes the prerequisites and procedures for installing Red Hat Certificate System and setting up the individual subsystems.

To make it easier to follow, through Chapter 6, Prerequisites for installation and Chapter 7, Installing and configuring Red Hat Certificate System, we are providing an example that demonstrates setting up a RHCS Common Criteria RSA environment on a Red Hat Enterprise Linux (RHEL) 8.6 operating system, complete with a root CA, a subordinate CA, an OCSP server, a KRA, and optionally, if TMS is of interest, a TKS and a TPS.

This example setup requires two 64-bit x86_64 machines containing 64-bit versions of the RHEL 8.6 Server release operating system:

  • rhcs10.example.com for Red Hat Certificate System (RHCS) server installation.
  • rhds11.example.com for Red Hat Directory Server (RHDS) server installation.

Chapter 6. Prerequisites for installation

The Red Hat Certificate System installation process requires some preparation of the environment. This chapter describes the requirements, dependencies, and other prerequisites for installing Certificate System in a Common Criteria environment.

6.1. Installing and subscribing the RHEL machines

Red Hat Certificate System requires Red Hat Enterprise Linux 8.6.

Prerequisites

Procedure

  1. On both machines, install RHEL 8 with all z-stream updates.

    1. Both BaseOS and AppStream repositories must be enabled (by default, those repositories are part of the full installation image that is available on the Red Hat Customer Portal and already enabled).
      For example, to verify that the BaseOS and Appstream repos are enabled for RHEL x86_64:

      # subscription-manager repos --enable rhel-8-for-x86_64-baseos-rpms
      # subscription-manager repos --enable rhel-8-for-x86_64-appstream-rpms
    2. Both machines should be registered and subscribed with a valid RHEL subscription.
      For example:

      # subscription-manager register --username=<customer access portal username>
      NOTE

      Check if Simple Content Access (SCA) mode is enabled on your account using:

      # subscription-manager status

      After registering with subscription-manager, if experiencing any issues installing packages from the enabled BaseOS and AppStream repositories, disable SCA in the subscription management page in the Access Portal. If you are not the administrator of your account, you will need to request the administrator to do so. Attach the pool ID containing your Red Hat Enterprise Linux subscription using the same method as outlined in the below step, and then try again to install the packages.

  2. Attach the Red Hat subscriptions to the system. If your system already has a subscription attached that provides Certificate System, or if Simple Content Access (SCA) is set to the default setting enabled, skip to step 3.

    1. List the available subscriptions and note the pool ID providing Red Hat Certificate System. For example:

      # subscription-manager list --available --all
      
      ...
      Subscription Name:   Red Hat Enterprise Linux Developer Suite
      Provides:            ...
                           Red Hat Certificate System
                           ...
      Pool ID:             7aba89677a6a38fc0bba7dac673f7993
      Available:           1
      ...

      Depending on the number of subscriptions you have, the output can be very long. In this case, you can redirect it to a file:

      # subscription-manager list --available --all > /root/subscriptions.txt
    2. Attach the Certificate System subscription to the system using the pool ID from the previous step:

      # subscription-manager attach --pool=7aba89677a6a38fc0bba7dac673f7993
      
      Successfully attached a subscription for: Red Hat Enterprise Linux Developer Suite
  3. "Pin" the RHEL version to 8.6 by using the subscription-manager release --set command. For example:

    # subscription-manager release --list
    # subscription-manager release --set 8.6

    Verification:

    # subscription-manager release --show
  4. In addition, on rhcs10.example.com, install the environment group Server with GUI:

    # dnf groupinstall "Server with GUI"

6.2. Enabling the repositories

Before you can install and update Red Hat Certificate System, you must enable the corresponding repositories for Certificate System and Directory Server.

Prerequisites

Enabling online repositories:

If you are installing Red Hat Certificate System with online repositories, follow the below steps on the Certificate System and on the Directory Server machine:

  1. Enable the Certificate System repository on rhcs10.example.com:

    # subscription-manager repos --enable certsys-10.x-for-rhel-8-x86_64-rpms

    Where x denotes the latest Certificate System version. For example, to enable the Certificate System repository for Red Hat Certificate System 10.4, please use the below command:

    # subscription-manager repos --enable certsys-10.4-for-rhel-8-x86_64-rpms
    
    Repository 'certsys-10.4-for-rhel-8-x86_64-rpms' is enabled for this system.
  2. Enable the Directory Server repository on rhds11.example.com:

    # subscription-manager repos --enable=dirsrv-11-for-rhel-8-x86_64-rpms
    
    Repository 'dirsrv-11-for-rhel-8-x86_64-rpms' is enabled for this system.
Note

For compliance, only enable Red Hat approved repositories. You can only enable repositories approved by Red Hat through the subscription-manager utility.

ISO repositories

If you are installing RHCS with ISO repositories, follow the below steps:

  • On rhcs10.example.com:

    1. Create a repo file in /etc/yum.repos.d/:

      # vi /etc/yum.repos.d/redhat.repo
      [rhcs10]
      
      name=rhcs10
      baseurl=http://rhcs10.example.com/rhcs10/
      enabled=1
      gpgcheck=1
      gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
      skip_if_unavailable=1
    2. Install the Apache web server, if it is not already installed on the system:

      # dnf install httpd
    3. Start the httpd service:

      # service httpd start
    4. Create a directory that will be used as the web root for hosting the ISO repository. For example:

      # mkdir -p /var/www/html/rhcs10
    5. Mount the ISO to the directory. For example:

      # mount -o loop XXXXXXX-CertificateSystem-x86_64-dvd1.iso /var/www/html/rhcs10
  • On rhds11.example.com:

    1. Create a repo file in /etc/yum.repos.d/:

      # vi /etc/yum.repos.d/redhat.repo
      [rhds11]
      
      name=rhds11
      baseurl=http://rhds11.example.com/rhds11/
      enabled=1
      gpgcheck=1
      gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
      skip_if_unavailable=1
    2. Install the Apache web server, if it is not already installed on the system:

      # dnf install httpd
    3. Start the httpd service:

      # service httpd start
    4. Create a directory that will be used as the web root for hosting the ISO repository. For example:

      # mkdir -p /var/www/html/rhds11
    5. Mount the ISO to the directory. For example:

      # mount -o loop XXXXXXX-DirectoryServer-x86_64-dvd1.iso /var/www/html/rhds11

6.3. Setting the FQDN

  1. Make sure the Fully Qualified Domain Name (FQDN) of each host matches how you wish them to be recognized. For example, run the following on both machines:

    # hostname
  2. If a hostname is not what you expect it to be, you can configure the FQDN using hostnamectl. For example, to update the CS machine’s hostname:

    # hostnamectl set-hostname rhcs10.example.com
  3. To update the DS machine’s hostname:

    # hostnamectl set-hostname rhds11.example.com
  4. Additionally, add both the CS and DS machines' IP addresses and new hostnames as entries in /etc/hosts:

    # vi /etc/hosts
    127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
    ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
    10.1.111.111 rhcs10.example.com
    10.2.222.222 rhds11.example.com
  5. Verify the FQDN again after the change:

    # hostname

6.4. Enabling FIPS on RHEL 8

FIPS mode must be enabled before you install the Certificate System.

  • To check whether your system is in FIPS mode, run the following command:

    # sysctl crypto.fips_enabled

    If the returned value is 1, FIPS mode is enabled.

The following procedure demonstrates how to enable the Federal Information Processing Standard (FIPS) mode on both rhcs10.example.com and rhds11.example.com.

  1. To switch to FIPS mode, use the fips-mode-setup --enable command.

    # fips-mode-setup --enable
    
    Kernel initramdisks are being regenerated. This might take some time.
    Setting system policy to FIPS
    Note: System-wide crypto policies are applied on application start-up.
    It is recommended to restart the system for the change of policies to fully take place.
    FIPS mode will be enabled.
    Please reboot the system for the setting to take effect.
  2. Restart your system to allow the kernel to switch to FIPS mode:

    # reboot
  3. Verify the current state of FIPS mode after the restart:

    # fips-mode-setup --check
    
    FIPS mode is enabled.
Note

If an existing directory server is running on a non-FIPS RHEL 8 system that has only just had its FIPS enabled, you will need to reset the Directory Manager password to allow the existing directory server to run properly. For more information, see Managing the Directory Manager Password in the Red Hat Directory Server Administration Guide.

6.5. Setting up fapolicyd (for STIG environments)

The fapolicyd software framework controls the execution of applications based on a user-defined policy. In a STIG environment, installing Certificate System will fail if fapolicyd is not set up properly. The following procedure describes how to add the rules needed to install and run RHCS instances.

Important

Do not follow this section unless you are certain that your system is in a STIG environment. In case you complete the below procedure unnecessarily, and later run into issues when running pkispawn, you will need to revert the changes before proceeding.

Procedure

To add the required fapolicyd rule:

  1. As root, create a file under /etc/fapolicyd/rules.d/ with a unique name. The prefix must contain a number in the 30s range for the priority, such as 35-allow-java.rules, or 39.

    # vi /etc/fapolicyd/35-allow-java.rules
  2. Add the following rule:

    allow perm=open dir=/usr/lib/jvm/ : dir=/usr/share/tomcat/bin/ ftype=application/java-archive
  3. After saving the file, restart the fapolicyd service to recompile the rules:

    # systemctl restart fapolicyd.service

6.6. Configuring a HSM

To use a Hardware Security Module (HSM), a Federal Information Processing Standard (FIPS) 140-2 validated HSM is required. Red Hat Certificate System supports the nShield Connect XC hardware security module (HSM) and Thales Luna HSM by default (please see Section 4.4, “Supported Hardware Security Modules” for more information on Luna’s limitations). Certificate System-supported HSMs are automatically added to the pkcs11.txt database with the modutil command during the pre-configuration stage of the installation, if the PKCS #11 library modules are in the specified installation paths.

  • Configure rhcs10.example.com to be the HSM client machine.
Important

Please follow the instructions provided by your HSM vendor for your specific HSM brand / model / release.

In our example, an nShield Connect XC unit is installed and configured with the latest software and firmware for compliance with FIPS 140-2 (Level 3). As of this writing the RFS software is SecWorld_Lin64-12.71.0, the firmware is nShield firmware 12.72.1 (FIPS certified), image 12.80.5.

6.6.1. FIPS mode on an HSM

To use a Hardware Security Module (HSM), a Federal Information Processing Standard (FIPS) 140-2 validated HSM is required. Certain deployments require to setup their HSM to use FIPS mode. To enable FIPS Mode on HSMs, please refer to your HSM vendor’s documentation.

Important
nShield Connect XC HSM
On a nShield Connect XC HSM, the FIPS mode can only be enabled when generating the Security World, this cannot be changed afterwards. While there is a variety of ways to generate the Security World, the preferred method is always to use the new-world command.
For guidance on how to generate a FIPS-compliant Security World, please follow the HSM vendor’s documentation.
Luna HSM
Similarly, enabling the FIPS mode on a Luna HSM must be done during the initial configuration, since changing this policy zeroizes the HSM as a security measure.
For details, please refer to the Luna HSM vendor’s documentation. Please see Section 4.4, “Supported Hardware Security Modules” for more information on Luna’s limitations.

The below steps help you verify if FIPS mode is enabled for nShield Connect XC and Luna HSMs. For other HSMs, please refer to your HSM manufacturer’s documentation.

nShield Connect XC HSM

To verify if the FIPS mode is enabled on an nShield HSM, enter:

# /opt/nfast/bin/nfkminfo

With older versions of the software, if the StrictFIPS140 is listed in the state flag, the FIPS mode is enabled. In newer versions, it is however better to check the new mode line and look for fips1402level3. In all cases, there should also be an hkfips key present in the nfkminfo output.

Luna HSM

To verify if the FIPS mode is enabled on a Luna HSM:

  1. Open the lunash management console
  2. Use the hsm show command and verify that the output contains the text The HSM is in FIPS 140-2 approved operation mode.:

    lunash:> hsm show
    ...
           FIPS 140-2 Operation:
           =====================
           The HSM is in FIPS 140-2 approved operation mode.
    ...
Note

Please refer to your HSM vendor’s documentation for complete procedures.

6.6.2. Setting up SELinux for an HSM

Certain HSMs require that you manually update SELinux settings before you can install Certificate System. The following describes nShield and Luna HSMs. For other HSMs, please refer to your HSM manufacturer’s documentation.

nShield Connect XC

After you have installed the HSM and before you start installing Certificate System:

  1. Reset the context of files in the /opt/nfast/ directory:

    # restorecon -R /opt/nfast/
  2. Restart the nfast software.

    # /opt/nfast/sbin/init.d-ncipher restart
Thales Luna HSM
No SELinux-related actions are required before you start installing Certificate System.

For details about supported HSMs and their limits, see Section 4.4, “Supported Hardware Security Modules”.

In Chapter 7, Installing and configuring Red Hat Certificate System, you are instructed to use the following parameters in the configuration file you pass to the pkispawn utility when installing Certificate System with an HSM:

...
[DEFAULT]
##########################
# Provide HSM parameters #
##########################
pki_hsm_enable=True
pki_hsm_libfile=hsm_libfile
pki_hsm_modulename=hsm_modulename
pki_token_name=hsm_token_name
pki_token_password=pki_token_password

########################################
# Provide PKI-specific HSM token names #
########################################
pki_audit_signing_token=hsm_token_name
pki_ssl_server_token=hsm_token_name
pki_subsystem_token=hsm_token_name
...
  • The values of the pki_hsm_libfile and pki_token_name parameter depend on your specific HSM installation. These values allow the pkispawn utility to set up your HSM and enable Certificate System to connect to it.
  • The value of the pki_token_password depends upon your particular HSM token’s password. The password gives the pkispawn utility read and write permissions to create new keys on the HSM.
  • The value of the pki_hsm_modulename is a name used in later pkispawn operations to identify the HSM. The string is an identifier you can set as whatever you like. It allows pkispawn and Certificate System to refer to the HSM and configuration information by name in later operations.

The following section provides settings for individual HSMs. If your HSM is not listed, consult your HSM manufacturer’s documentation.

nShield HSM parameters

For a nShield Connect XC, set the following parameters:

pki_hsm_libfile=/opt/nfast/toolkits/pkcs11/libcknfast.so
pki_hsm_modulename=nfast

Note that you can set the value of pki_hsm_modulename to any value. The above is a suggested value.

To identify the token name, run the following command as the root user:

# /opt/nfast/bin/nfkminfo

Module #1 Slot #0 IC 1
 generation    1
 phystype      SmartCard
 slotlistflags 0x2 SupportsAuthentication
 state         0x5 Operator
 flags         0x10000
 shareno       1 (`CONNXC-1')
 shares        LTU(PIN) LTFIPS
 error         OK
Cardset
 name          "NHSM-CONN-XC"
 k-out-of-n    1/2
 flags         Persistent PINRecoveryForbidden(disabled) !RemoteEnabled
 timeout       none
 card names    "CONNXC-1" "CONNXC-2"
 hkltu         xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
 gentime       2021-11-17 21:19:47

Module #1 Slot #1 IC 0
 generation    1
 phystype      SoftToken
 slotlistflags 0x0
 state         0x2 Empty
 flags         0x0
 shareno       0
 shares
 error         OK
No Cardset

No Pre-Loaded Objects

The value of the name field in the Cardset section lists the token name.

Set the token name as follows:

pki_token_name=NHSM-CONN-XC

SafeNet / Luna HSM parameters

For a SafeNet / Luna HSM, such as a SafeNet Luna Network HSM, specify the following parameters:

pki_hsm_libfile=/usr/safenet/lunaclient/lib/libCryptoki2_64.so
pki_hsm_modulename=thalesluna

Note that you can set the value of pki_hsm_modulename to any value. The above is a suggested value.

To identify the token name, run the following command as the root user:

# /usr/safenet/lunaclient/bin/vtl verify

The following Luna Slots/Partitions were found:

Slot    Serial #            Label
===    ===============    =====
   0       1209461834772     thaleslunaQE

The value in the label column lists the token name.

Set the token name as follows:

pki_token_name=thaleslunaQE
Note

Please see Section 4.4, “Supported Hardware Security Modules” for more information on Luna’s limitations.

6.6.4. Testing the HSM connection

To test the HSM connection:

  1. Create a temporary database:

    # mkdir -p /root/tmp1
    # certutil -N -d /root/tmp1
  2. Add the PKCS #11 library module to the database:

    • nShield Connect XC:

      # modutil -dbdir /root/tmp1 -nocertdb -add nfast -libfile /opt/nfast/toolkits/pkcs11/libcknfast.so
      ---
      Module "nfast" added to database.
    • Thales Luna:

      # modutil -dbdir ~/testLuna -nocertdb -add thalesluna -libfile /usr/safenet/lunaclient/lib/libCryptoki2_64.so
      ---
      Module "thalesluna" added to database.
  3. List the modules and note down the HSM name at "token:" for the next step (e.g. NHSM-CONN-XC in the below example):

    # modutil -dbdir /root/tmp1 -list
    
    1. NSS Internal PKCS #11 Module
    …
    token: NSS FIPS 140-2 Certificate DB
    …
    2. nfast
    …
    token: accelerator
    …
    token: NHSM-CONN-XC
  4. Display the certificates for this token:

    # certutil -L -d /root/tmp1 -h <token name>

6.7. Verifying SELinux enforcement

Security-Enhanced Linux (SELinux) is an implementation of a mandatory access control mechanism in the Linux kernel, checking for allowed operations after standard discretionary access controls are checked. SELinux can enforce rules on files and processes in a Linux system, and on their actions, based on defined policies.

By default, RHEL 8 is installed with SELinux enabled. The SELinux policy must be set to Enforcing.

  • To verify the current SELinux mode:

    # /usr/sbin/getenforce
    
      Enforcing
    # /usr/sbin/sestatus
    
    SELinux status:                 enabled
    SELinuxfs mount:                /sys/fs/selinux
    SELinux root directory:         /etc/selinux
    Loaded policy name:             targeted
    Current mode:                   enforcing
    Mode from config file:          enforcing
    Policy MLS status:              enabled
    Policy deny_unknown status:     allowed
    Memory protection checking:     actual (secure)
    Max kernel policy version:      33
  • Optional: If you need to set the policy to Enforcing:

    # /usr/sbin/setenforce 1
    
      Enforcing

In our examples, Certificate System subsystems use the following ports. You might want to bookmark the following table for ease of reference to selected ports used by the example installations.

Expand
Table 6.1. Ports
Instance and servicesPorts (RSA)Ports (ECC)

RootCA

HTTP / HTTPS

8080 / 8443

20080 / 20443

CRL HTTP

8085

20085

LDAP

389 / 636

1389 / 1636

Tomcat

8009 / 8005

20009 / 20005

SubCA

HTTP / HTTPS

31080 / 31443

21080 / 21443

CRL HTTP

31085

21085

LDAP

7389 / 7636

8389 / 8636

Tomcat

31009 / 31005

21009 / 21005

OCSP (RootCA)

HTTP / HTTPS

33080 / 33443

34080 / 34443

LDAP

6389 / 6636

2389 / 2636

Tomcat

33009 / 33005

34009 / 34005

CRL publishing

12389 / 12636

13389 / 13636

OCSP (SubCA)

HTTP / HTTPS

32080 / 32443

22080 / 22443

LDAP

11389 / 11636

9389 / 9636

Tomcat

32009 / 32005

22009 / 22005

CRL publishing

5389 / 5636

14389 / 14636

KRA

HTTP / HTTPS

28080 / 28443

23080 / 23443

LDAP

22389 / 22636

4389 / 4636

Tomcat

28009 / 28005

23009 / 23005

TKS

HTTP / HTTPS

24080 / 24443

N/A

LDAP

16389 / 16636

N/A

Tomcat Management

14009 / 14005

N/A

TPS

HTTP / HTTPS

25080 / 25443

N/A

LDAP

17389 / 17636

N/A

TPS Auth

9389 / 9636

N/A

Tomcat Management

14019 / 14015

N/A

Note

When you set up Certificate System using the pkispawn utility, you can customize the port numbers. If you use different ports than the ones listed above, open them correspondingly in the firewall as described below.

To enable communication between the clients and Certificate System, open the required ports in your firewall on the machine that will be hosting the corresponding service:

  1. Make sure the firewalld service is running.

    # systemctl status firewalld
  2. To start firewalld and configure it to start automatically when the system boots:

    # systemctl start firewalld
    # systemctl enable firewalld

Adding ports to the firewall

  1. Open the required ports using the firewall-cmd utility. For example, to open the default ports for the RootCA instance in the default firewall zone:

    # firewall-cmd --permanent --add-port={8080/tcp,8443/tcp,8009/tcp,8005/tcp}

    Additionally, to open the default ports for the RootCA’s LDAP instance:

    # firewall-cmd --permanent --add-port={389/tcp,636/tcp}
  2. Verify that all ports that will be used are successfully added to the firewall:

    # firewall-cmd --list-ports
  3. Reload the firewall configuration to ensure that the change takes place immediately:

    # firewall-cmd --reload

Adding ports with SELinux context

If you want to add non-default ports, you will need to add them with SELinux context. If not, you will get an error like the following: Installation failed: port 33080 has invalid selinux context ephemeral_port_t.

  1. For CS instances, add SELinux context to all ports that will be used as type http_port_t. You can do this quickly using a FOR loop command with all ports you need to add. For example, to add the default RootCA ports:

    # for port in 8080 8443 8009 8005 31080 31443 31009 31005 33080 33443 33009 33005 32080 32443 32009 32005 28080 28443 28009 28005 24080 24443 14009 14005 25080 25443 14019 14015; do semanage port -a -t http_port_t -p tcp $port; done
  2. For DS ports, replace the port type option http_port_t with ldap_port_t. For example, for the RootCA’s LDAP ports:

    # for port in 389 636 7389 7636 6389 6636 12389 12636 11389 11636 5389 5636 22389 22636 16389 16636 17389 17636; do semanage port -a -t ldap_port_t -p tcp $i; done
  3. Verify that all ports that will be used are successfully added with SELinux context:

    # semanage port -l

6.9. Installing RHCS and RHDS packages

This section describes the installation of Red Hat Directory Server (RHDS) and Red Hat Certificate System (RHCS) packages and their initial configuration.

When installing the Certificate System packages you can either install them for each subsystem individually or all at once.

The following subsystem packages and components are available in Red Hat Certificate System:

  • pki-ca: Provides the Certificate Authority (CA) subsystem.
  • pki-kra: Provides the Key Recovery Authority (KRA) subsystem.
  • pki-ocsp: Provides the Online Certificate Status Protocol (OCSP) responder.
  • pki-tks: Provides the Token Key Service (TKS).
  • pki-tps: Provides the Token Processing Service (TPS).
  • pki-server and redhat-pki-server-theme: Provides the web-based Certificate System interface. Both packages must be installed. This is installed as a dependency if you install one of the following packages: pki-ca, pki-kra, pki-ocsp, pki-tks, pki-tps.
  • pki-console and redhat-pki-console-theme: Provides the Java-based Red Hat PKI console. Both packages must be installed.
  • pki-acme provides Automatic Certificate Management Environment (ACME).
  • pki-est is available as Technology Preview, providing Enrollment over Secure Transport (EST).

    Note

    Technology Preview features provide early access to upcoming product functionality, and are not yet fully supported under subscription agreements.

Important

ACME (Automatic Certificate Management Environment) and (EST) Enrollment over Secure Transport are not evaluated and must not be used in the Common Criteria configuration.

With the redhat-pki module, you can install all Certificate System subsystem packages and components at once on a RHEL 8 system. The redhat-pki module installs the five subsystems of Red Hat Certificate System: in addition to the pki-core module (CA, KRA) which is part of Red Hat Identity Management (IdM), includes the RHCS-specific subsystems (OCSP, TKS and TPS) as well as the pki-deps module that takes care of the required dependencies.

Prerequisites

Install the packages

  • Install the Red Hat Certificate System (RHCS) subsystem packages as follows:

    1. On rhcs10.example.com, enable the RHCS module and install the RHCS 10.4 packages:

      # dnf module enable redhat-pki
      # dnf install redhat-pki

      This installs the following packages:

      idm-console-framework-1.3.0-1.module+el8pki+14677+1ef79a68.noarch.rpm
      jss-4.9.10-1.module+el8pki+21949+4b2d0700.x86_64.rpm
      jss-javadoc-4.9.10-1.module+el8pki+21949+4b2d0700.x86_64.rpm
      ldapjdk-4.23.0-1.module+el8pki+14677+1ef79a68.noarch.rpm
      ldapjdk-javadoc-4.23.0-1.module+el8pki+14677+1ef79a68.noarch.rpm
      python3-redhat-pki-10.13.11-1.module+el8pki+21949+4b2d0700.noarch.rpm
      redhat-pki-10.13.11-1.module+el8pki+21949+4b2d0700.x86_64.rpm
      redhat-pki-acme-10.13.11-1.module+el8pki+21949+4b2d0700.noarch.rpm
      redhat-pki-base-10.13.11-1.module+el8pki+21949+4b2d0700.noarch.rpm
      redhat-pki-base-java-10.13.11-1.module+el8pki+21949+4b2d0700.noarch.rpm
      redhat-pki-ca-10.13.11-1.module+el8pki+21949+4b2d0700.noarch.rpm
      redhat-pki-console-10.13.11-1.module+el8pki+21949+4b2d0700.noarch.rpm
      redhat-pki-console-theme-10.13.11-1.module+el8pki+21949+4b2d0700.noarch.rpm
      redhat-pki-est-10.13.11-1.module+el8pki+21949+4b2d0700.noarch.rpm
      redhat-pki-javadoc-10.13.11-1.module+el8pki+21949+4b2d0700.noarch.rpm
      redhat-pki-kra-10.13.11-1.module+el8pki+21949+4b2d0700.noarch.rpm
      redhat-pki-ocsp-10.13.11-1.module+el8pki+21949+4b2d0700.noarch.rpm
      redhat-pki-server-10.13.11-1.module+el8pki+21949+4b2d0700.noarch.rpm
      redhat-pki-server-theme-10.13.11-1.module+el8pki+21949+4b2d0700.noarch.rpm
      redhat-pki-symkey-10.13.11-1.module+el8pki+21949+4b2d0700.x86_64.rpm
      redhat-pki-tks-10.13.11-1.module+el8pki+21949+4b2d0700.noarch.rpm
      redhat-pki-tools-10.13.11-1.module+el8pki+21949+4b2d0700.x86_64.rpm
      redhat-pki-tps-10.13.11-1.module+el8pki+21949+4b2d0700.x86_64.rpm
      tomcatjss-7.7.4-1.module+el8pki+21738+33a5e23b.noarch.rpm
    2. In addition, on rhds11.example.com, install the RHDS module to install all the Red Hat Directory Server 11.5 packages:

      # dnf module install redhat-ds:11

Create directories for storing pki files

  • On rhcs10.example.com:

    # mkdir -p /root/pki_rsa
    # mkdir -p /opt/pki_rsa
  • On rhds11.example.com:

    # mkdir -p /root/pki_rsa/dirsrv
    # mkdir -p /opt/pki_rsa
    # mkdir -p /etc/dirsrv/save-rsa

Verifying Certificate System product version

The Red Hat Certificate System product version is stored in the /usr/share/pki/CS_SERVER_VERSION file.

  • To display the version:

    # cat /usr/share/pki/CS_SERVER_VERSION
    
    Red Hat Certificate System 10.4.3
  • To display the PKI version:

    # cat /usr/share/pki/VERSION
    
    Name: pki
    Specification-Version: 10.13.11
    Implementation-Version: 10.13.11-1.module+el8pki+21949+4b2d0700
Note

Future updates will have newer version numbers (that is, 10.4.x).

Note

Once you have a server installed and running, you could find the product version for each instance by accessing the URLs as instructed in Section 7.13.16, “Determining the product version”.

Updating Certificate System packages

To update Certificate System and operating system packages, use the dnf update command.

  • For example:

    # dnf update

    This updates the whole system including the RHCS packages. You can verify the version number before and after updating packages, to confirm they were successfully installed.

Important

Updating Certificate System requires the PKI infrastructure to be restarted. We suggest scheduling a maintenance window during which you can take the PKI infrastructure offline to install the update.

  • To optionally download updates without installing, use the --downloadonly option in the above procedure:

    # dnf update --downloadonly

    The downloaded packages are stored in the /var/cache/yum/ directory.
    The dnf update will later use the packages if they are the latest versions.

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)
Note

TKS and TPS are for TMS (Token Management System) only.

Each subsystem is installed and configured individually as a standalone Tomcat web server instance.

Important

The order in which the individual subsystems are set up is important because of relationships between the different subsystems:

  1. At least one CA running as a security domain is required before any of the other public key infrastructure (PKI) subsystems can be installed.
  2. Install the OCSP after you have configured the CA.
  3. The KRA and TKS subsystems can be installed in any order, after you have configured the CA and OCSP.
  4. The TPS subsystem depends on the CA and TKS, and optionally on the KRA and OCSP subsystem.
Note

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.

Note

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.

Note

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

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

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:

  1. Create an OS administrator group (e.g. pkiadmin):

    # /usr/sbin/groupadd -r pkiadmin
  2. Create OS users:

    1. 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
    2. 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
    3. 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
  3. Associate pkiuser with the pkiadmin and nfast groups:

    # /usr/sbin/usermod -a -G pkiadmin pkiuser
    # /usr/sbin/usermod -a -G nfast pkiuser
    NOTE

    If using a Thales Luna HSM, associate pkiuser with the hsmusers group (instead of nfast):

    # /usr/sbin/usermod -a -G hsmusers pkiuser

    Please see Section 4.4, “Supported Hardware Security Modules” for more information on Luna’s limitations.

  4. 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
    NOTE

    Again, if using a Thales Luna HSM, associate the users who are to administer the HSM device with the hsmusers group (instead of nfast). For example:

    # /usr/sbin/usermod -a -G hsmusers jgenie

    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
    
    pkiuser : pkiuser nfast pkiadmin
    
    jgenie : pkiadmin nfast
Note

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

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
Important

Before proceeding, make sure you have followed the Chapter 6, Prerequisites for installation.

7.1.2.1. Installing a DS instance for the RootCA

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:

  1. Create the RootCA directory server installation file at a chosen location (e.g. /root/pki_rsa):

    # vim /root/pki_rsa/rootca-ldap.cfg
    
    [general]
    full_machine_name = rhds11.example.com
    
    [slapd]
    port = 389
    secure_port = 636
    instance_name = CC-RSA-RootCA-LDAP
    root_password = SECret.123
    self_sign_cert = True
    
    [backend-userroot]
    create_suffix_entry = True
    suffix = dc=example,dc=com
    Important

    Make 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 the suffix matches.

  2. 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
  3. Set up the directory server instance using the .cfg file:

    # dscreate from-file /root/pki_rsa/rootca-ldap.cfg
    
    Starting installation...
    
    Completed installation for CC-RSA-RootCA-LDAP
Note

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:

  1. List the bootstrap certificates to verify:

    # certutil -L -d /etc/dirsrv/slapd-CC-RSA-RootCA-LDAP/
    
    Certificate Nickname                            Trust Attributes
                                                    SSL,S/MIME,JAR/XPI
    Self-Signed-CA                                  CT,,
    Server-Cert                                     u,u,u
  2. 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
  3. 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
  4. 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
  5. 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

    The LDAP search should be successful, e.g:

    # extended LDIF
    #
    # LDAPv3
    # base <dc=example,dc=com> with scope subtree
    # filter: (objectclass=*)
    # requesting: ALL
    #
    
    # example.com
    dn: dc=example,dc=com
    objectClass: top
    objectClass: domain
    dc: example
    description: dc=example,dc=com
    
    # search result
    search: 2
    result: 0 Success
    
    # numResponses: 2
    # numEntries: 1
Note

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:

  1. Create the RootCA’s OCSP directory server installation file at a chosen location (e.g. /root/pki_rsa):

    # vim /root/pki_rsa/ocsp-rootca-ldap.cfg
    
    [general]
    full_machine_name = rhds11.example.com
    
    [slapd]
    port = 6389
    secure_port = 6636
    instance_name = CC-RSA-OCSP-rootca-LDAP
    root_password = SECret.123
    self_sign_cert = True
    
    [backend-userroot]
    create_suffix_entry = True
    suffix = dc=example,dc=com
    Important

    Make 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 the suffix matches.

  2. Set up the directory server instance using the .cfg file:

    # dscreate from-file /root/pki_rsa/ocsp-rootca-ldap.cfg
    
    Starting installation...
    
    Completed installation for CC-RSA-OCSP-rootca-LDAP
Note

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:

  1. List the bootstrap certificates to verify:

    # certutil -L -d /etc/dirsrv/slapd-CC-RSA-OCSP-rootca-LDAP/
    
    Certificate Nickname                            Trust Attributes
                                                    SSL,S/MIME,JAR/XPI
    Self-Signed-CA                                  CT,,
    Server-Cert                                     u,u,u
  2. 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
  3. 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
  4. 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
  5. 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

    The LDAP search should be successful, e.g:

    # extended LDIF
    #
    # LDAPv3
    # base <dc=example,dc=com> with scope subtree
    # filter: (objectclass=*)
    # requesting: ALL
    #
    
    # example.com
    dn: dc=example,dc=com
    objectClass: top
    objectClass: domain
    dc: example
    description: dc=example,dc=com
    
    # search result
    search: 2
    result: 0 Success
    
    # numResponses: 2
    # numEntries: 1
7.1.2.3. Installing a DS instance for the SubCA

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:

  1. Create the SubCA directory server installation file at a chosen location (e.g. /root/pki_rsa):

    # vim /root/pki_rsa/subca-ldap.cfg
    
    [general]
    full_machine_name = rhds11.example.com
    
    [slapd]
    port = 7389
    secure_port = 7636
    instance_name = CC-RSA-SubCA-LDAP
    root_password = SECret.123
    self_sign_cert = True
    
    [backend-userroot]
    create_suffix_entry = True
    suffix = dc=example,dc=com
    Important

    Make 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 the suffix matches.

  2. Set up the directory server instance using the .cfg file:

    # dscreate from-file /root/pki_rsa/subca-ldap.cfg
    
    Starting installation...
    
    Completed installation for CC-RSA-SubCA-LDAP
Note

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:

  1. List the bootstrap certificates to verify:

    # certutil -L -d /etc/dirsrv/slapd-CC-RSA-SubCA-LDAP/
    
    Certificate Nickname                            Trust Attributes
                                                    SSL,S/MIME,JAR/XPI
    Self-Signed-CA                                  CT,,
    Server-Cert                                     u,u,u
  2. 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
  3. 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
  4. 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
  5. 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

    The LDAP search should be successful, e.g:

    # extended LDIF
    #
    # LDAPv3
    # base <dc=example,dc=com> with scope subtree
    # filter: (objectclass=*)
    # requesting: ALL
    #
    
    # example.com
    dn: dc=example,dc=com
    objectClass: top
    objectClass: domain
    dc: example
    description: dc=example,dc=com
    
    # search result
    search: 2
    result: 0 Success
    
    # numResponses: 2
    # numEntries: 1

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:

  1. Create the SubCA’s OCSP directory server installation file at a chosen location (e.g. /root/pki_rsa):

    # vim /root/pki_rsa/ocsp-subca-ldap.cfg
    
    [general]
    full_machine_name = rhds11.example.com
    
    [slapd]
    port = 11389
    secure_port = 11636
    instance_name = CC-RSA-OCSP-subca-LDAP
    root_password = SECret.123
    self_sign_cert = True
    
    [backend-userroot]
    create_suffix_entry = True
    suffix = dc=example,dc=com
    Important

    Make 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 the suffix matches.

  2. Set up the directory server instance using the .cfg file:

    # dscreate from-file /root/pki_rsa/ocsp-subca-ldap.cfg
    
    Starting installation...
    
    Completed installation for CC-RSA-OCSP-subca-LDAP
Note

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:

  1. List the bootstrap certificates to verify:

    # certutil -L -d /etc/dirsrv/slapd-CC-RSA-OCSP-subca-LDAP/
    
    Certificate Nickname                            Trust Attributes
                                                    SSL,S/MIME,JAR/XPI
    Self-Signed-CA                                  CT,,
    Server-Cert                                     u,u,u
  2. 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
  3. 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
  4. 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
  5. 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

    The LDAP search should be successful, e.g:

    # extended LDIF
    #
    # LDAPv3
    # base <dc=example,dc=com> with scope subtree
    # filter: (objectclass=*)
    # requesting: ALL
    #
    
    # example.com
    dn: dc=example,dc=com
    objectClass: top
    objectClass: domain
    dc: example
    description: dc=example,dc=com
    
    # search result
    search: 2
    result: 0 Success
    
    # numResponses: 2
    # numEntries: 1
7.1.2.5. Installing a DS instance for the KRA

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:

  1. Create the KRA directory server installation file at a chosen location (e.g. /root/pki_rsa):

    # vim /root/pki_rsa/kra-ldap.cfg
    
    [general]
    full_machine_name = rhds11.example.com
    
    [slapd]
    port = 22389
    secure_port = 22636
    instance_name = CC-RSA-KRA-LDAP
    root_password = SECret.123
    self_sign_cert = True
    
    [backend-userroot]
    create_suffix_entry = True
    suffix = dc=example,dc=com
    Important

    Make 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 the suffix matches.

  2. Set up the directory server instance using the .cfg file:

    # dscreate from-file /root/pki_rsa/kra-ldap.cfg
    
    Starting installation...
    
    Completed installation for CC-RSA-KRA-LDAP
Note

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:

  1. List the bootstrap certificates to verify:

    # certutil -L -d /etc/dirsrv/slapd-CC-RSA-KRA-LDAP/
    
    Certificate Nickname                            Trust Attributes
                                                    SSL,S/MIME,JAR/XPI
    Self-Signed-CA                                  CT,,
    Server-Cert                                     u,u,u
  2. 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
  3. 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
  4. 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
  5. 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

    The LDAP search should be successful, e.g:

    # extended LDIF
    #
    # LDAPv3
    # base <dc=example,dc=com> with scope subtree
    # filter: (objectclass=*)
    # requesting: ALL
    #
    
    # example.com
    dn: dc=example,dc=com
    objectClass: top
    objectClass: domain
    dc: example
    description: dc=example,dc=com
    
    # search result
    search: 2
    result: 0 Success
    
    # numResponses: 2
    # numEntries: 1
7.1.2.6. Installing a DS instance for the TKS

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.

Note

Please note that TMS is not supported for ECC.

On rhds11.example.com:

  1. Create the TKS directory server installation file at a chosen location (e.g. /root/pki_rsa):

    # vim /root/pki_rsa/tks-ldap.cfg
    
    [general]
    full_machine_name = rhds11.example.com
    
    [slapd]
    port = 16389
    secure_port = 16636
    instance_name = CC-RSA-TKS-LDAP
    root_password = SECret.123
    self_sign_cert = True
    
    [backend-userroot]
    create_suffix_entry = True
    suffix = dc=example,dc=com
    Important

    Make 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 the suffix matches.

  2. Set up the directory server instance using the .cfg file:

    # dscreate from-file /root/pki_rsa/tks-ldap.cfg
    
    Starting installation...
    
    Completed installation for CC-RSA-TKS-LDAP
Note

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:

  1. List the bootstrap certificates to verify:

    # certutil -L -d /etc/dirsrv/slapd-CC-RSA-TKS-LDAP/
    
    Certificate Nickname                            Trust Attributes
                                                    SSL,S/MIME,JAR/XPI
    Self-Signed-CA                                  CT,,
    Server-Cert                                     u,u,u
  2. 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
  3. 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
  4. 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
  5. 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

    The LDAP search should be successful, e.g:

    # extended LDIF
    #
    # LDAPv3
    # base <dc=example,dc=com> with scope subtree
    # filter: (objectclass=*)
    # requesting: ALL
    #
    
    # example.com
    dn: dc=example,dc=com
    objectClass: top
    objectClass: domain
    dc: example
    description: dc=example,dc=com
    
    # search result
    search: 2
    result: 0 Success
    
    # numResponses: 2
    # numEntries: 1
7.1.2.7. Installing a DS instance for the TPS

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:

  1. Create the TPS directory server installation file at a chosen location (e.g. /root/pki_rsa):

    # vim /root/pki_rsa/tps-ldap.cfg
    
    [general]
    full_machine_name = rhds11.example.com
    
    [slapd]
    port = 17389
    secure_port = 17636
    instance_name = CC-RSA-TPS-LDAP
    root_password = SECret.123
    self_sign_cert = True
    
    [backend-userroot]
    create_suffix_entry = True
    suffix = dc=example,dc=com
    Important

    Make 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 the suffix matches.

  2. Set up the directory server instance using the .cfg file:

    # dscreate from-file /root/pki_rsa/tps-ldap.cfg
    
    Starting installation...
    
    Completed installation for CC-RSA-TPS-LDAP
Note

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:

  1. List the bootstrap certificates to verify:

    # certutil -L -d /etc/dirsrv/slapd-CC-RSA-TPS-LDAP/
    
    Certificate Nickname                            Trust Attributes
                                                    SSL,S/MIME,JAR/XPI
    Self-Signed-CA                                  CT,,
    Server-Cert                                     u,u,u
  2. 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
  3. 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
  4. 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
  5. 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

    The LDAP search should be successful, e.g:

    # extended LDIF
    #
    # LDAPv3
    # base <dc=example,dc=com> with scope subtree
    # filter: (objectclass=*)
    # requesting: ALL
    #
    
    # example.com
    dn: dc=example,dc=com
    objectClass: top
    objectClass: domain
    dc: example
    description: dc=example,dc=com
    
    # search result
    search: 2
    result: 0 Success
    
    # numResponses: 2
    # numEntries: 1

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.

pki_ds_database=back_end_database_name
pki_ds_hostname=host_name
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_ldaps_port=port
pki_ds_bind_dn=cn=Directory Manager
  • The value of the pki_ds_database parameter is a name used by the pkispawn 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 to pkispawn being able to utilize it.
  • pki_ds_ldaps_port: Sets the value of the secure LDAPS port Directory Server is listening to. The default is 636.
Enabling TLS mutual authentication between CS and DS

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

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.

Note

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

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:

  1. [DEFAULT] - subsystem-independent settings
  2. [Tomcat]
  3. [CA], [KRA], [OCSP], [TKS], or [TPS] - the subsystem-specific sections

When it runs, pkispawn:

  1. Reads the default values from the /usr/share/pki/server/etc/default.cfg file. For further details, see the pki_default.cfg(5) man page.

    Important

    Do 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 example pkispawn configuration files in the following sections that correspond to each different type of subsystem.

  2. Reads the administrator-provided configuration file mentioned above to override the default values.
  3. Performs the installation of the requested subsystem.
  4. 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.

Important

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:

  1. Set a unique instance name:

    # pki_instance_name=instance_name
  2. Set the host name:

    # pki_hostname=server.example.com
    Note

    Certificate 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.

  3. Set the port numbers for the HTTP and HTTPS protocols:

    pki_https_port=port_number
    pki_http_port=port_number
    Important

    To run more than one Certificate System instance on the same host, you must set ports in the pki_https_port and pki_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.

  4. Set the HSM-specific parameters:

    pki_hsm_enable=True
    pki_hsm_libfile=HSM_PKCS11_library_path
    pki_hsm_modulename=HSM_module_name
    pki_token_name=HSM_token_name
    pki_token_password=HSM_token_password
    
    pki_audit_signing_token=HSM_token_name
    pki_subsystem_token=HSM_token_name
    pki_sslserver_token=HSM_token_name

    For further details, see Section 6.6.3, “Preparing for installing Certificate System with an HSM”.

  5. If building an RSA Certificate System instance, use the following configuration:

    pki_admin_key_algorithm=SHA256withRSA
    pki_admin_key_size=4096
    pki_admin_key_type=rsa
    pki_sslserver_key_algorithm=SHA256withRSA
    pki_sslserver_key_size=4096
    pki_sslserver_key_type=rsa
    pki_subsystem_key_algorithm=SHA256withRSA
    pki_subsystem_key_size=4096
    pki_subsystem_key_type=rsa
    pki_audit_signing_key_algorithm=SHA256withRSA
    pki_audit_signing_key_size=4096
    pki_audit_signing_key_type=rsa
    pki_audit_signing_signing_algorithm=SHA256withRSA

    Allowed choices for the key_algorithm parameters are:

    SHA256withRSA
    SHA384withRSA
    SHA512withRSA
    Note

    You can set these algorithm parameters to a value specified in the ca.profiles.defaultSigningAlgsAllowed parameter in the CA’s CS.cfg file. For details, see the B.2.10 Signing Algorithm Constraint annex in the Administration Guide (Common Criteria Edition). Signature algorithm must match key_type.

  6. To use Elliptic Curve Cryptography (ECC) instead of RSA when creating certificates, set:

    pki_admin_key_algorithm=SHA256withEC
    pki_admin_key_size=nistp256
    pki_admin_key_type=ecc
    pki_sslserver_key_algorithm=SHA256withEC
    pki_sslserver_key_size=nistp256
    pki_sslserver_key_type=ecc
    pki_subsystem_key_algorithm=SHA256withEC
    pki_subsystem_key_size=nistp256
    pki_subsystem_key_type=ecc
    pki_audit_signing_key_algorithm=SHA256withEC
    pki_audit_signing_key_size=nistp256
    pki_audit_signing_key_type=ecc
    pki_audit_signing_signing_algorithm=SHA256withEC

    Allowed choices for the key_algorithm parameters are:

    SHA256withEC
    SHA384withEC
    SHA512withEC
    Note

    You can set these algorithm parameters to a value specified in the ca.profiles.defaultSigningAlgsAllowed parameter in the CA’s CS.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 with key_type.

    For ECC, the allowed choices for key_size are:

    nistp256
    nistp384
    nistp521

    For ECC, the allowed choice for key_type is ecc.

  7. Set the client directory of the bootstrap admin user:

    pki_client_dir=bootstrap_admin_directory

    By default, the path is set to ~/.dogtag/instance_name/

    Important

    The pki_admin_* and pki_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 the pki_default.cfg(5) man page.

  8. Set various passwords for the bootstrap admin user:

    pki_admin_password=password
    pki_client_database_password=password
    pki_client_pkcs12_password=password
  9. 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
  10. 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
  11. For the CA that will act as a security domain, set the proper parameters:

    # 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

[Tomcat] section:

  1. Set the Tomcat JServ Protocol (AJP) port:

    pki_ajp_port=Tomcat_AJP_port
  2. Set the Tomcat server port:

    pki_tomcat_server_port=Tomcat_server_port
Important

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:

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
Note

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 --precheck --debug
# pkispawn -s CA -f rootca_inst.cfg --debug

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 of pkispawn is run as the following:

# pkispawn -s [CA, OCSP, KRA, TKS, TPS] -f cs_inst.cfg --skip-configuration –debug
Note

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-configuration --precheck --debug
# pkispawn -s CA -f rootca_inst.cfg --skip-configuration --debug

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
Note

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

For a complete example, see Section 7.3.2, “Installing the RootCA instance (two-step method)”.

7.2.3. Installation example (introduction)

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).
Note

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:

pkitopology
Important

To gain a better picture of the process involved, we advise you to:

  1. Follow Chapter 6, Prerequisites for installation if you have not done it yet.
  2. Follow either the single-step installation or two-step installation example to install

    1. RootCA
    2. OCSP of RootCA (optional)
    3. SubCA
    4. OCSP of SubCA
    5. KRA
  3. (if TMS is of interest - RSA only) continue to follow either the single-step installation or two-step installation example to install

    1. TKS
    2. TPS

7.3. Create and configure the RootCA (Part I)

To install and configure a RootCA instance, use either one of two pkispawn methods:

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

Procedure

  1. 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
    Note

    Unless 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…​

    [DEFAULT]
    pki_instance_name=rhcs10-RSA-RootCA
    pki_https_port=8443
    pki_http_port=8080
    
    ### Crypto Token
    pki_hsm_enable=True
    pki_hsm_libfile=/opt/nfast/toolkits/pkcs11/libcknfast.so
    pki_hsm_modulename=nfast
    pki_token_name=NHSM-CONN-XC
    pki_token_password=<YourHSMpassword>
    
    pki_audit_signing_token=NHSM-CONN-XC
    pki_audit_signing_key_algorithm=SHA256withRSA
    pki_audit_signing_key_size=2048
    pki_audit_signing_key_type=rsa
    pki_audit_signing_signing_algorithm=SHA256withRSA
    
    pki_subsystem_token=NHSM-CONN-XC
    pki_subsystem_key_algorithm=SHA256withRSA
    pki_subsystem_signing_algorithm=SHA256withRSA
    pki_subsystem_key_size=2048
    pki_subsystem_key_type=rsa
    
    pki_sslserver_token=NHSM-CONN-XC
    pki_sslserver_key_algorithm=SHA256withRSA
    pki_sslserver_signing_algorithm=SHA256withRSA
    pki_sslserver_key_size=2048
    pki_sslserver_key_type=rsa
    
    ### Bootstrap Admin
    pki_admin_password=SECret.123
    pki_admin_key_type=rsa
    pki_admin_key_size=2048
    pki_admin_key_algorithm=SHA256withRSA
    
    ### Bootstrap Admin client dir
    ### by default, if pki_client_dir, pki_client_database_dir,
    ### and pki_client_admin_cert_p12 are not specified, items will be placed
    ### under some default directories in /root/.dogtag
    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_database_password=SECret.123
    pki_client_dir=/opt/pki_rsa/rhcs10-RSA-RootCA
    pki_client_pkcs12_password=SECret.123
    
    ### Internal LDAP
    pki_ds_bind_dn=cn=Directory Manager
    pki_ds_ldap_port=389
    pki_ds_ldaps_port=636
    pki_ds_password=SECret.123
    pki_ds_remove_data=True
    pki_ds_secure_connection=True
    pki_ds_secure_connection_ca_pem_file=/opt/pki_rsa/temp-dirsrv-rootca-cert.pem
    pki_ds_secure_connection_ca_nickname=DS temp CA certificate
    
    ### Security Domain
    pki_security_domain_hostname=rhcs10.example.com
    pki_security_domain_name=Example-rhcs10-RSA-RootCA
    pki_security_domain_password=SECret.123
    
    
    [Tomcat]
    pki_ajp_port=8009
    pki_tomcat_server_port=8005
    
    
    [CA]
    pki_import_admin_cert=False
    pki_admin_nickname=PKI Bootstrap Administrator for RSA-RootCA
    pki_admin_name=caadmin
    pki_admin_uid=caadmin
    pki_admin_email=caadmin@example.com
    
    pki_ca_signing_token=NHSM-CONN-XC
    pki_ca_signing_key_algorithm=SHA256withRSA
    pki_ca_signing_key_size=3072
    pki_ca_signing_key_type=rsa
    pki_ca_signing_nickname=CA Signing Cert - %(pki_instance_name)s
    pki_ca_signing_signing_algorithm=SHA256withRSA
    
    pki_ocsp_signing_token=NHSM-CONN-XC
    pki_ocsp_signing_key_algorithm=SHA256withRSA
    pki_ocsp_signing_key_size=3072
    pki_ocsp_signing_key_type=rsa
    pki_ocsp_signing_signing_algorithm=SHA256withRSA
    
    pki_ds_hostname=rhds11.example.com
    pki_ds_base_dn=dc=RSA-RootCA
    pki_ds_database=CC-RSA-RootCA-LDAP
    pki_share_db=False
    
    ### Enable random serial numbers
    pki_random_serial_numbers_enable=True
  2. Run the pkispawn tool to install the RHCS CA instance:

    # pkispawn -s CA -f rootca_inst.cfg --debug

Verification steps

  1. Show the status of the installed CA:

    # pki-server status rhcs10-RSA-RootCA

    Note down the Unsecure EE, Secure EE, Agent, Admin and pkiconsole URLs.

  2. 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
Note

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)?

Select y to trust the CA signing cert if the Subject DN matches the hostname as expected. The warning will not display again.

Note

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.

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

First step of RootCA installation

  1. 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
    [DEFAULT]
    pki_instance_name=rhcs10-RSA-RootCA
    pki_https_port=8443
    pki_http_port=8080
    
    ### Crypto Token
    pki_hsm_enable=True
    pki_hsm_libfile=/opt/nfast/toolkits/pkcs11/libcknfast.so
    pki_hsm_modulename=nfast
    pki_token_name=NHSM-CONN-XC
    pki_token_password=<YourHSMpassword>
    
    pki_audit_signing_token=NHSM-CONN-XC
    pki_audit_signing_key_algorithm=SHA256withRSA
    pki_audit_signing_key_size=2048
    pki_audit_signing_key_type=rsa
    pki_audit_signing_signing_algorithm=SHA256withRSA
    
    pki_subsystem_token=NHSM-CONN-XC
    pki_subsystem_key_algorithm=SHA256withRSA
    pki_subsystem_signing_algorithm=SHA256withRSA
    pki_subsystem_key_size=2048
    pki_subsystem_key_type=rsa
    
    pki_sslserver_token=NHSM-CONN-XC
    pki_sslserver_key_algorithm=SHA256withRSA
    pki_sslserver_signing_algorithm=SHA256withRSA
    pki_sslserver_key_size=2048
    pki_sslserver_key_type=rsa
    
    ### Bootstrap Admin
    pki_admin_password=SECret.123
    pki_admin_key_type=rsa
    pki_admin_key_size=2048
    pki_admin_key_algorithm=SHA256withRSA
    
    ### Bootstrap Admin client dir
    ### by default, if pki_client_dir, pki_client_database_dir,
    ### and pki_client_admin_cert_p12 are not specified, items will be placed
    ### under some default directories in /root/.dogtag
    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_database_password=SECret.123
    pki_client_pkcs12_password=SECret.123
    
    ### Internal LDAP
    pki_ds_bind_dn=cn=Directory Manager
    pki_ds_ldap_port=389
    pki_ds_ldaps_port=636
    pki_ds_password=SECret.123
    pki_ds_remove_data=True
    pki_ds_secure_connection=True
    pki_ds_secure_connection_ca_pem_file=/opt/pki_rsa/temp-dirsrv-rootca-cert.pem
    pki_ds_secure_connection_ca_nickname=DS temp CA certificate
    
    ### Security Domain
    pki_security_domain_hostname=rhcs10.example.com
    pki_security_domain_name=Example-rhcs10-RSA-RootCA
    pki_security_domain_password=SECret.123
    
    
    [Tomcat]
    pki_ajp_port=8009
    pki_tomcat_server_port=8005
    
    
    [CA]
    pki_import_admin_cert=False
    pki_admin_nickname=PKI Bootstrap Administrator for RSA-RootCA
    pki_admin_name=caadmin
    pki_admin_uid=caadmin
    pki_admin_email=caadmin@example.com
    
    pki_ca_signing_token=NHSM-CONN-XC
    pki_ca_signing_key_algorithm=SHA256withRSA
    pki_ca_signing_key_size=3072
    pki_ca_signing_key_type=rsa
    pki_ca_signing_nickname=CA Signing Cert - %(pki_instance_name)s
    pki_ca_signing_signing_algorithm=SHA256withRSA
    
    pki_ocsp_signing_token=NHSM-CONN-XC
    pki_ocsp_signing_key_algorithm=SHA256withRSA
    pki_ocsp_signing_key_size=3072
    pki_ocsp_signing_key_type=rsa
    pki_ocsp_signing_signing_algorithm=SHA256withRSA
    
    pki_ds_hostname=rhds11.example.com
    pki_ds_base_dn=dc=RSA-RootCA
    pki_ds_database=CC-RSA-RootCA-LDAP
    pki_share_db=False
    
    ### Enable random serial numbers
    pki_random_serial_numbers_enable=True
    Note

    Unless 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, the pki_instance_name value of both files should match. The following values are just examples.

  2. Run the pkispawn tool to install the RHCS CA instance:

    # pkispawn -s CA -f rootca_inst.cfg --skip-configuration --debug

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:

    1. Open the enrollment profile for this CA’s signing certificate:

      # vi /var/lib/pki/rhcs10-RSA-RootCA/ca/conf/caCert.profile
    2. Add the following parameter:

      7.default.params.messageDigest=SHA-256
    3. Save the file.

    Likewise, do the same for the CA signing cert that this CA will be issuing in the future:

    1. 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/caCMCcaCert.cfg
    2. Add the following parameter:

      policyset.caCertSet.8.default.params.messageDigest=SHA-256
    3. 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:

    1. Open the corresponding configuration file:

      # vi /var/lib/pki/rhcs10-RSA-RootCA/ca/profiles/ca/caInternalAuthAuditSigningCert.cfg
    2. Change the following range parameters to the desired values:

      policyset.auditSigningCertSet.2.constraint.params.range=720
      policyset.auditSigningCertSet.2.default.params.range=720
    3. 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

Verification steps

  1. Show the status of the installed CA:

    # pki-server status rhcs10-RSA-RootCA

    Note down the Unsecure EE, Secure EE, Agent, Admin and pkiconsole URLs.

  2. 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
Note

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)?

Select y to trust the CA signing cert if the Subject DN matches the hostname as expected. The warning will not display again.

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

  1. 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
  2. Stop the RootCA instance:

    pki-server stop rhcs10-RSA-RootCA
  3. For every profile in the list, change the visible and enable parameters from true to false. For example, use the following command to set visible=false and enable=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
  4. In addition, also change the visible parameter for the caCMCUserCert profile to false:

    # sed -i 's/^visible=true/visible=false/' /var/lib/pki/rhcs10-RSA-RootCA/ca/profiles/ca/caCMCUserCert.cfg
  5. Start the RootCA instance:

    pki-server start rhcs10-RSA-RootCA

7.3.4. Create a CA chain file

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).

  1. 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
    # cp /opt/pki_rsa/rootCA.pem /opt/pki_rsa/ca-chain.pem
  2. 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/ca-chain.pem root@rhds11.example.com:/opt/pki_rsa
  3. On rhds11.example.com, edit the /etc/openldap/ldap.conf file so that TLS_CACERT points to the CA chain file we just created:

    # echo "TLS_CACERT /opt/pki_rsa/ca-chain.pem" >> /etc/openldap/ldap.conf
  4. Restart the DS instance for the RootCA:

    # dsctl slapd-CC-RSA-RootCA-LDAP restart

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.

Note

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

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

  1. Create a client nssdb:

    # pki -d /root/.dogtag/pki_rsa_bootstrap/certs_db -c SECret.123 client-init
    NOTE

    The 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

    and if none exist, you can select Yes to overwrite.

  2. 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
  3. 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
    
    ----------------------------------------
    Imported certificates from PKCS #12 file
    ----------------------------------------

Verification:

  1. List the certificates:

    # certutil -d /root/.dogtag/pki_rsa_bootstrap/certs_db -L
    
    Certificate Nickname                            Trust Attributes
                                                    SSL,S/MIME,JAR/XPI
    
    PKI Bootstrap Administrator for RSA-RootCA      u,u,u
    CA Signing Cert - rhcs10-RSA-RootCA             CT,C,C
  2. 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
    -----------------
    3 entries matched
    -----------------
      User ID:  CA-rhcs10.example.com-8443
      Full name:  CA-rhcs10.example.com-8443
    
      User ID: caadmin
      Full name: caadmin
    
      User ID: pkidbuser
      Full name: pkidbuser
    ----------------------------
    Number of entries returned 3

7.3.6. Check for random serial numbers

  • List the certificates to make sure all the subsystem certificates have random serial numbers.

    # pki -p 8443 ca-cert-find | grep -i serial

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"

    You should observe that there is no AIA extension.

Note

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.

Note

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
Note

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>

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.

  1. 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
  2. Add the following to the CA’s CS.cfg:

    ca.publish.publisher.instance.crlFilePublisher.Filename.b64=false
    ca.publish.publisher.instance.crlFilePublisher.Filename.der=true
    ca.publish.publisher.instance.crlFilePublisher.crlLinkExt=crl
    ca.publish.publisher.instance.crlFilePublisher.directory=/var/lib/pki/rhcs10-RSA-RootCA/crl
    ca.publish.publisher.instance.crlFilePublisher.latestCrlLink=true
    ca.publish.publisher.instance.crlFilePublisher.maxAge=0
    ca.publish.publisher.instance.crlFilePublisher.maxFullCRLs=0
    ca.publish.publisher.instance.crlFilePublisher.pluginName=FileBasedPublisher
    ca.publish.publisher.instance.crlFilePublisher.timeStamp=LocalTime
    ca.publish.publisher.instance.crlFilePublisher.zipCRLs=false
    ca.publish.publisher.instance.crlFilePublisher.zipLevel=9

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:

    ca.publish.rule.instance.FileCrlRule.enable=true
    ca.publish.rule.instance.FileCrlRule.mapper=NoMap
    ca.publish.rule.instance.FileCrlRule.pluginName=Rule
    ca.publish.rule.instance.FileCrlRule.predicate=issuingPointId==ServerCertCRL
    ca.publish.rule.instance.FileCrlRule.publisher=crlFilePublisher
    ca.publish.rule.instance.FileCrlRule.type=crl

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

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:

    ca.crl.ServerCertCRL.allowExtensions=true
    ca.crl.ServerCertCRL.alwaysUpdate=false
    ca.crl.ServerCertCRL.autoUpdateInterval=240
    ca.crl.ServerCertCRL.caCertsOnly=false
    ca.crl.ServerCertCRL.cacheUpdateInterval=15
    ca.crl.ServerCertCRL.class=com.netscape.ca.CRLIssuingPoint
    ca.crl.ServerCertCRL.dailyUpdates=1:00
    ca.crl.ServerCertCRL.description=CA's Certificate Revocation List containing certificates issued via the caCMCserverCertWithCRLDP and caCMCECserverCertWithCRLDP enrollment profile
    ca.crl.ServerCertCRL.enable=true
    ca.crl.ServerCertCRL.enableCRLCache=false
    ca.crl.ServerCertCRL.enableCRLUpdates=true
    ca.crl.ServerCertCRL.enableCacheRecovery=true
    ca.crl.ServerCertCRL.enableCacheTesting=false
    ca.crl.ServerCertCRL.enableDailyUpdates=true
    ca.crl.ServerCertCRL.enableUpdateInterval=true
    ca.crl.ServerCertCRL.extendedNextUpdate=true
    ca.crl.ServerCertCRL.extension.AuthorityInformationAccess.accessLocation0=""
    ca.crl.ServerCertCRL.extension.AuthorityInformationAccess.accessLocationType0=URI
    ca.crl.ServerCertCRL.extension.AuthorityInformationAccess.accessMethod0=caIssuers
    ca.crl.ServerCertCRL.extension.AuthorityInformationAccess.class=com.netscape.cms.crl.CMSAuthInfoAccessExtension
    ca.crl.ServerCertCRL.extension.AuthorityInformationAccess.critical=false
    ca.crl.ServerCertCRL.extension.AuthorityInformationAccess.enable=false
    ca.crl.ServerCertCRL.extension.AuthorityInformationAccess.numberOfAccessDescriptions=1
    ca.crl.ServerCertCRL.extension.AuthorityInformationAccess.type=CRLExtension
    ca.crl.ServerCertCRL.extension.AuthorityKeyIdentifier.class=com.netscape.cms.crl.CMSAuthorityKeyIdentifierExtension
    ca.crl.ServerCertCRL.extension.AuthorityKeyIdentifier.critical=false
    ca.crl.ServerCertCRL.extension.AuthorityKeyIdentifier.enable=false
    ca.crl.ServerCertCRL.extension.AuthorityKeyIdentifier.type=CRLExtension
    ca.crl.ServerCertCRL.extension.CRLNumber.class=com.netscape.cms.crl.CMSCRLNumberExtension
    ca.crl.ServerCertCRL.extension.CRLNumber.critical=false
    ca.crl.ServerCertCRL.extension.CRLNumber.enable=true
    ca.crl.ServerCertCRL.extension.CRLNumber.type=CRLExtension
    ca.crl.ServerCertCRL.extension.CRLReason.class=com.netscape.cms.crl.CMSCRLReasonExtension
    ca.crl.ServerCertCRL.extension.CRLReason.critical=false
    ca.crl.ServerCertCRL.extension.CRLReason.enable=true
    ca.crl.ServerCertCRL.extension.CRLReason.type=CRLEntryExtension
    ca.crl.ServerCertCRL.extension.DeltaCRLIndicator.class=com.netscape.cms.crl.CMSDeltaCRLIndicatorExtension
    ca.crl.ServerCertCRL.extension.DeltaCRLIndicator.critical=true
    ca.crl.ServerCertCRL.extension.DeltaCRLIndicator.enable=false
    ca.crl.ServerCertCRL.extension.DeltaCRLIndicator.type=CRLExtension
    ca.crl.ServerCertCRL.extension.FreshestCRL.class=com.netscape.cms.crl.CMSFreshestCRLExtension
    ca.crl.ServerCertCRL.extension.FreshestCRL.critical=false
    ca.crl.ServerCertCRL.extension.FreshestCRL.enable=false
    ca.crl.ServerCertCRL.extension.FreshestCRL.numPoints=0
    ca.crl.ServerCertCRL.extension.FreshestCRL.pointName0=""
    ca.crl.ServerCertCRL.extension.FreshestCRL.pointType0=""
    ca.crl.ServerCertCRL.extension.FreshestCRL.type=CRLExtension
    ca.crl.ServerCertCRL.extension.InvalidityDate.class=com.netscape.cms.crl.CMSInvalidityDateExtension
    ca.crl.ServerCertCRL.extension.InvalidityDate.critical=false
    ca.crl.ServerCertCRL.extension.InvalidityDate.enable=true
    ca.crl.ServerCertCRL.extension.InvalidityDate.type=CRLEntryExtension
    ca.crl.ServerCertCRL.extension.IssuerAlternativeName.class=com.netscape.cms.crl.CMSIssuerAlternativeNameExtension
    ca.crl.ServerCertCRL.extension.IssuerAlternativeName.critical=false
    ca.crl.ServerCertCRL.extension.IssuerAlternativeName.enable=false
    ca.crl.ServerCertCRL.extension.IssuerAlternativeName.name0=""
    ca.crl.ServerCertCRL.extension.IssuerAlternativeName.nameType0=""
    ca.crl.ServerCertCRL.extension.IssuerAlternativeName.numNames=0
    ca.crl.ServerCertCRL.extension.IssuerAlternativeName.type=CRLExtension
    ca.crl.ServerCertCRL.extension.IssuingDistributionPoint.class=com.netscape.cms.crl.CMSIssuingDistributionPointExtension
    ca.crl.ServerCertCRL.extension.IssuingDistributionPoint.critical=true
    ca.crl.ServerCertCRL.extension.IssuingDistributionPoint.enable=false
    ca.crl.ServerCertCRL.extension.IssuingDistributionPoint.indirectCRL=false
    ca.crl.ServerCertCRL.extension.IssuingDistributionPoint.onlyContainsCACerts=false
    ca.crl.ServerCertCRL.extension.IssuingDistributionPoint.onlyContainsUserCerts=false
    ca.crl.ServerCertCRL.extension.IssuingDistributionPoint.onlySomeReasons=""
    ca.crl.ServerCertCRL.extension.IssuingDistributionPoint.pointName=
    ca.crl.ServerCertCRL.extension.IssuingDistributionPoint.pointType=
    ca.crl.ServerCertCRL.extension.IssuingDistributionPoint.type=CRLExtension
    ca.crl.ServerCertCRL.includeExpiredCerts=false
    ca.crl.ServerCertCRL.includeExpiredCertsOneExtraTime=false
    ca.crl.ServerCertCRL.minUpdateInterval=0
    ca.crl.ServerCertCRL.nextAsThisUpdateExtension=0
    ca.crl.ServerCertCRL.nextUpdateGracePeriod=0
    ca.crl.ServerCertCRL.profileCertsOnly=true
    ca.crl.ServerCertCRL.profileList=caCMCserverCertWithCRLDP,caCMCECserverCertWithCRLDP
    ca.crl.ServerCertCRL.publishOnStart=false
    ca.crl.ServerCertCRL.saveMemory=false
    ca.crl.ServerCertCRL.signingAlgorithm=SHA256withRSA
    ca.crl.ServerCertCRL.updateSchema=1
Note

For an ECC CA, set the following to SHA512withEC:

ca.crl.ServerCertCRL.signingAlgorithm=SHA512withEC
7.3.8.2. Set up CRL HTTP service in the CA

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:

  1. Add the following CRL service before the Catalina service in the file /var/lib/pki/rhcs10-RSA-RootCA/conf/server.xml:

    <Service name="CRL">
      <Connector port="8085" protocol="HTTP/1.1" connectionTimeout="80000"
       maxParameterCount="1000" name="Unsecure" maxHttpHeaderSize="8192"
       acceptCount="100" maxThreads="15" minSpareThreads="25"
       enableLookups="false" disableUploadTimeout="true"/>
      <Engine name="CRL" defaultHost="localhost">
        <Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true">
          <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
           prefix="localhost_crl_access_log" suffix=".txt" pattern="common"/>
        </Host>
      </Engine>
    </Service>
  2. 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
    Note

    If 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

    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>

    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
  3. 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
  4. 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>
  5. Set the user:group ownership for the crl.xml file:

    chown pkiuser:pkiuser  /var/lib/pki/rhcs10-RSA-RootCA/conf/CRL/localhost/crl.xml
Note

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

Important

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.

Enable the desired profile(s) to include the CRL Distribution Points. These are the profiles corresponding to the configuration in the sections above.

  1. 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:

    # vi /var/lib/pki/rhcs10-RSA-RootCA/ca/profiles/ca/caCMCserverCertWithCRLDP.cfg
    …
    enable=true
    …
    policyset.serverCertSet.10.default.params.crlDistPointsPointName_0=http://rhcs10.example.com:8085/crl/ServerCertCRL.crl
    …
  2. 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:

    # vi /var/lib/pki/rhcs10-ECC-RootCA/ca/profiles/ca/caCMCECserverCertWithCRLDP.cfg
    …
    enable=true
    …
    policyset.serverCertSet.10.default.params.crlDistPointsPointName_0=http://rhcs10.example.com:20085/crl/ServerCertCRL.crl
    …
  3. 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
  4. Register a new profile in the CA’s CS.cfg:

    1. 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
    2. Edit the profile.list entry to add the two new profiles. For example::

      profile.list=caCMCserverCertWithCRLDP,caCMCECserverCertWithCRLDP,acmeServerCert,caCMCserverCert,caCMCECserverCert, …
7.3.8.4. Set up for more immediate CRL update

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

Once configuration is complete, start up the CA:

# pki-server start rhcs10-RSA-RootCA
Note

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.

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.

Note

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.

Note

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

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.

Note

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:

  1. Stop DS:

    # dsctl slapd-CC-RSA-OCSP-rootca-LDAP stop
    Note

    If you are not certain about the name of a DS instance, list all instances using: dsctl -l.

  2. 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
    Important

    Edit 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

    The CSR file must start with the line "-----BEGIN CERTIFICATE REQUEST-----" and end with the line "-----END CERTIFICATE REQUEST-----".

  3. 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

Issue the real DS certificate

On rhcs10.example.com, issue the actual SSL server certificate:

  1. Generate a CMC request:

    1. Create a CMCRequest configuration file. For example:

      # vim /root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.dirsrv-ocsp-rootca_pkcs10.cfg
      ### numRequests: Total number of PKCS10 requests or CRMF requests.
      numRequests=1
      
      ### input: full path for the PKCS10 request or CRMF request,
      ### The content must be in Base-64 encoded format.
      ### Multiple files are supported. They must be separated by a space.
      ### For input on a different host, specify where to find the CSR.
      input=/root/.dogtag/pki_rsa_bootstrap/certs_db/Server-Cert-ocsp-rootca.csr
      
      ### output: full path for the CMC request in binary format
      ### For output on a different host, specify the destination.
      output=/root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.dirsrv-ocsp-rootca_pkcs10.req
      
      ### tokenname: name of the token where the agent signing cert can be found (default is internal)
      tokenname=internal
      
      ### nickname: nickname for the agent certificate that will be used to sign the CMC full request.
      nickname=PKI Bootstrap Administrator for RSA-RootCA
      
      ### dbdir: directory for cert8.db, key3.db and secmod.db
      dbdir=/root/.dogtag/pki_rsa_bootstrap/certs_db
      
      ### password: password for cert8.db that stores the agent certificate
      password=SECret.123
      
      ### format: request format, either pkcs10 or crmf
      format=pkcs10
    2. Generate the request using the CMCRequest command:

      # CMCRequest /root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.dirsrv-ocsp-rootca_pkcs10.cfg
      
      cert/key prefix =
      path = /root/.dogtag/pki_rsa_bootstrap/certs_db
      CryptoManger initialized
      token internal logged in...
      got signerCert: PKI Bootstrap Administrator for RSA-RootCA
      createPKIData: begins
      k=0
      createPKIData:  format: pkcs10
      useSharedSecret is false...
      signData: begins:
      getPrivateKey: got signing cert
      signData:  got signer privKey
      createSignedData: begins
      getSigningAlgFromPrivate: begins.
      getSigningAlgFromPrivate: found signingKeyType=RSA
      getSigningAlgFromPrivate: using SignatureAlgorithm: RSASignatureWithSHA256Digest
      createSignedData: digest created for pkidata
      createSignedData: digest algorithm =RSASignatureWithSHA256Digest
      createSignedData: building cert chain
      signData: signed request generated.
      getCMCBlob: begins
      getCMCBlob: generating signed data
      
      The CMC enrollment request in base-64 encoded format:
      
      . . . Output omitted . . .
      
      The CMC enrollment request in binary format is stored in
      /root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.dirsrv-ocsp-rootca_pkcs10.req
  2. Submit the CMC request:

    1. Create a HttpClient configuration file. For example:

      # vim /root/.dogtag/pki_rsa_bootstrap/certs_db/HttpClient_dirsrv-ocsp-rootca.cfg
      ### host: host name for the http server
      host=rhcs10.example.com
      
      ### port: port number
      port=8443
      
      ### secure: true for secure connection, false for nonsecure connection
      secure=true
      
      ### input: full path for the enrollment request, the content must be in binary format
      input=/root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.dirsrv-ocsp-rootca_pkcs10.req
      
      ### output: full path for the response in binary format
      output=/root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.dirsrv-ocsp-rootca_pkcs10.resp
      
      ### tokenname: name of the token where the SSL client authentication cert can be found (default is internal)
      ### This parameter will be ignored if secure=false
      tokenname=internal
      
      ### dbdir: directory for cert8.db, key3.db and secmod.db
      ### This parameter will be ignored if secure=false
      dbdir=/root/.dogtag/pki_rsa_bootstrap/certs_db
      
      ### clientmode: true for client authentication, false for no client authentication
      ### This parameter will be ignored if secure=false
      clientmode=true
      
      ### password: password for cert8.db
      ### This parameter will be ignored if secure=false and clientauth=false
      password=SECret.123
      
      ### nickname: nickname for client certificate
      ### This parameter will be ignored if clientmode=false
      nickname=PKI Bootstrap Administrator for RSA-RootCA
      
      ### servlet: servlet name
      servlet=/ca/ee/ca/profileSubmitCMCFull?profileId=caCMCserverCert
    2. Submit the request using the HttpClient command:

      # HttpClient /root/.dogtag/pki_rsa_bootstrap/certs_db/HttpClient_dirsrv-ocsp-rootca.cfg
      
      Total number of bytes read = 3096
      after SSLSocket created, thread token is NSS FIPS 140-2 User Private Key
      client cert is not null
      handshake happened
      writing to socket
      
      ##Response Headers begin##
      HTTP/1.1 200
      Content-Type: application/pkcs7-mime
      Content-Length: 2492
      Date: Tue, 29 Sep 2020 15:20:21 GMT
      Connection: close
      ##end##
      
      . . . Output omitted . . .
      
      The response in binary format is stored in
      /root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.dirsrv-ocsp-rootca_pkcs10.resp
  3. Process the CMC Response:

    1. Process the response using CMCResponse to display all certificates in chain individually in PEM format:

      Important

      Running 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.

      # CMCResponse -d /root/.dogtag/pki_rsa_bootstrap/certs_db -i /root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.dirsrv-ocsp-rootca_pkcs10.resp -v
      
      Cert:0
      ...
      ===
      Cert:1
      ...
      ===
      Cert:2
      ...
      ===
      Certificates:
      
        Certificate:
            Data:
                Version:  v3
                Serial Number: 0xA383694
                Signature Algorithm: SHA256withRSA - 1.2.840.113549.1.1.11
                Issuer: CN=CA Signing Certificate,OU=rhcs10-RSA-OCSP-rootca,O=Example-rhcs10-RSA-OCSP-rootca
                Validity:
                    Not Before: Tuesday, April 5, 2022 8:41:36 AM EDT America/New_York
                    Not  After: Monday, March 25, 2024 8:41:36 AM EDT America/New_York
                Subject: CN=rhds11.example.com
      
      . . . Output omitted . . .
      
          Certificate:
              Data:
                  Version:  v3
                  Serial Number: 0x5C8FAD4
                  Signature Algorithm: SHA256withRSA - 1.2.840.113549.1.1.11
                  Issuer: CN=CA Signing Certificate,OU=rhcs10-RSA-RootCA,O=Example-rhcs10-RSA-RootCA
                  Validity:
                      Not Before: Tuesday, April 5, 2022 8:36:21 AM EDT America/New_York
                      Not  After: Saturday, April 5, 2042 8:36:21 AM EDT America/New_York
                  Subject: CN=CA Signing Certificate,OU=rhcs10-RSA-RootCA,O=Example-rhcs10-RSA-RootCA
      
      . . . Output omitted . . .
      
          Certificate:
              Data:
                  Version:  v3
                  Serial Number: 0x80296C3
                  Signature Algorithm: SHA256withRSA - 1.2.840.113549.1.1.11
                  Issuer: CN=CA Signing Certificate,OU=rhcs10-RSA-RootCA,O=Example-rhcs10-RSA-OCSP-rootca
                  Validity:
                      Not Before: Tuesday, April 5, 2022 8:39:43 AM EDT America/New_York
                      Not  After: Friday, April 5, 2041 8:39:43 AM EDT America/New_York
                  Subject: CN=CA Signing Certificate,OU=rhcs10-RSA-OCSP-rootca,O=Example-rhcs10-RSA-RootCA
      
      . . . Output omitted . . .
      
      Number of controls is 1
      Control #0: CMCStatusInfoV2
      OID: {1 3 6 1 5 5 7 7 25}
      BodyList: 1
      Status: SUCCESS
      CMC Full Response.
    2. 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

      Where Server-Cert-ocsp-rootca.pem is the new Server-Cert certificate of the Directory Server instance that serves as the internaldb of the OCSP for the RootCA.

      Note

      The 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
  4. 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/

Replace the temporary DS certificate

On rhds11.example.com, replace the temporary DS certificate with the actual DS certificate:

  1. 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/
  2. 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 "Self-Signed-CA"
  3. 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 "u,u,u" -n "Server-Cert" -i /etc/dirsrv/slapd-CC-RSA-OCSP-rootca-LDAP/Server-Cert-ocsp-rootca.pem
  4. List the certificates:

    # certutil -L -d /etc/dirsrv/slapd-CC-RSA-OCSP-rootca-LDAP/
    
    Certificate Nickname                           Trust Attributes
                                                   SSL,S/MIME,JAR/XPI
    CA Signing Cert - rhcs10-RSA-RootCA            CT,C,C
    Server-Cert                                    u,u,u
  5. Start DS:

    # dsctl slapd-CC-RSA-OCSP-rootca-LDAP start
  6. 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

    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

7.4.2. Install the OCSP instance for the RootCA

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

Procedure

  1. Create an OCSP installation file at a chosen location (e.g. /root/pki_rsa) for generating certificate requests:

    # cd /root/pki_rsa
    # vi ocsp_rootca_inst.cfg
    Note

    Unless 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…​

    [DEFAULT]
    pki_instance_name=rhcs10-RSA-OCSP-rootca
    pki_https_port=33443
    pki_http_port=33080
    
    ### Crypto Token
    pki_hsm_enable=True
    pki_hsm_libfile=/opt/nfast/toolkits/pkcs11/libcknfast.so
    pki_hsm_modulename=nfast
    pki_token_name=NHSM-CONN-XC
    pki_token_password=<YourHSMpassword>
    
    pki_audit_signing_token=NHSM-CONN-XC
    pki_audit_signing_key_algorithm=SHA256withRSA
    pki_audit_signing_key_size=2048
    pki_audit_signing_key_type=rsa
    pki_audit_signing_signing_algorithm=SHA256withRSA
    
    pki_subsystem_token=NHSM-CONN-XC
    pki_subsystem_key_algorithm=SHA256withRSA
    pki_subsystem_signing_algorithm=SHA256withRSA
    pki_subsystem_key_size=2048
    pki_subsystem_key_type=rsa
    
    pki_sslserver_token=NHSM-CONN-XC
    pki_sslserver_key_algorithm=SHA256withRSA
    pki_sslserver_signing_algorithm=SHA256withRSA
    pki_sslserver_key_size=2048
    pki_sslserver_key_type=rsa
    
    ### CA cert chain concatenated in PEM format
    pki_cert_chain_path=/opt/pki_rsa/ca-chain.pem
    
    ### Bootstrap Admin
    pki_admin_password=SECret.123
    pki_admin_key_type=rsa
    pki_admin_key_size=2048
    pki_admin_key_algorithm=SHA256withRSA
    
    ### Bootstrap Admin client dir
    pki_client_admin_cert_p12=/opt/pki_rsa/rhcs10-RSA-OCSP-rootca/ocsp_admin_cert.p12
    pki_client_database_dir=/opt/pki_rsa/rhcs10-RSA-OCSP-rootca/certs_db
    pki_client_database_password=SECret.123
    pki_client_database_purge=False
    pki_client_dir=/opt/pki_rsa/rhcs10-RSA-OCSP-rootca
    pki_client_pkcs12_password=SECret.123
    
    ### Internal LDAP
    pki_ds_bind_dn=cn=Directory Manager
    pki_ds_ldap_port=6389
    pki_ds_ldaps_port=6636
    pki_ds_password=SECret.123
    pki_ds_remove_data=True
    pki_ds_secure_connection=True
    pki_ds_secure_connection_ca_pem_file=/opt/pki_rsa/ca-chain.pem
    pki_ds_secure_connection_ca_nickname=CA Signing Cert - rhcs10-RSA-RootCA
    
    ### Security Domain
    pki_security_domain_hostname=rhcs10.example.com
    pki_security_domain_https_port=8443
    pki_security_domain_password=SECret.123
    pki_security_domain_user=caadmin
    
    
    [Tomcat]
    pki_ajp_port=33009
    pki_tomcat_server_port=33005
    
    [OCSP]
    pki_import_admin_cert=False
    
    pki_ocsp_signing_token=NHSM-CONN-XC
    pki_ocsp_signing_key_algorithm=SHA256withRSA
    pki_ocsp_signing_key_size=3072
    pki_ocsp_signing_key_type=rsa
    pki_ocsp_signing_signing_algorithm=SHA256withRSA
    
    pki_admin_nickname=PKI Bootstrap Administrator for RSA-OCSP-rootca
    pki_admin_name=ocspadmin
    pki_admin_uid=ocspadmin
    pki_admin_email=ocspadmin@example.com
    
    pki_ds_hostname=rhds11.example.com
    pki_ds_base_dn=dc=RSA-OCSP-rootca
    pki_ds_database=CC-RSA-OCSP-rootca-LDAP
    pki_share_db=False
  2. Run the pkispawn tool to install the OCSP subsystem:

    # pkispawn -s OCSP -f ocsp_rootca_inst.cfg --debug

    This will create the OCSP instance in /var/lib/pki/rhcs10-RSA-OCSP-rootca.

Note

For ease of reference, if you wanted to install this OCSP using the two-step method:

  1. 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
  2. Customize the configuration files between the two installation steps
  3. Run the pkispawn tool to configure the OCSP:

    # pkispawn -s OCSP -f ocsp_rootca_inst.cfg --skip-installation --debug

Verification

  • Show the status of the installed OCSP instance:

    # pki-server status rhcs10-RSA-OCSP-rootca
  1. Log in to rhcs10.example.com as root.
  2. Stop the RootCA’s OCSP service:

    pki-server stop rhcs10-RSA-OCSP-rootca
  3. Edit /var/lib/pki/rhcs10-RSA-OCSP-rootca/conf/server.xml to increase the timeout period:

    <Connector name="Secure" port="33443" …
    connectionTimeout="3000000"
  4. Start the RootCA’s OCSP service:

    # pki-server start rhcs10-RSA-OCSP-rootca

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:

  1. Stop the RootCA:

    # pki-server stop rhcs10-RSA-RootCA
  2. Edit the RootCA’s CS.cfg and set the ca.defaultOcspUri variable to point to the OCSP. For example:

    ca.defaultOcspUri=http://rhcs10.example.com:33080/ocsp/ee/ocsp
  3. Start the RootCA:

    # pki-server start rhcs10-RSA-RootCA
Note

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

  • 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
    
    ----------------------------------------
    Imported certificates from PKCS #12 file
    ----------------------------------------
  1. Configure OCSP with authType=sslclientauth and import the role user certificate by following Section 7.13.6, “Configure pkiconsole login with client authentication”.
  2. 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

    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

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.

On rhds11.example.com as root:

  1. 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.

    1. 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
    2. Edit the .cfg file created in the previous step. Uncomment the below parameters and set them to customize the installation:

      full_machine_name = rhds11.example.com
      port = 12389
      secure_port = 12636
      instance_name = CC-RSA-RootCA-CRL-PUBLISH
      root_password = SECret.123
      suffix = dc=example,dc=com
      create_suffix_entry = True
    3. Install the Directory Server instance:

      # dscreate from-file /root/pki_rsa/rootca-crl-publish-ldap.cfg
      
      Starting installation...
      
      Completed installation for CC-RSA-RootCA-CRL-PUBLISH
  2. Add an ACI (Access Control Instruction) rule to allow anonymous bind access. By default, this is disabled.

    1. 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";)
    2. 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
  3. Prepare the CRL publishing subtree:

    1. 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
      • For the rootca_crl_subtree.ldif file:

        dn: dc=crl,dc=pki,dc=example,dc=com
        objectClass: domain
        dc: crl
    2. 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_crl_subtree.ldif
7.4.7.2. Configuring CRL publishing on the RootCA

To configure CRL publishing:

  1. Add the ca.publish. properties:

    1. Stop the RootCA instance:

      # pki-server stop rhcs10-RSA-RootCA
    2. Configure the following properties in the RootCA’s CS.cfg configuration file (e.g. /var/lib/pki/rhcs10-RSA-RootCA/ca/conf/CS.cfg):

      ca.publish.ldappublish.enable=true
      ca.publish.ldappublish.ldap.ldapauth.authtype=BasicAuth
      ca.publish.ldappublish.ldap.ldapauth.bindDN=cn=Directory Manager
      ca.publish.ldappublish.ldap.ldapauth.bindPWPrompt=CA LDAP Publishing
      ca.publish.ldappublish.ldap.ldapconn.host=rhds11.example.com
      ca.publish.ldappublish.ldap.ldapconn.port=12389
      ca.publish.ldappublish.ldap.ldapconn.secureConn=false
      ca.publish.publisher.instance.LdapCaCertPublisher.caCertAttr=cACertificate;binary
      ca.publish.publisher.instance.LdapCaCertPublisher.caObjectClass=pkiCA
      ca.publish.publisher.instance.LdapCaCertPublisher.pluginName=LdapCaCertPublisher
      ca.publish.mapper.instance.LdapCaCertMap.createCAEntry=true
      ca.publish.mapper.instance.LdapCaCertMap.dnPattern=cn=$subj.cn,dc=crl,dc=pki,dc=example,dc=com
      ca.publish.mapper.instance.LdapCaCertMap.pluginName=LdapCaSimpleMap
      ca.publish.rule.instance.LdapCaCertRule.enable=true
      ca.publish.rule.instance.LdapCaCertRule.mapper=LdapCaCertMap
      ca.publish.rule.instance.LdapCaCertRule.pluginName=Rule
      ca.publish.rule.instance.LdapCaCertRule.predicate=
      ca.publish.rule.instance.LdapCaCertRule.publisher=LdapCaCertPublisher
      ca.publish.rule.instance.LdapCaCertRule.type=cacert
      ca.publish.publisher.instance.LdapCrlPublisher.crlAttr=certificateRevocationList;binary
      ca.publish.publisher.instance.LdapCrlPublisher.crlObjectClass=pkiCA
      ca.publish.publisher.instance.LdapCrlPublisher.pluginName=LdapCrlPublisher
      ca.publish.mapper.instance.LdapCrlMap.createCAEntry=true
      ca.publish.mapper.instance.LdapCrlMap.dnPattern=cn=$subj.cn,dc=crl,dc=pki,dc=example,dc=com
      ca.publish.mapper.instance.LdapCrlMap.pluginName=LdapCaSimpleMap
      ca.publish.rule.instance.LdapCrlRule.enable=true
      ca.publish.rule.instance.LdapCrlRule.mapper=LdapCrlMap
      ca.publish.rule.instance.LdapCrlRule.pluginName=Rule
      ca.publish.rule.instance.LdapCrlRule.predicate=issuingPointId==MasterCRL
      ca.publish.rule.instance.LdapCrlRule.publisher=LdapCrlPublisher
      ca.publish.rule.instance.LdapCrlRule.type=crl
      ca.publish.enable=true
      NOTE

      Alternatively, 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

      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
    3. Start the RootCA instance:

      pki-server start rhcs10-RSA-RootCA
  2. Push the CRL and CA certificate to the LDAP directory via curl. For example:

    # curl \
        -d "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/updateCRL \
        | xmllint --format -
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <xml>
      <header>
        <crlIssuingPoint>MasterCRL</crlIssuingPoint>
        <crlUpdate>Scheduled</crlUpdate>
      </header>
      <fixed/>
      <records/>
    </xml>
  3. Disable the direct CA→OCSP CRL publishing method:

    1. Stop the RootCA:

      pki-server stop rhcs10-RSA-RootCA
    2. Edit the CA’s CS.cfg configuration file (e.g. /var/lib/pki/rhcs10-RSA-RootCA/ca/conf/CS.cfg) and set the following to false:

      ca.publish.rule.instance.ocsprule-<host/port info>.enable=false

      For example:

      ca.publish.rule.instance.ocsprule-rhcs10-example-com-33443.enable=false
    3. Start the CA for the configuration change to take effect:

      # pki-server start rhcs10-RSA-RootCA
  4. 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 -
  5. Display the CRL using curl:

    # curl \
       -d "pageSize=50&crlIssuingPoint=MasterCRL&pageStart=1&crlDisplayType=entireCRL&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/displayCRL | xmllint --format -
  6. 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
    . . . Output omitted . . .
    
    # CA Signing Certificate, crl.pki.example.com
    dn: cn=CA Signing Certificate,dc=crl,dc=pki,dc=example,dc=com
    cn: CA Signing Certificate
    sn: CA Signing Certificate
    objectClass: top
    objectClass: person
    objectClass: organizationalPerson
    objectClass: inetOrgPerson
    objectClass: pkiCA
    
    
    cACertificate;binary::
    MIICBzCB8AIBATANBgkqhkiG9w0BAQ0FADBdMRYwFAYDVQQKEw1FeGFtcGxlLVN1YkNBMSIwIAYDVQQLExlyaGNzOTMtVE1TLVN1YkNBLWFha2tpYW5nMR8wHQYDVQQDExZDQSBTaWduaW5nIENlcnRpZmljYXRlFw0xODAzMDkxODA
    
    . . . Output omitted . . .
    
    certificateRevocationList;binary::
    IID9DCCAtygAwIBAgIEBwa6XDANBgkqhkiG9w0BAQsFADBiMR4wHAYDVQQKDBVFeGFtcGxlLXJoY3M5My1UTVMtQ0ExHzAdBgNVBAsMFnJoY3M5My1UTVMtQ
    
    . . . Output omitted . . .
  7. Disable certificate publishing for the RootCA (optional):
Note

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
  1. Stop the RootCA:

    # pki-server stop rhcs10-RSA-RootCA
  2. Edit /var/lib/pki/rhcs10-RSA-RootCA/ca/conf/CS.cfg and set the following:

    ca.publish.cert.enable=false
  3. Start the RootCA for the configuration change to take effect:

    # pki-server start rhcs10-RSA-RootCA

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:

  1. Stop the OCSP:

    # pki-server stop rhcs10-RSA-OCSP-rootca
  2. Set the ldapStore properties in the OCSP’s CS.cfg configuration file (e.g. /var/lib/pki/rhcs10-RSA-OCSP-rootca/ocsp/conf/CS.cfg). Make sure you change the ocsp.storeId parameter from defStore to ldapStore and add the following parameters:

    ocsp.storeId=ldapStore
    ocsp.store.ldapStore.numConns=1
    ocsp.store.ldapStore.host0=rhds11.example.com
    ocsp.store.ldapStore.port0=12389
    ocsp.store.ldapStore.baseDN0=dc=crl,dc=pki,dc=example,dc=com
    ocsp.store.ldapStore.refreshInSec0=120
    ocsp.store.ldapStore.byName=true
    ocsp.store.ldapStore.caCertAttr=cACertificate;binary
    ocsp.store.ldapStore.crlAttr=certificateRevocationList;binary
    ocsp.store.ldapStore.notFoundAsGood=true
    Note

    The 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.

  3. 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

    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.

  4. Start the OCSP for the ldapStore configuration to take effect:

    # pki-server start rhcs10-RSA-OCSP-rootca
7.4.7.4. Testing CRL publishing

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:

  1. List the certificates in the database:

    # certutil -d /root/.dogtag/pki_rsa_bootstrap/certs_db -L
    
    Certificate Nickname                          Trust Attributes
                                                  SSL,S/MIME,JAR/XPI
    
    PKI Bootstrap Administrator for RSA-RootCA    u,u,u
    CA Signing Cert - rhcs10-RSA-RootCA           CT,C,C
    
    . . . Output omitted . . .
  2. 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: 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
  3. Use cat on the .keyID file to display the key id. You will need it for the request.privKeyId= field in the next step:

    # cat /root/.dogtag/pki_rsa_bootstrap/certs_db/user1.req.keyId; echo
  4. Generate a CMC request:

    1. 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
      ### numRequests: Total number of PKCS10 requests or CRMF requests.
      numRequests=1
      
      ### input: full path for the PKCS10 request or CRMF request,
      ### The content must be in Base-64 encoded format.
      ### Multiple files are supported. They must be separated by a space.
      input=/root/.dogtag/pki_rsa_bootstrap/certs_db/user1.req
      
      ### output: full path for the CMC request in binary format
      output=/root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.user1_pkcs10.req
      
      ### tokenname: name of the token where the agent signing cert can be found (default is internal)
      tokenname=internal
      
      ### nickname: nickname for the certificate that will be used to sign the CMC full request.
      ### nickname=caaadmin
      nickname=PKI Bootstrap Administrator for RSA-RootCA
      
      ### dbdir: directory for cert8.db, key3.db and secmod.db
      dbdir=/root/.dogtag/pki_rsa_bootstrap/certs_db
      
      ### password: password for cert8.db that stores the user signing certificate and keys
      password=SECret.123
      
      ### format: request format, either pkcs10 or crmf
      format=pkcs10
      
      ### identityProofV2.enable: if true, then the request will contain this control. Otherwise, false.
      ### Note that if both identityProof and identityProofV2 are enabled,
      ### identityProofV2 takes precedence; Only one of them can be active at a time
      ### Supported hashAlg are:
      ### SHA-256, SHA-384, and SHA-512
      ### Supported macAlg are:
      ### SHA-256-HMAC, SHA-384-HMAC, and SHA-512-HMAC
      identityProofV2.enable=false
      identityProofV2.hashAlg=SHA-512
      identityProofV2.macAlg=SHA-256-HMAC
      request.privKeyId=<key id output from the PKCS10Client|CRMFPopClient cert request>
    2. Generate the request using the CMCRequest command:

      # CMCRequest cmcRequest_p10_user1.cfg
      
      cert/key prefix =
      path = /root/.dogtag/pki_rsa_bootstrap/certs_db
      CryptoManger initialized
      token internal logged in...
      got signerCert: PKI Bootstrap Administrator for RSA-RootCA
      createPKIData: begins
      k=0
      createPKIData:  format: pkcs10
      PKCS10: PKCS10: begins
      PKCS10: PKCS10: ends
      selfSign is false...
      signData: begins:
      getPrivateKey: got signing cert
      signData:  got signer privKey
      createSignedData: begins
      getSigningAlgFromPrivate: begins.
      getSigningAlgFromPrivate: found signingKeyType=RSA
      getSigningAlgFromPrivate: using SignatureAlgorithm: RSASignatureWithSHA256Digest
      createSignedData: digest created for pkidata
      createSignedData: digest algorithm =RSASignatureWithSHA256Digest
      createSignedData: building cert chain
      signData: signed request generated.
      getCMCBlob: begins
      getCMCBlob: generating signed data
      
      The CMC enrollment request in base-64 encoded format:
      
      . . . Output omitted . . .
      
      The CMC enrollment request in binary format is stored in
      /root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.user1_pkcs10.req
  5. Submit the CMC request:

    1. Create a HttpClient configuration file. For example:

      # vim /root/.dogtag/pki_rsa_bootstrap/certs_db/HttpClient_cmc_p10_user1.cfg
      ### host: host name for the http server
      host=rhcs10.example.com
      
      ### port: port number
      port=8443
      
      ### secure: true for secure connection, false for nonsecure connection
      secure=true
      
      ### input: full path for the enrollment request, the content must be in binary format
      input=/root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.user1_pkcs10.req
      
      ### output: full path for the response in binary format
      output=/root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.user1_pkcs10.resp
      
      ### tokenname: name of the token where the SSL client authentication cert can be found (default is internal)
      ### This parameter will be ignored if secure=false
      tokenname=internal
      
      ### dbdir: directory for cert8.db, key3.db and secmod.db
      ### This parameter will be ignored if secure=false
      dbdir=/root/.dogtag/pki_rsa_bootstrap/certs_db/
      
      ### clientmode: true for client authentication, false for no client authentication
      ### This parameter will be ignored if secure=false
      clientmode=true
      
      ### password: password for cert8.db
      ### This parameter will be ignored if secure=false and clientauth=false
      password=SECret.123
      
      ### nickname: nickname for client certificate
      ### This parameter will be ignored if clientmode=false
      nickname=PKI Bootstrap Administrator for RSA-RootCA
      
      ### servlet: servlet name
      servlet=/ca/ee/ca/profileSubmitCMCFull?profileId=caFullCMCUserCert
    2. Submit the request using the HttpClient command:

      # HttpClient /root/.dogtag/pki_rsa_bootstrap/certs_db/HttpClient_cmc_p10_user1.cfg
      
      Total number of bytes read = 3453
      after SSLSocket created, thread token is NSS FIPS 140-2 User Private Key
      client cert is not null
      handshake happened
      writing to socket
      Total number of bytes read = 2590
      
      . . . Output omitted . . .
      
      The response in binary format is stored in
      /root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.user1_pkcs10.resp
  6. Process the response using the CMCResponse command:

    # CMCResponse -d /root/.dogtag/pki_rsa_bootstrap/certs_db -i /root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.user1_pkcs10.resp
    
    . . . Output omitted . . .
    
    Number of controls is 1
    Control #0: CMCStatusInfoV2
       OID: {1 3 6 1 5 5 7 7 25}
       BodyList: 1
       Status: SUCCESS
  7. 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:

  1. Push the CRL and CA certificate to the LDAP directory:

    1. Login to the RootCA’s Agent UI in the browser.
    2. Select Update Revocation List and click Update.
    3. Click Update Directory Server and select:

      • Update the certificate revocation list to the directory
      • Update Certificate Manager certificate to the directory
    4. Click Update Directory.
    5. Wait for the OCSP’s ldapStore refresh to happen (observe the debug file in /var/lib/pki/rhcs10-RSA-OCSP-rootca/ocsp/logs/debug).
  2. Check the certificate status by using the OCSPClient tool. For example, using the certificate serial number of user1 (in decimal):

    # OCSPClient -v -d /root/.dogtag/pki_rsa_bootstrap/certs_db -h rhcs10.example.com -p 33080 -c "CA Signing Cert - rhcs10-RSA-RootCA" --serial 245832201
    
    Initializing security database
    Creating request for serial number 245832201
    Submitting OCSP request
    URL: http://rhcs10.example.com:33080/ocsp/ee/ocsp
    Request Length: 71
    Request: MEUwQzBBMD8wPTAJBgUrDgMCGgUABBRA+gjEGo4W0lUiC/Ve/oO8CrXQLQQUK4Bf
    o2u6SW0p6q58dlNCXxOVw30CBA7kEiA=
    
    Response Length: 3546
    Response: <blob>
    CertID.serialNumber=245832201
    CertStatus=Good
  3. Revoke the certificate of user2:

    1. Create a CMCRequest configuration file. For example:

      # vi cmc-agent-signed-revoke.cfg
      ### numRequests: Total number of PKCS10 requests or CRMF requests.
      numRequests=1
      
      ### output: full path for the CMC request in binary format
      output=/root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.revoke.agentSigned.req
      
      ### tokenname: name of the token where the user signing cert can be found (default is internal)
      tokenname=internal
      
      ### nickname: nickname for the signing certificate which will be used to sign the CMC full request.
      nickname=PKI Bootstrap Administrator for RSA-RootCA
      
      ### dbdir: directory for cert8.db, key3.db and secmod.db
      dbdir=/root/.dogtag/pki_rsa_bootstrap/certs_db
      
      ### password: password for cert8.db which stores the user signing certificate and keys
      password=SECret.123
      
      ### format: request format, either pkcs10 or crmf
      format=pkcs10
      
      ### revocation parameters
      revRequest.enable=true
      revRequest.serial=245832201
      revRequest.reason=unspecified
      revRequest.comment=test user2 certificate revocation
    2. Generate the request using the CMCRequest command:

      # CMCRequest cmc-agent-signed-revoke.cfg
      
      cert/key prefix =
      path = /root/.dogtag/pki_rsa_bootstrap/certs_db
      CryptoManger initialized
      token internal logged in...
      got signerCert: PKI Bootstrap Administrator for RSA-RootCA
      addRevRequestAttr: no sharedSecret found; request will be signed;
      addRevRequestAttr: RevokeRequest control created.
      selfSign is false...
      signData: begins:
      getPrivateKey: got signing cert
      signData:  got signer privKey
      createSignedData: begins
      getSigningAlgFromPrivate: begins.
      getSigningAlgFromPrivate: found signingKeyType=RSA
      getSigningAlgFromPrivate: using SignatureAlgorithm: RSASignatureWithSHA256Digest
      createSignedData: digest created for pkidata
      createSignedData: digest algorithm =RSASignatureWithSHA256Digest
      createSignedData: building cert chain
      signData: signed request generated.
      getCMCBlob: begins
      getCMCBlob: generating signed data
      
      The CMC enrollment request in base-64 encoded format:
      
      . . . Output omitted . . .
      
      The CMC enrollment request in binary format is stored in
      /root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.revoke.agentSigned.req
    3. Create a HttpClient configuration file. For example:

      # vi HttpClient.revoke.agentSigned.cfg
      ### CA server host name.
      host=rhcs10.example.com
      
      ### port: port number
      port=8443
      
      ### secure: true for secure connection, false for nonsecure connection
      secure=true
      
      ### input: full path for the enrollment request, the content must be in binary format
      input=/root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.revoke.agentSigned.req
      
      ### output: full path for the response in binary format
      output=/root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.revoke.agentSigned.resp
      
      ### tokenname: name of the token where the SSL client authentication cert can be found (default is internal)
      ### This parameter will be ignored if secure=false
      tokenname=internal
      
      ### dbdir: directory for cert8.db, key3.db and secmod.db
      ### This parameter will be ignored if secure=false
      dbdir=/root/.dogtag/pki_rsa_bootstrap/certs_db
      
      ### clientmode: true for client authentication, false for no client authentication
      ### This parameter will be ignored if secure=false
      clientmode=true
      
      ### password: password for cert8.db
      ### This parameter will be ignored if secure=false and clientauth=false
      password=SECret.123
      
      ### nickname: nickname for client certificate
      ### This parameter will be ignored if clientmode=false
      nickname=PKI Bootstrap Administrator for RSA-RootCA
      
      ### servlet: servlet name
      servlet=/ca/ee/ca/profileSubmitCMCFull?profileId=caFullCMCUserCert
    4. Submit the request using the HttpClient command:

      # HttpClient HttpClient.revoke.agentSigned.cfg
      
      Total number of bytes read = 2793
      after SSLSocket created, thread token is NSS FIPS 140-2 User Private Key
      client cert is not null
      handshake happened
      writing to socket
      Total number of bytes read = 1638
      
      . . . Output omitted . . .
      
      The response in binary format is stored in
      /root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.revoke.agentSigned.resp
    5. Process the CMC Response:

      # CMCResponse -d /root/.dogtag/pki_rsa_bootstrap/certs_db -i /root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.revoke.agentSigned.resp
      
      . . . Output omitted . . .
      
      Number of controls is 1
      Control #0: CMCStatusInfoV2
        OID: {1 3 6 1 5 5 7 7 25}
        BodyList: 1
        Status: SUCCESS

Verification

  1. Verify in the CA signed audit log, for example /var/log/pki/rhcs10-RSA-RootCA/ca/signedAudit/ca_audit, that the user2 certificate indeed got revoked.
  2. Wait until the next CRL autoupdate (update interval in minutes configured by the ca.crl.MasterCRL.autoUpdateInterval of the RootCA’s CS.cfg file. By default, this is set to 240 minutes).

    Note

    Alternatively, if you want to manually update the CRL immediately, login to the RootCA’s Agent UI in the browser, and:

    1. Select Update Revocation List and click Update.
    2. Click Update Directory Server and select:

      • Update the certificate revocation list to the directory
      • Update Certificate Manager certificate to the directory
    3. Click Update Directory.

    Once the ldapStore refresh completes, observe the debug file in /var/lib/pki/rhcs10-RSA-OCSP-rootca/ocsp/logs/debug.

  3. Verify with the OCSPCLient tool that the certificate of user2 has been revoked, using its serial number in decimal (with -c pointing to the nickname of the signing CA):

    # OCSPClient -v -d /root/.dogtag/pki_rsa_bootstrap/certs_db -h rhcs10.example.com -p 33080 -c "CA Signing Cert - rhcs10-RSA-RootCA" --serial 245832201
    
    Initializing security database
    Creating request for serial number 245832201
    Submitting OCSP request
    URL: http://rhcs10.example.com:33080/ocsp/ee/ocsp
    Request Length: 71
    Request: MEUwQzBBMD8wPTAJBgUrDgMCGgUABBRA+gjEGo4W0lUiC/Ve/oO8CrXQLQQUK4Bf
    o2u6SW0p6q58dlNCXxOVw30CBA7kEiA=
    
    Response Length: 3563
    Response: <blob>
    CertID.serialNumber=245832201
    CertStatus=Revoked

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)

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.

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.

Note

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:

  1. Verify the existence of the nssdb password file on this instance:

    # ls /etc/dirsrv/slapd-CC-RSA-RootCA-LDAP/pwdfile.txt
  2. Stop DS:

    # dsctl slapd-CC-RSA-RootCA-LDAP stop
  3. 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
    Important

    Edit 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

    The CSR file must start with the line "-----BEGIN CERTIFICATE REQUEST-----" and end with the line "-----END CERTIFICATE REQUEST-----".

    1. Start DS:

      # dsctl slapd-CC-RSA-RootCA-LDAP start
    2. 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

Issue the real DS certificate

On rhcs10.example.com, issue the actual SSL server certificate:

  1. Generate a CMC request:

    1. Create a CMCRequest configuration file. For example:

      # vim /root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.dirsrv-rootca_pkcs10.cfg
      ### numRequests: Total number of PKCS10 requests or CRMF requests.
      numRequests=1
      
      ### input: full path for the PKCS10 request or CRMF request,
      ### The content must be in Base-64 encoded format.
      ### Multiple files are supported. They must be separated by a space.
      ### For input on a different host, specify where to find the CSR.
      input=/root/.dogtag/pki_rsa_bootstrap/certs_db/Server-Cert-rootca.csr
      
      ### output: full path for the CMC request in binary format
      ### For output on a different host, specify the destination.
      output=/root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.dirsrv-rootca_pkcs10.req
      
      ### tokenname: name of the token where the agent signing cert can be found (default is internal)
      tokenname=internal
      
      ### nickname: nickname for the agent certificate that will be used to sign the CMC full request.
      nickname=PKI Bootstrap Administrator for RSA-RootCA
      
      ### dbdir: directory for cert8.db, key3.db and secmod.db
      dbdir=/root/.dogtag/pki_rsa_bootstrap/certs_db
      
      ### password: password for cert8.db that stores the agent certificate
      password=SECret.123
      
      ### format: request format, either pkcs10 or crmf
      format=pkcs10
    2. Generate the request using the CMCRequest command:

      # CMCRequest /root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.dirsrv-rootca_pkcs10.cfg
      
      cert/key prefix =
      path = /root/.dogtag/pki_rsa_bootstrap/certs_db
      CryptoManger initialized
      token internal logged in...
      got signerCert: PKI Bootstrap Administrator for RSA-RootCA
      createPKIData: begins
      k=0
      createPKIData:  format: pkcs10
      useSharedSecret is false...
      signData: begins:
      getPrivateKey: got signing cert
      signData:  got signer privKey
      createSignedData: begins
      getSigningAlgFromPrivate: begins.
      getSigningAlgFromPrivate: found signingKeyType=RSA
      getSigningAlgFromPrivate: using SignatureAlgorithm: RSASignatureWithSHA256Digest
      createSignedData: digest created for pkidata
      createSignedData: digest algorithm =RSASignatureWithSHA256Digest
      createSignedData: building cert chain
      signData: signed request generated.
      getCMCBlob: begins
      getCMCBlob: generating signed data
      
      The CMC enrollment request in base-64 encoded format:
      
      . . . Output omitted . . .
      
      The CMC enrollment request in binary format is stored in
      /root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.dirsrv-rootca_pkcs10.req
  2. Submit the CMC request:

    1. Create a HttpClient configuration file. For example:

      # vim /root/.dogtag/pki_rsa_bootstrap/certs_db/HttpClient_dirsrv-rootca.cfg
      ### host: host name for the http server
      host=rhcs10.example.com
      
      ### port: port number
      port=8443
      
      ### secure: true for secure connection, false for nonsecure connection
      secure=true
      
      ### input: full path for the enrollment request, the content must be in binary format
      input=/root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.dirsrv-rootca_pkcs10.req
      
      ### output: full path for the response in binary format
      output=/root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.dirsrv-rootca_pkcs10.resp
      
      ### tokenname: name of the token where the SSL client authentication cert can be found (default is internal)
      ### This parameter will be ignored if secure=false
      tokenname=internal
      
      ### dbdir: directory for cert8.db, key3.db and secmod.db
      ### This parameter will be ignored if secure=false
      dbdir=/root/.dogtag/pki_rsa_bootstrap/certs_db
      
      ### clientmode: true for client authentication, false for no client authentication
      ### This parameter will be ignored if secure=false
      clientmode=true
      
      ### password: password for cert8.db
      ### This parameter will be ignored if secure=false and clientauth=false
      password=SECret.123
      
      ### nickname: nickname for client certificate
      ### This parameter will be ignored if clientmode=false
      nickname=PKI Bootstrap Administrator for RSA-RootCA
      
      ### servlet: servlet name
      servlet=/ca/ee/ca/profileSubmitCMCFull?profileId=caCMCserverCertWithCRLDP
      Note

      For EC certificates, use the ECC profiles by setting:

      servlet=/ca/ee/ca/profileSubmitCMCFull?profileId=caCMCECserverCertWithCRLDP
    2. Submit the request using the HttpClient command:

      # HttpClient /root/.dogtag/pki_rsa_bootstrap/certs_db/HttpClient_dirsrv-rootca.cfg
      
      Total number of bytes read = 3096
      after SSLSocket created, thread token is NSS FIPS 140-2 User Private Key
      client cert is not null
      handshake happened
      writing to socket
      
      ##Response Headers begin##
      HTTP/1.1 200
      Content-Type: application/pkcs7-mime
      Content-Length: 2492
      Date: Tue, 29 Sep 2020 15:20:21 GMT
      Connection: close
      ##end##
      
      . . . Output omitted . . .
      
      The response in binary format is stored in
      /root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.dirsrv-rootca_pkcs10.resp
  3. Process the CMC Response :

    1. Process the response using CMCResponse to display all certificates in chain individually in PEM format:

      Important

      Running 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.

      # CMCResponse -d /root/.dogtag/pki_rsa_bootstrap/certs_db -i /root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.dirsrv-rootca_pkcs10.resp -v
      
      Cert:0
      ...
      ===
      Cert:1
      ...
      ===
      Cert:2
      ...
      ===
      Certificates:
          Certificate:
              Data:
                  Version:  v3
                  Serial Number: 0xA383694
                  Signature Algorithm: SHA256withRSA - 1.2.840.113549.1.1.11
                  Issuer: CN=CA Signing Certificate,OU=rhcs10-RSA-RootCA,O=Example-rhcs10-RSA-RootCA
                  Validity:
                      Not Before: Tuesday, April 5, 2022 8:41:36 AM EDT America/New_York
                      Not  After: Monday, March 25, 2024 8:41:36 AM EDT America/New_York
                  Subject: CN=rhds11.example.com
      
      . . . Output omitted . . .
      
          Certificate:
              Data:
                  Version:  v3
                  Serial Number: 0x5C8FAD4
                  Signature Algorithm: SHA256withRSA - 1.2.840.113549.1.1.11
                  Issuer: CN=CA Signing Certificate,OU=rhcs10-RSA-RootCA,O=Example-rhcs10-RSA-RootCA
                  Validity:
                      Not Before: Tuesday, April 5, 2022 8:36:21 AM EDT America/New_York
                      Not  After: Saturday, April 5, 2042 8:36:21 AM EDT America/New_York
                  Subject: CN=CA Signing Certificate,OU=rhcs10-RSA-RootCA,O=Example-rhcs10-RSA-RootCA
      
      . . . Output omitted . . .
      
          Certificate:
              Data:
                  Version:  v3
                  Serial Number: 0x80296C3
                  Signature Algorithm: SHA256withRSA - 1.2.840.113549.1.1.11
                  Issuer: CN=CA Signing Certificate,OU=rhcs10-RSA-RootCA,O=Example-rhcs10-RSA-RootCA
                  Validity:
                      Not Before: Tuesday, April 5, 2022 8:39:43 AM EDT America/New_York
                      Not  After: Friday, April 5, 2041 8:39:43 AM EDT America/New_York
                  Subject: CN=CA Signing Certificate,OU=rhcs10-RSA-RootCA,O=Example-rhcs10-RSA-RootCA
      
      . . . Output omitted . . .
      
      Number of controls is 1
      Control #0: CMCStatusInfoV2
      OID: {1 3 6 1 5 5 7 7 25}
      BodyList: 1
      Status: SUCCESS
      CMC Full Response.
    2. 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

      Where Server-Cert-rootca.pem is the new Server-Cert certificate of the Directory Server instance that serves as the internaldb of the RootCA.

      Note

      The 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
  4. 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/

Replace the temporary DS certificate

On rhds11.example.com, replace the temporary DS certificate with the actual DS certificate:

  1. Stop DS:

    # dsctl slapd-CC-RSA-RootCA-LDAP stop
  2. 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/
  3. 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 "Self-Signed-CA"
  4. 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 "u,u,u" -n "Server-Cert" -i /etc/dirsrv/slapd-CC-RSA-RootCA-LDAP/Server-Cert-rootca.pem
  5. List the certificates:

    # certutil -L -d /etc/dirsrv/slapd-CC-RSA-RootCA-LDAP/
    
    Certificate Nickname                        Trust Attributes
                                                SSL,S/MIME,JAR/XPI
    CA Signing Cert - rhcs10-RSA-RootCA         CT,C,C
    Server-Cert                                 u,u,u
  6. On rhds11.example.com, start DS:

    # dsctl slapd-CC-RSA-RootCA-LDAP start
  7. 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

    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

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:

  1. Stop the CA:

    # pki-server stop rhcs10-RSA-RootCA
  2. List the certificate:

    # certutil -L -d /var/lib/pki/rhcs10-RSA-RootCA/alias/
    
    Certificate Nickname                Trust Attributes
                                        SSL,S/MIME,JAR/XPI
    DS temp CA certificate              CT,C,C
    ...
  3. Remove the temporary certificate from the nssdb:

    # certutil -D -d /var/lib/pki/rhcs10-RSA-RootCA/alias/ -n "DS temp CA certificate"

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:

  1. To enable certificate revocation checks, in the respective /var/lib/pki/rhcs10-RSA-RootCA/conf/server.xml file:

    1. Set enableOCSP or enableRevocationCheck to true:

      enableOCSP=true
      or
      enableRevocationCheck=true
    2. Additionally, remove these two parameters and their assigned values:

      ocspResponderURL
      ocspResponderCertNickname
  2. Disable the legacy revocation check method by editing the CA’s CS.cfg file and setting the following to false:

    auths.revocationChecking.enabled=false
  3. Start the RootCA instance:

    # pki-server start rhcs10-RSA-RootCA

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”):

  1. Check the publishing of the file-based 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
  2. Display and verify the content of the CRL

    # BtoA /var/lib/pki/rhcs10-RSA-RootCA/crl/ServerCertCRL.crl /var/lib/pki/rhcs10-RSA-RootCA/crl/ServerCertCRL.bin
    # PrettyPrintCrl /var/lib/pki/rhcs10-RSA-RootCA/crl/ServerCertCRL.bin
    Certificate Revocation List:
            Data:
                Version:  v2
                Signature Algorithm: SHA256withRSA - 1.2.840.113549.1.1.11
                Issuer: CN=CA Signing Certificate,OU=rhcs10-RSA-RootCA,O=Example-rhcs10-RSA-RootCA
                This Update: Thursday, June 20, 2024 6:09:38 PM EDT America/New_York
                Next Update: Thursday, June 20, 2024 9:00:00 PM EDT America/New_York
                Revoked Certificates:
                    Serial Number: 0xF6FDEF3
                    Revocation Date: Thursday, June 20, 2024 6:09:38 PM EDT America/New_York
                    Extensions:
                        Identifier: Revocation Reason - 2.5.29.21
                            Critical: no
                            Reason: Certificate_Hold
            Extensions:
                Identifier: CRL Number - 2.5.29.20
                    Critical: no
                    Number: 21
            Signature:
                Algorithm: SHA256withRSA - 1.2.840.113549.1.1.11
                Signature:
                    69:38:47:5D:E4:50:17:C5:6C:60:3F:1B:D8:B4:62:4D:
                    8B:11:FC:31:E4:26:6B:07:B6:BB:2C:7E:48:10:F4:DD:
                    0A:67:17:CB:DF:4E:1A:50:BE:4F:8F:61:B4:91:AE:DA:
                    E5:58:D5:FE:54:D9:94:B3:38:E1:B6:2C:19:C4:93:54:
                    D5:5E:8B:61:4F:89:52:5A:F7:F5:1B:2F:59:19:AD:23:
                    1F:6F:3C:93:17:F3:1A:1C:0B:9A:D2:8F:01:76:08:6E:
                    DA:DD:6F:2D:75:54:D3:D4:40:9A:2B:5D:8B:D5:BB:8B:
                    AF:89:E4:13:A7:F1:8A:AF:0A:72:26:E3:3D:FE:B3:90:
                    2B:F7:88:57:E9:8B:E7:82:B6:D3:F3:80:CD:F7:87:77:
                    69:AF:39:90:5E:46:9C:C2:C4:FA:44:01:77:6D:8F:2D:
                    5A:BD:B9:39:3F:E4:99:E7:F9:FD:2D:CD:FA:87:C1:42:
                    A4:D0:3B:87:0B:28:30:2D:2A:68:F2:68:7C:00:A8:4B:
                    AC:38:49:5A:03:D1:B2:CE:45:D8:C1:6A:3F:42:F0:04:
                    F6:CC:43:83:E8:19:41:6F:0A:64:95:C3:57:8F:54:53:
                    31:40:58:D4:CD:29:0E:0A:D9:15:E9:08:0C:B8:74:F4:
                    82:B4:4E:51:8F:1C:86:A3:2E:BF:BB:F8:4A:DD:17:07:
                    37:27:0F:8B:5C:5E:75:28:B4:0C:DE:F2:38:B9:0E:AE:
                    73:06:A1:3D:36:85:54:74:E6:C3:4B:78:80:9F:76:42:
                    85:D2:94:FF:A0:0C:7D:23:61:AB:4E:7A:D0:5B:EC:CF:
                    91:E9:CB:80:C4:A1:EB:86:FB:D8:E6:65:AC:48:D0:9F:
                    8B:95:07:A9:CA:D7:34:A9:7B:32:25:1E:F4:21:A8:06:
                    44:73:B4:99:79:B5:69:77:D1:18:3B:40:C5:20:AF:5C:
                    8E:D0:65:AE:34:CF:1F:90:82:97:33:7F:90:E6:D9:BC:
                    49:8F:BE:59:22:FE:09:E5:FA:F2:5F:31:77:6D:F8:99
Important

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:

  1. Stop the CA service.

    # pki-server stop rhcs10-RSA-RootCA
  2. Set the enableRevocationCheck or enableOCSP parameter to false (if it is currently set to true) in CA’s server.xml.
  3. Set the ca.crl.ServerCertCRL.publishOnStart= parameter to true in CA’s CS.cfg.
  4. Start the CA service to regenerate the missing CRL file:

    # pki-server start rhcs10-RSA-RootCA
  5. After the CRL file has been recovered, stop the CA service once again.
  6. Revert the ca.crl.ServerCertCRL.publishOnStart= parameter to false in CA’s CS.cfg.
  7. Set the enableRevocationCheck or enableOCSP parameter to true in CA’s server.xml.
  8. 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

  1. List the certificates in the CA:

    # pki -p 8443 ca-cert-find
  2. 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

7.6. Create and configure the SubCA (Part I)

To install and configure a SubCA instance, use either one of two pkispawn methods:

Note

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

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

Procedure

  1. Create a SubCA installation file at a chosen location (e.g. /root/pki_rsa):

    # cd /root/pki_rsa
    # vi subca_inst.cfg
    Note

    Unless 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…​

    [DEFAULT]
    pki_instance_name=rhcs10-RSA-SubCA
    pki_https_port=31443
    pki_http_port=31080
    
    ### Crypto Token
    pki_hsm_enable=True
    pki_hsm_libfile=/opt/nfast/toolkits/pkcs11/libcknfast.so
    pki_hsm_modulename=nfast
    pki_token_name=NHSM-CONN-XC
    pki_token_password=<YourHSMpassword>
    
    pki_audit_signing_token=NHSM-CONN-XC
    pki_audit_signing_key_algorithm=SHA256withRSA
    pki_audit_signing_key_size=2048
    pki_audit_signing_key_type=rsa
    pki_audit_signing_signing_algorithm=SHA256withRSA
    
    pki_subsystem_token=NHSM-CONN-XC
    pki_subsystem_key_algorithm=SHA256withRSA
    pki_subsystem_signing_algorithm=SHA256withRSA
    pki_subsystem_key_size=2048
    pki_subsystem_key_type=rsa
    
    pki_sslserver_token=NHSM-CONN-XC
    pki_sslserver_key_algorithm=SHA256withRSA
    pki_sslserver_signing_algorithm=SHA256withRSA
    pki_sslserver_key_size=2048
    pki_sslserver_key_type=rsa
    
    ### CA cert chain concatenated in PEM format
    pki_cert_chain_path=/opt/pki_rsa/ca-chain.pem
    
    ### Bootstrap Admin
    pki_admin_password=SECret.123
    pki_admin_key_type=rsa
    pki_admin_key_size=2048
    pki_admin_key_algorithm=SHA256withRSA
    
    ### Bootstrap Admin client dir
    pki_client_admin_cert_p12=/opt/pki_rsa/rhcs10-RSA-SubCA/ca_admin_cert.p12
    pki_client_database_dir=/opt/pki_rsa/rhcs10-RSA-SubCA/certs_db
    pki_client_database_password=SECret.123
    pki_client_dir=/opt/pki_rsa/rhcs10-RSA-SubCA
    pki_client_pkcs12_password=SECret.123
    
    ### Internal LDAP
    pki_ds_bind_dn=cn=Directory Manager
    pki_ds_ldap_port=7389
    pki_ds_ldaps_port=7636
    pki_ds_password=SECret.123
    pki_ds_remove_data=True
    pki_ds_secure_connection=True
    pki_ds_secure_connection_ca_pem_file=/opt/pki_rsa/temp-dirsrv-subca-cert.pem
    pki_ds_secure_connection_ca_nickname=DS temp CA certificate
    
    
    [Tomcat]
    pki_ajp_port=31009
    pki_tomcat_server_port=31005
    
    
    [CA]
    pki_subordinate=True
    pki_issuing_ca_https_port=8443
    pki_issuing_ca_hostname=rhcs10.example.com
    pki_issuing_ca=https://rhcs10.example.com:8443
    
    ### New Security Domain
    pki_security_domain_hostname=rhcs10.example.com
    pki_security_domain_https_port=8443
    pki_security_domain_password=SECret.123
    pki_subordinate_create_new_security_domain=True
    pki_subordinate_security_domain_name=Example-rhcs10-RSA-SubCA
    
    pki_import_admin_cert=False
    pki_admin_nickname=PKI Bootstrap Administrator for RSA-SubCA
    pki_admin_name=caadmin
    pki_admin_uid=caadmin
    pki_admin_email=caadmin@example.com
    
    pki_ca_signing_token=NHSM-CONN-XC
    pki_ca_signing_key_algorithm=SHA256withRSA
    pki_ca_signing_key_size=3072
    pki_ca_signing_key_type=rsa
    pki_ca_signing_nickname=CA Signing Cert - %(pki_instance_name)s
    pki_ca_signing_signing_algorithm=SHA256withRSA
    
    pki_ocsp_signing_token=NHSM-CONN-XC
    pki_ocsp_signing_key_algorithm=SHA256withRSA
    pki_ocsp_signing_key_size=3072
    pki_ocsp_signing_key_type=rsa
    pki_ocsp_signing_signing_algorithm=SHA256withRSA
    
    pki_ds_hostname=rhds11.example.com
    pki_ds_base_dn=dc=RSA-SubCA
    pki_ds_database=CC-RSA-SubCA-LDAP
    pki_share_db=False
    
    ### Enable random serial numbers
    pki_random_serial_numbers_enable=True
  2. Run the pkispawn tool to install the RHCS SubCA instance:

    # pkispawn -s CA -f subca_inst.cfg --debug

    This will create the SubCA instance in /var/lib/pki/rhcs10-RSA-SubCA.

Verification steps

  1. Show the status of the installed CA:

    # pki-server status rhcs10-RSA-SubCA

    Note down the Unsecure EE, Secure EE, Agent, Admin and pkiconsole URLs.

  2. 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
Note

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)?

Select ‘y’ to trust the CA signing cert if the Subject DN matches the hostname as expected. The warning will not display again.

Note

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.

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

First step of SubCA installation

  1. 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
    [DEFAULT]
    pki_instance_name=rhcs10-RSA-SubCA
    pki_https_port=31443
    pki_http_port=31080
    
    ### Crypto Token
    pki_hsm_enable=True
    pki_hsm_libfile=/opt/nfast/toolkits/pkcs11/libcknfast.so
    pki_hsm_modulename=nfast
    pki_token_name=NHSM-CONN-XC
    pki_token_password=<YourHSMpassword>
    
    pki_audit_signing_token=NHSM-CONN-XC
    pki_audit_signing_key_algorithm=SHA256withRSA
    pki_audit_signing_key_size=2048
    pki_audit_signing_key_type=rsa
    pki_audit_signing_signing_algorithm=SHA256withRSA
    
    pki_subsystem_token=NHSM-CONN-XC
    pki_subsystem_key_algorithm=SHA256withRSA
    pki_subsystem_signing_algorithm=SHA256withRSA
    pki_subsystem_key_size=2048
    pki_subsystem_key_type=rsa
    
    pki_sslserver_token=NHSM-CONN-XC
    pki_sslserver_key_algorithm=SHA256withRSA
    pki_sslserver_signing_algorithm=SHA256withRSA
    pki_sslserver_key_size=2048
    pki_sslserver_key_type=rsa
    
    ### CA cert chain concatenated in PEM format
    pki_cert_chain_path=/opt/pki_rsa/ca-chain.pem
    
    ### Bootstrap Admin
    pki_admin_password=SECret.123
    pki_admin_key_type=rsa
    pki_admin_key_size=2048
    pki_admin_key_algorithm=SHA256withRSA
    
    ### Bootstrap Admin client dir
    pki_client_admin_cert_p12=/opt/pki_rsa/rhcs10-RSA-SubCA/ca_admin_cert.p12
    pki_client_database_dir=/opt/pki_rsa/rhcs10-RSA-SubCA/certs_db
    pki_client_database_password=SECret.123
    pki_client_dir=/opt/pki_rsa/rhcs10-RSA-SubCA
    pki_client_pkcs12_password=SECret.123
    
    ### Internal LDAP
    pki_ds_bind_dn=cn=Directory Manager
    pki_ds_ldap_port=7389
    pki_ds_ldaps_port=7636
    pki_ds_password=SECret.123
    pki_ds_remove_data=True
    pki_ds_secure_connection=True
    pki_ds_secure_connection_ca_pem_file=/opt/pki_rsa/temp-dirsrv-subca-cert.pem
    pki_ds_secure_connection_ca_nickname=DS temp CA certificate
    
    
    [Tomcat]
    pki_ajp_port=31009
    pki_tomcat_server_port=31005
    
    
    [CA]
    pki_subordinate=True
    pki_issuing_ca_https_port=8443
    pki_issuing_ca_hostname=rhcs10.example.com
    pki_issuing_ca=https://rhcs10.example.com:8443
    
    ### New Security Domain
    pki_security_domain_hostname=rhcs10.example.com
    pki_security_domain_https_port=8443
    pki_security_domain_password=SECret.123
    pki_subordinate_create_new_security_domain=True
    pki_subordinate_security_domain_name=Example-rhcs10-RSA-SubCA
    
    pki_import_admin_cert=False
    pki_admin_nickname=PKI Bootstrap Administrator for RSA-SubCA
    pki_admin_name=caadmin
    pki_admin_uid=caadmin
    pki_admin_email=caadmin@example.com
    
    pki_ca_signing_token=NHSM-CONN-XC
    pki_ca_signing_key_algorithm=SHA256withRSA
    pki_ca_signing_key_size=3072
    pki_ca_signing_key_type=rsa
    pki_ca_signing_nickname=CA Signing Cert - %(pki_instance_name)s
    pki_ca_signing_signing_algorithm=SHA256withRSA
    
    pki_ocsp_signing_token=NHSM-CONN-XC
    pki_ocsp_signing_key_algorithm=SHA256withRSA
    pki_ocsp_signing_key_size=3072
    pki_ocsp_signing_key_type=rsa
    pki_ocsp_signing_signing_algorithm=SHA256withRSA
    
    pki_ds_hostname=rhds11.example.com
    pki_ds_base_dn=dc=RSA-SubCA
    pki_ds_database=CC-RSA-SubCA-LDAP
    pki_share_db=False
    
    ### Enable random serial numbers
    pki_random_serial_numbers_enable=True
    Note

    Unless 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, the pki_instance_name value of both files should match. The following values are just examples.

  2. Run the pkispawn tool to install the RHCS CA instance:

    # pkispawn -s CA -f subca_inst.cfg --skip-configuration --debug

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:

    1. Open the enrollment profile for this CA’s signing certificate:

      # vi /var/lib/pki/rhcs10-RSA-SubCA/ca/conf/caCert.profile
    2. Add the following parameter:

      7.default.params.messageDigest=SHA-256
    3. Save the file.

    Likewise, do the same for the CA signing cert that this CA will be issuing in the future:

    1. 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/caCMCcaCert.cfg
    2. Add the following parameter:

      policyset.caCertSet.8.default.params.messageDigest=SHA-256
    3. 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:

    1. Open the corresponding configuration file:

      # vi /var/lib/pki/rhcs10-RSA-SubCA/ca/profiles/ca/caInternalAuthAuditSigningCert.cfg
    2. Change the following range parameters to the desired values:

      policyset.auditSigningCertSet.2.constraint.params.range=720
      policyset.auditSigningCertSet.2.default.params.range=720
    3. 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

Verification steps

  1. Show the status of the installed CA:

    # pki-server status rhcs10-RSA-SubCA

    Note down the Unsecure EE, Secure EE, Agent, Admin and pkiconsole URLs.

  2. 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
Note

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)?

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

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.

  1. Retrieve the SubCA certificate into a .pem file

    # certutil -L -d /var/lib/pki/rhcs10-RSA-SubCA/alias -n "CA Signing Cert - rhcs10-RSA-SubCA" -a > /opt/pki_rsa/subCA.pem
  2. Update the CA certificate chain. For example:

    # cat /opt/pki_rsa/subCA.pem /opt/pki_rsa/rootCA.pem > /opt/pki_rsa/ca-chain.pem
Note

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.
  1. 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/ca-chain.pem root@rhds11.example.com:/opt/pki_rsa
  2. Restart the DS instance for the SubCA:

    # dsctl slapd-CC-RSA-SubCA-LDAP restart

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.

  1. 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
  2. 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
  3. 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
    
    ----------------------------------------
    Imported certificates from PKCS #12 file
    ----------------------------------------

Verification:

  • List the contents of the nssdb:

    # certutil -d /root/.dogtag/pki_rsa_bootstrap/certs_db -L
    
    Certificate Nickname                            Trust Attributes
                                                    SSL,S/MIME,JAR/XPI
    
    CA Signing Cert - rhcs10-RSA-RootCA             CT,C,C
    PKI Bootstrap Administrator for RSA-RootCA      u,u,u
    CA Signing Cert - rhcs10-RSA-SubCA              CT,C,C
    PKI Bootstrap Administrator for RSA-SubCA       u,u,u

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

  1. 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
  2. Stop the SubCA instance:

    pki-server stop rhcs10-RSA-SubCA
  3. For every profile in the list, change the visible and enable parameters from true to false. For example, use the following command to set visible=false and enable=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
  4. In addition, also change the visible parameter for the caCMCUserCert profile to false:

    # 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
  5. Start the SubCA instance:

    pki-server start rhcs10-RSA-SubCA
Note

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.

Note

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
Note

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>

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.

  1. 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
  2. Add the following to the CA’s CS.cfg:

    ca.publish.publisher.instance.crlFilePublisher.Filename.b64=false
    ca.publish.publisher.instance.crlFilePublisher.Filename.der=true
    ca.publish.publisher.instance.crlFilePublisher.crlLinkExt=crl
    ca.publish.publisher.instance.crlFilePublisher.directory=/var/lib/pki/rhcs10-RSA-SubCA/crl
    ca.publish.publisher.instance.crlFilePublisher.latestCrlLink=true
    ca.publish.publisher.instance.crlFilePublisher.maxAge=0
    ca.publish.publisher.instance.crlFilePublisher.maxFullCRLs=0
    ca.publish.publisher.instance.crlFilePublisher.pluginName=FileBasedPublisher
    ca.publish.publisher.instance.crlFilePublisher.timeStamp=LocalTime
    ca.publish.publisher.instance.crlFilePublisher.zipCRLs=false
    ca.publish.publisher.instance.crlFilePublisher.zipLevel=9

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:

    ca.publish.rule.instance.FileCrlRule.enable=true
    ca.publish.rule.instance.FileCrlRule.mapper=NoMap
    ca.publish.rule.instance.FileCrlRule.pluginName=Rule
    ca.publish.rule.instance.FileCrlRule.predicate=issuingPointId==ServerCertCRL
    ca.publish.rule.instance.FileCrlRule.publisher=crlFilePublisher
    ca.publish.rule.instance.FileCrlRule.type=crl

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

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:

    ca.crl.ServerCertCRL.allowExtensions=true
    ca.crl.ServerCertCRL.alwaysUpdate=false
    ca.crl.ServerCertCRL.autoUpdateInterval=240
    ca.crl.ServerCertCRL.caCertsOnly=false
    ca.crl.ServerCertCRL.cacheUpdateInterval=15
    ca.crl.ServerCertCRL.class=com.netscape.ca.CRLIssuingPoint
    ca.crl.ServerCertCRL.dailyUpdates=1:00
    ca.crl.ServerCertCRL.description=CA's Certificate Revocation List containing certificates issued via the caCMCserverCertWithCRLDP and caCMCECserverCertWithCRLDP enrollment profile
    ca.crl.ServerCertCRL.enable=true
    ca.crl.ServerCertCRL.enableCRLCache=false
    ca.crl.ServerCertCRL.enableCRLUpdates=true
    ca.crl.ServerCertCRL.enableCacheRecovery=true
    ca.crl.ServerCertCRL.enableCacheTesting=false
    ca.crl.ServerCertCRL.enableDailyUpdates=true
    ca.crl.ServerCertCRL.enableUpdateInterval=true
    ca.crl.ServerCertCRL.extendedNextUpdate=true
    ca.crl.ServerCertCRL.extension.AuthorityInformationAccess.accessLocation0=""
    ca.crl.ServerCertCRL.extension.AuthorityInformationAccess.accessLocationType0=URI
    ca.crl.ServerCertCRL.extension.AuthorityInformationAccess.accessMethod0=caIssuers
    ca.crl.ServerCertCRL.extension.AuthorityInformationAccess.class=com.netscape.cms.crl.CMSAuthInfoAccessExtension
    ca.crl.ServerCertCRL.extension.AuthorityInformationAccess.critical=false
    ca.crl.ServerCertCRL.extension.AuthorityInformationAccess.enable=false
    ca.crl.ServerCertCRL.extension.AuthorityInformationAccess.numberOfAccessDescriptions=1
    ca.crl.ServerCertCRL.extension.AuthorityInformationAccess.type=CRLExtension
    ca.crl.ServerCertCRL.extension.AuthorityKeyIdentifier.class=com.netscape.cms.crl.CMSAuthorityKeyIdentifierExtension
    ca.crl.ServerCertCRL.extension.AuthorityKeyIdentifier.critical=false
    ca.crl.ServerCertCRL.extension.AuthorityKeyIdentifier.enable=false
    ca.crl.ServerCertCRL.extension.AuthorityKeyIdentifier.type=CRLExtension
    ca.crl.ServerCertCRL.extension.CRLNumber.class=com.netscape.cms.crl.CMSCRLNumberExtension
    ca.crl.ServerCertCRL.extension.CRLNumber.critical=false
    ca.crl.ServerCertCRL.extension.CRLNumber.enable=true
    ca.crl.ServerCertCRL.extension.CRLNumber.type=CRLExtension
    ca.crl.ServerCertCRL.extension.CRLReason.class=com.netscape.cms.crl.CMSCRLReasonExtension
    ca.crl.ServerCertCRL.extension.CRLReason.critical=false
    ca.crl.ServerCertCRL.extension.CRLReason.enable=true
    ca.crl.ServerCertCRL.extension.CRLReason.type=CRLEntryExtension
    ca.crl.ServerCertCRL.extension.DeltaCRLIndicator.class=com.netscape.cms.crl.CMSDeltaCRLIndicatorExtension
    ca.crl.ServerCertCRL.extension.DeltaCRLIndicator.critical=true
    ca.crl.ServerCertCRL.extension.DeltaCRLIndicator.enable=false
    ca.crl.ServerCertCRL.extension.DeltaCRLIndicator.type=CRLExtension
    ca.crl.ServerCertCRL.extension.FreshestCRL.class=com.netscape.cms.crl.CMSFreshestCRLExtension
    ca.crl.ServerCertCRL.extension.FreshestCRL.critical=false
    ca.crl.ServerCertCRL.extension.FreshestCRL.enable=false
    ca.crl.ServerCertCRL.extension.FreshestCRL.numPoints=0
    ca.crl.ServerCertCRL.extension.FreshestCRL.pointName0=""
    ca.crl.ServerCertCRL.extension.FreshestCRL.pointType0=""
    ca.crl.ServerCertCRL.extension.FreshestCRL.type=CRLExtension
    ca.crl.ServerCertCRL.extension.InvalidityDate.class=com.netscape.cms.crl.CMSInvalidityDateExtension
    ca.crl.ServerCertCRL.extension.InvalidityDate.critical=false
    ca.crl.ServerCertCRL.extension.InvalidityDate.enable=true
    ca.crl.ServerCertCRL.extension.InvalidityDate.type=CRLEntryExtension
    ca.crl.ServerCertCRL.extension.IssuerAlternativeName.class=com.netscape.cms.crl.CMSIssuerAlternativeNameExtension
    ca.crl.ServerCertCRL.extension.IssuerAlternativeName.critical=false
    ca.crl.ServerCertCRL.extension.IssuerAlternativeName.enable=false
    ca.crl.ServerCertCRL.extension.IssuerAlternativeName.name0=""
    ca.crl.ServerCertCRL.extension.IssuerAlternativeName.nameType0=""
    ca.crl.ServerCertCRL.extension.IssuerAlternativeName.numNames=0
    ca.crl.ServerCertCRL.extension.IssuerAlternativeName.type=CRLExtension
    ca.crl.ServerCertCRL.extension.IssuingDistributionPoint.class=com.netscape.cms.crl.CMSIssuingDistributionPointExtension
    ca.crl.ServerCertCRL.extension.IssuingDistributionPoint.critical=true
    ca.crl.ServerCertCRL.extension.IssuingDistributionPoint.enable=false
    ca.crl.ServerCertCRL.extension.IssuingDistributionPoint.indirectCRL=false
    ca.crl.ServerCertCRL.extension.IssuingDistributionPoint.onlyContainsCACerts=false
    ca.crl.ServerCertCRL.extension.IssuingDistributionPoint.onlyContainsUserCerts=false
    ca.crl.ServerCertCRL.extension.IssuingDistributionPoint.onlySomeReasons=""
    ca.crl.ServerCertCRL.extension.IssuingDistributionPoint.pointName=
    ca.crl.ServerCertCRL.extension.IssuingDistributionPoint.pointType=
    ca.crl.ServerCertCRL.extension.IssuingDistributionPoint.type=CRLExtension
    ca.crl.ServerCertCRL.includeExpiredCerts=false
    ca.crl.ServerCertCRL.includeExpiredCertsOneExtraTime=false
    ca.crl.ServerCertCRL.minUpdateInterval=0
    ca.crl.ServerCertCRL.nextAsThisUpdateExtension=0
    ca.crl.ServerCertCRL.nextUpdateGracePeriod=0
    ca.crl.ServerCertCRL.profileCertsOnly=true
    ca.crl.ServerCertCRL.profileList=caCMCserverCertWithCRLDP,caCMCECserverCertWithCRLDP
    ca.crl.ServerCertCRL.publishOnStart=false
    ca.crl.ServerCertCRL.saveMemory=false
    ca.crl.ServerCertCRL.signingAlgorithm=SHA256withRSA
    ca.crl.ServerCertCRL.updateSchema=1
Note

For an ECC CA, set the following to SHA512withEC:

ca.crl.ServerCertCRL.signingAlgorithm=SHA512withEC
7.6.6.2. Set up CRL HTTP service in the CA

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:

  1. Add the following CRL service before the Catalina service in the file /var/lib/pki/rhcs10-RSA-SubCA/conf/server.xml:

    <Service name="CRL">
     <Connector port="31085" protocol="HTTP/1.1" connectionTimeout="80000"
      maxParameterCount="1000" name="Unsecure" maxHttpHeaderSize="8192"
      acceptCount="100" maxThreads="15" minSpareThreads="25"
      enableLookups="false" disableUploadTimeout="true"/>
     <Engine name="CRL" defaultHost="localhost">
    	<Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true">
       <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
        prefix="localhost_crl_access_log" suffix=".txt" pattern="common"/>
      </Host>
     </Engine>
    </Service>
  2. 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
    Note

    If 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

    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>

    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
  3. 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
  4. 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>
  5. Set the user:group ownership for the crl.xml file:

    chown pkiuser:pkiuser  /var/lib/pki/rhcs10-RSA-SubCA/conf/CRL/localhost/crl.xml
Note

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

Important

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.

Enable the desired profile(s) to include the CRL Distribution Points. These are the profiles corresponding to the configuration in the sections above.

  1. 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:

    # vi /var/lib/pki/rhcs10-RSA-SubCA/ca/profiles/ca/caCMCserverCertWithCRLDP.cfg
    …
    enable=true
    …
    policyset.serverCertSet.10.default.params.crlDistPointsPointName_0=http://rhcs10.example.com:31085/crl/ServerCertCRL.crl
    …
  2. 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:

    # vi /var/lib/pki/rhcs10-ECC-SubCA/ca/profiles/ca/caCMCECserverCertWithCRLDP.cfg
    …
    enable=true
    …
    policyset.serverCertSet.10.default.params.crlDistPointsPointName_0=http://rhcs10.example.com:21085/crl/ServerCertCRL.crl
    …
  3. 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
  4. Register a new profile in the CA’s CS.cfg:

    1. 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
    2. Edit the profile.list entry to add the two new profiles. For example:

      profile.list=caCMCserverCertWithCRLDP,caCMCECserverCertWithCRLDP,acmeServerCert,caCMCserverCert,caCMCECserverCert, …
7.6.6.4. Set up for more immediate CRL update

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

Once configuration is complete, start up the CA:

# pki-server start rhcs10-RSA-SubCA
Note

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.

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.

Note

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

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.

Note

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:

  1. Stop DS:

    # dsctl slapd-CC-RSA-OCSP-subca-LDAP stop
    Note

    If you are not certain about the name of a DS instance, list all instances using: dsctl -l

  2. 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
    Important

    Edit 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

    The CSR file must start with the line "-----BEGIN CERTIFICATE REQUEST-----" and end with the line "-----END CERTIFICATE REQUEST-----".

  3. 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

Issue the real DS certificate

On rhcs10.example.com, issue the actual SSL server certificate:

  1. Generate a CMC request:

    1. Create a CMCRequest configuration file. For example:

      # vim /root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.dirsrv-ocsp-subca_pkcs10.cfg
      ### numRequests: Total number of PKCS10 requests or CRMF requests.
      numRequests=1
      
      ### input: full path for the PKCS10 request or CRMF request,
      ### The content must be in Base-64 encoded format.
      ### Multiple files are supported. They must be separated by a space.
      ### For input on a different host, specify where to find the CSR.
      input=/root/.dogtag/pki_rsa_bootstrap/certs_db/Server-Cert-ocsp-subca.csr
      
      ### output: full path for the CMC request in binary format
      ### For output on a different host, specify the destination.
      output=/root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.dirsrv-ocsp-subca_pkcs10.req
      
      ### tokenname: name of the token where the agent signing cert can be found (default is internal)
      tokenname=internal
      
      ### nickname: nickname for the agent certificate that will be used to sign the CMC full request.
      nickname=PKI Bootstrap Administrator for RSA-SubCA
      
      ### dbdir: directory for cert8.db, key3.db and secmod.db
      dbdir=/root/.dogtag/pki_rsa_bootstrap/certs_db
      
      ### password: password for cert8.db that stores the agent certificate
      password=SECret.123
      
      ### format: request format, either pkcs10 or crmf
      format=pkcs10
    2. Generate the request using the CMCRequest command:

      # CMCRequest /root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.dirsrv-ocsp-subca_pkcs10.cfg
      
      cert/key prefix =
      path = /root/.dogtag/pki_rsa_bootstrap/certs_db
      CryptoManger initialized
      token internal logged in...
      got signerCert: PKI Bootstrap Administrator for RSA-SubCA
      createPKIData: begins
      k=0
      createPKIData:  format: pkcs10
      useSharedSecret is false...
      signData: begins:
      getPrivateKey: got signing cert
      signData:  got signer privKey
      createSignedData: begins
      getSigningAlgFromPrivate: begins.
      getSigningAlgFromPrivate: found signingKeyType=RSA
      getSigningAlgFromPrivate: using SignatureAlgorithm: RSASignatureWithSHA256Digest
      createSignedData: digest created for pkidata
      createSignedData: digest algorithm =RSASignatureWithSHA256Digest
      createSignedData: building cert chain
      signData: signed request generated.
      getCMCBlob: begins
      getCMCBlob: generating signed data
      
      The CMC enrollment request in base-64 encoded format:
      
      . . . Output omitted . . .
      
      The CMC enrollment request in binary format is stored in
      /root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.dirsrv-ocsp-subca_pkcs10.req
  2. Submit the CMC request:

    1. Create a HttpClient configuration file. For example:

      # vim /root/.dogtag/pki_rsa_bootstrap/certs_db/HttpClient_dirsrv-ocsp-subca.cfg
      ### host: host name for the http server
      host=rhcs10.example.com
      
      ### port: port number
      port=31443
      
      ### secure: true for secure connection, false for nonsecure connection
      secure=true
      
      ### input: full path for the enrollment request, the content must be in binary format
      input=/root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.dirsrv-ocsp-subca_pkcs10.req
      
      ### output: full path for the response in binary format
      output=/root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.dirsrv-ocsp-subca_pkcs10.resp
      
      ### tokenname: name of the token where the SSL client authentication cert can be found (default is internal)
      ### This parameter will be ignored if secure=false
      tokenname=internal
      
      ### dbdir: directory for cert8.db, key3.db and secmod.db
      ### This parameter will be ignored if secure=false
      dbdir=/root/.dogtag/pki_rsa_bootstrap/certs_db
      
      ### clientmode: true for client authentication, false for no client authentication
      ### This parameter will be ignored if secure=false
      clientmode=true
      
      ### password: password for cert8.db
      ### This parameter will be ignored if secure=false and clientauth=false
      password=SECret.123
      
      ### nickname: nickname for client certificate
      ### This parameter will be ignored if clientmode=false
      nickname=PKI Bootstrap Administrator for RSA-SubCA
      
      ### servlet: servlet name
      servlet=/ca/ee/ca/profileSubmitCMCFull?profileId=caCMCserverCert
    2. Submit the request using the HttpClient command:

      # HttpClient /root/.dogtag/pki_rsa_bootstrap/certs_db/HttpClient_dirsrv-ocsp-subca.cfg
      
      Total number of bytes read = 3096
      after SSLSocket created, thread token is NSS FIPS 140-2 User Private Key
      client cert is not null
      handshake happened
      writing to socket
      
      ##Response Headers begin##
      HTTP/1.1 200
      Content-Type: application/pkcs7-mime
      Content-Length: 2492
      Date: Tue, 29 Sep 2020 15:20:21 GMT
      Connection: close
      ##end##
      
      . . . Output omitted . . .
      
      The response in binary format is stored in
      /root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.dirsrv-ocsp-subca_pkcs10.resp
  3. Process the CMC Response:

    1. Process the response using CMCResponse to display all certificates in chain individually in PEM format:

      Important

      Running 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.

      # CMCResponse -d /root/.dogtag/pki_rsa_bootstrap/certs_db -i /root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.dirsrv-ocsp-subca_pkcs10.resp -v
      
      Cert:0
      …
      ===
      Cert:1
      …
      ===
      Cert:2
      …
      ===
      Certificates:
          Certificate:
              Data:
                  Version:  v3
                  Serial Number: 0xF4837FD
                  Signature Algorithm: SHA256withRSA - 1.2.840.113549.1.1.11
                  Issuer: CN=CA Signing Certificate,OU=rhcs10-RSA-SubCA,O=Example-rhcs10-RSA-RootCA
                  Validity:
                      Not Before: Wednesday, September 13, 2023 10:29:00 AM EDT America/New_York
                      Not  After: Tuesday, September 2, 2025 10:29:00 AM EDT America/New_York
                  Subject: CN=rhds11.example.com
      
      . . . Output omitted . . .
      
          Certificate:
              Data:
                  Version:  v3
                  Serial Number: 0xD0F4BEE
                  Signature Algorithm: SHA256withRSA - 1.2.840.113549.1.1.11
                  Issuer: CN=CA Signing Certificate,OU=rhcs10-RSA-RootCA,O=Example-rhcs10-RSA-RootCA
                  Validity:
                      Not Before: Friday, September 1, 2023 1:26:46 AM EDT America/New_York
                      Not  After: Tuesday, September 1, 2043 1:26:46 AM EDT America/New_York
                  Subject: CN=CA Signing Certificate,OU=rhcs10-RSA-RootCA,O=Example-rhcs10-RSA-RootCA
      
      . . . Output omitted . . .
      
          Certificate:
              Data:
                  Version:  v3
                  Serial Number: 0x485588D
                  Signature Algorithm: SHA256withRSA - 1.2.840.113549.1.1.11
                  Issuer: CN=CA Signing Certificate,OU=rhcs10-RSA-RootCA,O=Example-rhcs10-RSA-RootCA
                  Validity:
                      Not Before: Tuesday, September 12, 2023 5:18:54 PM EDT America/New_York
                      Not  After: Friday, September 12, 2042 5:18:54 PM EDT America/New_York
                  Subject: CN=CA Signing Certificate,OU=rhcs10-RSA-SubCA,O=Example-rhcs10-RSA-RootCA
      
      . . . Output omitted . . .
      
      Number of controls is 1
      Control #0: CMCStatusInfoV2
         OID: {1 3 6 1 5 5 7 7 25}
         BodyList: 1
         Status: SUCCESS
      CMC Full Response.
    2. 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

      Where Server-Cert-ocsp-subca.pem is the new Server-Cert certificate of the Directory Server instance that serves as the internaldb of the OCSP for the SubCA.

      Note

      The 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
  4. 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/

Replace the temporary DS certificate

On rhds11.example.com, replace the temporary DS certificate with the actual DS certificate:

  1. 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/
  2. 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 "Self-Signed-CA"
  3. 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-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 "u,u,u" -n "Server-Cert" -i /etc/dirsrv/slapd-CC-RSA-OCSP-subca-LDAP/Server-Cert-ocsp-subca.pem
  4. List the certificates:

    # certutil -L -d /etc/dirsrv/slapd-CC-RSA-OCSP-subca-LDAP/
    
    Certificate Nickname                           Trust Attributes
                                                   SSL,S/MIME,JAR/XPI
    CA Signing Cert - rhcs10-RSA-RootCA            CT,C,C
    CA Signing Cert - rhcs10-RSA-SubCA             CT,C,C
    Server-Cert                                    u,u,u
  5. Start DS:

    # dsctl slapd-CC-RSA-OCSP-subca-LDAP start
  6. 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

    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

7.7.2. Install the OCSP instance for the SubCA

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

Procedure

  1. Create an OCSP installation file at a chosen location (e.g. /root/pki_rsa) for generating certificate requests:

    # cd /root/pki_rsa
    # vi ocsp_subca_inst.cfg
    Note

    Unless 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…​

    [DEFAULT]
    pki_instance_name=rhcs10-RSA-OCSP-subca
    pki_https_port=32443
    pki_http_port=32080
    
    ### Crypto Token
    pki_hsm_enable=True
    pki_hsm_libfile=/opt/nfast/toolkits/pkcs11/libcknfast.so
    pki_hsm_modulename=nfast
    pki_token_name=NHSM-CONN-XC
    pki_token_password=<YourHSMpassword>
    
    pki_audit_signing_token=NHSM-CONN-XC
    pki_audit_signing_key_algorithm=SHA256withRSA
    pki_audit_signing_key_size=2048
    pki_audit_signing_key_type=rsa
    pki_audit_signing_signing_algorithm=SHA256withRSA
    
    pki_subsystem_token=NHSM-CONN-XC
    pki_subsystem_key_algorithm=SHA256withRSA
    pki_subsystem_signing_algorithm=SHA256withRSA
    pki_subsystem_key_size=2048
    pki_subsystem_key_type=rsa
    
    pki_sslserver_token=NHSM-CONN-XC
    pki_sslserver_key_algorithm=SHA256withRSA
    pki_sslserver_signing_algorithm=SHA256withRSA
    pki_sslserver_key_size=2048
    pki_sslserver_key_type=rsa
    
    ### CA cert chain concatenated in PEM format
    pki_cert_chain_path=/opt/pki_rsa/ca-chain.pem
    
    ### Bootstrap Admin
    pki_admin_password=SECret.123
    pki_admin_key_type=rsa
    pki_admin_key_size=2048
    pki_admin_key_algorithm=SHA256withRSA
    
    ### Bootstrap Admin client dir
    pki_client_admin_cert_p12=/opt/pki_rsa/rhcs10-RSA-OCSP-subca/ocsp_admin_cert.p12
    pki_client_database_dir=/opt/pki_rsa/rhcs10-RSA-OCSP-subca/certs_db
    pki_client_database_password=SECret.123
    pki_client_database_purge=False
    pki_client_dir=/opt/pki_rsa/rhcs10-RSA-OCSP-subca
    pki_client_pkcs12_password=SECret.123
    
    ### Internal LDAP
    pki_ds_bind_dn=cn=Directory Manager
    pki_ds_ldap_port=11389
    pki_ds_ldaps_port=11636
    pki_ds_password=SECret.123
    pki_ds_remove_data=True
    pki_ds_secure_connection=True
    pki_ds_secure_connection_ca_pem_file=/opt/pki_rsa/ca-chain.pem
    pki_ds_secure_connection_ca_nickname=CA Signing Cert - rhcs10-RSA-SubCA
    
    ### Security Domain
    pki_security_domain_hostname=rhcs10.example.com
    pki_security_domain_https_port=31443
    pki_security_domain_password=SECret.123
    pki_security_domain_user=caadmin
    
    
    [Tomcat]
    pki_ajp_port=32009
    pki_tomcat_server_port=32005
    
    
    [OCSP]
    pki_import_admin_cert=False
    
    pki_ocsp_signing_token=NHSM-CONN-XC
    pki_ocsp_signing_key_algorithm=SHA256withRSA
    pki_ocsp_signing_key_size=3072
    pki_ocsp_signing_key_type=rsa
    pki_ocsp_signing_signing_algorithm=SHA256withRSA
    
    pki_admin_nickname=PKI Bootstrap Administrator for RSA-OCSP-subca
    pki_admin_name=ocspadmin
    pki_admin_uid=ocspadmin
    pki_admin_email=ocspadmin@example.com
    
    pki_ds_hostname=rhds11.example.com
    pki_ds_base_dn=dc=RSA-OCSP-subca
    pki_ds_database=CC-RSA-OCSP-subca-LDAP
    pki_share_db=False
  2. Run the pkispawn tool to install the OCSP subsystem:

    # pkispawn -s OCSP -f ocsp_subca_inst.cfg --debug

    This will create the OCSP instance in /var/lib/pki/rhcs10-RSA-OCSP-subca.

Note

For ease of reference, if you wanted to install this OCSP using the two-step method:

  1. 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
  2. Customize the configuration files between the two installation steps
  3. Run the pkispawn tool to configure the OCSP:

    # pkispawn -s OCSP -f ocsp_subca_inst.cfg --skip-installation --debug

Verification

  • Show the status of the installed OCSP instance:

    # pki-server status rhcs10-RSA-OCSP-subca
  1. Log in to rhcs10.example.com as root.
  2. Stop the SubCA’s OCSP service:

    pki-server stop rhcs10-RSA-OCSP-subca
  3. Edit /var/lib/pki/rhcs10-RSA-OCSP-subca/conf/server.xml to increase the timeout period:

    <Connector name="Secure" port="32443" …
    connectionTimeout="3000000"
  4. Start the SubCA’s OCSP service:

    # pki-server start rhcs10-RSA-OCSP-subca

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:

  1. Stop the SubCA:

    # pki-server stop rhcs10-RSA-SubCA
  2. Edit the SubCA’s CS.cfg and set the ca.defaultOcspUri variable to point to the OCSP. For example:

    ca.defaultOcspUri=http://rhcs10.example.com:32080/ocsp/ee/ocsp
  3. Start the SubCA:

    # pki-server start rhcs10-RSA-SubCA
Note

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

  • 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
    
    ----------------------------------------
    Imported certificates from PKCS #12 file
    ----------------------------------------
  1. Configure OCSP with authType=sslclientauth and import the role user certificate by following Configure pkiconsole login with client authentication.
  2. 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

    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

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.

On rhds11.example.com as root:

  1. 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.

    1. 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
    2. Edit the .cfg file created in the previous step. Uncomment the below parameters and set them to customize the installation:

      full_machine_name = rhds11.example.com
      port = 5389
      secure_port = 5636
      instance_name = CC-RSA-SubCA-CRL-PUBLISH
      root_password = SECret.123
      suffix = dc=example,dc=com
      create_suffix_entry = True
    3. Install the Directory Server instance:

      # dscreate from-file /root/pki_rsa/subca-crl-publish-ldap.cfg
      
      Starting installation...
      
      Completed installation for CC-RSA-SubCA-CRL-PUBLISH
  2. Add an ACI (Access Control Instruction) rule to allow anonymous bind access. By default, this is disabled.

    1. 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";)
    2. 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
  3. Prepare the CRL publishing subtree:

    1. 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
      • For the subca_crl_subtree.ldif file:

        dn: dc=crl,dc=pki,dc=example,dc=com
        objectClass: domain
        dc: crl
    2. 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_crl_subtree.ldif
7.7.7.2. Configuring CRL publishing on the SubCA

To configure CRL publishing:

  1. Add the ca.publish. properties:

    1. Stop the SubCA instance:

      # pki-server stop rhcs10-RSA-SubCA
    2. Configure the following properties in the SubCA’s CS.cfg configuration file (e.g. /var/lib/pki/rhcs10-RSA-SubCA/ca/conf/CS.cfg):

      ca.publish.ldappublish.enable=true
      ca.publish.ldappublish.ldap.ldapauth.authtype=BasicAuth
      ca.publish.ldappublish.ldap.ldapauth.bindDN=cn=Directory Manager
      ca.publish.ldappublish.ldap.ldapauth.bindPWPrompt=CA LDAP Publishing
      ca.publish.ldappublish.ldap.ldapconn.host=rhds11.example.com
      ca.publish.ldappublish.ldap.ldapconn.port=5389
      ca.publish.ldappublish.ldap.ldapconn.secureConn=false
      ca.publish.publisher.instance.LdapCaCertPublisher.caCertAttr=cACertificate;binary
      ca.publish.publisher.instance.LdapCaCertPublisher.caObjectClass=pkiCA
      ca.publish.publisher.instance.LdapCaCertPublisher.pluginName=LdapCaCertPublisher
      ca.publish.mapper.instance.LdapCaCertMap.createCAEntry=true
      ca.publish.mapper.instance.LdapCaCertMap.dnPattern=cn=$subj.cn,dc=crl,dc=pki,dc=example,dc=com
      ca.publish.mapper.instance.LdapCaCertMap.pluginName=LdapCaSimpleMap
      ca.publish.rule.instance.LdapCaCertRule.enable=true
      ca.publish.rule.instance.LdapCaCertRule.mapper=LdapCaCertMap
      ca.publish.rule.instance.LdapCaCertRule.pluginName=Rule
      ca.publish.rule.instance.LdapCaCertRule.predicate=
      ca.publish.rule.instance.LdapCaCertRule.publisher=LdapCaCertPublisher
      ca.publish.rule.instance.LdapCaCertRule.type=cacert
      ca.publish.publisher.instance.LdapCrlPublisher.crlAttr=certificateRevocationList;binary
      ca.publish.publisher.instance.LdapCrlPublisher.crlObjectClass=pkiCA
      ca.publish.publisher.instance.LdapCrlPublisher.pluginName=LdapCrlPublisher
      ca.publish.mapper.instance.LdapCrlMap.createCAEntry=true
      ca.publish.mapper.instance.LdapCrlMap.dnPattern=cn=$subj.cn,dc=crl,dc=pki,dc=example,dc=com
      ca.publish.mapper.instance.LdapCrlMap.pluginName=LdapCaSimpleMap
      ca.publish.rule.instance.LdapCrlRule.enable=true
      ca.publish.rule.instance.LdapCrlRule.mapper=LdapCrlMap
      ca.publish.rule.instance.LdapCrlRule.pluginName=Rule
      ca.publish.rule.instance.LdapCrlRule.predicate=issuingPointId==MasterCRL
      ca.publish.rule.instance.LdapCrlRule.publisher=LdapCrlPublisher
      ca.publish.rule.instance.LdapCrlRule.type=crl
      ca.publish.enable=true
      NOTE

      Alternatively, 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

      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
    3. Start the SubCA instance:

      pki-server start rhcs10-RSA-SubCA
  2. Push the CRL and CA certificate to the LDAP directory via curl. For example:

    # curl \
        -d "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/updateCRL \
        | xmllint --format -
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <xml>
      <header>
        <crlIssuingPoint>MasterCRL</crlIssuingPoint>
        <crlUpdate>Scheduled</crlUpdate>
      </header>
      <fixed/>
      <records/>
    </xml>
  3. Disable the direct CA→OCSP CRL publishing method:

    1. Stop the SubCA:

      # pki-server stop rhcs10-RSA-SubCA
    2. Edit the CA’s CS.cfg configuration file (e.g. /var/lib/pki/rhcs10-RSA-SubCA/ca/conf/CS.cfg) and set the following to false:

      ca.publish.rule.instance.ocsprule-<host/port info>.enable=false

      For example:

      ca.publish.rule.instance.ocsprule-rhcs10-example-com-32443.enable=false
    3. Start the CA for the configuration change to take effect:

      # pki-server start rhcs10-RSA-SubCA
  4. 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 -
  5. Display the CRL using curl:

    # curl \
       -d "pageSize=50&crlIssuingPoint=MasterCRL&pageStart=1&crlDisplayType=entireCRL&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/displayCRL | xmllint --format -
  6. 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
    . . . Output omitted . . .
    
    # CA Signing Certificate, crl.pki.example.com
    dn: cn=CA Signing Certificate,dc=crl,dc=pki,dc=example,dc=com
    cn: CA Signing Certificate
    sn: CA Signing Certificate
    objectClass: top
    objectClass: person
    objectClass: organizationalPerson
    objectClass: inetOrgPerson
    objectClass: pkiCA
    
    
    cACertificate;binary::
    MIICBzCB8AIBATANBgkqhkiG9w0BAQ0FADBdMRYwFAYDVQQKEw1FeGFtcGxlLVN1YkNBMSIwIAYDVQQLExlyaGNzOTMtVE1TLVN1YkNBLWFha2tpYW5nMR8wHQYDVQQDExZDQSBTaWduaW5nIENlcnRpZmljYXRlFw0xODAzMDkxODA
    
    . . . Output omitted . . .
    
    certificateRevocationList;binary::
    IID9DCCAtygAwIBAgIEBwa6XDANBgkqhkiG9w0BAQsFADBiMR4wHAYDVQQKDBVFeGFtcGxlLXJoY3M5My1UTVMtQ0ExHzAdBgNVBAsMFnJoY3M5My1UTVMtQ
    
    . . . Output omitted . . .
  7. Disable certificate publishing for the SubCA (optional):
Note

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
  1. Stop the SubCA:

    # pki-server stop rhcs10-RSA-SubCA
  2. Edit /var/lib/pki/rhcs10-RSA-SubCA/ca/conf/CS.cfg and set the following:

    ca.publish.cert.enable=false
  3. Start the SubCA for the configuration change to take effect:

    # pki-server start rhcs10-RSA-SubCA

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:

  1. Stop the OCSP:

    # pki-server stop rhcs10-RSA-OCSP-subca
  2. Set the ldapStore properties in the OCSP’s CS.cfg configuration file (e.g. /var/lib/pki/rhcs10-RSA-OCSP-subca/ocsp/conf/CS.cfg). Make sure you change the ocsp.storeId parameter from defStore to ldapStore and add the following parameters:

    ocsp.storeId=ldapStore
    ocsp.store.ldapStore.numConns=1
    ocsp.store.ldapStore.host0=rhds11.example.com
    ocsp.store.ldapStore.port0=5389
    ocsp.store.ldapStore.baseDN0=dc=crl,dc=pki,dc=example,dc=com
    ocsp.store.ldapStore.refreshInSec0=120
    ocsp.store.ldapStore.byName=true
    ocsp.store.ldapStore.caCertAttr=cACertificate;binary
    ocsp.store.ldapStore.crlAttr=certificateRevocationList;binary
    ocsp.store.ldapStore.notFoundAsGood=true
    Note

    The 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.

  3. 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

    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.

  4. Start the OCSP for the ldapStore configuration to take effect:

    # pki-server start rhcs10-RSA-OCSP-subca
7.7.7.4. Testing CRL publishing

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:

  1. List the certificates in the database:

    # certutil -d /root/.dogtag/pki_rsa_bootstrap/certs_db -L
    
    Certificate Nickname                          Trust Attributes
                                                  SSL,S/MIME,JAR/XPI
    
    PKI Bootstrap Administrator for RSA-SubCA     u,u,u
    CA Signing Cert - rhcs10-RSA-SubCA            CT,C,C
    
    . . . Output omitted . . .
  2. 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: 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
    NOTE

    Use cat on the keyId file so it will be available for the next step:

    # cat /root/.dogtag/pki_rsa_bootstrap/certs_db/user1.req.keyId; echo
  3. Generate a CMC request:

    1. 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
      ### numRequests: Total number of PKCS10 requests or CRMF requests.
      numRequests=1
      
      ### input: full path for the PKCS10 request or CRMF request,
      ### The content must be in Base-64 encoded format.
      ### Multiple files are supported. They must be separated by a space.
      input=/root/.dogtag/pki_rsa_bootstrap/certs_db/user1.req
      
      ### output: full path for the CMC request in binary format
      output=/root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.user1_pkcs10.req
      
      ### tokenname: name of the token where the agent signing cert can be found (default is internal)
      tokenname=internal
      
      ### nickname: nickname for the certificate that will be used to sign the CMC full request.
      ### nickname=caaadmin
      nickname=PKI Bootstrap Administrator for RSA-SubCA
      
      ### dbdir: directory for cert8.db, key3.db and secmod.db
      dbdir=/root/.dogtag/pki_rsa_bootstrap/certs_db
      
      ### password: password for cert8.db that stores the user signing certificate and keys
      password=SECret.123
      
      ### format: request format, either pkcs10 or crmf
      format=pkcs10
      
      ### identityProofV2.enable: if true, then the request will contain this control. Otherwise, false.
      ### Note that if both identityProof and identityProofV2 are enabled,
      ### identityProofV2 takes precedence; Only one of them can be active at a time
      ### Supported hashAlg are:
      ### SHA-256, SHA-384, and SHA-512
      ### Supported macAlg are:
      ### SHA-256-HMAC, SHA-384-HMAC, and SHA-512-HMAC
      identityProofV2.enable=false
      identityProofV2.hashAlg=SHA-512
      identityProofV2.macAlg=SHA-256-HMAC
      request.privKeyId=<output from PKCS10Client|CRMFPopClient xxx.priv>
    2. Generate the request using the CMCRequest command:

      # CMCRequest cmcRequest_p10_user1.cfg
      
      cert/key prefix =
      path = /root/.dogtag/pki_rsa_bootstrap/certs_db
      CryptoManger initialized
      token internal logged in...
      got signerCert: PKI Bootstrap Administrator for RSA-SubCA
      createPKIData: begins
      k=0
      createPKIData:  format: pkcs10
      PKCS10: PKCS10: begins
      PKCS10: PKCS10: ends
      selfSign is false...
      signData: begins:
      getPrivateKey: got signing cert
      signData:  got signer privKey
      createSignedData: begins
      getSigningAlgFromPrivate: begins.
      getSigningAlgFromPrivate: found signingKeyType=RSA
      getSigningAlgFromPrivate: using SignatureAlgorithm: RSASignatureWithSHA256Digest
      createSignedData: digest created for pkidata
      createSignedData: digest algorithm =RSASignatureWithSHA256Digest
      createSignedData: building cert chain
      signData: signed request generated.
      getCMCBlob: begins
      getCMCBlob: generating signed data
      
      The CMC enrollment request in base-64 encoded format:
      
      . . . Output omitted . . .
      
      The CMC enrollment request in binary format is stored in
      /root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.user1_pkcs10.req
  4. Submit the CMC request:

    1. Create a HttpClient configuration file. For example:

      # vim /root/.dogtag/pki_rsa_bootstrap/certs_db/HttpClient_cmc_p10_user1.cfg
      ### host: host name for the http server
      host=rhcs10.example.com
      
      ### port: port number
      port=31443
      
      ### secure: true for secure connection, false for nonsecure connection
      secure=true
      
      ### input: full path for the enrollment request, the content must be in binary format
      input=/root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.user1_pkcs10.req
      
      ### output: full path for the response in binary format
      output=/root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.user1_pkcs10.resp
      
      ### tokenname: name of the token where the SSL client authentication cert can be found (default is internal)
      ### This parameter will be ignored if secure=false
      tokenname=internal
      
      ### dbdir: directory for cert8.db, key3.db and secmod.db
      ### This parameter will be ignored if secure=false
      dbdir=/root/.dogtag/pki_rsa_bootstrap/certs_db/
      
      ### clientmode: true for client authentication, false for no client authentication
      ### This parameter will be ignored if secure=false
      clientmode=true
      
      ### password: password for cert8.db
      ### This parameter will be ignored if secure=false and clientauth=false
      password=SECret.123
      
      ### nickname: nickname for client certificate
      ### This parameter will be ignored if clientmode=false
      nickname=PKI Bootstrap Administrator for RSA-SubCA
      
      ### servlet: servlet name
      servlet=/ca/ee/ca/profileSubmitCMCFull?profileId=caFullCMCUserCert
    2. Submit the request using the HttpClient command:

      # HttpClient /root/.dogtag/pki_rsa_bootstrap/certs_db/HttpClient_cmc_p10_user1.cfg
      
      Total number of bytes read = 3453
      after SSLSocket created, thread token is NSS FIPS 140-2 User Private Key
      client cert is not null
      handshake happened
      writing to socket
      Total number of bytes read = 2590
      
      . . . Output omitted . . .
      
      The response in binary format is stored in
      /root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.user1_pkcs10.resp
  5. Process the response using the CMCResponse command:

    # CMCResponse -d /root/.dogtag/pki_rsa_bootstrap/certs_db -i /root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.user1_pkcs10.resp
    
    . . . Output omitted . . .
    
    Number of controls is 1
    Control #0: CMCStatusInfoV2
       OID: {1 3 6 1 5 5 7 7 25}
       BodyList: 1
       Status: SUCCESS
  6. 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:

  1. Push the CRL and CA certificate to the LDAP directory:

    1. Login to the SubCA’s Agent UI in the browser.
    2. Select Update Revocation List and click Update.
    3. Click Update Directory Server and select:

      • Update the certificate revocation list to the directory
      • Update Certificate Manager certificate to the directory
    4. Click Update Directory.
    5. Wait for the OCSP’s ldapStore refresh to happen (observe the debug file in /var/lib/pki/rhcs10-RSA-OCSP-subca/ocsp/logs/debug).
  2. Check the certificate status by using the OCSPClient tool. For example, using the certificate serial number of user1 (in decimal):

    # OCSPClient -v -d /root/.dogtag/pki_rsa_bootstrap/certs_db -h rhcs10.example.com -p 32080 -c "CA Signing Cert - rhcs10-RSA-SubCA" --serial 245832201
    
    Initializing security database
    Creating request for serial number 245832201
    Submitting OCSP request
    URL: http://rhcs10.example.com:32080/ocsp/ee/ocsp
    Request Length: 71
    Request: MEUwQzBBMD8wPTAJBgUrDgMCGgUABBRA+gjEGo4W0lUiC/Ve/oO8CrXQLQQUK4Bf
    o2u6SW0p6q58dlNCXxOVw30CBA7kEiA=
    
    Response Length: 3546
    Response: <blob>
    CertID.serialNumber=245832201
    CertStatus=Good
  3. Revoke the certificate of user2:

    1. Create a CMCRequest configuration file. For example:

      # vi cmc-agent-signed-revoke.cfg
      ### numRequests: Total number of PKCS10 requests or CRMF requests.
      numRequests=1
      
      ### output: full path for the CMC request in binary format
      output=/root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.revoke.agentSigned.req
      
      ### tokenname: name of the token where the user signing cert can be found (default is internal)
      tokenname=internal
      
      ### nickname: nickname for the signing certificate which will be used to sign the CMC full request.
      nickname=PKI Bootstrap Administrator for RSA-SubCA
      
      ### dbdir: directory for cert8.db, key3.db and secmod.db
      dbdir=/root/.dogtag/pki_rsa_bootstrap/certs_db
      
      ### password: password for cert8.db which stores the user signing certificate and keys
      password=SECret.123
      
      ### format: request format, either pkcs10 or crmf
      format=pkcs10
      
      ### revocation parameters
      revRequest.enable=true
      revRequest.serial=245832201
      revRequest.reason=unspecified
      revRequest.comment=test user2 certificate revocation
    2. Generate the request using the CMCRequest command:

      # CMCRequest cmc-agent-signed-revoke.cfg
      
      cert/key prefix =
      path = /root/.dogtag/pki_rsa_bootstrap/certs_db
      CryptoManger initialized
      token internal logged in...
      got signerCert: PKI Bootstrap Administrator for RSA-SubCA
      addRevRequestAttr: no sharedSecret found; request will be signed;
      addRevRequestAttr: RevokeRequest control created.
      selfSign is false...
      signData: begins:
      getPrivateKey: got signing cert
      signData:  got signer privKey
      createSignedData: begins
      getSigningAlgFromPrivate: begins.
      getSigningAlgFromPrivate: found signingKeyType=RSA
      getSigningAlgFromPrivate: using SignatureAlgorithm: RSASignatureWithSHA256Digest
      createSignedData: digest created for pkidata
      createSignedData: digest algorithm =RSASignatureWithSHA256Digest
      createSignedData: building cert chain
      signData: signed request generated.
      getCMCBlob: begins
      getCMCBlob: generating signed data
      
      The CMC enrollment request in base-64 encoded format:
      
      . . . Output omitted . . .
      
      The CMC enrollment request in binary format is stored in
      /root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.revoke.agentSigned.req
    3. Create a HttpClient configuration file. For example:

      # vi HttpClient.revoke.agentSigned.cfg
      ### CA server host name.
      host=rhcs10.example.com
      
      ### port: port number
      port=31443
      
      ### secure: true for secure connection, false for nonsecure connection
      secure=true
      
      ### input: full path for the enrollment request, the content must be in binary format
      input=/root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.revoke.agentSigned.req
      
      ### output: full path for the response in binary format
      output=/root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.revoke.agentSigned.resp
      
      ### tokenname: name of the token where the SSL client authentication cert can be found (default is internal)
      ### This parameter will be ignored if secure=false
      tokenname=internal
      
      ### dbdir: directory for cert8.db, key3.db and secmod.db
      ### This parameter will be ignored if secure=false
      dbdir=/root/.dogtag/pki_rsa_bootstrap/certs_db
      
      ### clientmode: true for client authentication, false for no client authentication
      ### This parameter will be ignored if secure=false
      clientmode=true
      
      ### password: password for cert8.db
      ### This parameter will be ignored if secure=false and clientauth=false
      password=SECret.123
      
      ### nickname: nickname for client certificate
      ### This parameter will be ignored if clientmode=false
      nickname=PKI Bootstrap Administrator for RSA-SubCA
      
      ### servlet: servlet name
      servlet=/ca/ee/ca/profileSubmitCMCFull?profileId=caFullCMCUserCert
    4. Submit the request using the HttpClient command:

      # HttpClient HttpClient.revoke.agentSigned.cfg
      
      Total number of bytes read = 2793
      after SSLSocket created, thread token is NSS FIPS 140-2 User Private Key
      client cert is not null
      handshake happened
      writing to socket
      Total number of bytes read = 1638
      
      . . . Output omitted . . .
      
      The response in binary format is stored in
      /root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.revoke.agentSigned.resp
    5. Process the CMC Response:

      # CMCResponse -d /root/.dogtag/pki_rsa_bootstrap/certs_db -i /root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.revoke.agentSigned.resp
      
      . . . Output omitted . . .
      
      Number of controls is 1
      Control #0: CMCStatusInfoV2
        OID: {1 3 6 1 5 5 7 7 25}
        BodyList: 1
        Status: SUCCESS

Verification

  1. Verify in the CA signed audit log, for example /var/log/pki/rhcs10-RSA-SubCA/ca/signedAudit/ca_audit, that the user2 certificate indeed got revoked.
  2. Wait until the next CRL autoupdate (update interval in minutes configured by the ca.crl.MasterCRL.autoUpdateInterval of the SubCA’s CS.cfg file. By default, this is set to 240 minutes.)

    Note

    Alternatively, if you want to manually update the CRL immediately, login to the SubCA’s Agent UI in the browser, and:

    1. Select Update Revocation List and click Update.
    2. Click Update Directory Server and select:

      • Update the certificate revocation list to the directory
      • Update Certificate Manager certificate to the directory
    3. Click Update Directory.

    Once the ldapStore refresh completes, observe the debug file in /var/lib/pki/rhcs10-RSA-OCSP-subca/ocsp/logs/debug.

  3. Verify with the OCSPCLient tool that the certificate of user2 has been revoked, using its serial number in decimal (with -c pointing to the nickname of the signing CA):

    # OCSPClient -v -d /root/.dogtag/pki_rsa_bootstrap/certs_db -h rhcs10.example.com -p 32080 -c "CA Signing Cert - rhcs10-RSA-SubCA" --serial 245832201
    
    Initializing security database
    Creating request for serial number 245832201
    Submitting OCSP request
    URL: http://rhcs10.example.com:32080/ocsp/ee/ocsp
    Request Length: 71
    Request: MEUwQzBBMD8wPTAJBgUrDgMCGgUABBRA+gjEGo4W0lUiC/Ve/oO8CrXQLQQUK4Bf
    o2u6SW0p6q58dlNCXxOVw30CBA7kEiA=
    
    Response Length: 3563
    Response: <blob>
    CertID.serialNumber=245832201
    CertStatus=Revoked

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)

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.

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

  1. 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:

  1. Show the status of the installed SubCA:

    # pki-server status rhcs10-RSA-SubCA

    Note down the Secure Agent, Admin and pkiconsole URLs.

  2. Perform a sanity test to verify the new SubCA Admin certificate was added successfully:

    1. 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
    2. 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>
  3. Make sure the SubCA’s EE page is accessible on rhcs10.example.com.

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.

Note

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:

  1. Stop DS:

    # dsctl slapd-CC-RSA-SubCA-LDAP stop
  2. 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
    Important

    Edit 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

    The CSR file must start with the line "-----BEGIN CERTIFICATE REQUEST-----" and end with the line "-----END CERTIFICATE REQUEST-----".

  3. Start DS:

    # dsctl slapd-CC-RSA-SubCA-LDAP start
  4. 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

Issue the real DS certificate

On rhcs10.example.com, issue the actual SSL server certificate:

  1. Generate a CMC request:

    1. Create a CMCRequest configuration file. For example:

      # vim /root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.dirsrv-subca_pkcs10.cfg
      ### numRequests: Total number of PKCS10 requests or CRMF requests.
      numRequests=1
      
      ### input: full path for the PKCS10 request or CRMF request,
      ### The content must be in Base-64 encoded format.
      ### Multiple files are supported. They must be separated by a space.
      ### For input on a different host, specify where to find the CSR.
      input=/root/.dogtag/pki_rsa_bootstrap/certs_db/Server-Cert-subca.csr
      
      ### output: full path for the CMC request in binary format
      ### For output on a different host, specify the destination.
      output=/root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.dirsrv-subca_pkcs10.req
      
      ### tokenname: name of the token where the agent signing cert can be found (default is internal)
      tokenname=internal
      
      ### nickname: nickname for the agent certificate that will be used to sign the CMC full request.
      nickname=PKI Bootstrap Administrator for RSA-SubCA
      
      ### dbdir: directory for cert8.db, key3.db and secmod.db
      dbdir=/root/.dogtag/pki_rsa_bootstrap/certs_db
      
      ### password: password for cert8.db that stores the agent certificate
      password=SECret.123
      
      ### format: request format, either pkcs10 or crmf
      format=pkcs10
    2. Generate the request using the CMCRequest command:

      # CMCRequest /root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.dirsrv-subca_pkcs10.cfg
      
      cert/key prefix =
      path = /root/.dogtag/pki_rsa_bootstrap/certs_db
      CryptoManger initialized
      token internal logged in...
      got signerCert: PKI Bootstrap Administrator for RSA-SubCA
      createPKIData: begins
      k=0
      createPKIData:  format: pkcs10
      useSharedSecret is false...
      signData: begins:
      getPrivateKey: got signing cert
      signData:  got signer privKey
      createSignedData: begins
      getSigningAlgFromPrivate: begins.
      getSigningAlgFromPrivate: found signingKeyType=RSA
      getSigningAlgFromPrivate: using SignatureAlgorithm: RSASignatureWithSHA256Digest
      createSignedData: digest created for pkidata
      createSignedData: digest algorithm =RSASignatureWithSHA256Digest
      createSignedData: building cert chain
      signData: signed request generated.
      getCMCBlob: begins
      getCMCBlob: generating signed data
      
      The CMC enrollment request in base-64 encoded format:
      
      . . . Output omitted . . .
      
      The CMC enrollment request in binary format is stored in
      /root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.dirsrv-subca_pkcs10.req
  2. Submit the CMC request:

    1. Create a HttpClient configuration file. For example:

      # vim /root/.dogtag/pki_rsa_bootstrap/certs_db/HttpClient_dirsrv-subca.cfg
      ### host: host name for the http server
      host=rhcs10.example.com
      
      ### port: port number
      port=31443
      
      ### secure: true for secure connection, false for nonsecure connection
      secure=true
      
      ### input: full path for the enrollment request, the content must be in binary format
      input=/root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.dirsrv-subca_pkcs10.req
      
      ### output: full path for the response in binary format
      output=/root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.dirsrv-subca_pkcs10.resp
      
      ### tokenname: name of the token where the SSL client authentication cert can be found (default is internal)
      ### This parameter will be ignored if secure=false
      tokenname=internal
      
      ### dbdir: directory for cert8.db, key3.db and secmod.db
      ### This parameter will be ignored if secure=false
      dbdir=/root/.dogtag/pki_rsa_bootstrap/certs_db
      
      ### clientmode: true for client authentication, false for no client authentication
      ### This parameter will be ignored if secure=false
      clientmode=true
      
      ### password: password for cert8.db
      ### This parameter will be ignored if secure=false and clientauth=false
      password=SECret.123
      
      ### nickname: nickname for client certificate
      ### This parameter will be ignored if clientmode=false
      nickname=PKI Bootstrap Administrator for RSA-SubCA
      
      ### servlet: servlet name
      servlet=/ca/ee/ca/profileSubmitCMCFull?profileId=caCMCserverCertWithCRLDP
      Note

      For EC certificates, use the ECC profiles by setting:

      servlet=/ca/ee/ca/profileSubmitCMCFull?profileId=caCMCECserverCertWithCRLDP
    2. Submit the request using the HttpClient command:

      # HttpClient /root/.dogtag/pki_rsa_bootstrap/certs_db/HttpClient_dirsrv-subca.cfg
      
      Total number of bytes read = 3096
      after SSLSocket created, thread token is NSS FIPS 140-2 User Private Key
      client cert is not null
      handshake happened
      writing to socket
      
      ##Response Headers begin##
      HTTP/1.1 200
      Content-Type: application/pkcs7-mime
      Content-Length: 2492
      Date: Tue, 29 Sep 2020 15:20:21 GMT
      Connection: close
      ##end##
      
      . . . Output omitted . . .
      
      The response in binary format is stored in
      /root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.dirsrv-subca_pkcs10.resp
  3. Process the CMC Response:

    1. Process the response using CMCResponse to display all certificates in chain individually in PEM format:

      Important

      Running 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.

      # CMCResponse -d /root/.dogtag/pki_rsa_bootstrap/certs_db -i /root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.dirsrv-subca_pkcs10.resp -v
      
      Cert:0
      ...
      ===
      Cert:1
      ...
      ===
      Cert:2
      ...
      ===
      Certificates:
          Certificate:
              Data:
                  Version:  v3
                  Serial Number: 0xA383694
                  Signature Algorithm: SHA256withRSA - 1.2.840.113549.1.1.11
                  Issuer: CN=CA Signing Certificate,OU=rhcs10-RSA-SubCA,O=Example-rhcs10-RSA-SubCA
                  Validity:
                      Not Before: Tuesday, April 5, 2022 8:41:36 AM EDT America/New_York
                      Not  After: Monday, March 25, 2024 8:41:36 AM EDT America/New_York
                  Subject: CN=rhds11.example.com
      
      . . . Output omitted . . .
      
          Certificate:
              Data:
                  Version:  v3
                  Serial Number: 0x5C8FAD4
                  Signature Algorithm: SHA256withRSA - 1.2.840.113549.1.1.11
                  Issuer: CN=CA Signing Certificate,OU=rhcs10-RSA-RootCA,O=Example-rhcs10-RSA-RootCA
                  Validity:
                      Not Before: Tuesday, April 5, 2022 8:36:21 AM EDT America/New_York
                      Not  After: Saturday, April 5, 2042 8:36:21 AM EDT America/New_York
                  Subject: CN=CA Signing Certificate,OU=rhcs10-RSA-RootCA,O=Example-rhcs10-RSA-RootCA
      
      . . . Output omitted . . .
      
          Certificate:
              Data:
                  Version:  v3
                  Serial Number: 0x80296C3
                  Signature Algorithm: SHA256withRSA - 1.2.840.113549.1.1.11
                  Issuer: CN=CA Signing Certificate,OU=rhcs10-RSA-RootCA,O=Example-rhcs10-RSA-SubCA
                  Validity:
                      Not Before: Tuesday, April 5, 2022 8:39:43 AM EDT America/New_York
                      Not  After: Friday, April 5, 2041 8:39:43 AM EDT America/New_York
                  Subject: CN=CA Signing Certificate,OU=rhcs10-RSA-SubCA,O=Example-rhcs10-RSA-RootCA
      
      . . . Output omitted . . .
      
      Number of controls is 1
      Control #0: CMCStatusInfoV2
      OID: {1 3 6 1 5 5 7 7 25}
      BodyList: 1
      Status: SUCCESS
      CMC Full Response.
    2. 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

      Where Server-Cert-subca.pem is the new Server-Cert certificate of the Directory Server instance that serves as the internaldb of the SubCA.

      Note

      The 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
  4. 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/

Replace the temporary DS certificate

On rhds11.example.com, replace the temporary DS certificate with the actual DS certificate:

  1. Stop the SubCA’s LDAP instance:

    # dsctl slapd-CC-RSA-SubCA-LDAP stop
  2. 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/
  3. 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 "Self-Signed-CA"
  4. 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-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 "u,u,u" -n "Server-Cert" -i /etc/dirsrv/slapd-CC-RSA-SubCA-LDAP/Server-Cert-subca.pem
  5. List the certificates:

    # certutil -L -d /etc/dirsrv/slapd-CC-RSA-SubCA-LDAP/
    
    Certificate Nickname                         Trust Attributes
                                                 SSL,S/MIME,JAR/XPI
    CA Signing Cert - rhcs10-RSA-RootCA          CT,C,C
    CA Signing Cert - rhcs10-RSA-SubCA           CT,C,C
    Server-Cert                                  u,u,u
  6. Start DS:

    # dsctl slapd-CC-RSA-SubCA-LDAP start
  7. 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

    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

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:

  1. Stop the SubCA:

    # pki-server stop rhcs10-RSA-SubCA
  2. List the certificate:

    # certutil -L -d /var/lib/pki/rhcs10-RSA-SubCA/alias/
    
    Certificate Nickname                    Trust Attributes
                                            SSL,S/MIME,JAR/XPI
    DS temp CA certificate                  CT,C,C
    ...
  3. Remove the temporary certificate from the nssdb:

    # certutil -D -d /var/lib/pki/rhcs10-RSA-SubCA/alias/ -n "DS temp CA certificate"

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:

  1. To enable certificate revocation checks, in the respective /var/lib/pki/rhcs10-RSA-SubCA/conf/server.xml file:

    1. Set enableOCSP or enableRevocationCheck to true:

      enableOCSP=true
      or
      enableRevocationCheck=true
    2. Additionally, remove these two parameters and their assigned values:

      ocspResponderURL
      ocspResponderCertNickname
  2. Disable the legacy revocation check method by editing the CA’s CS.cfg file and setting the following to false:

    auths.revocationChecking.enabled=false
  3. Start the SubCA instance:

    # pki-server start rhcs10-RSA-SubCA

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”):

  1. Check the publishing of the file-based 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
  2. Display and verify the content of the CRL

    # BtoA /var/lib/pki/rhcs10-RSA-SubCA/crl/ServerCertCRL.crl /var/lib/pki/rhcs10-RSA-SubCA/crl/ServerCertCRL.bin
    # PrettyPrintCrl /var/lib/pki/rhcs10-RSA-SubCA/crl/ServerCertCRL.bin
        Certificate Revocation List:
            Data:
                Version:  v2
                Signature Algorithm: SHA256withRSA - 1.2.840.113549.1.1.11
                Issuer: CN=CA Signing Certificate,OU=rhcs10-RSA-SubCA,O=Example-rhcs10-RSA-RootCA
                This Update: Friday, June 21, 2024 5:53:39 PM EDT America/New_York
                Next Update: Friday, June 21, 2024 9:00:00 PM EDT America/New_York
                Revoked Certificates:
            Extensions:
                Identifier: CRL Number - 2.5.29.20
                    Critical: no
                    Number: 4
            Signature:
                Algorithm: SHA256withRSA - 1.2.840.113549.1.1.11
                Signature:
                    9E:8A:E1:38:C4:B8:EF:E0:34:2A:92:2D:96:F2:7C:DF:
                    71:F8:4E:8E:EF:AD:C1:CA:65:86:BD:27:45:1C:7E:DD:
                    32:E6:16:94:83:E9:83:3F:24:1F:A1:89:74:7E:70:B6:
                    04:20:36:7F:45:9C:A9:6C:7D:63:37:A3:9F:FD:F2:E1:
                    CE:64:FA:D8:75:82:09:42:AB:B6:83:73:40:1A:C7:98:
                    53:BC:65:81:3C:C3:71:D2:12:F9:A6:EA:00:80:B7:D8:
                    A9:56:37:CD:CF:B9:59:64:B1:7F:31:39:16:11:1C:DC:
                    93:64:87:F9:97:CC:EF:58:23:92:77:FC:2E:22:3A:57:
                    AA:D7:7B:D1:1E:2B:3F:AE:FF:17:1A:62:C4:0C:A0:1E:
                    0D:68:00:C4:68:4C:B5:27:4D:4B:DB:33:17:AC:8C:DF:
                    8D:FE:77:EE:B9:B1:17:55:8F:42:A2:5C:84:1B:6F:B8:
                    82:A6:F6:6E:E9:10:37:50:94:C4:33:D3:3C:18:22:7C:
                    D6:6E:5E:89:34:E1:55:F5:80:F6:8F:B9:49:AE:A0:86:
                    2E:B5:8A:B1:00:8C:B0:4C:81:37:A6:BA:D1:7D:77:81:
                    F3:68:6C:16:D6:0A:BA:E7:F6:65:4F:44:A1:5B:31:0F:
                    C2:F7:F9:FE:DC:55:BA:38:F2:AE:AA:34:9E:D0:7D:64:
                    E1:90:68:E2:68:DE:C9:D0:90:26:56:6B:3A:74:AF:E8:
                    CA:55:AE:E8:A1:DF:81:D1:E4:C8:46:DD:E3:12:6D:46:
                    BE:A5:F2:C4:12:4E:15:D5:0F:30:10:3D:77:62:A2:41:
                    F6:85:77:6F:EF:5C:78:0C:FE:F1:C5:4B:C5:C4:69:B5:
                    84:0A:7B:4B:E3:D7:39:9A:66:43:AB:E9:DD:25:8E:EA:
                    58:2F:AD:1D:D4:CD:1A:EE:50:73:B2:0C:F1:29:67:B3:
                    2D:49:E1:54:95:51:9A:36:82:C3:D2:3F:32:7E:73:20:
                    86:0F:28:6F:CC:89:9F:DF:4A:A9:64:CD:30:4A:80:EE
Important

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:

  1. Stop the CA service.

    # pki-server stop rhcs10-RSA-SubCA
  2. Set the enableRevocationCheck or enableOCSP parameter to false (if it is currently set to true) in CA’s server.xml.
  3. Set the ca.crl.ServerCertCRL.publishOnStart= parameter to true in CA’s CS.cfg.
  4. Start the CA service to regenerate the missing CRL file:

    # pki-server start rhcs10-RSA-SubCA
  5. After the CRL file has been recovered, stop the CA service once again.
  6. Revert the ca.crl.ServerCertCRL.publishOnStart= parameter to false in CA’s CS.cfg.
  7. Set the enableRevocationCheck or enableOCSP parameter to true in CA’s server.xml.
  8. 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

  1. List the certificates in the CA:

    # pki -p 31443 ca-cert-find
  2. 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

7.8.3. Increase the SubCA pkiconsole timeout

On rhcs10.example.com:

  1. Stop the SubCA:

    # pki-server stop rhcs10-RSA-SubCA
  2. Edit /var/lib/pki/rhcs10-RSA-SubCA/conf/server.xml to increase the timeout period:

    <Connector name="Secure" port="31443" …
    connectionTimeout="3000000"
  3. Start the SubCA:

    # pki-server start rhcs10-RSA-SubCA

7.8.4. Setting up CMC Shared Secret Authentication

CMC Shared Secret Authentication allows to preauthorize users for certificate issuance without manual interaction from an agent. The configuration requires the following:

  • Information in the CA’s CS.cfg to specify which LDAP to use for such authentication
  • Enablement of the authentication method
  • Creation of the Issuance Protection Certificate which serves the mechanism to secure the shared secret
NOTE

The CMC SharedToken feature requires AES key wrapping/unwrapping on the CA side using OAEP. If the HSM that is used by the CA does not support the algorithm, and CMC Shared Token is a feature that you wish to employ, it is advised that you set up it up so that the key wrapping/unwrapping will take place in the internal crypto token (nssdb). In such a case, please note three differences in Section 7.8.4.2, “Add an issuance protection certificate”:

  • Generate a CSR for the Issuance Protection Certificate in the nssdb:

    # PKCS10Client -d /var/lib/pki/rhcs10-RSA-SubCA/alias -a rsa -l 2048 -n "CN=IssuanceProtectionSystemCert" -w -o /root/.dogtag/pki_rsa_bootstrap/certs_db/IssuanceProtectionSystemCert.csr
  • Import the Issuance Protection Certificate into the nssdb:

    # certutil -A -d /var/lib/pki/rhcs10-RSA-SubCA/alias -i /root/.dogtag/pki_rsa_bootstrap/IssuanceProtectionSystemCert.pem -n "IssuanceProtectionSystemCert" -t ""
  • When instructed to edit CS.cfg to set the nickname for the Issuance Protection Certificate: ca.cert.issuance_protection.nickname=IssuanceProtectionSystemCert
7.8.4.1. Setup the CMC Shared Token

This section describes the configuration for CMC Shared Token authentication, specific to LDAP and profile enablement.

Procedure

On rhcs10.example.com:

  1. Stop the SubCA:

    # pki-server stop rhcs10-RSA-SubCA
  2. Optional step: To add the shrTok attribute to LDAP, use the ldapmodify command and enter the required information at each interactive > prompt. For example:

    # LDAPTLS_CACERT=/opt/pki_rsa/ca-chain.pem ldapmodify -x -D "cn=Directory Manager" -H ldaps://rhds11.example.com:7636 -w SECret.123 << EOF
    
    > dn: cn=schema
    > changetype: modify
    > add: attributetypes
    > attributetypes: ( 2.16.840.1.117370.3.1.123 NAME 'shrTok' DESC 'User Defined ObjectClass for SharedToken' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40 SINGLE-VALUE X-ORIGIN 'custom for sharedToken')
    > EOF
    
    modifying entry "cn=schema"
  3. Add the SharedToken authentication plugin by editing /var/lib/pki/rhcs10-RSA-SubCA/ca/conf/CS.cfg to set the following properties:

    auths.instance.SharedToken.ldap.basedn=dc=example,dc=com
    auths.instance.SharedToken.ldap.ldapauth.authtype=BasicAuth
    auths.instance.SharedToken.ldap.ldapauth.bindDN=cn=Directory Manager
    auths.instance.SharedToken.ldap.ldapauth.bindPWPrompt=Rule SharedToken
    auths.instance.SharedToken.ldap.ldapconn.host=rhds11.example.com
    auths.instance.SharedToken.ldap.ldapconn.port=7636
    auths.instance.SharedToken.ldap.ldapconn.secureConn=true
    auths.instance.SharedToken.pluginName=SharedToken
    auths.instance.SharedToken.shrTokAttr=shrTok
  4. Configure the SubCA to use the HSM for CMC key wrapping:

    1. Edit /var/lib/pki/rhcs10-RSA-SubCA/ca/conf/CS.cfg and set: cmc.token=NHSM-CONN-XC
    2. Also add the following entry: keyWrap.useOAEP=true
  5. Enable the CMC shared token enrollment profile for self-signed enrollment by configuring as follows:

    1. Make sure the enrollment profile caFullCMCSharedTokenCert.cfg is enabled (enable=true). For example:

      # cat /var/lib/pki/rhcs10-RSA-SubCA/ca/profiles/ca/caFullCMCSharedTokenCert.cfg | grep enable=
      
      enable=true
    2. In case this shows enable=false, change to enable=true by editing caFullCMCSharedTokenCert.cfg.
  6. Start the SubCA to apply the changes:

    # pki-server start rhcs10-RSA-SubCA
7.8.4.2. Add an issuance protection certificate

CMC Shared Token Authentication requires additional setup, namely generating an Issuance Protection Certificate to import into the CA.

Note

The Issuance Protection Certificate must be an RSA certificate.

Generate a certificate request for the Issuance Protection certificate

  1. Login on rhcs10.example.com as root.
  2. Use the PKCS10Client tool to generate a PKCS10 certificate request:

    # echo "<YourHSMpassword>" > /root/.dogtag/pki_rsa_bootstrap/certs_db/hsm_pass.txt
    # PKCS10Client -d /var/lib/pki/rhcs10-RSA-SubCA/alias -h NHSM-CONN-XC -P /root/.dogtag/pki_rsa_bootstrap/certs_db/hsm_pass.txt -a rsa -l 2048 -n "CN=IssuanceProtectionSystemCert" -w -o /root/.dogtag/pki_rsa_bootstrap/certs_db/IssuanceProtectionSystemCert.csr
    
    CryptoUtil: generateRSAKeyPair: calling kg.setKeyPairUsages
    PKCS10Client: Certificate request written into /root/.dogtag/pki_rsa_bootstrap/certs_db/IssuanceProtectionSystemCert.csr
    PKCS10Client: PKCS#10 request key id written into /root/.dogtag/pki_rsa_bootstrap/certs_db/IssuanceProtectionSystemCert.csr.keyId
  3. Send the resulting certificate request, /root/.dogtag/pki_rsa_bootstrap/certs_db/IssuanceProtectionSystemCert.csr, to a pki agent (e.g. jsmith).

    Note

    At the beginning of this section, in Section 7.8.1, “Issue a non-bootstrap agent user certificate”, in case you decided to import the SubCA Agent’s certificate into /root/.dogtag/pki_rsa_bootstrap/certs_db/ for convenience, instead of jsmith’s nssdb, you can skip this step and perform the below steps as the root user.

Issue the Issuance Protection Certificate

  1. Verify that rsa_SubCA_AgentV has the correct certificate. The following two commands should result in the same certificate:

    # certutil -L -d /home/jsmith/certs_db -n "rsa_SubCA_AgentV" -a
    # 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-show rsa_SubCA_AgentV <Cert ID> --encoded
    NOTE

    You can obtain the Cert ID with the following command:

    # 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-find rsa_SubCA_AgentV
  2. Login on rhcs10.example.com as jsmith
  3. Place the certificate request file received, IssuanceProtectionSystemCert.csr, in the agent’s own directory, e.g. /home/jsmith/certs_db.
  4. Generate a CMC request:

    1. Create a CMCRequest configuration file. For example:

      # vi /home/jsmith/certs_db/cmc_IssuanceProtectionSystemCert_pkcs10.cfg
      ### numRequests: Total number of PKCS10 requests or CRMF requests.
      numRequests=1
      
      ### input: full path for the PKCS10 request or CRMF request,
      ### The content must be in Base-64 encoded format.
      ### Multiple files are supported. They must be separated by a space.
      input=/home/jsmith/certs_db/IssuanceProtectionSystemCert.csr
      
      ### output: full path for the CMC request in binary format
      output=/home/jsmith/certs_db/IssuanceProtectionSystemCert.req
      
      ### tokenname: name of the token where the agent signing cert can be found (default is internal)
      tokenname=internal
      
      ### nickname: nickname for the agent certificate that will be used to sign the CMC full request.
      nickname=rsa_SubCA_AgentV
      
      ### dbdir: directory for cert8.db, key3.db and secmod.db
      dbdir=/home/jsmith/certs_db
      
      ### password: password for cert8.db that stores the agent certificate
      password=SECret.123
      
      ### format: request format, either pkcs10 or crmf
      format=pkcs10
    2. Generate the request using the CMCRequest command:

      # CMCRequest /home/jsmith/certs_db/cmc_IssuanceProtectionSystemCert_pkcs10.cfg
      
      cert/key prefix =
      path = /root/.dogtag/pki_rsa_bootstrap/certs_db
      CryptoManger initialized
      token internal logged in...
      got signerCert: CA agentV
      createPKIData: begins
      k=0
      createPKIData:  format: pkcs10
      PKCS10: PKCS10: begins
      PKCS10: PKCS10: ends
      selfSign is false...
      signData: begins:
      getPrivateKey: got signing cert
      signData:  got signer privKey
      createSignedData: begins
      getSigningAlgFromPrivate: begins.
      getSigningAlgFromPrivate: found signingKeyType=EC
      getSigningAlgFromPrivate: using SignatureAlgorithm: ECSignatureWithSHA512Digest
      createSignedData: digest created for pkidata
      createSignedData: digest algorithm =ECSignatureWithSHA512Digest
      createSignedData: building cert chain
      signData: signed request generated.
      getCMCBlob: begins
      getCMCBlob: generating signed data
      
      The CMC enrollment request in base-64 encoded format:
      
      . . . Output omitted . . .
      
      The CMC enrollment request in binary format is stored in
      /home/jsmith/certs_db/IssuanceProtectionSystemCert.req
  5. Submit the CMC request:

    1. Create a HttpClient configuration file. For example:

      # vi /home/jsmith/certs_db/HttpClient_IssuanceProtectionSystemCert.cfg
      ### host: host name for the http server
      host=rhcs10.example.com
      
      ### port: port number
      port=31443
      
      ### secure: true for secure connection, false for nonsecure connection
      secure=true
      
      ### input: full path for the enrollment request, the content must be in binary format
      input=/home/jsmith/certs_db/IssuanceProtectionSystemCert.req
      
      ### output: full path for the response in binary format
      output=/home/jsmith/certs_db/IssuanceProtectionSystemCert.resp
      
      ### tokenname: name of the token where the SSL client authentication cert can be found (default is internal)
      ### This parameter will be ignored if secure=false
      tokenname=internal
      
      ### dbdir: directory for cert8.db, key3.db and secmod.db
      ### This parameter will be ignored if secure=false
      dbdir=/home/jsmith/certs_db
      
      ### clientmode: true for client authentication, false for no client authentication
      ### This parameter will be ignored if secure=false
      clientmode=true
      
      ### password: password for cert8.db
      ### This parameter will be ignored if secure=false and clientauth=false
      password=SECret.123
      
      ### nickname: nickname for client certificate
      ### This parameter will be ignored if clientmode=false
      nickname=rsa_SubCA_AgentV
      
      ### servlet: servlet name
      servlet=/ca/ee/ca/profileSubmitCMCFull?profileId=caCMCcaIssuanceProtectionCert
    2. Submit the request using the HttpClient command:

      # HttpClient /home/jsmith/certs_db/HttpClient_IssuanceProtectionSystemCert.cfg
      
      Total number of bytes read = 2210
      after SSLSocket created, thread token is NSS FIPS 140-2 User Private Key
      client cert is not null
      handshake happened
      writing to socket
      Total number of bytes read = 1790
      
      . . . Output omitted . . .
      
      The response in binary format is stored in
      /home/jsmith/certs_db/IssuanceProtectionSystemCert.resp
  6. Get the CMC Response :

    # CMCResponse -d /home/jsmith/certs_db -i /home/jsmith/certs_db/IssuanceProtectionSystemCert.resp -o /home/jsmith/certs_db/IssuanceProtectionSystemCert.crt
    
    Certificates:
        Certificate:
        Data:
        Version:  v3
        Serial Number: 0x37C05EC
        Signature Algorithm: SHA512withRSA - 1.2.840.10045.4.3.2
    
    . . . Output omitted . . .
    
    Number of controls is 1
    Control #0: CMCStatusInfoV2
       OID: {1 3 6 1 5 5 7 7 25}
       BodyList: 1
       Status: SUCCESS
    PKCS#7 now stored in file: /home/jsmith/certs_db/IssuanceProtectionSystemCert.crt

    Note down the serial number. It should match the same serial number shown when running the following command:

    # pki -d /root/.dogtag/pki_rsa_bootstrap/certs_db -p 31443 -n "PKI Bootstrap Administrator for RSA-SubCA" ca-cert-find --name "IssuanceProtectionSystemCert"
  7. Import the Issuance Protection Certificate into the agent nssdb for handling passphrase wrapping in the case of CMC SharedSecret enrollment:

    # pki -d /home/jsmith/certs_db -c SECret.123 -n "IssuanceProtectionSystemCert" client-cert-import --cert /home/jsmith/certs_db/IssuanceProtectionSystemCert.crt --trust ",,"

Import the Issuance Protection Certificate into the CA

  1. Login on rhcs10.example.com as the root user that requested the certificate.
  2. Import the Issuance Protection Certificate:

    # pki -p 31443 ca-cert-export <issuance protection cert ID> --output-file /root/.dogtag/pki_rsa_bootstrap/IssuanceProtectionSystemCert.pem
    # certutil -A -d /var/lib/pki/rhcs10-RSA-SubCA/alias -h NHSM-CONN-XC -P NHSM-CONN-XC -i /root/.dogtag/pki_rsa_bootstrap/IssuanceProtectionSystemCert.pem -n "IssuanceProtectionSystemCert" -t "" -f /root/.dogtag/pki_rsa_bootstrap/certs_db/hsm_pass.txt
    
    certutil: could not change trust on certificate: SEC_ERROR_TOKEN_NOT_LOGGED_IN: The operation failed because the PKCS#11 token is not logged in.
    Note

    Ignore this error message (BZ#1393668).

    #  certutil -L -d /var/lib/pki/rhcs10-RSA-SubCA/alias -h NHSM-CONN-XC f /root/.dogtag/pki_rsa_bootstrap/certs_db/hsm_pass.txt
    
    Certificate Nickname                            Trust Attributes
                                                    SSL,S/MIME,JAR/XPI
    
    Enter Password or Pin for NHSM-CONN-XC":
    NHSM-CONN-XC:IssuanceProtectionSystemCert       u,u,u
    ...
  3. Configure the SubCA to use the newly created IssuanceProtectionSystemCert:

    1. Stop the SubCA:

      # pki-server stop rhcs10-RSA-SubCA
    2. Edit /var/lib/pki/rhcs10-RSA-SubCA/ca/conf/CS.cfg to set
      ca.cert.issuance_protection.nickname=NHSM-CONN-XC:IssuanceProtectionSystemCert
    3. Start the SubCA:

      # pki-server start rhcs10-RSA-SubCA
7.8.4.3. Test the CMC Shared Token

The following test procedure consists in issuing a user certificate using CMC Shared Token authentication with issuance protection.

Set up a Shared Secret for a user

As a Directory Manager, create a CMC Shared Token for an LDAP user.

  1. Create a regular OS user, e.g. FooUser123:

    # /usr/sbin/useradd -d /home/FooUser123 -s /bin/bash -c "FooUser123" -m FooUser123
  2. Add a user in LDAP. For example, for the FooUser123 user, create the /root/.dogtag/pki_rsa_bootstrap/certs_db/ldap_cc_rsa_user.ldif file to use with the ldapadd command:

    dn: uid=FooUser123,dc=example,dc=com
    objectClass: extensibleobject
    objectclass: inetorgperson
    objectclass: organizationalPerson
    objectClass: person
    objectClass: top
    sn: FooUser123
    uid: FooUser123
    cn: CA FooUser123
    mail: FooUser123@example.com
    givenName: FooUser123
    userPassword: secret
    shrTok:
    # LDAPTLS_CACERT=/opt/pki_rsa/ca-chain.pem ldapadd -x -D "cn=Directory Manager" -H ldaps://rhds11.example.com:7636 -w SECret.123 -f /root/.dogtag/pki_rsa_bootstrap/certs_db/ldap_cc_rsa_user.ldif
    
    adding new entry "uid=FooUser123,dc=example,dc=com"
  3. Generate the shrTok entry for the user. In the following CMCSharedToken command:

    • The -s parameter specifies the shared secret (e.g. secretShrTokFooUser123), which is to be shared with the regular user that is going to perform the self-signed CMC enrollment.
    • The -n parameter specifies the nickname of the issuance protection certificate.

      # CMCSharedToken -d /home/jsmith/certs_db -p SECret.123 -s secretShrTokFooUser123 -o /root/.dogtag/pki_rsa_bootstrap/cmcSharedTok_FooUser123.b64 -n "IssuanceProtectionSystemCert" --oaep
      
      Encrypted Secret Data:
      MIIBJgSCAQBRCvkCYlEm/6ntzKyQ+FUTbj6KrIfCPW8h9mehkmIDgAtp5vvEzkVNaOz2FZiESE6nXJlQbjODVGuN7XN5F+qORSWFVW1ifnumCw+czeO7OHIenEQ3C7XTwnX77RWoxZECv2tfn818TGR3+YLSJXl8LbSX5qDXv8ydpHAi+GJdtpllnbndA5d8XEKmwg0zRPGsMjJ9t40DA1WEqjVTxxShk4QgxgZxcOYutfj1dtEtMrwcyo9+FRO9MMg4iAWigvAVsMfZphBKCQNAoth+Cv7BZiI45Xtlt6RXQ+x6zgabBwrqn2LIvQ2FBwMhDr+IdDrZdZGAlpci9Q8TUN1Km4A+BCAyc0BksAUX9qX8ylyrrfxaijk3AZyfdnCi6nTXLE+N3A==
      
      Storing Base64 secret data into /root/.dogtag/pki_rsa_bootstrap/cmcSharedTok_FooUser123.b64
  4. Add the above CMCSharedToken encrypted passphrase secret data to the shrTok attribute of the LDAP user. For example, create the /root/.dogtag/pki_rsa_bootstrap/certs_db/ldap_cc_rsa_user_shrtok.ldif file as follows to use with the ldapmodify command:

    dn: uid=FooUser123,dc=example,dc=com
    changetype: modify
    replace: shrTok
    shrTok: MIIBJgSCAQBRCvkCYlEm/6ntzKyQ+FUTbj6KrIfCPW8h9mehkmIDgAtp5vvEzkVNaOz2FZiESE6nXJlQbjODVGuN7XN5F+qORSWFVW1ifnumCw+czeO7OHIenEQ3C7XTwnX7RWoxZECv2tfn818TGR3+YLSJXl8LbSX5qDXv8ydpHAi+GJdtpllnbndA5d8XEKmwg0zRGsMjJ9t40DA1WEqjVTxxShk4QgxgZxcOYutfj1dtEtMrwcyo9+FRO9MMg4iAWigvAVsMfZphBKCQNAoth+Cv7BZiI45Xtlt6RXQ+x6zgabBwrqn2LIvQ2FBwMhDr+IdDrZdZGAlpci9Q8UN1Km4A+BCAyc0BksAUX9qX8ylyrrfxaijk3AZyfdnCi6nTXLE+N3A==
    # LDAPTLS_CACERT=/opt/pki_rsa/ca-chain.pem ldapmodify -x -D "cn=Directory Manager" -H ldaps://rhds11.example.com:7636 -w SECret.123 -f /root/.dogtag/pki_rsa_bootstrap/certs_db/ldap_cc_rsa_user_shrtok.ldif
    Note

    Make sure the shrTok value is on the same single line in the .ldif file, with a single space between "shrTok:" and the value itself.

Test procedure

As the test user FooUser123,

  1. Create a client nssdb if it does not already exist:

    $ pki -d /home/FooUser123/certs_db -c SECret.123 client-init
  2. Import the CA trust chain into the nssdb:

    $ pki -d /home/FooUser123/certs_db -c SECret.123 client-cert-import "CA Signing Cert - rhcs10-RSA-RootCA" --ca-cert /opt/pki_rsa/rootCA.pem
    $ pki -d /home/FooUser123/certs_db -c SECret.123 client-cert-import "CA Signing Cert - rhcs10-RSA-SubCA" --ca-cert /opt/pki_rsa/subCA.pem
  3. List the contents of the nssdb:

    # certutil -d /home/FooUser123/certs_db/ -L
    Certificate Nickname                    Trust Attributes
                                            SSL,S/MIME,JAR/XPI
    
    CA Signing Cert - rhcs10-RSA-RootCA     CT,C,C
    CA Signing Cert - rhcs10-RSA-SubCA      CT,C,C
  4. Create a PKCS#10 request. The resulting request and private key id are to be used in the CMCRequest file in the next step:

    $ PKCS10Client -d /home/FooUser123/certs_db -p SECret.123 -y true -n "cn=FooUser123, uid=FooUser123, ou=self-signed" -o /home/FooUser123/certs_db/pkcs10.self.req
  5. Display the private key ID to have it available for the next step:

    # cat /home/FooUser123/certs_db/pkcs10.self.req.keyId; echo
  6. Generate a CMC request:

    1. Create a CMCRequest configuration file, using the PKCS#10 request and private key id you obtained from the previous step. For example:

      $ vi /home/FooUser123/certs_db/cmc-p10-self.cfg
      ### numRequests: Total number of PKCS10 requests or CRMF requests.
      numRequests=1
      
      ### input: full path for the PKCS10 request or CRMF request,
      ### The content must be in Base-64 encoded format.
      ### Multiple files are supported. They must be separated by a space.
      input=/home/FooUser123/certs_db/pkcs10.self.req
      
      ### output: full path for the CMC request in binary format
      output=/home/FooUser123/certs_db/cmc.pkcs10.self.req
      
      ### tokenname: name of the token where agent signing cert can be found (default is internal)
      tokenname=internal
      request.useSharedSecret=true
      
      ### nickname: nickname for the agent certificate which will be used to sign the CMC full request.
      #nickname=
      
      ### dbdir: directory for cert8.db, key3.db and secmod.db
      dbdir=/home/FooUser123/certs_db
      
      ### password: password for cert8.db which stores the agent certificate
      password=SECret.123
      
      ### format: request format, either pkcs10 or crmf
      format=pkcs10
      
      ### identityProofV2.enable: if true, then the request will contain this control. Otherwise, false.
      ### Note that if both identityProof and identityProofV2 are enabled,
      ### identityProofV2 takes precedence; Only one of them can be active at a time
      ### Supported hashAlg are:
      ### SHA-256, SHA-384, and SHA-512
      ### Supported macAlg are:
      ### SHA-256-HMAC, SHA-384-HMAC, and SHA-512-HMAC
      identityProofV2.enable=true
      identityProofV2.hashAlg=SHA-512
      identityProofV2.macAlg=SHA-256-HMAC
      
      ### identityProofV2.sharedSecret: Shared Secret
      witness.sharedSecret=secretShrTokFooUser123
      
      popLinkWitnessV2.enable=true
      popLinkWitnessV2.keyGenAlg=SHA-256
      popLinkWitnessV2.macAlg=SHA-256-HMAC
      
      request.privKeyId=<output from PKCS10Client|CRMFPopClient xxx.priv>
      
      ### identification works with identityProofV2
      identification.enable=true
      identification=FooUser123
    2. Generate the request using the CMCRequest command:

      $ CMCRequest /home/FooUser123/certs_db/cmc-p10-self.cfg
      
      cert/key prefix =
      path = /home/FooUser123/certs_db
      CryptoManger initialized
      token internal logged in...
      got request privKeyId: 2e560e1974669b79b0b71eb096cfe90a2b3db370
      got private key
      
      . . . Output omitted . . .
      
      identification control: identification =FooUser123
      Successfully create identification control. bpid = 1
      
      CMCRequest: addIdentityProofV2Attr: hashAlg=SHA-512; macAlg=SHA-256-HMAC
      Identity Proof V2 control:
       Value: 44 -108 -21 24 76 -10 59 -56 28 -110 -114 -100 -70 40 48 80 24 69 -104 -13 -124 79 75 -42 -92 -29 -89 -27 -37 -107 -91 -82
      Successfully create identityProofV2 control. bpid = 2
      
      selfSign is true...
      signData for selfSign: begins:
      createSignedData: begins
      getSigningAlgFromPrivate: begins.
      getSigningAlgFromPrivate: found signingKeyType=RSA
      getSigningAlgFromPrivate: using SignatureAlgorithm: RSASignatureWithSHA256Digest
      createSignedData: digest created for pkidata
      createSignedData: digest algorithm =RSASignatureWithSHA256Digest
      getCMCBlob: begins
      getCMCBlob: generating signed data
      
      The CMC enrollment request in base-64 encoded format:
      
      . . . Output omitted . . .
      
      The CMC enrollment request in binary format is stored in /home/FooUser123/certs_db/cmc.pkcs10.self.req
  7. Submit the CMC request:

    1. Create a HttpClient configuration file. For example:

      $ vim /home/FooUser123/certs_db/HttpClient-cmc-p10.self.cfg
      ### host: host name for the http server
      host=rhcs10.example.com
      
      ### port: port number
      port=31443
      
      ### secure: true for secure connection, false for nonsecure connection
      secure=true
      
      ### input: full path for the enrollment request, the content must be in binary format
      input=/home/FooUser123/certs_db/cmc.pkcs10.self.req
      
      ### output: full path for the response in binary format
      output=/home/FooUser123/certs_db/cmc.p10.self.resp
      
      ### tokenname: name of the token where the SSL client authentication cert can be found (default is internal)
      ### This parameter will be ignored if secure=false
      tokenname=internal
      
      ### dbdir: directory for cert8.db, key3.db and secmod.db
      ### This parameter will be ignored if secure=false
      dbdir=/home/FooUser123/certs_db
      
      ### clientmode: true for client authentication, false for no client authentication
      ### This parameter will be ignored if secure=false
      clientmode=false
      
      ### password: password for cert8.db
      ### This parameter will be ignored if secure=false and clientauth=false
      password=SECret.123
      
      ### nickname: nickname for client certificate
      ### This parameter will be ignored if clientmode=false
      nickname=
      
      ### servlet: servlet name
      servlet=/ca/ee/ca/profileSubmitCMCFull?profileId=caFullCMCSharedTokenCert
      Note

      In case you require TLS mutual authentication for connections to CS, see Section 7.13.12, “Requiring TLS mutual authentication for connections to CS”.

    2. Submit the request using the HttpClient command:

      # HttpClient /home/FooUser123/certs_db/HttpClient-cmc-p10.self.cfg
      
      Total number of bytes read = 2966
      after SSLSocket created, thread token is NSS FIPS 140-2 User Private Key
      handshake happened
      writing to socket
      handshake happened
      Total number of bytes read = 1714
      
      . . . Output omitted . . .
      
      The response in binary format is stored in /home/FooUser123/certs_db/cmc.p10.self.resp
  8. Process the CMCResponse call:

    $ CMCResponse -d /home/FooUser123/certs_db -i /home/FooUser123/certs_db/cmc.p10.self.resp
    
    Certificates:
       Certificate:
          Data:
              Version:  v3
              Serial Number: 0x3D58D34
              Signature Algorithm: SHA256withRSA - 1.2.840.113549.1.1.11
              Issuer: CN=CA Signing Certificate,OU=rhcs10-RSA-RootCA,O=Example-rhcs10-RSA-RootCA
              Validity:
                  Not Before: Sunday, February 11, 2018 6:38:08 PM EST America/New_York
                  Not  After: Friday, August 10, 2018 6:38:08 PM EDT America/New_York
              Subject: CN=FooUser123,UID=FooUser123
    
    . . . Output omitted . . .
    
    Number of controls is 1
    Control #0: CMCStatusInfoV2
     OID: {1 3 6 1 5 5 7 7 25}
     BodyList: 1
     Status: SUCCESS

7.8.5. Check for random serial numbers

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

7.8.6. Create other SubCA role users

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”.

  1. Configure the SubCA with sslclientauth and import the role user certificate as described in Section 7.13.6, “Configure pkiconsole login with client authentication”.
  2. 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

    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

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

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.

Note

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

7.9.1. Replace the temporary DS certificate (KRA)

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.

Note

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:

  1. Stop DS:

    # dsctl slapd-CC-RSA-KRA-LDAP stop
  2. 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
    Important

    Edit 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

    The CSR file must start with the line "-----BEGIN CERTIFICATE REQUEST-----" and end with the line "-----END CERTIFICATE REQUEST-----".

  3. 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

Issue the real DS certificate

On rhcs10.example.com, issue the actual SSL server certificate:

  1. Generate a CMC request:

    1. Create a CMCRequest configuration file. For example:

      # vim /root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.dirsrv-kra_pkcs10.cfg
      ### numRequests: Total number of PKCS10 requests or CRMF requests.
      numRequests=1
      
      ### input: full path for the PKCS10 request or CRMF request,
      ### The content must be in Base-64 encoded format.
      ### Multiple files are supported. They must be separated by a space.
      ### For input on a different host, specify where to find the CSR.
      input=/root/.dogtag/pki_rsa_bootstrap/certs_db/Server-Cert-kra.csr
      
      ### output: full path for the CMC request in binary format
      ### For output on a different host, specify the destination.
      output=/root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.dirsrv-kra_pkcs10.req
      
      ### tokenname: name of the token where the agent signing cert can be found (default is internal)
      tokenname=internal
      
      ### nickname: nickname for the agent certificate that will be used to sign the CMC full request.
      nickname=PKI Bootstrap Administrator for RSA-SubCA
      
      ### dbdir: directory for cert8.db, key3.db and secmod.db
      dbdir=/root/.dogtag/pki_rsa_bootstrap/certs_db
      
      ### password: password for cert8.db that stores the agent certificate
      password=SECret.123
      
      ### format: request format, either pkcs10 or crmf
      format=pkcs10
    2. Generate the request using the CMCRequest command:

      # CMCRequest /root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.dirsrv-kra_pkcs10.cfg
      
      cert/key prefix =
      path = /root/.dogtag/pki_rsa_bootstrap/certs_db
      CryptoManger initialized
      token internal logged in...
      got signerCert: PKI Bootstrap Administrator for RSA-SubCA
      createPKIData: begins
      k=0
      createPKIData:  format: pkcs10
      useSharedSecret is false...
      signData: begins:
      getPrivateKey: got signing cert
      signData:  got signer privKey
      createSignedData: begins
      getSigningAlgFromPrivate: begins.
      getSigningAlgFromPrivate: found signingKeyType=RSA
      getSigningAlgFromPrivate: using SignatureAlgorithm: RSASignatureWithSHA256Digest
      createSignedData: digest created for pkidata
      createSignedData: digest algorithm =RSASignatureWithSHA256Digest
      createSignedData: building cert chain
      signData: signed request generated.
      getCMCBlob: begins
      getCMCBlob: generating signed data
      
      The CMC enrollment request in base-64 encoded format:
      
      . . . Output omitted . . .
      
      The CMC enrollment request in binary format is stored in
      /root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.dirsrv-kra_pkcs10.req
  2. Submit the CMC request:

    1. Create a HttpClient configuration file. For example:

      # vim /root/.dogtag/pki_rsa_bootstrap/certs_db/HttpClient_dirsrv-kra.cfg
      ### host: host name for the http server
      host=rhcs10.example.com
      
      ### port: port number
      port=31443
      
      ### secure: true for secure connection, false for nonsecure connection
      secure=true
      
      ### input: full path for the enrollment request, the content must be in binary format
      input=/root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.dirsrv-kra_pkcs10.req
      
      ### output: full path for the response in binary format
      output=/root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.dirsrv-kra_pkcs10.resp
      
      ### tokenname: name of the token where the SSL client authentication cert can be found (default is internal)
      ### This parameter will be ignored if secure=false
      tokenname=internal
      
      ### dbdir: directory for cert8.db, key3.db and secmod.db
      ### This parameter will be ignored if secure=false
      dbdir=/root/.dogtag/pki_rsa_bootstrap/certs_db
      
      ### clientmode: true for client authentication, false for no client authentication
      ### This parameter will be ignored if secure=false
      clientmode=true
      
      ### password: password for cert8.db
      ### This parameter will be ignored if secure=false and clientauth=false
      password=SECret.123
      
      ### nickname: nickname for client certificate
      ### This parameter will be ignored if clientmode=false
      nickname=PKI Bootstrap Administrator for RSA-SubCA
      
      ### servlet: servlet name
      servlet=/ca/ee/ca/profileSubmitCMCFull?profileId=caCMCserverCert
    2. Submit the request using the HttpClient command:

      # HttpClient /root/.dogtag/pki_rsa_bootstrap/certs_db/HttpClient_dirsrv-kra.cfg
      
      Total number of bytes read = 3096
      after SSLSocket created, thread token is NSS FIPS 140-2 User Private Key
      client cert is not null
      handshake happened
      writing to socket
      
      ##Response Headers begin##
      HTTP/1.1 200
      Content-Type: application/pkcs7-mime
      Content-Length: 2492
      Date: Tue, 29 Sep 2020 15:20:21 GMT
      Connection: close
      ##end##
      
      . . . Output omitted . . .
      
      The response in binary format is stored in
      /root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.dirsrv-kra_pkcs10.resp
  3. Process the CMC Response:

    1. Process the response using CMCResponse to display all certificates in chain individually in PEM format:

      Important

      Running 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.

      # CMCResponse -d /root/.dogtag/pki_rsa_bootstrap/certs_db -i /root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.dirsrv-kra_pkcs10.resp -v
      
      Cert:0
      ...
      ===
      Cert:1
      ...
      ===
      Cert:2
      ...
      ===
      Certificates:
      
        Certificate:
            Data:
                Version:  v3
                Serial Number: 0x34F6548
                Signature Algorithm: SHA256withRSA - 1.2.840.113549.1.1.11
                Issuer: CN=CA Signing Certificate,OU=rhcs10-RSA-SubCA,O=Example-rhcs10-RSA-RootCA
                Validity:
                    Not Before: Monday, September 25, 2023 8:28:24 PM EDT America/New_York
                    Not  After: Sunday, September 14, 2025 8:28:24 PM EDT America/New_York
                Subject: CN=rhds11.example.com
      
      . . . Output omitted . . .
      
          Certificate:
              Data:
                  Version:  v3
                  Serial Number: 0x66AA3D5
                  Signature Algorithm: SHA256withRSA - 1.2.840.113549.1.1.11
                  Issuer: CN=CA Signing Certificate,OU=rhcs10-RSA-RootCA,O=Example-rhcs10-RSA-RootCA
                  Validity:
                      Not Before: Friday, September 15, 2023 3:22:33 PM EDT America/New_York
                      Not  After: Tuesday, September 15, 2043 3:22:33 PM EDT America/New_York
                  Subject: CN=CA Signing Certificate,OU=rhcs10-RSA-RootCA,O=Example-rhcs10-RSA-RootCA
      
      
      . . . Output omitted . . .
      
          Certificate:
              Data:
                  Version:  v3
                  Serial Number: 0xABA9C22
                  Signature Algorithm: SHA256withRSA - 1.2.840.113549.1.1.11
                  Issuer: CN=CA Signing Certificate,OU=rhcs10-RSA-RootCA,O=Example-rhcs10-RSA-RootCA
                  Validity:
                      Not Before: Tuesday, September 19, 2023 3:55:59 PM EDT America/New_York
                      Not  After: Friday, September 19, 2042 3:55:59 PM EDT America/New_York
                  Subject: CN=CA Signing Certificate,OU=rhcs10-RSA-SubCA,O=Example-rhcs10-RSA-RootCA
      
      
      . . . Output omitted . . .
      
      Number of controls is 1
      Control #0: CMCStatusInfoV2
      OID: {1 3 6 1 5 5 7 7 25}
      BodyList: 1
      Status: SUCCESS
      CMC Full Response.
    2. 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

      Where Server-Cert-kra.pem is the new Server-Cert certificate of the Directory Server instance that serves as the internaldb of the KRA.

      Note

      The 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
  4. 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/

Replace the temporary DS certificate

On rhds11.example.com, replace the temporary DS certificate with the actual DS certificate:

  1. 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/
  2. 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 "Self-Signed-CA"
  3. 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-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 "u,u,u" -n "Server-Cert" -i /etc/dirsrv/slapd-CC-RSA-KRA-LDAP/Server-Cert-kra.pem
  4. List the certificates:

    # certutil -L -d /etc/dirsrv/slapd-CC-RSA-KRA-LDAP/
    
    Certificate Nickname                           Trust Attributes
                                                   SSL,S/MIME,JAR/XPI
    CA Signing Cert - rhcs10-RSA-RootCA            CT,C,C
    CA Signing Cert - rhcs10-RSA-SubCA             CT,C,C
    Server-Cert                                    u,u,u
  5. Start DS:

    # dsctl slapd-CC-RSA-KRA-LDAP start
  6. 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

    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

7.9.2. Install the KRA instance

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[.

Important

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

Procedure

  1. Create a KRA installation file at a chosen location (e.g. /root/pki_rsa):

    # cd /root/pki_rsa
    # vi kra_inst.cfg
    Note

    Unless 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…​

    [DEFAULT]
    pki_instance_name=rhcs10-RSA-KRA
    pki_https_port=28443
    pki_http_port=28080
    
    ### Crypto Token
    pki_hsm_enable=True
    pki_hsm_libfile=/opt/nfast/toolkits/pkcs11/libcknfast.so
    pki_hsm_modulename=nfast
    pki_token_name=NHSM-CONN-XC
    pki_token_password=<YourHSMpassword>
    
    pki_audit_signing_token=NHSM-CONN-XC
    pki_audit_signing_key_algorithm=SHA256withRSA
    pki_audit_signing_key_size=2048
    pki_audit_signing_key_type=rsa
    pki_audit_signing_signing_algorithm=SHA256withRSA
    
    pki_subsystem_token=NHSM-CONN-XC
    pki_subsystem_key_algorithm=SHA256withRSA
    pki_subsystem_signing_algorithm=SHA256withRSA
    pki_subsystem_key_size=2048
    pki_subsystem_key_type=rsa
    
    pki_sslserver_token=NHSM-CONN-XC
    pki_sslserver_key_algorithm=SHA256withRSA
    pki_sslserver_signing_algorithm=SHA256withRSA
    pki_sslserver_key_size=2048
    pki_sslserver_key_type=rsa
    
    ### CA cert chain concatenated in PEM format
    pki_cert_chain_path=/opt/pki_rsa/ca-chain.pem
    
    ### Bootstrap Admin
    pki_admin_password=SECret.123
    pki_admin_key_type=rsa
    pki_admin_key_size=2048
    pki_admin_key_algorithm=SHA256withRSA
    
    ### Bootstrap Admin client dir
    pki_client_admin_cert_p12=/opt/pki_rsa/rhcs10-RSA-KRA/kra_admin_cert.p12
    pki_client_database_dir=/opt/pki_rsa/rhcs10-RSA-KRA/certs_db
    pki_client_database_password=SECret.123
    pki_client_database_purge=False
    pki_client_dir=/opt/pki_rsa/rhcs10-RSA-KRA
    pki_client_pkcs12_password=SECret.123
    
    ### Internal LDAP
    pki_ds_bind_dn=cn=Directory Manager
    pki_ds_ldap_port=22389
    pki_ds_ldaps_port=22636
    pki_ds_password=SECret.123
    pki_ds_remove_data=True
    pki_ds_secure_connection=True
    pki_ds_secure_connection_ca_pem_file=/opt/pki_rsa/ca-chain.pem
    pki_ds_secure_connection_ca_nickname=CA Signing Cert - rhcs10-RSA-SubCA
    
    ### Security Domain
    pki_security_domain_hostname=rhcs10.example.com
    pki_security_domain_https_port=31443
    pki_security_domain_password=SECret.123
    pki_security_domain_user=caadmin
    
    
    [Tomcat]
    pki_ajp_port=28009
    pki_tomcat_server_port=28005
    
    [KRA]
    pki_import_admin_cert=False
    
    pki_storage_token=NHSM-CONN-XC
    pki_storage_key_algorithm=SHA256withRSA
    pki_storage_key_size=2048
    pki_storage_key_type=rsa
    pki_storage_signing_algorithm=SHA256withRSA
    
    pki_transport_token=NHSM-CONN-XC
    pki_transport_key_algorithm=SHA256withRSA
    pki_transport_key_size=2048
    pki_transport_key_type=rsa
    pki_transport_signing_algorithm=SHA256withRSA
    
    pki_admin_nickname=PKI Bootstrap Administrator for RSA-KRA
    pki_admin_name=kraadmin
    pki_admin_uid=kraadmin
    pki_admin_email=kraadmin@example.com
    
    pki_ds_hostname=rhds11.example.com
    pki_ds_base_dn=dc=RSA-KRA
    pki_ds_database=CC-RSA-KRA-LDAP
    pki_share_db=False
  2. Run the pkispawn tool to install the KRA subsystem:

    # pkispawn -s KRA -f kra_inst.cfg --debug

    This will create the KRA instance in /var/lib/pki/rhcs10-RSA-KRA.

Note

For ease of reference, if you wanted to install the KRA using the two-step method:

  1. 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
  2. Customize the configuration files between the two installation steps
  3. Run the pkispawn tool to configure the KRA:

    # pkispawn -s KRA -f kra_inst.cfg --skip-installation --debug

Verification

  1. Show the status of the installed KRA instance:

    # pki-server status rhcs10-RSA-KRA

    Note down the Secure Agent, Admin and pkiconsole URLs.

  2. Verify that the KRA agent web page is accessible.
  3. 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
  4. 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
Note

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

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.

Note

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

  1. Stop the KRA:

    # pki-server stop rhcs10-RSA-KRA
  2. 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

  1. Start the KRA:

    # pki-server start rhcs10-RSA-KRA
  2. Restart the SubCA:

    # pki-server restart rhcs10-RSA-SubCA

7.9.4. Create KRA role users

7.9.5. Test key archival

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.

Important

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.

  1. Create a client nssdb if it does not already exist:

    $ pki -d /home/FooUser123/certs_db -c SECret.123 client-init
  2. Create a CRMF request using the KRA transport certificate:

    1. 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:

      # pki -p 31443 ca-cert-find --name "DRM Transport Certificate"
      ---------------
      1 entries found
      ---------------
       Serial Number: 0x555251b
       Subject DN: CN=DRM Transport Certificate,OU=rhcs10-RSA-KRA,O=Example-rhcs10-RSA-KRA
       Status: VALID
      ...
      ----------------------------
      Number of entries returned 1
      ----------------------------
    2. 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
    3. Create the CRMF request using the transport certificate:

      # CRMFPopClient -d /home/FooUser123/certs_db -p SECret.123 -n "cn=FooUser123, uid=FooUser123" -q POP_SUCCESS -b /home/FooUser123/certs_db/kra_transport.txt -w "AES KeyWrap/Wrapped" -y -o /home/FooUser123/certs_db/crmf.req -oaep
      
      CryptoUtil: generateRSAKeyPair: calling kg.setKeyPairUsages
      Keypair private key id: 56906e65ef43a2e756908726758e9061d8d7ee9c
      CRMFPopClient: use_shared_secret true. Generating SubjectKeyIdentifier extension.
      Storing CRMF request into /home/FooUser123/certs_db/crmf.req
      Storing CRMF request key id into /home/FooUser123/certs_db/crmf.req.keyId
  3. Generate a CMC request:

    1. 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
      ### numRequests: Total number of PKCS10 requests or CRMF requests.
      numRequests=1
      
      ### input: full path for the PKCS10 request or CRMF request,
      ### The content must be in Base-64 encoded format.
      ### Multiple files are supported. They must be separated by a space.
      input=/home/FooUser123/certs_db/crmf.req
      
      ### output: full path for the CMC request in binary format
      output=/home/FooUser123/certs_db/cmc.self.req
      
      ### tokenname: name of the token where agent signing cert can be found (default is internal)
      tokenname=internal
      request.useSharedSecret=true
      
      ### nickname: nickname for the agent certificate which will be used to sign the CMC full request.
      #nickname=
      
      ### dbdir: directory for cert8.db, key3.db and secmod.db
      dbdir=/home/FooUser123/certs_db
      
      ### password: password for cert8.db which stores the agent certificate
      password=SECret.123
      
      ### format: request format, either pkcs10 or crmf
      format=crmf
      
      ### identityProofV2.enable: if true, then the request will contain this control. Otherwise, false.
      ### Note that if both identityProof and identityProofV2 are enabled,
      ### identityProofV2 takes precedence; Only one of them can be active at a time
      ### Supported hashAlg are:
      ### SHA-256, SHA-384, and SHA-512
      ### Supported macAlg are:
      ### SHA-256-HMAC, SHA-384-HMAC, and SHA-512-HMAC
      identityProofV2.enable=true
      identityProofV2.hashAlg=SHA-512
      identityProofV2.macAlg=SHA-256-HMAC
      
      ### identityProofV2.sharedSecret: Shared Secret
      witness.sharedSecret=secretShrTokFooUser123
      
      popLinkWitnessV2.enable=true
      popLinkWitnessV2.keyGenAlg=SHA-256
      popLinkWitnessV2.macAlg=SHA-256-HMAC
      
      request.privKeyId=<output from PKCS10Client|CRMFPopClient xxx.priv>
      
      ### identification works with identityProofV2
      identification.enable=true
      identification=FooUser123
    2. Generate the request using the CMCRequest command:

      # CMCRequest /home/FooUser123/certs_db/cmc-crmf-self.cfg
      
      cert/key prefix =
      path = /home/FooUser123/certs_db
      CryptoManger initialized
      token internal logged in...
      got request privKeyId: 56906e65ef43a2e756908726758e9061d8d7ee9c
      got private key
      createPKIData: begins
      createPopLinkWitnessV2Attr: begins
      createPopLinkWitnessV2Attr: keyGenAlg=SHA-256; macAlg=SHA-256-HMAC
      createPopLinkWitnessV2Attr: Successfully created id_cmc_idPOPLinkRandom control. bpid = 1
      createPopLinkWitnessV2Attr: Successfully created PopLinkWitnessV2 control.
      createPopLinkWitnessV2Attr: returning...
      
      k=0
      createPKIData:  format: crmf
      CryptoUtil: getSKIExtensionFromCertTemplate: SKIoid == jssOID
      createPKIData:  SubjectKeyIdentifier extension found in use_shared_secret request
      createPKIData: popLinkWitnessV2 enabled. reconstructing crmf
      createNewPOP: begins
      createNewPOP: about to create POPOSigningKey
      createNewPOP: creating and returning newPopOfSigningKey
      createPKIData: new CRMF b64encode completes.
      -----BEGIN CERTIFICATE REQUEST-----
      MIIIsDCCCKwwggeQAgEBMIIBfYABAqUzMDExGjAYBgoJkiaJk/IsZAEBEwpGb29Vc2VyMTIzMRMw
      
      . . . Output omitted . . .
      
      -----END CERTIFICATE REQUEST-----
      
      identification control: identification =FooUser123
      Successfully create identification control. bpid = 1
      
      CMCRequest: addIdentityProofV2Attr: hashAlg=SHA-512; macAlg=SHA-256-HMAC
      Identity Proof V2 control:
         Value: -50 -36 103 -38 70 85 70 91 -71 96 -121 100 -127 50 -63 -57 123 -30 115 58 -55 -34 -22 104 90 -20 48 46 80 -85 64 68
      Successfully create identityProofV2 control. bpid = 2
      
      useSharedSecret is true...
      signData for useSharedSecret begins: begins:
      createSignedData: begins
      getSigningAlgFromPrivate: begins.
      getSigningAlgFromPrivate: found signingKeyType=RSA
      getSigningAlgFromPrivate: using SignatureAlgorithm: RSASignatureWithSHA256Digest
      createSignedData: digest created for pkidata
      createSignedData: digest algorithm =RSASignatureWithSHA256Digest
      getCMCBlob: begins
      getCMCBlob: generating signed data
      
      The CMC enrollment request in base-64 encoded format:
      MIILlAYJKoZIhvcNAQcCoIILhTCCC4ECAQMxDzANBglghkgBZQMEAgEFADCCCdgGCCsGAQUFBwwC
      
      . . . Output omitted . . .
      
      The CMC enrollment request in binary format is stored in /home/FooUser123/certs_db/cmc.self.req
  4. Submit the CMC request:

    1. Create a HttpClient configuration file. For example:

      # vim /home/FooUser123/certs_db/HttpClient-cmc-crmf.self.cfg
      ### host: host name for the http server
      host=rhcs10.example.com
      
      ### port: port number
      port=31443
      
      ### secure: true for secure connection, false for nonsecure connection
      secure=true
      
      ### input: full path for the enrollment request, the content must be in binary format
      input=/home/FooUser123/certs_db/cmc.self.req
      
      ### output: full path for the response in binary format
      output=/home/FooUser123/certs_db/cmc.self.Resp
      
      ### tokenname: name of the token where the SSL client authentication cert can be found (default is internal)
      ### This parameter will be ignored if secure=false
      tokenname=internal
      
      ### dbdir: directory for cert8.db, key3.db and secmod.db
      ### This parameter will be ignored if secure=false
      dbdir=/home/FooUser123/certs_db
      
      ### clientmode: true for client authentication, false for no client authentication
      ### This parameter will be ignored if secure=false
      clientmode=false
      
      ### password: password for cert8.db
      ### This parameter will be ignored if secure=false and clientauth=false
      password=SECret.123
      
      ### nickname: nickname for client certificate
      ### This parameter will be ignored if clientmode=false
      nickname=
      
      ### servlet: servlet name
      servlet=/ca/ee/ca/profileSubmitCMCFull?profileId=caFullCMCSharedTokenCert
    2. Submit the request using the HttpClient command:

      # HttpClient /home/FooUser123/certs_db/HttpClient-cmc-crmf.self.cfg
      
      Total number of bytes read = 2968
      after SSLSocket created, thread token is NSS FIPS 140-2 User Private Key
      handshake happened
      writing to socket
      
      #Response Headers begin
      HTTP/1.1 200
      Content-Type: application/pkcs7-mime
      Content-Length: 4348
      Date: Thu, 08 Sep 2022 20:51:44 GMT
      Connection: close
      #end
      
      Total number of bytes read = 4348
      MIIQ+AYJKoZIhvcNAQcCoIIQ6TCCEOUCAQMxDzANBglghkgBZQMEAgEFADAxBggrBgEFBQcMA6Al
      
      . . . Output omitted . . .
      
      The response in binary format is stored in /home/FooUser123/certs_db/cmc.self.Resp
  5. Process the response using the CMCResponse command:

    # CMCResponse -d /home/FooUser123/certs_db -i /home/FooUser123/certs_db/cmc.self.Resp
    
    Certificates:
        Certificate:
            Data:
                Version:  v3
                Serial Number: 0x98D0212
                Signature Algorithm: SHA256withRSA - 1.2.840.113549.1.1.11
                Issuer: CN=CA Signing Certificate,OU=rhcs10-RSA-SubCA,O=Example-rhcs10-RSA-RootCA
                Validity:
                    Not Before: Thursday, September 8, 2022 4:51:44 PM EDT America/New_York
                    Not  After: Tuesday, March 7, 2023 4:51:44 PM EST America/New_York
                Subject: UID=FooUser123,DC=example,DC=com
                Subject Public Key Info:
                    Algorithm: RSA - 1.2.840.113549.1.1.1
                    Public Key:
                        Exponent: 65537
                        Public Key Modulus: (2048 bits) :
                            BB:F3:C6:66:AC:9E:39:02:59:B8:E7:5A:6D:9E:29:8C:
    
    . . . Output omitted . . .
    
    Number of controls is 1
    Control #0: CMCStatusInfoV2
       OID: {1 3 6 1 5 5 7 7 25}
       BodyList: 1
       Status: SUCCESS
    CMC Full Response.

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

Test the key recovery process with the following steps:

  1. As a KRA agent, go to the KRA’s agent services page in the browser, and click the Recover Keys link.
  2. Tick the Certificate checkbox in order to search for the key by certificate:

    1. 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
    2. 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.
  3. Click Recover. Make sure that the Async Recovery checkbox is selected to allow the browser session to be closed while recovery is ongoing.

    Note

    Asynchronous recovery is the default way to perform a key recovery. Synchronous key recovery is no longer supported.

  4. 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.
  5. Once all the agents have authorized the recovery, select List Requests on the left side of the agent page, then select Request typeshow key recovery requests and Request statusshow all requests.
  6. 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.
  7. A dialog pops up. Click on Save File to download the PKCS #12 file for the owner of the private key certificate.
  8. 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
  9. You can now use the certificate again.

7.9.7. Increase the KRA pkiconsole timeout

  1. Stop the KRA:

    # pki-server stop rhcs10-RSA-KRA
  2. Increase the timeout period by editing the /var/lib/pki/rhcs10-RSA-KRA/conf/server.xml file:

    <Connector name="Secure" port="28443" …
    connectionTimeout="3000000"
  3. Then restart the KRA:

    # pki-server start rhcs10-RSA-KRA
  1. Configure the KRA with authType=sslclientauth and import the role user certificate by following Section 7.13.6, “Configure pkiconsole login with client authentication”.
  2. 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

    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

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

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.

Note

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

7.10.1. Replace the temporary DS certificate (TKS)

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.

Note

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:

  1. Stop DS:

    # dsctl slapd-CC-RSA-TKS-LDAP stop
  2. 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
    Important

    Edit 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

    The CSR file must start with the line "-----BEGIN CERTIFICATE REQUEST-----" and end with the line "-----END CERTIFICATE REQUEST-----".

  3. 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

Issue the real DS certificate

On rhcs10.example.com, issue the actual SSL server certificate:

  1. Generate a CMC request:

    1. Create a CMCRequest configuration file. For example:

      # vim /root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.dirsrv-tks_pkcs10.cfg
      ### numRequests: Total number of PKCS10 requests or CRMF requests.
      numRequests=1
      
      ### input: full path for the PKCS10 request or CRMF request,
      ### The content must be in Base-64 encoded format.
      ### Multiple files are supported. They must be separated by a space.
      ### For input on a different host, specify where to find the CSR.
      input=/root/.dogtag/pki_rsa_bootstrap/certs_db/Server-Cert-tks.csr
      
      ### output: full path for the CMC request in binary format
      ### For output on a different host, specify the destination.
      output=/root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.dirsrv-tks_pkcs10.req
      
      ### tokenname: name of the token where the agent signing cert can be found (default is internal)
      tokenname=internal
      
      ### nickname: nickname for the agent certificate that will be used to sign the CMC full request.
      nickname=PKI Bootstrap Administrator for RSA-SubCA
      
      ### dbdir: directory for cert8.db, key3.db and secmod.db
      dbdir=/root/.dogtag/pki_rsa_bootstrap/certs_db
      
      ### password: password for cert8.db that stores the agent certificate
      password=SECret.123
      
      ### format: request format, either pkcs10 or crmf
      format=pkcs10
    2. Generate the request using the CMCRequest command:

      # CMCRequest /root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.dirsrv-tks_pkcs10.cfg
      
      cert/key prefix =
      path = /root/.dogtag/pki_rsa_bootstrap/certs_db
      CryptoManger initialized
      token internal logged in...
      got signerCert: PKI Bootstrap Administrator for RSA-SubCA
      createPKIData: begins
      k=0
      createPKIData:  format: pkcs10
      useSharedSecret is false...
      signData: begins:
      getPrivateKey: got signing cert
      signData:  got signer privKey
      createSignedData: begins
      getSigningAlgFromPrivate: begins.
      getSigningAlgFromPrivate: found signingKeyType=RSA
      getSigningAlgFromPrivate: using SignatureAlgorithm: RSASignatureWithSHA256Digest
      createSignedData: digest created for pkidata
      createSignedData: digest algorithm =RSASignatureWithSHA256Digest
      createSignedData: building cert chain
      signData: signed request generated.
      getCMCBlob: begins
      getCMCBlob: generating signed data
      
      The CMC enrollment request in base-64 encoded format:
      
      . . . Output omitted . . .
      
      The CMC enrollment request in binary format is stored in
      /root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.dirsrv-tks_pkcs10.req
  2. Submit the CMC request:

    1. Create a HttpClient configuration file. For example:

      # vim /root/.dogtag/pki_rsa_bootstrap/certs_db/HttpClient_dirsrv-tks.cfg
      ### host: host name for the http server
      host=rhcs10.example.com
      
      ### port: port number
      port=31443
      
      ### secure: true for secure connection, false for nonsecure connection
      secure=true
      
      ### input: full path for the enrollment request, the content must be in binary format
      input=/root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.dirsrv-tks_pkcs10.req
      
      ### output: full path for the response in binary format
      output=/root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.dirsrv-tks_pkcs10.resp
      
      ### tokenname: name of the token where the SSL client authentication cert can be found (default is internal)
      ### This parameter will be ignored if secure=false
      tokenname=internal
      
      ### dbdir: directory for cert8.db, key3.db and secmod.db
      ### This parameter will be ignored if secure=false
      dbdir=/root/.dogtag/pki_rsa_bootstrap/certs_db
      
      ### clientmode: true for client authentication, false for no client authentication
      ### This parameter will be ignored if secure=false
      clientmode=true
      
      ### password: password for cert8.db
      ### This parameter will be ignored if secure=false and clientauth=false
      password=SECret.123
      
      ### nickname: nickname for client certificate
      ### This parameter will be ignored if clientmode=false
      nickname=PKI Bootstrap Administrator for RSA-SubCA
      
      ### servlet: servlet name
      servlet=/ca/ee/ca/profileSubmitCMCFull?profileId=caCMCserverCert
    2. Submit the request using the HttpClient command:

      # HttpClient /root/.dogtag/pki_rsa_bootstrap/certs_db/HttpClient_dirsrv-tks.cfg
      
      Total number of bytes read = 3096
      after SSLSocket created, thread token is NSS FIPS 140-2 User Private Key
      client cert is not null
      handshake happened
      writing to socket
      
      ##Response Headers begin##
      HTTP/1.1 200
      Content-Type: application/pkcs7-mime
      Content-Length: 2492
      Date: Tue, 29 Sep 2020 15:20:21 GMT
      Connection: close
      ##end##
      
      . . . Output omitted . . .
      
      The response in binary format is stored in
      /root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.dirsrv-tks_pkcs10.resp
  3. Process the CMC Response:

    1. Process the response using CMCResponse to display all certificates in chain individually in PEM format:

      Important

      Running 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.

      # CMCResponse -d /root/.dogtag/pki_rsa_bootstrap/certs_db -i /root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.dirsrv-tks_pkcs10.resp -v
      
      Cert:0
      ...
      ===
      Cert:1
      ...
      ===
      Cert:2
      ...
      ===
      Certificates:
      
        Certificate:
            Data:
                Version:  v3
                Serial Number: 0xA383694
                Signature Algorithm: SHA256withRSA - 1.2.840.113549.1.1.11
                Issuer: CN=CA Signing Certificate,OU=rhcs10-RSA-TKS,O=Example-rhcs10-RSA-TKS
                Validity:
                    Not Before: Tuesday, April 5, 2022 8:41:36 AM EDT America/New_York
                    Not  After: Monday, March 25, 2024 8:41:36 AM EDT America/New_York
                Subject: CN=rhds11.example.com
      
      . . . Output omitted . . .
      
          Certificate:
              Data:
                  Version:  v3
                  Serial Number: 0x5C8FAD4
                  Signature Algorithm: SHA256withRSA - 1.2.840.113549.1.1.11
                  Issuer: CN=CA Signing Certificate,OU=rhcs10-RSA-RootCA,O=Example-rhcs10-RSA-RootCA
                  Validity:
                      Not Before: Tuesday, April 5, 2022 8:36:21 AM EDT America/New_York
                      Not  After: Saturday, April 5, 2042 8:36:21 AM EDT America/New_York
                  Subject: CN=CA Signing Certificate,OU=rhcs10-RSA-RootCA,O=Example-rhcs10-RSA-RootCA
      
      . . . Output omitted . . .
      
          Certificate:
              Data:
                  Version:  v3
                  Serial Number: 0x80296C3
                  Signature Algorithm: SHA256withRSA - 1.2.840.113549.1.1.11
                  Issuer: CN=CA Signing Certificate,OU=rhcs10-RSA-RootCA,O=Example-rhcs10-RSA-TKS
                  Validity:
                      Not Before: Tuesday, April 5, 2022 8:39:43 AM EDT America/New_York
                      Not  After: Friday, April 5, 2041 8:39:43 AM EDT America/New_York
                  Subject: CN=CA Signing Certificate,OU=rhcs10-RSA-TKS,O=Example-rhcs10-RSA-RootCA
      
      . . . Output omitted . . .
      
      Number of controls is 1
      Control #0: CMCStatusInfoV2
      OID: {1 3 6 1 5 5 7 7 25}
      BodyList: 1
      Status: SUCCESS
      CMC Full Response.
    2. 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

      Where Server-Cert-tks.pem is the new Server-Cert certificate of the Directory Server instance that serves as the internaldb of the TKS.

      Note

      The 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
  4. 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/

Replace the temporary DS certificate

On rhds11.example.com, replace the temporary DS certificate with the actual DS certificate:

  1. 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/
  2. 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 "Self-Signed-CA"
  3. 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-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 "u,u,u" -n "Server-Cert" -i /etc/dirsrv/slapd-CC-RSA-TKS-LDAP/Server-Cert-tks.pem
  4. List the certificates:

    # certutil -L -d /etc/dirsrv/slapd-CC-RSA-TKS-LDAP/
    
    Certificate Nickname                        Trust Attributes
                                                SSL,S/MIME,JAR/XPI
    CA Signing Cert - rhcs10-RSA-RootCA         CT,C,C
    CA Signing Cert - rhcs10-RSA-SubCA          CT,C,C
    Server-Cert                                 u,u,u
  5. Start DS:

    # dsctl slapd-CC-RSA-TKS-LDAP start
  6. 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

    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

7.10.2. Install the TKS instance

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[.

Important

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

Procedure

  1. Create a TKS installation file at a chosen location (e.g. /root/pki_rsa):

    # cd /root/pki_rsa
    # vi tks_inst.cfg
    Note

    Unless 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…​

    [DEFAULT]
    pki_instance_name=rhcs10-RSA-TKS
    pki_https_port=24443
    pki_http_port=24080
    
    ### Crypto Token
    pki_hsm_enable=True
    pki_hsm_libfile=/opt/nfast/toolkits/pkcs11/libcknfast.so
    pki_hsm_modulename=nfast
    pki_token_name=NHSM-CONN-XC
    pki_token_password=<YourHSMpassword>
    
    pki_audit_signing_token=NHSM-CONN-XC
    pki_audit_signing_key_algorithm=SHA256withRSA
    pki_audit_signing_key_size=2048
    pki_audit_signing_key_type=rsa
    pki_audit_signing_signing_algorithm=SHA256withRSA
    
    pki_subsystem_token=NHSM-CONN-XC
    pki_subsystem_key_algorithm=SHA256withRSA
    pki_subsystem_signing_algorithm=SHA256withRSA
    pki_subsystem_key_size=2048
    pki_subsystem_key_type=rsa
    
    pki_sslserver_token=NHSM-CONN-XC
    pki_sslserver_key_algorithm=SHA256withRSA
    pki_sslserver_signing_algorithm=SHA256withRSA
    pki_sslserver_key_size=2048
    pki_sslserver_key_type=rsa
    
    ### CA cert chain concatenated in PEM format
    pki_cert_chain_path=/opt/pki_rsa/ca-chain.pem
    
    ### Bootstrap Admin
    pki_admin_password=SECret.123
    pki_admin_key_type=rsa
    pki_admin_key_size=2048
    pki_admin_key_algorithm=SHA256withRSA
    
    ### Bootstrap Admin client dir
    pki_client_admin_cert_p12=/opt/pki_rsa/rhcs10-RSA-TKS/tks_admin_cert.p12
    pki_client_database_dir=/opt/pki_rsa/rhcs10-RSA-TKS/certs_db
    pki_client_database_password=SECret.123
    pki_client_database_purge=False
    pki_client_dir=/opt/pki_rsa/rhcs10-RSA-TKS
    pki_client_pkcs12_password=SECret.123
    
    ### Internal LDAP
    pki_ds_bind_dn=cn=Directory Manager
    pki_ds_ldap_port=16389
    pki_ds_ldaps_port=16636
    pki_ds_password=SECret.123
    pki_ds_remove_data=True
    pki_ds_secure_connection=True
    pki_ds_secure_connection_ca_pem_file=/opt/pki_rsa/ca-chain.pem
    pki_ds_secure_connection_ca_nickname=CA Signing Cert - rhcs10-RSA-SubCA
    
    ### Security Domain
    pki_security_domain_hostname=rhcs10.example.com
    pki_security_domain_https_port=31443
    pki_security_domain_password=SECret.123
    pki_security_domain_user=caadmin
    
    
    [Tomcat]
    pki_ajp_port=14009
    pki_tomcat_server_port=14005
    
    
    [TKS]
    pki_import_admin_cert=False
    
    pki_admin_nickname=PKI Bootstrap Administrator for RSA-TKS
    pki_admin_name=tksadmin
    pki_admin_uid=tksadmin
    pki_admin_email=tksadmin@example.com
    
    pki_ds_hostname=rhds11.example.com
    pki_ds_base_dn=dc=RSA-TKS
    pki_ds_database=CC-RSA-TKS-LDAP
    pki_share_db=False
  2. Run the pkispawn tool to install the TKS subsystem:

    # pkispawn -s TKS -f tks_inst.cfg --debug

    This will create the TKS instance in /var/lib/pki/rhcs10-RSA-TKS.

Note

For ease of reference, if you wanted to install the TKS using the two-step method:

  1. 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
  2. Customize the configuration files between the two installation steps
  3. Run the pkispawn tool to configure the KRA:

    # pkispawn -s TKS -f tks_inst.cfg --skip-installation --debug

Verification

  1. Show the status of the installed TKS instance:

    # pki-server status rhcs10-RSA-TKS

    Note down the Secure Agent, Admin and pkiconsole URLs.

7.10.3. Configure OAEP support for the TKS

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.

Note

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

  1. Stop the TKS:

    # pki-server stop rhcs10-RSA-TKS
  2. Edit the /var/lib/pki/rhcs10-RSA-TKS/tks/conf/CS.cfg configuration file and add the following line:

keyWrap.useOAEP=true

  1. Start the TKS:

    # pki-server start rhcs10-RSA-TKS

7.10.4. Create TKS Role users

7.10.5. Post-installation

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

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.

Note

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

7.11.1. Replace the temporary DS certificate (TPS)

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.

Note

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:

  1. Stop DS:

    # dsctl slapd-CC-RSA-TPS-LDAP stop
  2. 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
    Important

    Edit 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

    The CSR file must start with the line "-----BEGIN CERTIFICATE REQUEST-----" and end with the line "-----END CERTIFICATE REQUEST-----".

  3. 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

Issue the real DS certificate

On rhcs10.example.com, issue the actual SSL server certificate:

  1. Generate a CMC request:

    1. Create a CMCRequest configuration file. For example:

      # vim /root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.dirsrv-tps_pkcs10.cfg
      ### numRequests: Total number of PKCS10 requests or CRMF requests.
      numRequests=1
      
      ### input: full path for the PKCS10 request or CRMF request,
      ### The content must be in Base-64 encoded format.
      ### Multiple files are supported. They must be separated by a space.
      ### For input on a different host, specify where to find the CSR.
      input=/root/.dogtag/pki_rsa_bootstrap/certs_db/Server-Cert-tps.csr
      
      ### output: full path for the CMC request in binary format
      ### For output on a different host, specify the destination.
      output=/root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.dirsrv-tps_pkcs10.req
      
      ### tokenname: name of the token where the agent signing cert can be found (default is internal)
      tokenname=internal
      
      ### nickname: nickname for the agent certificate that will be used to sign the CMC full request.
      nickname=PKI Bootstrap Administrator for RSA-SubCA
      
      ### dbdir: directory for cert8.db, key3.db and secmod.db
      dbdir=/root/.dogtag/pki_rsa_bootstrap/certs_db
      
      ### password: password for cert8.db that stores the agent certificate
      password=SECret.123
      
      ### format: request format, either pkcs10 or crmf
      format=pkcs10
    2. Generate the request using the CMCRequest command:

      # CMCRequest /root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.dirsrv-tps_pkcs10.cfg
      
      cert/key prefix =
      path = /root/.dogtag/pki_rsa_bootstrap/certs_db
      CryptoManger initialized
      token internal logged in...
      got signerCert: PKI Bootstrap Administrator for RSA-SubCA
      createPKIData: begins
      k=0
      createPKIData:  format: pkcs10
      useSharedSecret is false...
      signData: begins:
      getPrivateKey: got signing cert
      signData:  got signer privKey
      createSignedData: begins
      getSigningAlgFromPrivate: begins.
      getSigningAlgFromPrivate: found signingKeyType=RSA
      getSigningAlgFromPrivate: using SignatureAlgorithm: RSASignatureWithSHA256Digest
      createSignedData: digest created for pkidata
      createSignedData: digest algorithm =RSASignatureWithSHA256Digest
      createSignedData: building cert chain
      signData: signed request generated.
      getCMCBlob: begins
      getCMCBlob: generating signed data
      
      The CMC enrollment request in base-64 encoded format:
      
      . . . Output omitted . . .
      
      The CMC enrollment request in binary format is stored in
      /root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.dirsrv-tps_pkcs10.req
  2. Submit the CMC request:

    1. Create a HttpClient configuration file. For example:

      # vim /root/.dogtag/pki_rsa_bootstrap/certs_db/HttpClient_dirsrv-tps.cfg
      ### host: host name for the http server
      host=rhcs10.example.com
      
      ### port: port number
      port=31443
      
      ### secure: true for secure connection, false for nonsecure connection
      secure=true
      
      ### input: full path for the enrollment request, the content must be in binary format
      input=/root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.dirsrv-tps_pkcs10.req
      
      ### output: full path for the response in binary format
      output=/root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.dirsrv-tps_pkcs10.resp
      
      ### tokenname: name of the token where the SSL client authentication cert can be found (default is internal)
      ### This parameter will be ignored if secure=false
      tokenname=internal
      
      ### dbdir: directory for cert8.db, key3.db and secmod.db
      ### This parameter will be ignored if secure=false
      dbdir=/root/.dogtag/pki_rsa_bootstrap/certs_db
      
      ### clientmode: true for client authentication, false for no client authentication
      ### This parameter will be ignored if secure=false
      clientmode=true
      
      ### password: password for cert8.db
      ### This parameter will be ignored if secure=false and clientauth=false
      password=SECret.123
      
      ### nickname: nickname for client certificate
      ### This parameter will be ignored if clientmode=false
      nickname=PKI Bootstrap Administrator for RSA-SubCA
      
      ### servlet: servlet name
      servlet=/ca/ee/ca/profileSubmitCMCFull?profileId=caCMCserverCert
    2. Submit the request using the HttpClient command:

      # HttpClient /root/.dogtag/pki_rsa_bootstrap/certs_db/HttpClient_dirsrv-tps.cfg
      
      Total number of bytes read = 3096
      after SSLSocket created, thread token is NSS FIPS 140-2 User Private Key
      client cert is not null
      handshake happened
      writing to socket
      
      ##Response Headers begin##
      HTTP/1.1 200
      Content-Type: application/pkcs7-mime
      Content-Length: 2492
      Date: Tue, 29 Sep 2020 15:20:21 GMT
      Connection: close
      ##end##
      
      . . . Output omitted . . .
      
      The response in binary format is stored in
      /root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.dirsrv-tps_pkcs10.resp
  3. Process the CMC Response:

    1. Process the response using CMCResponse to display all certificates in chain individually in PEM format:

      Important

      Running 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.

      # CMCResponse -d /root/.dogtag/pki_rsa_bootstrap/certs_db -i /root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.dirsrv-tps_pkcs10.resp -v
      
      Cert:0
      ...
      ===
      Cert:1
      ...
      ===
      Cert:2
      ...
      ===
      Certificates:
      
        Certificate:
            Data:
                Version:  v3
                Serial Number: 0xA383694
                Signature Algorithm: SHA256withRSA - 1.2.840.113549.1.1.11
                Issuer: CN=CA Signing Certificate,OU=rhcs10-RSA-TPS,O=Example-rhcs10-RSA-TPS
                Validity:
                    Not Before: Tuesday, April 5, 2022 8:41:36 AM EDT America/New_York
                    Not  After: Monday, March 25, 2024 8:41:36 AM EDT America/New_York
                Subject: CN=rhds11.example.com
      
      . . . Output omitted . . .
      
          Certificate:
              Data:
                  Version:  v3
                  Serial Number: 0x5C8FAD4
                  Signature Algorithm: SHA256withRSA - 1.2.840.113549.1.1.11
                  Issuer: CN=CA Signing Certificate,OU=rhcs10-RSA-RootCA,O=Example-rhcs10-RSA-RootCA
                  Validity:
                      Not Before: Tuesday, April 5, 2022 8:36:21 AM EDT America/New_York
                      Not  After: Saturday, April 5, 2042 8:36:21 AM EDT America/New_York
                  Subject: CN=CA Signing Certificate,OU=rhcs10-RSA-RootCA,O=Example-rhcs10-RSA-RootCA
      
      . . . Output omitted . . .
      
          Certificate:
              Data:
                  Version:  v3
                  Serial Number: 0x80296C3
                  Signature Algorithm: SHA256withRSA - 1.2.840.113549.1.1.11
                  Issuer: CN=CA Signing Certificate,OU=rhcs10-RSA-RootCA,O=Example-rhcs10-RSA-TPS
                  Validity:
                      Not Before: Tuesday, April 5, 2022 8:39:43 AM EDT America/New_York
                      Not  After: Friday, April 5, 2041 8:39:43 AM EDT America/New_York
                  Subject: CN=CA Signing Certificate,OU=rhcs10-RSA-TPS,O=Example-rhcs10-RSA-RootCA
      
      . . . Output omitted . . .
      
      Number of controls is 1
      Control #0: CMCStatusInfoV2
      OID: {1 3 6 1 5 5 7 7 25}
      BodyList: 1
      Status: SUCCESS
      CMC Full Response.
    2. 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

      Where Server-Cert-tps.pem is the new Server-Cert certificate of the Directory Server instance that serves as the internaldb of the TPS.

      Note

      The 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
  4. 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/

Replace the temporary DS certificate

On rhds11.example.com, replace the temporary DS certificate with the actual DS certificate:

  1. 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/
  2. 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 "Self-Signed-CA"
  3. 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-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 "u,u,u" -n "Server-Cert" -i /etc/dirsrv/slapd-CC-RSA-TPS-LDAP/Server-Cert-tps.pem
  4. List the certificates:

    # certutil -L -d /etc/dirsrv/slapd-CC-RSA-TPS-LDAP/
    
    Certificate Nickname                         Trust Attributes
                                                 SSL,S/MIME,JAR/XPI
    CA Signing Cert - rhcs10-RSA-RootCA          CT,C,C
    CA Signing Cert - rhcs10-RSA-SubCA           CT,C,C
    Server-Cert                                  u,u,u
  5. Start DS:

    # dsctl slapd-CC-RSA-TPS-LDAP start
  6. 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

    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

7.11.2. Configuring a TPS authentication database

TPS relies on an authentication database to authenticate smartcard tokens.
For more information, please see Section 2.5.2.4, “Token database”.

Prior to installing the TPS, we are installing a Directory Server instance that will host the TPS AuthDB.

Note

The TPS authentication database mentioned in this section is created with simplified steps for demonstration purposes only.

On rhds11.example.com as root:

  1. 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.

    1. 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
    2. Edit the .cfg file created in the previous step. Uncomment the below parameters and set them to customize the installation:

      [general]
      full_machine_name = rhds11.example.com
      
      [slapd]
      port = 9389
      secure_port = 9636
      instance_name = CC-RSA-TPS-AUTH-DB
      root_password = SECret.123
      self_sign_cert = True
      
      [backend-userroot]
      suffix = dc=example,dc=com
      create_suffix_entry = True
    3. Install the Directory Server instance:

      # dscreate from-file /root/pki_rsa/tps-auth-db-ldap.cfg
      
      Starting installation...
      
      Completed installation for CC-RSA-TPS-AUTH-DB
  2. Add an ACI (Access Control Instruction) rule to allow anonymous bind access. By default, this is disabled.

    1. 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";)
    2. 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

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.

Note

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:

  1. Stop DS:

    # dsctl slapd-CC-RSA-TPS-AUTH-DB stop
  2. 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
    Important

    Edit 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

    The CSR file must start with the line "-----BEGIN CERTIFICATE REQUEST-----" and end with the line "-----END CERTIFICATE REQUEST-----".

  3. 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

Issue the real DS certificate

On rhcs10.example.com, issue the actual SSL server certificate:

  1. Generate a CMC request:

    1. Create a CMCRequest configuration file. For example:

      # vim /root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.dirsrv-tps-auth_pkcs10.cfg
      ### numRequests: Total number of PKCS10 requests or CRMF requests.
      numRequests=1
      
      ### input: full path for the PKCS10 request or CRMF request,
      ### The content must be in Base-64 encoded format.
      ### Multiple files are supported. They must be separated by a space.
      ### For input on a different host, specify where to find the CSR.
      input=/root/.dogtag/pki_rsa_bootstrap/certs_db/Server-Cert-tps-auth.csr
      
      ### output: full path for the CMC request in binary format
      ### For output on a different host, specify the destination.
      output=/root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.dirsrv-tps-auth_pkcs10.req
      
      ### tokenname: name of the token where the agent signing cert can be found (default is internal)
      tokenname=internal
      
      ### nickname: nickname for the agent certificate that will be used to sign the CMC full request.
      nickname=PKI Bootstrap Administrator for RSA-SubCA
      
      ### dbdir: directory for cert8.db, key3.db and secmod.db
      dbdir=/root/.dogtag/pki_rsa_bootstrap/certs_db
      
      ### password: password for cert8.db that stores the agent certificate
      password=SECret.123
      
      ### format: request format, either pkcs10 or crmf
      format=pkcs10
    2. Generate the request using the CMCRequest command:

      # CMCRequest /root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.dirsrv-tps-auth_pkcs10.cfg
      
      cert/key prefix =
      path = /root/.dogtag/pki_rsa_bootstrap/certs_db
      CryptoManger initialized
      token internal logged in...
      got signerCert: PKI Bootstrap Administrator for RSA-SubCA
      createPKIData: begins
      k=0
      createPKIData:  format: pkcs10
      useSharedSecret is false...
      signData: begins:
      getPrivateKey: got signing cert
      signData:  got signer privKey
      createSignedData: begins
      getSigningAlgFromPrivate: begins.
      getSigningAlgFromPrivate: found signingKeyType=RSA
      getSigningAlgFromPrivate: using SignatureAlgorithm: RSASignatureWithSHA256Digest
      createSignedData: digest created for pkidata
      createSignedData: digest algorithm =RSASignatureWithSHA256Digest
      createSignedData: building cert chain
      signData: signed request generated.
      getCMCBlob: begins
      getCMCBlob: generating signed data
      
      The CMC enrollment request in base-64 encoded format:
      
      . . . Output omitted . . .
      
      The CMC enrollment request in binary format is stored in
      /root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.dirsrv-tps-auth_pkcs10.req
  2. Submit the CMC request:

    1. Create a HttpClient configuration file. For example:

      # vim /root/.dogtag/pki_rsa_bootstrap/certs_db/HttpClient_dirsrv-tps-auth.cfg
      ### host: host name for the http server
      host=rhcs10.example.com
      
      ### port: port number
      port=31443
      
      ### secure: true for secure connection, false for nonsecure connection
      secure=true
      
      ### input: full path for the enrollment request, the content must be in binary format
      input=/root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.dirsrv-tps-auth_pkcs10.req
      
      ### output: full path for the response in binary format
      output=/root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.dirsrv-tps-auth_pkcs10.resp
      
      ### tokenname: name of the token where the SSL client authentication cert can be found (default is internal)
      ### This parameter will be ignored if secure=false
      tokenname=internal
      
      ### dbdir: directory for cert8.db, key3.db and secmod.db
      ### This parameter will be ignored if secure=false
      dbdir=/root/.dogtag/pki_rsa_bootstrap/certs_db
      
      ### clientmode: true for client authentication, false for no client authentication
      ### This parameter will be ignored if secure=false
      clientmode=true
      
      ### password: password for cert8.db
      ### This parameter will be ignored if secure=false and clientauth=false
      password=SECret.123
      
      ### nickname: nickname for client certificate
      ### This parameter will be ignored if clientmode=false
      nickname=PKI Bootstrap Administrator for RSA-SubCA
      
      ### servlet: servlet name
      servlet=/ca/ee/ca/profileSubmitCMCFull?profileId=caCMCserverCert
    2. Submit the request using the HttpClient command:

      # HttpClient /root/.dogtag/pki_rsa_bootstrap/certs_db/HttpClient_dirsrv-tps-auth.cfg
      
      Total number of bytes read = 3096
      after SSLSocket created, thread token is NSS FIPS 140-2 User Private Key
      client cert is not null
      handshake happened
      writing to socket
      
      ##Response Headers begin##
      HTTP/1.1 200
      Content-Type: application/pkcs7-mime
      Content-Length: 2492
      Date: Tue, 29 Sep 2020 15:20:21 GMT
      Connection: close
      ##end##
      
      . . . Output omitted . . .
      
      The response in binary format is stored in
      /root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.dirsrv-tps-auth_pkcs10.resp
  3. Process the CMC Response:

    1. Process the response using CMCResponse to display all certificates in chain individually in PEM format:

      Important

      Running 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.

      # CMCResponse -d /root/.dogtag/pki_rsa_bootstrap/certs_db -i /root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.dirsrv-tps-auth_pkcs10.resp -v
      
      Cert:0
      ...
      ===
      Cert:1
      ...
      ===
      Cert:2
      ...
      ===
      Certificates:
      
        Certificate:
            Data:
                Version:  v3
                Serial Number: 0xA383694
                Signature Algorithm: SHA256withRSA - 1.2.840.113549.1.1.11
                Issuer: CN=CA Signing Certificate,OU=rhcs10-RSA-TPS,O=Example-rhcs10-RSA-TPS
                Validity:
                    Not Before: Tuesday, April 5, 2022 8:41:36 AM EDT America/New_York
                    Not  After: Monday, March 25, 2024 8:41:36 AM EDT America/New_York
                Subject: CN=rhds11.example.com
      
      . . . Output omitted . . .
      
          Certificate:
              Data:
                  Version:  v3
                  Serial Number: 0x5C8FAD4
                  Signature Algorithm: SHA256withRSA - 1.2.840.113549.1.1.11
                  Issuer: CN=CA Signing Certificate,OU=rhcs10-RSA-RootCA,O=Example-rhcs10-RSA-RootCA
                  Validity:
                      Not Before: Tuesday, April 5, 2022 8:36:21 AM EDT America/New_York
                      Not  After: Saturday, April 5, 2042 8:36:21 AM EDT America/New_York
                  Subject: CN=CA Signing Certificate,OU=rhcs10-RSA-RootCA,O=Example-rhcs10-RSA-RootCA
      
      . . . Output omitted . . .
      
          Certificate:
              Data:
                  Version:  v3
                  Serial Number: 0x80296C3
                  Signature Algorithm: SHA256withRSA - 1.2.840.113549.1.1.11
                  Issuer: CN=CA Signing Certificate,OU=rhcs10-RSA-RootCA,O=Example-rhcs10-RSA-TPS
                  Validity:
                      Not Before: Tuesday, April 5, 2022 8:39:43 AM EDT America/New_York
                      Not  After: Friday, April 5, 2041 8:39:43 AM EDT America/New_York
                  Subject: CN=CA Signing Certificate,OU=rhcs10-RSA-TPS,O=Example-rhcs10-RSA-RootCA
      
      . . . Output omitted . . .
      
      Number of controls is 1
      Control #0: CMCStatusInfoV2
      OID: {1 3 6 1 5 5 7 7 25}
      BodyList: 1
      Status: SUCCESS
      CMC Full Response.
    2. 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

      Where Server-Cert-tps-auth.pem is the new Server-Cert certificate of the Directory Server instance that serves as the authentication db of the TPS.

      Note

      The 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
  4. 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/

Replace the temporary DS certificate

On rhds11.example.com, replace the temporary DS certificate with the actual DS certificate:

  1. 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/
  2. 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 "Self-Signed-CA"
  3. 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-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 "u,u,u" -n "Server-Cert" -i /etc/dirsrv/slapd-CC-RSA-TPS-AUTH-DB/Server-Cert-tps-auth.pem
  4. List the certificates:

    # certutil -L -d /etc/dirsrv/slapd-CC-RSA-TPS-AUTH-DB/
    
    Certificate Nickname                        Trust Attributes
                                                SSL,S/MIME,JAR/XPI
    CA Signing Cert - rhcs10-RSA-RootCA         CT,C,C
    CA Signing Cert - rhcs10-RSA-SubCA          CT,C,C
    Server-Cert                                 u,u,u
  5. Start DS:

    # dsctl slapd-CC-RSA-TPS-AUTH-DB start
  6. 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

    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

7.11.3. Install the TPS instance

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[.

Important

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

Procedure

  1. Create a TPS installation file at a chosen location (e.g. /root/pki_rsa):

    # cd /root/pki_rsa
    # vi tps_inst.cfg
    Note

    Unless 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…​

    [DEFAULT]
    pki_instance_name=rhcs10-RSA-TPS
    pki_https_port=25443
    pki_http_port=25080
    
    ### Crypto Token
    pki_hsm_enable=True
    pki_hsm_libfile=/opt/nfast/toolkits/pkcs11/libcknfast.so
    pki_hsm_modulename=nfast
    pki_token_name=NHSM-CONN-XC
    pki_token_password=<YourHSMpassword>
    
    pki_audit_signing_token=NHSM-CONN-XC
    pki_audit_signing_key_algorithm=SHA256withRSA
    pki_audit_signing_key_size=2048
    pki_audit_signing_key_type=rsa
    pki_audit_signing_signing_algorithm=SHA256withRSA
    
    pki_subsystem_token=NHSM-CONN-XC
    pki_subsystem_key_algorithm=SHA256withRSA
    pki_subsystem_signing_algorithm=SHA256withRSA
    pki_subsystem_key_size=2048
    pki_subsystem_key_type=rsa
    
    pki_sslserver_token=NHSM-CONN-XC
    pki_sslserver_key_algorithm=SHA256withRSA
    pki_sslserver_signing_algorithm=SHA256withRSA
    pki_sslserver_key_size=2048
    pki_sslserver_key_type=rsa
    
    ### CA cert chain concatenated in PEM format
    pki_cert_chain_path=/opt/pki_rsa/ca-chain.pem
    
    ### Bootstrap Admin
    pki_admin_password=SECret.123
    pki_admin_key_type=rsa
    pki_admin_key_size=2048
    pki_admin_key_algorithm=SHA256withRSA
    
    ### Bootstrap Admin client dir
    pki_client_admin_cert_p12=/opt/pki_rsa/rhcs10-RSA-TPS/tps_admin_cert.p12
    pki_client_database_dir=/opt/pki_rsa/rhcs10-RSA-TPS/certs_db
    pki_client_database_password=SECret.123
    pki_client_database_purge=False
    pki_client_dir=/opt/pki_rsa/rhcs10-RSA-TPS
    pki_client_pkcs12_password=SECret.123
    
    ### Internal LDAP
    pki_ds_bind_dn=cn=Directory Manager
    pki_ds_ldap_port=17389
    pki_ds_ldaps_port=17636
    pki_ds_password=SECret.123
    pki_ds_remove_data=True
    pki_ds_secure_connection=True
    pki_ds_secure_connection_ca_pem_file=/opt/pki_rsa/ca-chain.pem
    pki_ds_secure_connection_ca_nickname=CA Signing Cert - rhcs10-RSA-SubCA
    
    ### Security Domain
    pki_security_domain_hostname=rhcs10.example.com
    pki_security_domain_https_port=31443
    pki_security_domain_password=SECret.123
    pki_security_domain_user=caadmin
    
    
    [Tomcat]
    pki_ajp_port=14019
    pki_tomcat_server_port=14015
    
    [TPS]
    pki_import_admin_cert=False
    
    pki_admin_nickname=PKI Bootstrap Administrator for RSA-TPS
    pki_admin_name=tpsadmin
    pki_admin_uid=tpsadmin
    pki_admin_email=tpsadmin@example.com
    
    pki_ds_hostname=rhds11.example.com
    pki_ds_base_dn=dc=RSA-TPS
    pki_ds_database=CC-RSA-TPS-LDAP
    pki_share_db=False
    
    ### basedn of the TPS token authentication database
    pki_authdb_basedn = dc=example,dc=com
    pki_authdb_hostname=rhds11.example.com
    pki_authdb_port=9636
    pki_authdb_secure_conn=True
    pki_ca_uri=https://rhcs10.example.com:31443
    pki_tks_uri=https://rhcs10.example.com:24443
    pki_kra_uri=https://rhcs10.example.com:28443
    pki_enable_server_side_keygen=True
    
    pki_import_shared_secret=True
  2. Run the pkispawn tool to install the TPS subsystem:

    # pkispawn -s TPS -f tps_inst.cfg --debug

    This will create the TPS instance in /var/lib/pki/rhcs10-RSA-TPS.

Note

For ease of reference, if you wanted to install the TPS using the two-step method:

  1. 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
  2. Customize the configuration files between the two installation steps
  3. Run the pkispawn tool to configure the TPS:

    # pkispawn -s TPS -f tps_inst.cfg --skip-installation --debug

Verification

  1. Show the status of the installed TPS instance:

    # pki-server status rhcs10-RSA-TPS

    Note down the Secure Agent, Admin and pkiconsole URLs.

  2. Verify that the TPS agent web page is accessible.
  3. 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
    
    ----------------------------------------
    Imported certificates from PKCS #12 file
    ----------------------------------------
Note

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

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

  1. Temporarily update the userKey profile to only generate signing certificates:

    1. Stop the TPS:

      # pki-server stop rhcs10-RSA-TPS
    2. Edit the /var/lib/pki/rhcs10-RSA-TPS/tps/conf/CS.cfg configuration file and change the op.enroll.userKey.keyGen.keyType.num parameter from 2 to 1. E.g:

      op.enroll.userKey.keyGen.keyType.num=1
    3. Start the TPS:

      # pki-server start rhcs10-RSA-TPS
  2. Create a new user for testing token enrollment, e.g. jdoe:

    1. First check if the TPS WebUI is up:

      # pki -U https://rhcs10.example.com:25443 -d /root/.dogtag/pki_rsa_bootstrap/certs_db/ -n "PKI Bootstrap Administrator for RSA-TPS" -c SECret.123 tps-user-show tpsadmin
      
      ---------------
      User "tpsadmin"
      ---------------
        User ID: tpsadmin
        Full name: tpsadmin
        Email: tpsadmin@example.com
        Type: adminType
        State: 1
        TPS Profiles:
      	All Profiles
    2. Create a .cfg file for a POSIX user as follows:

      # vi ldap_user1_add.cfg
      • Add the following content to the file and save:

        dn: uid=jdoe,dc=example,dc=com
        objectClass: extensibleobject
        objectclass: inetorgperson
        objectclass: organizationalPerson
        objectClass: person
        objectClass: posixAccount
        objectClass: top
        homeDirectory: /var/empty
        gidNumber: 99997
        uidNumber: 99996
        sn: jdoe
        uid: jdoe
        cn: TPS jdoe
        mail: user3@redhat.com
        givenName: jdoe
        userPassword: SECret.123
        shrTok:
    3. Configure anonymous bind access:

      1. 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";)
      2. 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
    4. 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

Test token-side key generation

Test token-side key generation using the tpsclient tool to format and enroll a token.

  1. On a separate non-FIPS-enabled system, install the tpsclient package. For example:

    # dnf install -y redhat-pki-tps
    Note

    If you are testing on a Fedora system, the corresponding package providing the tpsclient tool would be dogtag-pki-tools.

  2. Add the TPS server hostname and IP address to the /etc/hosts file:

    # echo "<TPS server IP> rhcs10.example.com" >> /etc/hosts
  3. Test the format and enrollment for the newly created user:

    1. Prepare to format a token for jdoe. Create a .txt file:

      # vi token_format.txt

      Add the following content. The host and port values should match your own; the port should be a non-SSL port.

      op=var_set name=ra_host value=rhcs10.example.com
      op=var_set name=ra_port value=25080
      op=var_set name=ra_uri value=/tps/tps
      op=token_set cuid=40906145C76224192D2B msn=01020304 app_ver=6FBBC105 key_info=0101 major_ver=0 minor_ver=0
      op=token_set auth_key=404142434445464748494a4b4c4d4e4f
      op=token_set mac_key=404142434445464748494a4b4c4d4e4f
      op=token_set kek_key=404142434445464748494a4b4c4d4e4f
      op=ra_format uid=jdoe pwd=SECret.123 num_threads=1 extensions=tokenType=userKey
    2. Prepare to enroll a token for jdoe. Create a .txt file:

      # vi token_enroll.txt

      Add the following content. The host and port values should match your own; the port should be a non-SSL port.

      op=var_set name=ra_host value=rhcs10.example.com
      op=var_set name=ra_port value=25080
      op=var_set name=ra_uri value=/tps/tps
      op=token_set cuid=40906145C76224192D2B msn=01020304 app_ver=6FBBC105 key_info=0101 major_ver=0 minor_ver=0
      op=token_set auth_key=404142434445464748494a4b4c4d4e4f
      op=token_set mac_key=404142434445464748494a4b4c4d4e4f
      op=token_set kek_key=404142434445464748494a4b4c4d4e4f
      op=ra_enroll uid=jdoe pwd=SECret.123 num_threads=1 extensions=tokenType=userKey
      op=exit
    3. Format jdoe’s token. The operation should succeed.:

      # tpsclient < token_format.txt
    4. Enroll jdoe’s token. The operation should succeed:

      # tpsclient < token_enroll.txt

Revert the changes after testing

  1. To delete the added test token after verification:

    1. Log in to the TPS WebUI at https://rhcs10.example.com:25443/tps/ui/
    2. Click Tokens and select the token in check box.
    3. Click Remove, then confirm.
  2. Alternatively, you can use CLI commands to delete the test token. For example:

    # pki -d /root/.dogtag/pki_rsa_bootstrap/certs_db/ -n "PKI Bootstrap Administrator for RSA-TPS" -c SECret.123 -p 25443 tps-token-find
    -----------------
    1 entries matched
    -----------------
      Token ID: 40906145C76224192D2B
      User ID: jdoe
      Type: userKey
      Status: ACTIVE
      Next States: DAMAGED, PERM_LOST, SUSPENDED, TERMINATED
      Applet ID: 1.4.58768072
      Key Info: 0101
      Policy: RE_ENROLL=YES;RENEW=NO;FORCE_FORMAT=NO;PIN_RESET=NO;RESET_PIN_RESET_TO_NO=NO
      Date Created: Tue Dec 19 13:17:46 EST 2023
      Date Modified: Tue Dec 19 13:17:50 EST 2023
    ----------------------------
    Number of entries returned 1
    ----------------------------
    # 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"
    ------------------------------------
  3. Revert op.enroll.userKey.keyGen.keyType.num back to 2:

    1. Stop the TPS:

      # pki-server stop rhcs10-RSA-TPS
    2. Edit the /var/lib/pki/rhcs10-RSA-TPS/tps/conf/CS.cfg configuration file and change back the op.enroll.userKey.keyGen.keyType.num parameter from 1 to 2. E.g.:

      op.enroll.userKey.keyGen.keyType.num=2
    3. Start the TPS:

      # pki-server start rhcs10-RSA-TPS

7.11.5. Configure OAEP support for the TPS

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.

Note

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

  1. Stop the TPS:

    # pki-server stop rhcs10-RSA-TPS
  2. Edit the /var/lib/pki/rhcs10-RSA-TPS/tps/conf/CS.cfg configuration file and add the following line:

keyWrap.useOAEP=true

  1. Start the TPS:

    # pki-server start rhcs10-RSA-TPS

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.

Note

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
  • For format:

    op.format.<tps profile>.update.applet.requiredVersion.prot.3=1.5.64260792

Note that you must then configure any other profiles (including external registration) to use this applet.

For example:

op.enroll.userKey.update.applet.directory=/usr/share/pki/tps/applets
op.enroll.userKey.update.applet.emptyToken.enable=true
op.enroll.userKey.update.applet.enable=true
op.enroll.userKey.update.applet.encryption=true
op.enroll.userKey.update.applet.requiredVersion=1.4.58768072
op.enroll.userKey.update.applet.requiredVersion.prot.3=1.5.64260792

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”

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”

TKS CS.cfg

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

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

7.11.8. Setup TPS phoneHome

  1. Edit the phoneHome.xml configuration file. For example:

    # vi /var/lib/pki/rhcs10-RSA-TPS/tps/conf/phoneHome.xml
  2. Set the correct http port for the TPS. For example:

    <Operation>http://rhcs10.example.com:25080/tps/tps</Operation>

    It will now look like the following:

    # cat phoneHome.xml
    
    <ServiceInfo>
    <IssuerName>Example Corp</IssuerName>
    <Services>
    <Operation>http://rhcs10.example.com:25080/tps/tps</Operation>
    <UI></UI>
    <EnrolledTokenBrowserURL>http://fedoraproject.org</EnrolledTokenBrowserURL>
    <EnrolledTokenURL></EnrolledTokenURL>
    <TokenType>userKey</TokenType>
    </Services>
    </ServiceInfo>
  3. Save and restart the TPS.

7.11.9. Create TPS Role users

7.11.10. Post-installation

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

This section describes the user configuration that takes place after the subsystems installation.

Important

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.

Note

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

Prior to performing the recommended procedure to issue any certificate, make sure your SubCA bootstrap admin certificate/key is ready to perform the tasks.

  1. Login to rhcs10.example.com as root user.
  2. 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”:

    # certutil -d /root/.dogtag/pki_rsa_bootstrap/certs_db -L
    
    Certificate Nickname                            Trust Attributes
                                                    SSL,S/MIME,JAR/XPI
    PKI Bootstrap Administrator for RSA-SubCA       u,u,u
    CA Signing Cert - rhcs10-RSA-RootCA             CT,C,C
    CA Signing Cert - rhcs10-RSA-SubCA              CT,C,C
    PKI Bootstrap Administrator for RSA-RootCA      u,u,u

7.12.2. Admin users

  • 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)

    Note

    This last one requires a second CA setup!

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.

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.

  1. Login to rhcs10.example.com as an 'Administrator' (a non-root user), in this example jgenie.
  2. Create a client nssdb in case it does not already exist:

    $ pki -d /home/jgenie/certs_db -c SECret.123 client-init
  3. Use the PKCS10Client tool to generate a PKCS #10 certificate request:

    Note

    Change 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: 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

    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.

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:

  1. Place the CSR file (rsa_SubCA_AdminV.req) received from jgenie to the /root/.dogtag/pki_rsa_bootstrap/certs_db directory.
  2. Generate a CMC request:

    1. Create a CMCRequest configuration file. For example:

      # vi /root/.dogtag/pki_rsa_bootstrap/certs_db/cmcRequest_p10_rsa_SubCA_AdminV.cfg
      ### numRequests: Total number of PKCS10 requests or CRMF requests.
      numRequests=1
      
      ### input: full path for the PKCS10 request or CRMF request,
      ### The content must be in Base-64 encoded format.
      ### Multiple files are supported. They must be separated by a space.
      input=/root/.dogtag/pki_rsa_bootstrap/certs_db/rsa_SubCA_AdminV.req
      
      ### output: full path for the CMC request in binary format
      output=/root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.rsa_SubCA_AdminV_pkcs10.req
      
      ### tokenname: name of the token where the user signing cert can be found (default is internal)
      tokenname=internal
      
      ### nickname: nickname for the user cert that will be used to sign the CMC full request.
      nickname=PKI Bootstrap Administrator for RSA-SubCA
      
      ### dbdir: directory for cert8.db, key3.db and secmod.db
      dbdir=/root/.dogtag/pki_rsa_bootstrap/certs_db
      
      ### password: password for the cert8.db that stores the user signing cert and keys
      password=SECret.123
      
      ### format: request format, either pkcs10 or crmf
      format=pkcs10
      
      ### identityProofV2.enable: if true, then the request will contain this control. Otherwise, false.
      ### Note that if both identityProof and identityProofV2 are enabled,
      ### identityProofV2 takes precedence; Only one of them can be active at a time
      ### Supported hashAlg are:
      ### SHA-256, SHA-384, and SHA-512
      ### Supported macAlg are:
      ### SHA-256-HMAC, SHA-384-HMAC, and SHA-512-HMAC
      identityProofV2.enable=false
      identityProofV2.hashAlg=SHA-512
      identityProofV2.macAlg=SHA-256-HMAC
      request.privKeyId= _<private key id>_
      NOTE

      For 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

      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.cfg

    2. Generate the request using the CMCRequest command:

      # CMCRequest /root/.dogtag/pki_rsa_bootstrap/certs_db/cmcRequest_p10_rsa_SubCA_AdminV.cfg
      
      cert/key prefix =
      path = /root/.dogtag/pki_rsa_bootstrap/certs_db
      CryptoManger initialized
      token internal logged in...
      got signerCert: PKI Bootstrap Administrator for RSA-SubCA
      createPKIData: begins
      k=0
      createPKIData:  format: pkcs10
      useSharedSecret is false...
      signData: begins:
      getPrivateKey: got signing cert
      signData:  got signer privKey
      createSignedData: begins
      getSigningAlgFromPrivate: begins.
      getSigningAlgFromPrivate: found signingKeyType=RSA
      getSigningAlgFromPrivate: using SignatureAlgorithm: RSASignatureWithSHA256Digest
      createSignedData: digest created for pkidata
      createSignedData: digest algorithm =RSASignatureWithSHA256Digest
      createSignedData: building cert chain
      signData: signed request generated.
      getCMCBlob: begins
      getCMCBlob: generating signed data
      
      The CMC enrollment request in base-64 encoded format:
      
      . . . Output omitted . . .
      
      The CMC enrollment request in binary format is stored in /root/.dogtag/pki_rsa_bootstrap/cmc.rsa_SubCA_AdminV_pkcs10.req
  3. Submit the CMC request:

    1. Create a HttpClient configuration file. For example:

      # vi /root/.dogtag/pki_rsa_bootstrap/certs_db/HttpClient_cmc_p10_rsa_SubCA_AdminV_signed.cfg
      ### host: host name for the http server
      host=rhcs10.example.com
      
      ### port: port number
      port=31443
      
      ### secure: true for secure connection, false for nonsecure connection
      secure=true
      
      ### input: full path for the enrollment request, the content must be in binary format
      input=/root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.rsa_SubCA_AdminV_pkcs10.req
      
      ### output: full path for the response in binary format
      output=/root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.rsa_SubCA_AdminV_pkcs10.resp
      
      ### tokenname: name of the token where the SSL client authentication cert can be found (default is internal)
      ### This parameter will be ignored if secure=false
      tokenname=internal
      
      ### dbdir: directory for cert8.db, key3.db and secmod.db
      ### This parameter will be ignored if secure=false
      dbdir=/root/.dogtag/pki_rsa_bootstrap/certs_db
      
      ### clientmode: true for client authentication, false for no client authentication
      ### This parameter will be ignored if secure=false
      clientmode=true
      
      ### password: password for cert8.db
      ### This parameter will be ignored if secure=false and clientauth=false
      password=SECret.123
      
      ### nickname: nickname for client certificate
      ### This parameter will be ignored if clientmode=false
      nickname=PKI Bootstrap Administrator for RSA-SubCA
      
      ### servlet: servlet name
      servlet=/ca/ee/ca/profileSubmitCMCFull?profileId=caFullCMCUserCert
    2. Submit the request using the HttpClient command:

      # HttpClient /root/.dogtag/pki_rsa_bootstrap/certs_db/HttpClient_cmc_p10_rsa_SubCA_AdminV_signed.cfg
      
      Total number of bytes read = 3455
      after SSLSocket created, thread token is NSS FIPS 140-2 User Private Key
      client cert is not null
      handshake happened
      writing to socket
      Total number of bytes read = 2592
      MIIKHAYJKoZIhvcNAQcCoIIKDTCCCgkCAQMxDzANBglghkgBZQMEAgMFADAxBggr
      
      . . . Output omitted . . .
      
      The response in binary format is stored in /root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.rsa_SubCA_AdminV_pkcs10.resp
  4. Process the response using CMCResponse to display all certificates in chain individually in PEM format:

    # CMCResponse -d /root/.dogtag/pki_rsa_bootstrap/certs_db -i /root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.rsa_SubCA_AdminV_pkcs10.resp -o /root/.dogtag/pki_rsa_bootstrap/certs_db/rsa_SubCA_AdminV_pkcs7.crt
    
    Cert:0
    ...
    ===
    Cert:1
    ...
    ===
    Cert:2
    ...
    ===
    Certificates:
        Certificate:
           Data:
               Version:  v3
               Serial Number: 0xF64CE29
               Signature Algorithm: SHA512withRSA - 1.2.840.113549.1.1.13
               Issuer: CN=CA Signing Certificate,OU=rhcs10-RSA-RootCA,O=Example-rhcs10-RSA-RootCA
               Validity:
                   Not Before: Friday, January 5, 2018 8:09:48 PM EST America/New_York
                   Not  After: Wednesday, July 4, 2018 8:09:48 PM EDT America/New_York
               Subject: CN=rsa_SubCA_AdminV,UID=rsa_SubCA_AdminV
    
    . . . Output omitted . . .
    
    Number of controls is 1
    Control #0: CMCStatusInfoV2
      OID: {1 3 6 1 5 5 7 7 25}
      BodyList: 1
      Status: SUCCESS
  5. 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

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:

  1. Create a user, in this example 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-user-add --fullName="rsa_SubCA_AdminV" rsa_SubCA_AdminV
    ---------------------
    Added user "rsa_SubCA_AdminV"
    ---------------------
     User ID: rsa_SubCA_AdminV
     Full name: rsa_SubCA_AdminV

    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.
  2. 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
    -----------------------------
    Added group member "rsa_SubCA_AdminV"
    -----------------------------
     User: rsa_SubCA_AdminV

    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.
  3. Verify that the user got added 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-find Administrators
    -----------------
    2 entries matched
    -----------------
     User: caadmin
    
     User: rsa_SubCA_AdminV
    ----------------------------
    Number of entries returned 2
    ----------------------------

    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.
  4. 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
    
    -------------------------------------------------------------------------------------------------------------------------------------
    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"

    Similarly:

    • To add certificates to users in the KRA and the OCSP, use respectively the kra-user-cert-add and the ocsp-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 the tps-user-cert-add commands with the corresponding subsystem’s hostname and port.
  5. 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.

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.

  1. Login to rhcs10.example.com as the pki administrator whose certificate was issued in the previous section, e.g. jgenie.
  2. 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
    $ certutil -d /home/jgenie/certs_db -L
    
    Certificate Nickname                Trust Attributes
                                        SSL,S/MIME,JAR/XPI
    
    . . . Output omitted . . .
    
    rsa_SubCA_AdminV                    u,u,u
  3. 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
    Note

    You 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

7.12.3. Agent users

  • 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)

    Note

    This last one requires a second CA setup!

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

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).

    1. Create a client nssdb if it does not already exist:

      $ pki -d /home/jsmith/certs_db -c SECret.123 client-init
    2. Use the PKCS10Client tool to generate a PKCS#10 certificate request:

      Note

      Change 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: 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

      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

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:

  1. Place the CSR file (rsa_SubCA_AgentV.req) received from jsmith to the /root/.dogtag/pki_rsa_bootstrap/certs_db directory.
  2. Generate a CMC request:

    1. Create a CMCRequest configuration file. For example:

      # vi /root/.dogtag/pki_rsa_bootstrap/certs_db/cmcRequest_p10_rsa_SubCA_AgentV.cfg
      ### numRequests: Total number of PKCS10 requests or CRMF requests.
      numRequests=1
      
      ### input: full path for the PKCS10 request or CRMF request,
      ### The content must be in Base-64 encoded format.
      ### Multiple files are supported. They must be separated by a space.
      input=/root/.dogtag/pki_rsa_bootstrap/certs_db/rsa_SubCA_AgentV.req
      
      ### output: full path for the CMC request in binary format
      output=/root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.rsa_SubCA_AgentV_pkcs10.req
      
      ### tokenname: name of the token where the user signing cert can be found (default is internal)
      tokenname=internal
      
      ### nickname: nickname for the user cert that will be used to sign the CMC full request.
      nickname=PKI Bootstrap Administrator for RSA-SubCA
      
      ### dbdir: directory for cert8.db, key3.db and secmod.db
      dbdir=/root/.dogtag/pki_rsa_bootstrap/certs_db
      
      ### password: password for the cert8.db that stores the user signing cert and keys
      password=SECret.123
      
      ### format: request format, either pkcs10 or crmf
      format=pkcs10
      
      ### identityProofV2.enable: if true, then the request will contain this control. Otherwise, false.
      ### Note that if both identityProof and identityProofV2 are enabled,
      ### identityProofV2 takes precedence; Only one of them can be active at a time
      ### Supported hashAlg are:
      ### SHA-256, SHA-384, and SHA-512
      ### Supported macAlg are:
      ### SHA-256-HMAC, SHA-384-HMAC, and SHA-512-HMAC
      identityProofV2.enable=false
      identityProofV2.hashAlg=SHA-512
      identityProofV2.macAlg=SHA-256-HMAC
      request.privKeyId= _<private key id>_
    2. Generate the request using the CMCRequest command:

      # CMCRequest /root/.dogtag/pki_rsa_bootstrap/certs_db/cmcRequest_p10_rsa_SubCA_AgentV.cfg
      
      cert/key prefix =
      path = /root/.dogtag/pki_rsa_bootstrap/certs_db
      CryptoManger initialized
      token internal logged in...
      got signerCert: PKI Bootstrap Administrator for RSA-SubCA
      createPKIData: begins
      k=0
      createPKIData:  format: pkcs10
      useSharedSecret is false...
      signData: begins:
      getPrivateKey: got signing cert
      signData:  got signer privKey
      createSignedData: begins
      getSigningAlgFromPrivate: begins.
      getSigningAlgFromPrivate: found signingKeyType=RSA
      getSigningAlgFromPrivate: using SignatureAlgorithm: RSASignatureWithSHA256Digest
      createSignedData: digest created for pkidata
      createSignedData: digest algorithm =RSASignatureWithSHA256Digest
      createSignedData: building cert chain
      signData: signed request generated.
      getCMCBlob: begins
      getCMCBlob: generating signed data
      
      The CMC enrollment request in base-64 encoded format:
      
      . . . Output omitted . . .
      
      The CMC enrollment request in binary format is stored in /root/.dogtag/pki_rsa_bootstrap/cmc.rsa_SubCA_AgentV_pkcs10.req
  3. Submit the CMC request:

    1. Create a HttpClient configuration file. For example:

      # vi /root/.dogtag/pki_rsa_bootstrap/certs_db/HttpClient_cmc_p10_rsa_SubCA_AgentV_signed.cfg
      ### host: host name for the http server
      host=rhcs10.example.com
      
      ### port: port number
      port=31443
      
      ### secure: true for secure connection, false for nonsecure connection
      secure=true
      
      ### input: full path for the enrollment request, the content must be in binary format
      input=/root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.rsa_SubCA_AgentV_pkcs10.req
      
      ### output: full path for the response in binary format
      output=/root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.rsa_SubCA_AgentV_pkcs10.resp
      
      ### tokenname: name of the token where the SSL client authentication cert can be found (default is internal)
      ### This parameter will be ignored if secure=false
      tokenname=internal
      
      ### dbdir: directory for cert8.db, key3.db and secmod.db
      ### This parameter will be ignored if secure=false
      dbdir=/root/.dogtag/pki_rsa_bootstrap/certs_db
      
      ### clientmode: true for client authentication, false for no client authentication
      ### This parameter will be ignored if secure=false
      clientmode=true
      
      ### password: password for cert8.db
      ### This parameter will be ignored if secure=false and clientauth=false
      password=SECret.123
      
      ### nickname: nickname for client certificate
      ### This parameter will be ignored if clientmode=false
      nickname=PKI Bootstrap Administrator for RSA-SubCA
      
      ### servlet: servlet name
      servlet=/ca/ee/ca/profileSubmitCMCFull?profileId=caFullCMCUserCert
    2. Submit the request using the HttpClient command:

      # HttpClient /root/.dogtag/pki_rsa_bootstrap/certs_db/HttpClient_cmc_p10_rsa_SubCA_AgentV_signed.cfg
      
      Total number of bytes read = 3455
      after SSLSocket created, thread token is NSS FIPS 140-2 User Private Key
      client cert is not null
      handshake happened
      writing to socket
      Total number of bytes read = 2592
      
      . . . Output omitted . . .
      
      The response in binary format is stored in /root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.rsa_SubCA_AgentV_pkcs10.resp
  4. Process the response using CMCResponse:

    Important

    Running 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.

    # CMCResponse -v -d /root/.dogtag/pki_rsa_bootstrap/certs_db -i /root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.rsa_SubCA_AgentV_pkcs10.resp -o /root/.dogtag/pki_rsa_bootstrap/certs_db/rsa_SubCA_AgentV_pkcs7.crt
    
    Cert:0
    ...
    ===
    Cert:1
    ...
    ===
    Cert:2
    ...
    ===
    Certificates:
        Certificate:
           Data:
               Version:  v3
               Serial Number: 0xE1E0F54
    
    . . . Output omitted . . .
    
    Number of controls is 1
    Control #0: CMCStatusInfoV2
      OID: {1 3 6 1 5 5 7 7 25}
      BodyList: 1
      Status: SUCCESS
  5. 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
  1. Create the rsa_SubCA_AgentV 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-add --fullName="rsa_SubCA_AgentV" rsa_SubCA_AgentV
    ---------------------
    Added user "rsa_SubCA_AgentV"
    ---------------------
     User ID: rsa_SubCA_AgentV
     Full name: rsa_SubCA_AgentV

    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.
  2. 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
    -----------------------------
    Added group member "rsa_SubCA_AgentV"
    -----------------------------
     User: rsa_SubCA_AgentV

    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".
  3. Verify that the user rsa_SubCA_AgentV got added 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-find "Certificate Manager Agents"
    -----------------
    3 entries matched
    -----------------
     User: caadmin
    
     User: pkidbuser
    
     User: rsa_SubCA_AgentV
    ----------------------------
    Number of entries returned 3
    ----------------------------

    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".
  4. 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
    
    -------------------------------------------------------------------------------------------------------------------------------------
    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"

    Similarly:

    • To add certificates to users in the KRA and the OCSP, use respectively the kra-user-cert-add and the ocsp-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 the tps-user-cert-add commands with the corresponding subsystem’s hostname and port.
  5. 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.

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.

  1. Login to rhcs10.example.com as an 'Agent' (a non-root user, for example jsmith).
  2. 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
    $ certutil -d /home/jsmith/certs_db -L
    
    Certificate Nickname              Trust Attributes
                                      SSL,S/MIME,JAR/XPI
    
    . . . Output omitted . . .
    
    rsa_SubCA_AgentV                  u,u,u
  3. 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

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

  • auditV (this user will have a valid certificate throughout testing)

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

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).

    1. Create a client nssdb if it does not already exist:

      $ pki -d /home/aguru/certs_db -c SECret.123 client-init
    2. Use the PKCS10Client tool to generate a PKCS#10 Certificate Request:

      Note

      Change 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: 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

      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

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

  1. Place the CSR file (rsa_SubCA_AuditV.req) received from aguru to the /root/.dogtag/pki_rsa_bootstrap/certs_db directory.
  2. Generate a CMC request:

    1. Create a CMCRequest configuration file. For example:

      # vi /root/.dogtag/pki_rsa_bootstrap/certs_db/cmcRequest_p10_rsa_SubCA_AuditV.cfg
      ### numRequests: Total number of PKCS10 requests or CRMF requests.
      numRequests=1
      
      ### input: full path for the PKCS10 request or CRMF request,
      ### The content must be in Base-64 encoded format.
      ### Multiple files are supported. They must be separated by a space.
      input=/root/.dogtag/pki_rsa_bootstrap/certs_db/rsa_SubCA_AuditV.req
      
      ### output: full path for the CMC request in binary format
      output=/root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.rsa_SubCA_AuditV_pkcs10.req
      
      ### tokenname: name of the token where the user signing cert can be found (default is internal)
      tokenname=internal
      
      ### nickname: nickname for the user cert that will be used to sign the CMC full request.
      nickname=PKI Bootstrap Administrator for RSA-SubCA
      
      ### dbdir: directory for cert8.db, key3.db and secmod.db
      dbdir=/root/.dogtag/pki_rsa_bootstrap/certs_db
      
      ### password: password for the cert8.db that stores the user signing cert and keys
      password=SECret.123
      
      ### format: request format, either pkcs10 or crmf
      format=pkcs10
      
      ### identityProofV2.enable: if true, then the request will contain this control. Otherwise, false.
      ### Note that if both identityProof and identityProofV2 are enabled,
      ### identityProofV2 takes precedence; Only one of them can be active at a time
      ### Supported hashAlg are:
      ### SHA-256, SHA-384, and SHA-512
      ### Supported macAlg are:
      ### SHA-256-HMAC, SHA-384-HMAC, and SHA-512-HMAC
      identityProofV2.enable=false
      identityProofV2.hashAlg=SHA-512
      identityProofV2.macAlg=SHA-256-HMAC
      request.privKeyId= _<private key id>_
    2. Generate the request using the CMCRequest command:

      # CMCRequest /root/.dogtag/pki_rsa_bootstrap/certs_db/cmcRequest_p10_rsa_SubCA_AuditV.cfg
      
      cert/key prefix =
      path = /root/.dogtag/pki_rsa_bootstrap/certs_db
      CryptoManger initialized
      token internal logged in...
      got signerCert: PKI Bootstrap Administrator for RSA-SubCA
      createPKIData: begins
      k=0
      createPKIData:  format: pkcs10
      useSharedSecret is false...
      signData: begins:
      getPrivateKey: got signing cert
      signData:  got signer privKey
      createSignedData: begins
      getSigningAlgFromPrivate: begins.
      getSigningAlgFromPrivate: found signingKeyType=RSA
      getSigningAlgFromPrivate: using SignatureAlgorithm: RSASignatureWithSHA256Digest
      createSignedData: digest created for pkidata
      createSignedData: digest algorithm =RSASignatureWithSHA256Digest
      createSignedData: building cert chain
      signData: signed request generated.
      getCMCBlob: begins
      getCMCBlob: generating signed data
      
      The CMC enrollment request in base-64 encoded format:
      
      . . . Output omitted . . .
      
      The CMC enrollment request in binary format is stored in /root/.dogtag/pki_rsa_bootstrap/cmc.rsa_SubCA_AuditV_pkcs10.req
  3. Submit the CMC request:

    1. Create a HttpClient configuration file. For example:

      # vi /root/.dogtag/pki_rsa_bootstrap/certs_db/HttpClient_cmc_p10_rsa_SubCA_AuditV_signed.cfg
      ### host: host name for the http server
      host=rhcs10.example.com
      
      ### port: port number
      port=31443
      
      ### secure: true for secure connection, false for nonsecure connection
      secure=true
      
      ### input: full path for the enrollment request, the content must be in binary format
      input=/root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.rsa_SubCA_AuditV_pkcs10.req
      
      ### output: full path for the response in binary format
      output=/root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.rsa_SubCA_AuditV_pkcs10.resp
      
      ### tokenname: name of the token where the SSL client authentication cert can be found (default is internal)
      ### This parameter will be ignored if secure=false
      tokenname=internal
      
      ### dbdir: directory for cert8.db, key3.db and secmod.db
      ### This parameter will be ignored if secure=false
      dbdir=/root/.dogtag/pki_rsa_bootstrap/certs_db
      
      ### clientmode: true for client authentication, false for no client authentication
      ### This parameter will be ignored if secure=false
      clientmode=true
      
      ### password: password for cert8.db
      ### This parameter will be ignored if secure=false and clientauth=false
      password=SECret.123
      
      ### nickname: nickname for client certificate
      ### This parameter will be ignored if clientmode=false
      nickname=PKI Bootstrap Administrator for RSA-SubCA
      
      ### servlet: servlet name
      servlet=/ca/ee/ca/profileSubmitCMCFull?profileId=caFullCMCUserCert
    2. Submit the request using the HttpClient command:

      # HttpClient /root/.dogtag/pki_rsa_bootstrap/certs_db/HttpClient_cmc_p10_rsa_SubCA_AuditV_signed.cfg
      
      Total number of bytes read = 3459
      after SSLSocket created, thread token is NSS FIPS 140-2 User Private Key
      client cert is not null
      handshake happened
      writing to socket
      Total number of bytes read = 2596
      
      . . . Output omitted . . .
      
      The response in binary format is stored in /root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.rsa_SubCA_AuditV_pkcs10.resp
  4. Process the response using CMCResponse to display all certificates in chain individually in PEM format:

    Important

    Running 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.

    # CMCResponse -v -d /root/.dogtag/pki_rsa_bootstrap/certs_db -i /root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.rsa_SubCA_AuditV_pkcs10.resp -o /root/.dogtag/pki_rsa_bootstrap/certs_db/rsa_SubCA_AuditV_pkcs7.crt
    
    Certificates:
        Certificate:
           Data:
               Version:  v3
               Serial Number: 0xD107903
               Signature Algorithm: SHA512withRSA - 1.2.840.113549.1.1.13
               Issuer: CN=CA Signing Certificate,OU=rhcs10-RSA-RootCA,O=Example-rhcs10-RSA-RootCA
               Validity:
                   Not Before: Sunday, January 7, 2018 1:12:52 PM EST America/New_York
                   Not  After: Friday, July 6, 2018 1:12:52 PM EDT America/New_York
               Subject: CN=rsa_SubCA_AuditV,UID=rsa_SubCA_AuditV
    
    . . . Output omitted . . .
    
    Number of controls is 1
    Control #0: CMCStatusInfoV2
      OID: {1 3 6 1 5 5 7 7 25}
      BodyList: 1
      Status: SUCCESS
  5. 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

This procedure is to be performed by an existing pki admin user, in this case, the root user that holds the SubCA bootstrap certificate.

  1. Create the rsa_SubCA_AuditV 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-add --fullName="rsa_SubCA_AuditV" rsa_SubCA_AuditV
    ---------------------
    Added user "rsa_SubCA_AuditV"
    ---------------------
     User ID: rsa_SubCA_AuditV
     Full name: rsa_SubCA_AuditV

    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.
  2. 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
    -----------------------------
    Added group member "rsa_SubCA_AuditV"
    -----------------------------
     User: rsa_SubCA_AuditV

    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.
  3. Verify that the user rsa_SubCA_AuditV got added 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-find "Auditors"
    -----------------
    1 entries matched
    -----------------
     User: rsa_SubCA_AuditV
    ----------------------------
    Number of entries returned 1
    ----------------------------

    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.
  4. 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
    
    -------------------------------------------------------------------------------------------------------------------------------------
    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"

    Similarly:

    • To add certificates to users in the KRA and the OCSP, use respectively the kra-user-cert-add and the ocsp-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 the tps-user-cert-add commands with the corresponding subsystem’s hostname and port.
  5. 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.

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.

  1. Login to rhcs10.example.com as an 'Auditor' (a non-root user, for example aguru).
  2. 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
    $ certutil -d /home/aguru/certs_db -L
    
    Certificate Nickname              Trust Attributes
                                      SSL,S/MIME,JAR/XPI
    
    . . . Output omitted . . .
    
    rsa_SubCA_AuditV                  u,u,u
  3. 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

7.12.5. TPS operators

The process for TPS operators is similar to the process for Auditors.

Note

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.

  1. List the certificates in the authentication nssdb to determine the installed bootstrap admin certificates for the SubCA, KRA and OCSP. For example:

    # certutil -d /root/.dogtag/pki_rsa_bootstrap/certs_db -L
    
    Certificate Nickname                             Trust Attributes
                                                     SSL,S/MIME,JAR/XPI
    
    PKI Bootstrap Administrator for RSA-RootCA       u,u,u
    PKI Bootstrap Administrator for RSA-SubCA        u,u,u
    PKI Bootstrap Administrator for RSA-OCSP-rootca  u,u,u
    PKI Bootstrap Administrator for RSA-OCSP-subca   u,u,u
    PKI Bootstrap Administrator for RSA-KRA          u,u,u
  2. 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-OCSP-rootca"
    # 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-KRA"
  3. 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-TPS"

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

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:

For required or strongly recommended procedures, perform the actions described below.

Important

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

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

    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

    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:

    1. First, display the list of available time zones:

      # timedatectl list-timezones
    2. Based on the above list, set your desired time zone with this command:

      # timedatectl set-timezone <your_preferred_timezone>

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

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”.

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:

  1. Open the enrollment profile for the certificate:

    # vi /var/lib/pki/rhcs10-RSA-SubCA/ca/profiles/ca/caCMCcaCert.cfg
  2. Add the following parameter:

    policyset.caCertSet.8.default.params.messageDigest=SHA-256
  3. Save the file and restart the CA.
Note

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

You can do certificate enrollments and revocation via CMC. The configuration is described in Section 9.6, “Configuration for CMC”. Specifically:

7.13.5. Enable Nuxwdog (watchdog service)

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

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

  1. Add the cms.tokenList=<HSM_TOKEN_NAME> parameter to CS.cfg, for example:

    # cat /var/lib/pki/rhcs10-RSA-RootCA/ca/conf/CS.cfg | grep cms.tokenList
    
    cms.tokenList=NHSM-CONN-XC
  2. Move the password file to another directory:

    # mv /var/lib/pki/rhcs10-RSA-RootCA/conf/password.conf ~/<YOUR_PREFERRED_DIR>/
  3. Enable the Nuxwdog service:

    # pki-server instance-nuxwdog-enable rhcs10-RSA-RootCA
    ---------------------------
    Nuxwdog enabled for instance rhcs10-RSA-RootCA.
    ---------------------------
  4. 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
    
    [rhcs10-RSA-RootCA] Please provide the password for internal: *****
    [rhcs10-RSA-RootCA] Please provide the password for hardware-NHSM-CONN-XC: *****

Verification steps:

  • Check the status of the RootCA instance using Nuxwdog:

    # systemctl status pki-tomcatd-nuxwdog@rhcs10-RSA-RootCA.service
    
    ● pki-tomcatd-nuxwdog@rhcs10-RSA-RootCA.service - PKI Tomcat Server rhcs10-RSA-RootCA
    Started by Nuxwdog
      Loaded: loaded (/lib/systemd/system/pki-tomcatd-nuxwdog@.service; enabled; vendor preset: disabled)
      Active: active (running) since …
7.13.5.2. Enable Nuxwdog for the SubCA

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

  1. Add the cms.tokenList=<HSM_TOKEN_NAME> parameter to CS.cfg, for example:

    # cat /var/lib/pki/rhcs10-RSA-SubCA/ca/conf/CS.cfg | grep cms.tokenList
    
    cms.tokenList=NHSM-CONN-XC
  2. Move the password file to another directory:

    # mv /var/lib/pki/rhcs10-RSA-SubCA/conf/password.conf ~/<YOUR_PREFERRED_DIR>/
  3. Enable the Nuxwdog service:

    # pki-server instance-nuxwdog-enable rhcs10-RSA-SubCA
    ---------------------------
    Nuxwdog enabled for instance rhcs10-RSA-SubCA.
    ---------------------------
  4. 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
    
    [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: ******

Verification steps:

  • Check the status of the SubCA instance using Nuxwdog:

    # systemctl status pki-tomcatd-nuxwdog@rhcs10-RSA-SubCA.service
    
    ● pki-tomcatd-nuxwdog@rhcs10-RSA-SubCA.service - PKI Tomcat Server rhcs10-RSA-SubCA
    Started by Nuxwdog
      Loaded: loaded (/lib/systemd/system/pki-tomcatd-nuxwdog@.service; enabled; vendor preset: disabled)
      Active: active (running) since …
7.13.5.3. Enable Nuxwdog for the OCSPs

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 or systemctl stop pki-tomcatd@rhcs10-RSA-OCSP-subca.service for the relevant instance.

Procedure

For example, for the RootCA’s OCSP:

  1. Add the cms.tokenList=<TOKEN_NAME> parameter to CS.cfg, for example:

    # cat /var/lib/pki/rhcs10-RSA-OCSP-rootca/ocsp/conf/CS.cfg | grep cms.tokenList
    
    cms.tokenList=NHSM-CONN-XC
  2. Move the password file to another directory:

    # mv /var/lib/pki/rhcs10-RSA-OCSP-rootca/conf/password.conf ~/<YOUR_PREFERRED_DIR>/
  3. Enable the Nuxwdog service:

    # pki-server instance-nuxwdog-enable rhcs10-RSA-OCSP-rootca/
    ---------------------------
    Nuxwdog enabled for instance rhcs10-RSA-OCSP-rootca/.
    ---------------------------
  4. Start the instance using the Nuxwdog 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: *****
  5. 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:

    # systemctl status pki-tomcatd-nuxwdog@rhcs10-RSA-OCSP-rootca.service
    
    ● pki-tomcatd-nuxwdog@rhcs10-RSA-OCSP-rootca.service - PKI Tomcat Server rhcs10-RSA-OCSP-rootca/
    Started by Nuxwdog
      Loaded: loaded (/lib/systemd/system/pki-tomcatd-nuxwdog@.service; enabled; vendor preset: disabled)
      Active: active (running) since …
    # systemctl status pki-tomcatd-nuxwdog@rhcs10-RSA-OCSP-subca.service
    
    ● pki-tomcatd-nuxwdog@rhcs10-RSA-OCSP-subca/.service - PKI Tomcat Server rhcs10-RSA-OCSP-subca/
    Started by Nuxwdog
      Loaded: loaded (/lib/systemd/system/pki-tomcatd-nuxwdog@.service; enabled; vendor preset: disabled)
      Active: active (running) since …
7.13.5.4. Enable Nuxwdog for the KRA

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

  1. Add the cms.tokenList=<TOKEN_NAME> parameter to the CS.cfg file, for example:

    # cat /var/lib/pki/rhcs10-RSA-KRA/kra/conf/CS.cfg | grep cms.tokenList
    
    cms.tokenList=NHSM-CONN-XC
  2. Move the password file to another directory:

    # mv /var/lib/pki/rhcs10-RSA-KRA/conf/password.conf ~/<YOUR_PREFERRED_DIR>/
  3. Enable the Nuxwdog service:

    # pki-server instance-nuxwdog-enable rhcs10-RSA-KRA
    ---------------------------
    Nuxwdog enabled for instance rhcs10-RSA-KRA.
    ---------------------------
  4. Start the instance using the Nuxwdog 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: *****

Verification steps:

  • Check the status of the KRA instance using Nuxwdog:

    # systemctl status pki-tomcatd-nuxwdog@rhcs10-RSA-KRA.service
    
    ● pki-tomcatd-nuxwdog@rhcs10-RSA-KRA.service - PKI Tomcat Server rhcs10-RSA-KRA
    Started by Nuxwdog
      Loaded: loaded (/lib/systemd/system/pki-tomcatd-nuxwdog@.service; enabled; vendor preset: disabled)
      Active: active (running) since …
7.13.5.5. Enable Nuxwdog for the TKS

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

  1. Add the cms.tokenList=<TOKEN_NAME> parameter to the CS.cfg file, for example:

    # cat /var/lib/pki/rhcs10-RSA-TKS/TKS/conf/CS.cfg | grep cms.tokenList
    
    cms.tokenList=NHSM-CONN-XC
  2. Move the password file to another directory:

    # mv /var/lib/pki/rhcs10-RSA-TKS/conf/password.conf ~/<YOUR_PREFERRED_DIR>/
  3. Enable the Nuxwdog service:

    # pki-server instance-nuxwdog-enable rhcs10-RSA-TKS
    ---------------------------
    Nuxwdog enabled for instance rhcs10-RSA-TKS.
    ---------------------------
  4. Start the instance using the Nuxwdog 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: *****

Verification steps:

  • Check the status of the TKS instance using Nuxwdog:

    # systemctl status pki-tomcatd-nuxwdog@rhcs10-RSA-TKS.service
    
    ● pki-tomcatd-nuxwdog@rhcs10-RSA-TKS.service - PKI Tomcat Server rhcs10-RSA-TKS
    Started by Nuxwdog
      Loaded: loaded (/lib/systemd/system/pki-tomcatd-nuxwdog@.service; enabled; vendor preset: disabled)
      Active: active (running) since …
7.13.5.6. Enable Nuxwdog for the TPS

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

  1. Add the cms.tokenList=<TOKEN_NAME> parameter to the CS.cfg file, for example:

    # cat /var/lib/pki/rhcs10-RSA-TPS/TPS/conf/CS.cfg | grep cms.tokenList
    
    cms.tokenList=NHSM-CONN-XC
  2. Move the password file to another directory:

    # mv /var/lib/pki/rhcs10-RSA-TPS/conf/password.conf ~/<YOUR_PREFERRED_DIR>/
  3. Enable the Nuxwdog service:

    # pki-server instance-nuxwdog-enable rhcs10-RSA-TPS
    ---------------------------
    Nuxwdog enabled for instance rhcs10-RSA-TPS.
    ---------------------------
  4. Start the instance using the Nuxwdog 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: *****

Verification steps:

  • Check the status of the TPS instance using Nuxwdog:

    # systemctl status pki-tomcatd-nuxwdog@rhcs10-RSA-TPS.service
    
    ● pki-tomcatd-nuxwdog@rhcs10-RSA-TPS.service - PKI Tomcat Server rhcs10-RSA-TPS
    Started by Nuxwdog
      Loaded: loaded (/lib/systemd/system/pki-tomcatd-nuxwdog@.service; enabled; vendor preset: disabled)
      Active: active (running) since …

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.

  1. Login to rhcs10.example.com as root.
  2. Stop the server that needs a console login with client authentication.

    # pki-server stop rhcs10-<INSTANCE>

    OR if using the Nuxwdog watchdog:

    # systemctl stop pki-tomcatd-nuxwdog@rhcs10-<INSTANCE>.service
  3. 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
  4. Modify the CS.cfg file to change the authType from pwd to sslclientauth, e.g.:

    authType=sslclientauth
    NOTE

    Alternatively, you can add the line authType=sslclientauth to the CS.cfg using the config-set commands. For example, use ca-config-set to add to the RootCA:

    # pki-server ca-config-set -i rhcs10-RSA-RootCA authType sslclientauth
  5. Start the server:

    # pki-server start rhcs10-<INSTANCE>

    OR if using the Nuxwdog watchdog:

    # systemctl start pki-tomcatd-nuxwdog@rhcs10-<INSTANCE>.service

Procedure

Each RHCS administrator needs to perform some setup prior to using pkiconsole with TLS connections.

  1. Login to rhcs10.example.com as a non-root admin user (for example: jgenie).
  2. 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.
  3. Create a nssdb, if it does not already exist:

    $ pki -d /home/jgenie/.redhat-idm-console -c SECret.123 client-init
  4. 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
  5. 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
    -------------------------------------
    Imported certificate "CA Signing Cert - rhcs10-RSA-SubCA"
    -------------------------------------
    $ 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"
    -------------------------------------

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
    1. Verify that pkiconsole can connect to the ca using client authentication:

      1. Login as a pki admin user (e.g. jgenie), for example:

        $ ssh -X jgenie@rhcs10.example.com
      2. Run pkiconsole. For example:

        $ pkiconsole -d /home/jgenie/.redhat-idm-console -n rsa_SubCA_AdminV https://rhcs10.example.com:31443/ca
Note

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:

  1. Install xauth as a root user on rhcs10.example.com:

    # dnf install xauth
  2. Login again as a RHCS admin user to run pkiconsole. For example:

    # ssh -X jgenie@rhcs10.example.com
    # pkiconsole -d /home/jgenie/.redhat-idm-console -n rsa_SubCA_AdminV https://rhcs10.example.com:31443/ca

7.13.7. Enable signed audit Logging

Prerequisite

  • You are logged onto rhcs10.example.com as root user.

Procedure

  1. Stop the instance. For example, for the KRA:

    # pki-server stop rhcs10-RSA-KRA

    OR if using the Nuxwdog watchdog:

    # systemctl stop pki-tomcatd-nuxwdog@rhcs10-KRA.service
  2. Set the log.instance.SignedAudit.logSigning attribute to true in the CS.cfg file (false by default). For example:

    # vi /var/lib/pki/rhcs10-RSA-KRA/kra/conf/CS.cfg
    log.instance.SignedAudit.logSigning=true
  3. Start the instance. For example:

    # pki-server start rhcs10-RSA-KRA

    OR if using the Nuxwdog watchdog:

    # systemctl start pki-tomcatd-nuxwdog@rhcs10-KRA.service
Note

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)

Auditors (e.g - rsa_SubCA_AuditV) can access the signed audit logs using the following procedure.

Procedure

  1. Login to rhcs10.example.com as an Auditor (a non-root user, e.g. - aguru).

    $ certutil -d /home/aguru/certs_db -L
    
    Certificate Nickname                      Trust Attributes
                                              SSL,S/MIME,JAR/XPI
    
    . . . Output omitted . . .
    
    rsa_SubCA_AuditV                          u,u,u
    CA Signing Cert - rhcs10-RSA-RootCA       CT,C,C
  2. List the available audit log files:

    $ pki -d /home/aguru/certs_db -n "rsa_SubCA_AuditV" -c SECret.123 -p 31443 -h `hostname` ca-audit-file-find
    -----------------
    1 entries matched
    -----------------
      File name: ca_audit
      Size: 1184345
    ----------------------------
    Number of entries returned 1
    ----------------------------

    In this example, there is only one file, ca_audit, but you can have multiple audit log files.

  3. 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

    If you have multiple log files, retrieve them one by one.

  4. Verify the signed audit logs using the AuditVerify tool:

    1. Import the SubCA audit signing certificate to the nssdb:

      $ pki -p 31443 -h `hostname` ca-cert-find --name "CA Audit Signing Certificate"
      ---------------
      1 entries found
      ---------------
        Serial Number: 0xe8e47bf
      
      . . . Output omitted . . .
      $ 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"
      ---------------------------------------------------
    2. Create a file containing a list of audit log files in chronological order:

      $ cat > /home/aguru/certs_db/audit.txt << EOF
      ca_audit
      EOF
    3. Run the AuditVerify tool:

      $ cd /home/aguru/certs_db/
      $ AuditVerify -d /home/aguru/certs_db -n "SubCA Audit Signing Certificate" -a audit.txt

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
Important

Make sure the file /etc/audit/rules.d/audit.rules remains present on the system with the following content:

# cat /etc/audit/rules.d/audit.rules
## First rule - delete all
-D
## Increase the buffers to survive stress events.
## Make this bigger for busy systems
-b 8192
## This determine how long to wait in burst of events
--backlog_wait_time 60000
## Set failure mode to syslog
-f 1

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.

  1. Create the file /etc/audit/rules.d/rhcs-audit-log-deletion.rules with the following contents:

    -a always,exit -F arch=b32 -S unlink -F dir=/var/log/pki -F key=rhcs_audit_deletion
    -a always,exit -F arch=b32 -S rename -F dir=/var/log/pki -F key=rhcs_audit_deletion
    -a always,exit -F arch=b32 -S rmdir -F dir=/var/log/pki -F key=rhcs_audit_deletion
    -a always,exit -F arch=b32 -S unlinkat -F dir=/var/log/pki -F key=rhcs_audit_deletion
    -a always,exit -F arch=b32 -S renameat -F dir=/var/log/pki -F key=rhcs_audit_deletion
    -a always,exit -F arch=b64 -S unlink -F dir=/var/log/pki -F key=rhcs_audit_deletion
    -a always,exit -F arch=b64 -S rename -F dir=/var/log/pki -F key=rhcs_audit_deletion
    -a always,exit -F arch=b64 -S rmdir -F dir=/var/log/pki -F key=rhcs_audit_deletion
    -a always,exit -F arch=b64 -S unlinkat -F dir=/var/log/pki -F key=rhcs_audit_deletion
    -a always,exit -F arch=b64 -S renameat -F dir=/var/log/pki -F key=rhcs_audit_deletion
  2. Then restart the auditd service:

    # service auditd restart

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.

  1. 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
  2. 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

    For example, if files on the rhcs10-RSA-SubCA instance are cert8.db, key3.db, NHSM-CONN-XCcert8.db, NHSM-CONN-XCkey3.db, and secmod.db, then the configuration file would contain:

    -w /etc/pki/rhcs10-RSA-SubCA/alias/ -p warx -k rhcs_audit_nssdb
    -w /etc/pki/rhcs10-RSA-SubCA/alias/ca.crt -p warx -k rhcs_audit_nssdb
    -w /etc/pki/rhcs10-RSA-SubCA/alias/cert9.db -p warx -k rhcs_audit_nssdb
    -w /etc/pki/rhcs10-RSA-SubCA/alias/key4.db -p warx -k rhcs_audit_nssdb
    -w /etc/pki/rhcs10-RSA-SubCA/alias/NHSM-CONN-XCcert9.db -p warx -k rhcs_audit_nssdb
    -w /etc/pki/rhcs10-RSA-SubCA/alias/NHSM-CONN-XCkey4.db -p warx -k rhcs_audit_nssdb
    -w /etc/pki/rhcs10-RSA-SubCA/alias/pkcs11.txt -p warx -k rhcs_audit_nssdb
  3. Then restart auditd:

    # service auditd restart
Note

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.

  1. Create the /etc/audit/rules.d/rhcs-audit-rhcs_audit_time_change.rules file with the following contents:

    -a always,exit -F arch=b32 -S adjtimex,settimeofday,stime -F key=rhcs_audit_time_change
    -a always,exit -F arch=b64 -S adjtimex,settimeofday -F key=rhcs_audit_time_change
    -a always,exit -F arch=b32 -S clock_settime -F a0=0x0 -F key=rhcs_audit_time_change
    -a always,exit -F arch=b64 -S clock_settime -F a0=0x0 -F key=rhcs_audit_time_change
    -a always,exit -F arch=b32 -S clock_adjtime -F key=rhcs_audit_time_change
    -a always,exit -F arch=b64 -S clock_adjtime -F key=rhcs_audit_time_change
    -w /etc/localtime -p wa -k rhcs_audit_time_change
  2. Then restart auditd:

    # service auditd restart

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.

  1. 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
  2. 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

    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

    Note that access to the RHCS NSS database is already audited under rhcs_audit_nssdb.

Note

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

  1. After adding each audit rule and restarting the auditd service, you can validate that the new rules were added:

    # auditctl -l

    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:

  1. Access the SubCA alias directory:

    # cd /etc/pki/rhcs10-RSA-SubCA/alias/
  2. Check for the audit event:

    # ausearch -k rhcs_audit_nssdb

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.

Important

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

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”
Note

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:

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.

  1. Stop the KRA:

    # pki-server stop rhcs10-RSA-KRA

    OR if using the Nuxwdog watchdog:

    # systemctl stop pki-tomcatd-nuxwdog@rhcs10-KRA.service
  2. Edit the /var/lib/pki/rhcs10-RSA-KRA/conf/server.xml file to configure the Connector name="Secure" section:

    1. Set the enableRevocationCheck parameter to true. Note that enableRevocationCheck is also known as enableOCSP. Only set one and not both.
    2. Make sure you remove these two parameters and their assigned values:

      • ocspResponderURL
      • ocspResponderCertNickname

      For example:

    <Connector name="Secure"
         enableRevocationCheck="true"
         ocspCacheSize="1000"
         ocspMinCacheEntryDuration="60"
         ocspMaxCacheEntryDuration="120"
         ocspTimeout="10"
         ...
    />
  3. Start the KRA:

    # pki-server start rhcs10-RSA-KRA

    OR if using the Nuxwdog watchdog:

    # systemctl start pki-tomcatd-nuxwdog@rhcs10-KRA.service
Note

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.

Important

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.

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.

Note

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
  • 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
  • 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

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.

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.

Important

Back up the original server.xml file before editing, for example to server.xml.orig.

  1. Edit the server.xml file, navigate to the main SSL port’s Connector declaration and find the SSLHostConfig element.
  2. 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">

    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).

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.

Important

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
    Note

    To 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
  • 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
Note

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-SubCA
# pki-server restart rhcs10-RSA-OCSP-rootca
# pki-server restart rhcs10-RSA-OCSP-subca
# pki-server restart rhcs10-RSA-KRA

OR if using the Nuxwdog watchdog:

# systemctl restart rhcs10-RSA-RootCA
# 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-subca.service
# systemctl restart pki-tomcatd-nuxwdog@rhcs10-RSA-KRA.service

…​

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:

    1. 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"
    2. Restart the DS instance:

      # dsctl slapd-CC-RSA-SubCA-LDAP stop
      # dsctl slapd-CC-RSA-SubCA-LDAP start
    3. Verify by listing the enabled ciphers:

      # dsconf -D "cn=Directory Manager" ldap://rhds11.example.com:7389 security ciphers list --enabled
      
      Enter password for cn=Directory Manager on ldap://rhds11.example.com:7389:
      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

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.

Important

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.

Important

Back up the original server.xml file before editing, for example to server.xml.orig.

  1. Edit the server.xml file and search for the certificateVerification= parameter.
  2. Change the parameter value from optional to required:

    certificateVerification=required
  3. 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 of HttpClient call, edit the HttpClient configuration file so that it contains the following:

    clientmode=true
    nickname=<client cert that was issued and imported>
  • 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
    • 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

      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.

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.

Note

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 :

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 a pkidbuser on its internal Directory Server, where the CS instance’s "subsystem certificate" (for example subsystemCert 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

    For example

    certmap rhcs CN=CA Signing Certificate,OU=pki-tomcat-ca,O=pki-tomcat-ca-SD
    		rhcs:CmapLdapAttr seeAlso
    		rhcs:verifyCert on
  • After configuring, restart the Directory Server. For example:

    # dsctl slapd-CC-RSA-SubCA-LDAP restart

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

  1. Stop the CS instance you want to configure:

    # pki-server stop rhcs10-<INSTANCE>

    OR if using the Nuxwdog watchdog:

    # systemctl stop pki-tomcatd-nuxwdog@rhcs10-<INSTANCE>.service
  2. In the CS.cfg, please add the RHCS instance’s subsystem certificate nickname to internaldb.ldapauth.clientCertNickname, and remove the two unused entries:

    internaldb.ldapauth.bindDN
    		internaldb.ldapauth.bindPWPrompt

    As shown below:

internaldb._000=##
		internaldb._001=## Internal Database
		internaldb._002=##
		internaldb.basedn=o=pki-tomcat-ca-SD
		internaldb.database=pki-tomcat-ca
		internaldb.maxConns=15
		internaldb.minConns=3
		internaldb.ldapauth.authtype=SslClientAuth
		internaldb.ldapauth.clientCertNickname=HSM-A:subsystemCert pki-tomcat-ca
		internaldb.ldapconn.host=example.com
		internaldb.ldapconn.port=11636
		internaldb.ldapconn.secureConn=true
  1. Restart the CS instance:

    # pki-server start rhcs10-<INSTANCE>

    OR if using the Nuxwdog watchdog:

    # systemctl start pki-tomcatd-nuxwdog@rhcs10-<INSTANCE>.service
Note

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

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:

  1. 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.
  2. 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.
Important

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

Procedure

  1. Shut down all Certificate System servers. For example:

    # pki-server stop rhcs10-<INSTANCE>

    OR if using the Nuxwdog watchdog:

    # systemctl stop pki-tomcatd-nuxwdog@rhcs10-<INSTANCE>.service
  2. Find out which file the system is basing its policies on:

    # update-crypto-policies --show

    If you followed the installation procedure, you should see "FIPS" as the command output.

  3. 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
  4. Edit the custom policy file, for example:

    # vi /etc/crypto-policies/policies/CC-FIPS.pol

    Make the following modifications, then save the file:

    1. Change the assignment of the groups parameter from:

      group = SECP256R1 SECP384R1 SECP521R1 \ FFDHE-2048 FFDHE-3072 FFDHE-4096 FFDHE-6144 FFDHE-8192

      to

      group = SECP256R1 SECP384R1 SECP521R1
    2. Change the assignment of the key_exchange parameter from:

      key_exchange = ECDHE DHE DHE-RSA PSK DHE-PSK ECDHE-PSK

      to

      key_exchange = ECDHE DHE PSK DHE-PSK ECDHE-PSK
    3. Change the assignment of the min_dh_size parameter from

      min_dh_size = 2048

      to

      min_dh_size = 176384
  5. Register the custom site policy:

    # update-crypto-policies --set CC-FIPS

    The nss.config file will reflect the changes after the update_crypto-policies -set call to the custom policy file.
    The second part of this procedure consists in further required changes to the nss.config file.

  6. Edit the nss.config file, for example:

    # vi /etc/crypto-policies/back-ends/nss.config

    Under the assignment for the config parameter, in the allow= string, insert the following string directly after the dtls-version-min=dtls1.2 setting:

    tls-version-max=tls1.2:dtls-version-max=dtls1.2

    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"
  7. Start or restart any nss-based applications / servers / clients to see the changes apply. For example:

    # pki-server start rhcs10-RSA-RootCA
    # pki-server restart rhcs10-RSA-SubCA

    …​

    OR if using the Nuxwdog Watchdog:

    # systemctl start pki-tomcatd-nuxwdog@rhcs10-RSA-RootCA.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-subca.service
    # systemctl restart pki-tomcatd-nuxwdog@rhcs10-RSA-KRA.service

    …​

7.13.15. Enabling the access banner

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

Verification:

  1. Validate that the banner does not contain invalid characters:

    # pki-server banner-validate -i instance_name
    ---------------
    Banner is valid
    ---------------
  2. To display the currently configured banner:

    # pki-server banner-show -i instance_name

7.13.16. Determining the product version

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

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

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.

Chapter 8. Installing and configuring for ECC

This section highlights differences that you would encounter if you want to do an ECC installation, compared to the RSA instructions (chapter 6&7)

8.1. Prerequisites for ECC installation

Prepare your systems in a similar manner to the procedure described in Chapter 6, Prerequisites for installation, making sure you adapt paths, names, and other configuration for ECC.

For example, we will install the following instances:

  • rhcs10-ECC-RootCA
  • rhcs10-ECC-SubCA
  • rhcs10-ECC-OCSP-rootca
  • rhcs10-ECC-OCSP-subca
  • rhcs10-ECC-KRA
Note

Please note that ECC is not supported for TMS (TPS and TKS).

Create directories for storing pki files

For example, on rhcs10.example.com:

# mkdir -p /root/pki_ecc

Setup the firewall ports for ECC

Please refer to the table in Section 6.8, “Adding ports to the firewall and with SELinux context” for ports used by ECC.

  • You can use the following command to open the ports:

    # firewall-cmd --permanent --add-port={20080/tcp,20443/tcp,1389/tcp,1636/tcp,20009/tcp,20005/tcp,21080/tcp,21443/tcp,8389/tcp,8636/tcp,21009/tcp,21005/tcp,23080/tcp,23443/tcp,2389/tcp,2636/tcp,23009/tcp,23005/tcp,13389/tcp,13636/tcp,22080/tcp,22443/tcp,9389/tcp,9636/tcp,22009/tcp,22005/tcp,14389/tcp,14636/tcp,23009/tcp,23005/tcp,34080/tcp,34443/tcp,4389/tcp,4636/tcp}

    Then reload the firewall in order to apply the newly opened ports:

    # firewall-cmd --reload

Setup SELinux contexts

  • For Red Hat Certificate System ports:

    # for port in 20080 20443 21080 21443 34080 34443 22080 22443 23080 2343; do semanage port -a -t http_port_t -p tcp $port; done
  • For DS ports (replace the port type option http_port_t with ldap_port_t):

    # for port in 1389 1636 8389 8636 2389 2636 13389 13636 9389 9636 14389 14636 4389 4636; do semanage port -a -t ldap_port_t -p tcp $port; done

Install RHDS instances

Install Red Hat Directory Server instances, e.g.:

  • CC-ECC-RootCA-LDAP (LDAP ports: 1389/1636)
  • CC-ECC-SubCA-LDAP (LDAP ports: 8389/8636)
  • CC-ECC-OCSP-rootca-LDAP (LDAP ports: 2389/2636)
  • CC-ECC-OCSP-subca-LDAP (LDAP ports: 9389/9636)
  • CC-ECC-KRA-LDAP (LDAP ports: 4389/4636)
Note

Please note that ECC is not supported for TMS (TPS and TKS).

You can use the example script below to install the DS instances. For example for the ECC RootCA:

echo "Setting up ENV VARIABLES"
export BASEDN='dc=example,dc=com'
export PORT=1389
export INSTANCE_NAME=CC-ECC-RootCA-LDAP
export SECURE_PORT=1636
export PASSWORD=SECret.123

echo "Running dscreate create-template..."
dscreate create-template | sed -e 's/;suffix =/suffix = '$BASEDN'/' \
    -e 's/;instance_name = localhost/instance_name ='$INSTANCE_NAME'/' \
    -e 's/;port = 389/port = '$PORT'/' \
    -e 's/;secure_port = 636/secure_port = '$SECURE_PORT'/' \
    -e 's/;full_machine_name =/full_machine_name =/' \
    -e 's/;create_suffix_entry = False/create_suffix_entry = True/' \
    -e 's/;root_password = Directory_Manager_Password/root_password = '$PASSWORD'/' \
    -e 's/;self_sign_cert = True/self_sign_cert = True/' > /root/pki_ecc/rootca-ldap.cfg; \
    dscreate from-file /root/pki_ecc/rootca-ldap.cfg

Testing CRL publishing

Make sure you use the ECC algorithm in the commands.

  • For example:
# PKCS10Client -d /root/.dogtag/pki_ecc_bootstrap/certs_db -p SECret.123 -a ec -c nistp256 -n "cn=test user1, uid=user1" -o /root/.dogtag/pki_ecc_bootstrap/certs_db/user1.req

Note a ec -c nistp256 in the above command.

8.2. Installing ECC RHCS instances

Please follow the example installation procedure described in Chapter 7, Installing and configuring Red Hat Certificate System, but make sure you adapt for ECC as relevant. We provide the following reference pkispawn files for an ECC installation:

8.2.1. RootCA

Please refer to Section 7.3, “Create and configure the RootCA (Part I)” for the example installation procedure and adapt for an ECC installation.

Important

Once you have installed the RootCA, you will need to Section 8.2.2, “OCSP (RootCA)”. This is so that the role user certificates and the TLS server certificate of the RootCA will bear AIA extensions pointing to the OCSP instance. You can then finish configuring the RootCA by following Section 7.5, “Create and configure the RootCA (Part II)”.

[DEFAULT]
pki_instance_name=rhcs10-ECC-RootCA
pki_https_port=20443
pki_http_port=20080

### Crypto Token
pki_hsm_enable=True
pki_hsm_libfile=/opt/nfast/toolkits/pkcs11/libcknfast.so
pki_hsm_modulename=nfast
pki_token_name=NHSM-CONN-XC
pki_token_password=<YourHSMpassword>

pki_audit_signing_token=NHSM-CONN-XC
pki_audit_signing_key_algorithm=SHA512withEC
pki_audit_signing_key_size=nistp521
pki_audit_signing_key_type=ecc
pki_audit_signing_signing_algorithm=SHA512withEC

pki_subsystem_token=NHSM-CONN-XC
pki_subsystem_key_algorithm=SHA512withEC
pki_subsystem_signing_algorithm=SHA256withEC
pki_subsystem_key_size=nistp521
pki_subsystem_key_type=ecc

pki_sslserver_token=NHSM-CONN-XC
pki_sslserver_key_algorithm=SHA512withEC
pki_sslserver_signing_algorithm=SHA512withEC
pki_sslserver_key_size=nistp521
pki_sslserver_key_type=ecc

### Bootstrap Admin
pki_admin_password=SECret.123
pki_admin_key_type=ecc
pki_admin_key_size=nistp521
pki_admin_key_algorithm=SHA512withEC

### Bootstrap Admin client dir
### by default, if pki_client_dir, pki_client_database_dir,
### and pki_client_admin_cert_p12 are not specified, items will be placed
### under some default directories in /root/.dogtag
pki_client_admin_cert_p12=/opt/pki_ecc/rhcs10-ECC-RootCA/ca_admin_cert.p12
pki_client_database_dir=/opt/pki_ecc/rhcs10-ECC-RootCA/certs_db
pki_client_database_password=SECret.123
pki_client_dir=/opt/pki_ecc/rhcs10-ECC-RootCA
pki_client_pkcs12_password=SECret.123

### Internal LDAP
pki_ds_bind_dn=cn=Directory Manager
pki_ds_ldap_port=1389
pki_ds_ldaps_port=1636
pki_ds_password=SECret.123
pki_ds_remove_data=True
pki_ds_secure_connection=True
pki_ds_secure_connection_ca_pem_file=/opt/pki_ecc/temp-dirsrv-rootca-cert.pem
pki_ds_secure_connection_ca_nickname=DS temp CA certificate

### Security Domain
pki_security_domain_hostname=rhcs10.example.com
pki_security_domain_name=Example-rhcs10-ECC-RootCA
pki_security_domain_password=SECret.123


[Tomcat]
pki_ajp_port=20009
pki_tomcat_server_port=20005


[CA]
pki_import_admin_cert=False
pki_admin_nickname=PKI Bootstrap Administrator for ECC-RootCA
pki_admin_name=caadmin
pki_admin_uid=caadmin
pki_admin_email=caadmin@example.com

pki_ca_signing_token=NHSM-CONN-XC
pki_ca_signing_key_algorithm=SHA512withEC
pki_ca_signing_key_size=nistp384
pki_ca_signing_key_type=ecc
pki_ca_signing_nickname=CA Signing Cert - %(pki_instance_name)s
pki_ca_signing_signing_algorithm=SHA512withEC

pki_ocsp_signing_token=NHSM-CONN-XC
pki_ocsp_signing_key_algorithm=SHA512withEC
pki_ocsp_signing_key_size=nistp384
pki_ocsp_signing_key_type=ecc
pki_ocsp_signing_signing_algorithm=SHA512withEC

pki_ds_hostname=rhds11.example.com
pki_ds_base_dn=dc=ECC-RootCA
pki_ds_database=CC-ECC-RootCA-LDAP
pki_share_db=False

### Enable random serial numbers
pki_random_serial_numbers_enable=True

8.2.2. OCSP (RootCA)

Please refer to Section 7.4, “Create and configure the OCSP instance (RootCA)” for the example installation procedure and adapt for an ECC installation.

Important

Once you are done installing the RootCA’s OCSP, do not forget to proceed with the Section 7.5, “Create and configure the RootCA (Part II)”.

[DEFAULT]
pki_instance_name=rhcs10-ECC-OCSP-rootca
pki_https_port=34443
pki_http_port=34080

### Crypto Token
pki_hsm_enable=True
pki_hsm_libfile=/opt/nfast/toolkits/pkcs11/libcknfast.so
pki_hsm_modulename=nfast
pki_token_name=NHSM-CONN-XC
pki_token_password=<YourHSMpassword>

pki_audit_signing_token=NHSM-CONN-XC
pki_audit_signing_key_algorithm=SHA512withEC
pki_audit_signing_key_size=nistp521
pki_audit_signing_key_type=ecc
pki_audit_signing_signing_algorithm=SHA512withEC

pki_subsystem_token=NHSM-CONN-XC
pki_subsystem_key_algorithm=SHA512withEC
pki_subsystem_signing_algorithm=SHA256withEC
pki_subsystem_key_size=nistp521
pki_subsystem_key_type=ecc

pki_sslserver_token=NHSM-CONN-XC
pki_sslserver_key_algorithm=SHA512withEC
pki_sslserver_signing_algorithm=SHA512withEC
pki_sslserver_key_size=nistp521
pki_sslserver_key_type=ecc

### CA cert chain concatenated in PEM format
pki_cert_chain_path=/opt/pki_ecc/ca-chain.pem

### Bootstrap Admin
pki_admin_password=SECret.123
pki_admin_key_type=ecc
pki_admin_key_size=nistp521
pki_admin_key_algorithm=SHA512withEC

### Bootstrap Admin client dir
pki_client_admin_cert_p12=/opt/pki_ecc/rhcs10-ECC-OCSP-rootca/ocsp_admin_cert.p12
pki_client_database_dir=/opt/pki_ecc/rhcs10-ECC-OCSP-rootca/certs_db
pki_client_database_password=SECret.123
pki_client_database_purge=False
pki_client_dir=/opt/pki_ecc/rhcs10-ECC-OCSP-rootca
pki_client_pkcs12_password=SECret.123

### Internal LDAP
pki_ds_bind_dn=cn=Directory Manager
pki_ds_ldap_port=2389
pki_ds_ldaps_port=2636
pki_ds_password=SECret.123
pki_ds_remove_data=True
pki_ds_secure_connection=True
pki_ds_secure_connection_ca_pem_file=/opt/pki_ecc/ca-chain.pem
pki_ds_secure_connection_ca_nickname=CA Signing Cert - rhcs10-ECC-RootCA

### Security Domain
pki_security_domain_hostname=rhcs10.example.com
pki_security_domain_https_port=20443
pki_security_domain_password=SECret.123
pki_security_domain_user=caadmin


[Tomcat]
pki_ajp_port=34009
pki_tomcat_server_port=34005


[OCSP]
pki_import_admin_cert=False

pki_ocsp_signing_token=NHSM-CONN-XC
pki_ocsp_signing_key_algorithm=SHA512withEC
pki_ocsp_signing_key_size=nistp384
pki_ocsp_signing_key_type=ecc
pki_ocsp_signing_signing_algorithm=SHA512withEC

pki_admin_nickname=PKI Bootstrap Administrator for ECC-OCSP-rootca
pki_admin_name=ocspadmin
pki_admin_uid=ocspadmin
pki_admin_email=ocspadmin@example.com

pki_ds_hostname=rhds11.example.com
pki_ds_base_dn=dc=ECC-OCSP-rootca
pki_ds_database=CC-ECC-OCSP-rootca-LDAP
pki_share_db=False

8.2.3. SubCA

Please refer to Section 7.6, “Create and configure the SubCA (Part I)” for the example installation procedure and adapt for an ECC installation.

IMPORTANT

Once you have installed the SubCA, you will need to Section 8.2.4, “OCSP (SubCA)”. 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. You can then finish configuring the SubCA by following Section 7.8, “Create and configure the SubCA (Part II)”.

[DEFAULT]
pki_instance_name=rhcs10-ECC-SubCA
pki_https_port=21443
pki_http_port=21080

### Crypto Token
pki_hsm_enable=True
pki_hsm_libfile=/opt/nfast/toolkits/pkcs11/libcknfast.so
pki_hsm_modulename=nfast
pki_token_name=NHSM-CONN-XC
pki_token_password=<YourHSMpassword>

pki_audit_signing_token=NHSM-CONN-XC
pki_audit_signing_key_algorithm=SHA512withEC
pki_audit_signing_key_size=nistp521
pki_audit_signing_key_type=ecc
pki_audit_signing_signing_algorithm=SHA512withEC

pki_subsystem_token=NHSM-CONN-XC
pki_subsystem_key_algorithm=SHA512withEC
pki_subsystem_signing_algorithm=SHA256withEC
pki_subsystem_key_size=nistp521
pki_subsystem_key_type=ecc

pki_sslserver_token=NHSM-CONN-XC
pki_sslserver_key_algorithm=SHA512withEC
pki_sslserver_signing_algorithm=SHA512withEC
pki_sslserver_key_size=nistp521
pki_sslserver_key_type=ecc

### CA cert chain concatenated in PEM format
pki_cert_chain_path=/opt/pki_ecc/ca-chain.pem

### Bootstrap Admin
pki_admin_password=SECret.123
pki_admin_key_type=ecc
pki_admin_key_size=nistp521
pki_admin_key_algorithm=SHA512withEC

### Bootstrap Admin client dir
pki_client_admin_cert_p12=/opt/pki_ecc/rhcs10-ECC-SubCA/ca_admin_cert.p12
pki_client_database_dir=/opt/pki_ecc/rhcs10-ECC-SubCA/certs_db
pki_client_database_password=SECret.123
pki_client_dir=/opt/pki_ecc/rhcs10-ECC-SubCA
pki_client_pkcs12_password=SECret.123

### Internal LDAP
pki_ds_bind_dn=cn=Directory Manager
pki_ds_ldap_port=8389
pki_ds_ldaps_port=8636
pki_ds_password=SECret.123
pki_ds_remove_data=True
pki_ds_secure_connection=True
pki_ds_secure_connection_ca_pem_file=/opt/pki_ecc/temp-dirsrv-subca-cert.pem
pki_ds_secure_connection_ca_nickname=DS temp CA certificate


[Tomcat]
pki_ajp_port=21009
pki_tomcat_server_port=21005


[CA]
pki_subordinate=True
pki_issuing_ca_https_port=20443
pki_issuing_ca_hostname=rhcs10.example.com
pki_issuing_ca=https://rhcs10.example.com:20443

### New Security Domain
pki_security_domain_hostname=rhcs10.example.com
pki_security_domain_https_port=20443
pki_security_domain_password=SECret.123
pki_subordinate_create_new_security_domain=True
pki_subordinate_security_domain_name=Example-rhcs10-ECC-SubCA

pki_import_admin_cert=False
pki_admin_nickname=PKI Bootstrap Administrator for ECC-SubCA
pki_admin_name=caadmin
pki_admin_uid=caadmin
pki_admin_email=caadmin@example.com

pki_ca_signing_token=NHSM-CONN-XC
pki_ca_signing_key_algorithm=SHA512withEC
pki_ca_signing_key_size=nistp384
pki_ca_signing_key_type=ecc
pki_ca_signing_nickname=CA Signing Cert - %(pki_instance_name)s
pki_ca_signing_signing_algorithm=SHA512withEC

pki_ocsp_signing_token=NHSM-CONN-XC
pki_ocsp_signing_key_algorithm=SHA512withEC
pki_ocsp_signing_key_size=nistp384
pki_ocsp_signing_key_type=ecc
pki_ocsp_signing_signing_algorithm=SHA512withEC

pki_ds_hostname=rhds11.example.com
pki_ds_base_dn=dc=ECC-SubCA
pki_ds_database=CC-ECC-SubCA-LDAP
pki_share_db=False

### Enable random serial numbers
pki_random_serial_numbers_enable=True

8.2.4. OCSP (SubCA)

Please refer to Section 7.7, “Create and configure the OCSP instance (SubCA)” for the example installation procedure and adapt for an ECC installation.

Important

Once you are done installing the SubCA’s OCSP, do not forget to proceed with the Section 7.8, “Create and configure the SubCA (Part II)”.

[DEFAULT]
pki_instance_name=rhcs10-ECC-OCSP-subca
pki_https_port=22443
pki_http_port=22080

### Crypto Token
pki_hsm_enable=True
pki_hsm_libfile=/opt/nfast/toolkits/pkcs11/libcknfast.so
pki_hsm_modulename=nfast
pki_token_name=NHSM-CONN-XC
pki_token_password=<YourHSMpassword>

pki_audit_signing_token=NHSM-CONN-XC
pki_audit_signing_key_algorithm=SHA512withEC
pki_audit_signing_key_size=nistp521
pki_audit_signing_key_type=ecc
pki_audit_signing_signing_algorithm=SHA512withEC

pki_subsystem_token=NHSM-CONN-XC
pki_subsystem_key_algorithm=SHA512withEC
pki_subsystem_signing_algorithm=SHA256withEC
pki_subsystem_key_size=nistp521
pki_subsystem_key_type=ecc

pki_sslserver_token=NHSM-CONN-XC
pki_sslserver_key_algorithm=SHA512withEC
pki_sslserver_signing_algorithm=SHA512withEC
pki_sslserver_key_size=nistp521
pki_sslserver_key_type=ecc

### CA cert chain concatenated in PEM format
pki_cert_chain_path=/opt/pki_ecc/ca-chain.pem

### Bootstrap Admin
pki_admin_password=SECret.123
pki_admin_key_type=ecc
pki_admin_key_size=nistp521
pki_admin_key_algorithm=SHA512withEC

### Bootstrap Admin client dir
pki_client_admin_cert_p12=/opt/pki_ecc/rhcs10-ECC-OCSP-subca/ocsp_admin_cert.p12
pki_client_database_dir=/opt/pki_ecc/rhcs10-ECC-OCSP-subca/certs_db
pki_client_database_password=SECret.123
pki_client_database_purge=False
pki_client_dir=/opt/pki_ecc/rhcs10-ECC-OCSP-subca
pki_client_pkcs12_password=SECret.123

### Internal LDAP
pki_ds_bind_dn=cn=Directory Manager
pki_ds_ldap_port=9389
pki_ds_ldaps_port=9636
pki_ds_password=SECret.123
pki_ds_remove_data=True
pki_ds_secure_connection=True
pki_ds_secure_connection_ca_pem_file=/opt/pki_ecc/ca-chain.pem
pki_ds_secure_connection_ca_nickname=CA Signing Cert - rhcs10-ECC-SubCA

### Security Domain
pki_security_domain_hostname=rhcs10.example.com
pki_security_domain_https_port=21443
pki_security_domain_password=SECret.123
pki_security_domain_user=caadmin


[Tomcat]
pki_ajp_port=22009
pki_tomcat_server_port=22005


[OCSP]
pki_import_admin_cert=False

pki_ocsp_signing_token=NHSM-CONN-XC
pki_ocsp_signing_key_algorithm=SHA512withEC
pki_ocsp_signing_key_size=nistp384
pki_ocsp_signing_key_type=ecc
pki_ocsp_signing_signing_algorithm=SHA512withEC

pki_admin_nickname=PKI Bootstrap Administrator for ECC-OCSP-subca
pki_admin_name=ocspadmin
pki_admin_uid=ocspadmin
pki_admin_email=ocspadmin@example.com

pki_ds_hostname=rhds11.example.com
pki_ds_base_dn=dc=ECC-OCSP-subca
pki_ds_database=CC-ECC-OCSP-subca-LDAP
pki_share_db=False

8.2.5. KRA

Please refer to Section 7.9, “Create and configure the KRA instance” for the example installation procedure and adapt for an ECC installation.

[DEFAULT]
pki_instance_name=rhcs10-ECC-KRA
pki_https_port=23443
pki_http_port=23080

### Crypto Token
pki_hsm_enable=True
pki_hsm_libfile=/opt/nfast/toolkits/pkcs11/libcknfast.so
pki_hsm_modulename=nfast
pki_token_name=NHSM-CONN-XC
pki_token_password=<YourHSMpassword>

pki_audit_signing_token=NHSM-CONN-XC
pki_audit_signing_key_algorithm=SHA512withEC
pki_audit_signing_key_size=nistp521
pki_audit_signing_key_type=ecc
pki_audit_signing_signing_algorithm=SHA512withEC

pki_subsystem_token=NHSM-CONN-XC
pki_subsystem_key_algorithm=SHA512withEC
pki_subsystem_signing_algorithm=SHA256withEC
pki_subsystem_key_size=nistp521
pki_subsystem_key_type=ecc

pki_sslserver_token=NHSM-CONN-XC
pki_sslserver_key_algorithm=SHA512withEC
pki_sslserver_signing_algorithm=SHA512withEC
pki_sslserver_key_size=nistp521
pki_sslserver_key_type=ecc

### CA cert chain concatenated in PEM format
pki_cert_chain_path=/opt/pki_ecc/ca-chain.pem

### Bootstrap Admin
pki_admin_password=SECret.123
pki_admin_key_type=ecc
pki_admin_key_size=nistp521
pki_admin_key_algorithm=SHA512withEC

### Bootstrap Admin client dir
pki_client_admin_cert_p12=/opt/pki_ecc/rhcs10-ECC-KRA/kra_admin_cert.p12
pki_client_database_dir=/opt/pki_ecc/rhcs10-ECC-KRA/certs_db
pki_client_database_password=SECret.123
pki_client_database_purge=False
pki_client_dir=/opt/pki_ecc/rhcs10-ECC-KRA
pki_client_pkcs12_password=SECret.123

### Internal LDAP
pki_ds_bind_dn=cn=Directory Manager
pki_ds_ldap_port=4389
pki_ds_ldaps_port=4636
pki_ds_password=SECret.123
pki_ds_remove_data=True
pki_ds_secure_connection=True
pki_ds_secure_connection_ca_pem_file=/opt/pki_ecc/ca-chain.pem
pki_ds_secure_connection_ca_nickname=CA Signing Cert - rhcs10-ECC-SubCA

### Security Domain
pki_security_domain_hostname=rhcs10.example.com
pki_security_domain_https_port=21443
pki_security_domain_password=SECret.123
pki_security_domain_user=caadmin


[Tomcat]
pki_ajp_port=23009
pki_tomcat_server_port=23005

[KRA]
pki_import_admin_cert=False

pki_storage_token=NHSM-CONN-XC
pki_storage_key_algorithm=SHA512withEC
pki_storage_key_size=nistp521
pki_storage_key_type=ecc
pki_storage_signing_algorithm=SHA512withEC

pki_transport_token=NHSM-CONN-XC
pki_transport_key_algorithm=SHA512withEC
pki_transport_key_size=nistp521
pki_transport_key_type=ecc
pki_transport_signing_algorithm=SHA512withEC

pki_admin_nickname=PKI Bootstrap Administrator for ECC-KRA
pki_admin_name=kraadmin
pki_admin_uid=kraadmin
pki_admin_email=kraadmin@example.com

pki_ds_hostname=rhds11.example.com
pki_ds_base_dn=dc=ECC-KRA
pki_ds_database=CC-ECC-KRA-LDAP
pki_share_db=False

8.3. Post-installation for ECC

Please follow the post-installation configuration described in Section 7.13, “Post-installation”, but when reaching Section 7.13.11, “Update the ciphers list” make sure you apply the following ECC-specific parameters instead. Configure all your CS instances as relevant based on their role.

Configuring ECC ciphers for CS instances:

  • When a CS instance is acting as a server, add the following ciphers to the SSLHostConfig element in the server.xml file:

    <SSLHostConfig sslProtocol="TLS" protocols="TLSv1.2" certificateVerification="optional" ciphers="ECDHE-ECDSA-AES128-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384">
  • 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:

    TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384
  • 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_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384

    Once you have configured all your CS instances, restart them in order to apply the new ciphers.

Configuring ECC ciphers for DS instances:

By default, a Directory Server instance inherits the ciphers enabled on the OS.

  • You can verify the enabled ciphers using the following command (here, for the SubCA’s DS instance):

    # dsconf -D "cn=Directory Manager" ldap://rhds11.example.com:8389 security ciphers list --enabled
  • If you wish to set the cipher list to match the ciphers of Certificate System (here, for the SubCA’s DS instance):

    # dsconf -D "cn=Directory Manager" ldap://rhds11.example.com:8389 security ciphers set "+TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,+TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,+TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,+"

    Do the same for all other DS instances, then restart the DS instances to apply the ciphers.

This part describes the initial configuration of Red Hat Certificate System.

The primary configuration file for every subsystem is its CS.cfg file. This chapter covers basic information about and rules for editing the CS.cfg file. This chapter also describes some other useful configuration files used by the subsystems, such as password and web services files.

Certificate System servers consist of an Apache Tomcat instance, which contains one or more subsystems. Each subsystem consists of a web application, which handles requests for a specific type of PKI function.

The available subsystems are: CA, KRA, OCSP, TKS, and TPS. Each instance can contain only one of each type of a PKI subsystem.

A subsystem can be installed within a particular instance using the pkispawn command.

9.1.1. Instance-specific information

For instance information for the default instance (pki-tomcat, if you have not specified pki_instance_name when running pkispawn), see Table 2.2, “Tomcat instance information”

Expand
Table 9.1. Certificate server port assignments (default)
Port TypePort NumberNotes

Secure port

8443

Main port used to access PKI services by end-users, agents, and admins over HTTPS.

Insecure port

8080

Used to access the server insecurely for some end-entity functions over HTTP. Used for instance to provide CRLs, which are already signed and therefore need not be encrypted.

AJP port

8009

Used to access the server from a front end Apache proxy server through an AJP connection. Redirects to the HTTPS port.

Tomcat port

8005

Used by the web server.

9.1.2. CA subsystem information

This section contains details about the CA subsystem, which is one of the possible subsystems that can be installed as a web application in a Certificate Server instance.

Expand
Table 9.2. CA subsystem information for the default instance (pki-tomcat)
SettingValue

Main directory

/var/lib/pki/pki-tomcat/ca/

Configuration directory

/var/lib/pki/pki-tomcat/ca/conf/ [a]

Configuration file

/var/lib/pki/pki-tomcat/ca/conf/CS.cfg

Subsystem certificates

CA signing certificate

OCSP signing certificate (for the CA’s internal OCSP service)

TLS server certificate

Audit log signing certificate

Subsystem certificate [b]

Security databases

/var/lib/pki/pki-tomcat/alias/ [c]

Log files

/var/lib/pki/pki-tomcat/ca/logs/ [d]

Install log

/var/log/pki/pki-ca-spawn.date.log

Uninstall log

/var/log/pki/pki-ca-destroy.date.log

Audit logs

/var/log/pki/pki-tomcat/ca/logs/signedAudit/

Profile files

/var/lib/pki/pki-tomcat/ca/profiles/ca/

Email notification templates

/var/lib/pki/pki-tomcat/ca/emails/

Web services files [e]

Agent services: /usr/share/pki/ca/webapps/ca/agent/

Admin services: /usr/share/pki/ca/webapps/ca/admin/

End user services: /usr/share/pki/ca/webapps/ca/ee/

[a] Aliased to /etc/pki/pki-tomcat/ca/
[b] The subsystem certificate is always issued by the security domain so that domain-level operations that require client authentication are based on this subsystem certificate.
[c] Note that all subsystem certificates are stored in the instance security database or the associated HSM, if so dictated at instance creation.
[d] Aliased to /var/lib/pki/pki-tomcat/ca
[e] Instead of instance-specific webapp files as with in the past, there are now webapp descriptors that point to the webapp location. E.g. in /var/lib/pki/rhcs10-RSA-SubCA/conf/Catalina/localhost/ca.xml: <Context docBase="/usr/share/pki/ca/webapps/ca" crossContext="true">

9.1.3. KRA subsystem information

This section contains details about the KRA subsystem, which is one of the possible subsystems that can be installed as a web application in a Certificate Server instance.

Expand
Table 9.3. KRA subsystem information for the default instance (pki-tomcat)
SettingValue

Main directory

/var/lib/pki/pki-tomcat/kra/

Configuration directory

/var/lib/pki/pki-tomcat/kra/conf/ [a]

Configuration file

/var/lib/pki/pki-tomcat/kra/conf/CS.cfg

Subsystem certificates

Transport certificate

Storage certificate

TLS server certificate

Audit log signing certificate

Subsystem certificate [b]

Security databases

/var/lib/pki/pki-tomcat/alias/ [c]

Log files

/var/lib/pki/pki-tomcat/kra/logs/

Install log

/var/log/pki/pki-kra-spawn-date.log

Uninstall log

/var/log/pki/pki-kra-destroy-date.log

Audit logs

/var/log/pki/pki-tomcat/kra/logs/signedAudit/

Web services files [d]

Agent services: /usr/share/pki/kra/webapps/kra/agent/

Admin services: /usr/share/pki/kra/webapps/kra/admin/

[a] Linked to /etc/pki/pki-tomcat/kra/
[b] The subsystem certificate is always issued by the security domain so that domain-level operations that require client authentication are based on this subsystem certificate.
[c] Note that all subsystem certificates are stored in the instance security database or the associated HSM, if so dictated at instance creation.
[d] Instead of instance-specific webapp files as with in the past, there are now webapp descriptors that point to the webapp location. E.g. in /var/lib/pki/rhcs10-RSA-SubCA/conf/Catalina/localhost/ca.xml: <Context docBase="/usr/share/pki/ca/webapps/ca" crossContext="true">

9.1.4. OCSP subsystem information

This section contains details about the OCSP subsystem, which is one of the possible subsystems that can be installed as a web application in a Certificate Server instance.

Expand
Table 9.4. OCSP subsystem information for the default instance (pki-tomcat)
SettingValue

Main directory

/var/lib/pki/pki-tomcat/ocsp/

Configuration directory

/var/lib/pki/pki-tomcat/ocsp/conf/ [a]

Configuration file

/var/lib/pki/pki-tomcat/ocsp/conf/CS.cfg

Subsystem certificates

Transport certificate

Storage certificate

TLS server certificate

Audit log signing certificate

Subsystem certificate [b]

Security databases

/var/lib/pki/pki-tomcat/alias/ [c]

Log files

/var/lib/pki/pki-tomcat/ocsp/logs/

Install log

/var/log/pki/pki-ocsp-spawn-date.log

Uninstall log

/var/log/pki/pki-ocsp-destroy-date.log

Audit logs

/var/log/pki/pki-tomcat/ocsp/logs/signedAudit/

Web services files [d]

Agent services: /var/lib/pki/pki-tomcat/ocsp/webapps/ocsp/agent/

Admin services: /var/lib/pki/pki-tomcat/ocsp/webapps/ocsp/admin/

[a] Linked to /etc/pki/pki-tomcat/ocsp/
[b] The subsystem certificate is always issued by the security domain so that domain-level operations that require client authentication are based on this subsystem certificate.
[c] Note that all subsystem certificates are stored in the instance security database or the associated HSM, if so dictated at instance creation.
[d] Instead of instance-specific webapp files as with in the past, there are now webapp descriptors that point to the webapp location. E.g. in /var/lib/pki/rhcs10-RSA-SubCA/conf/Catalina/localhost/ca.xml: <Context docBase="/usr/share/pki/ca/webapps/ca" crossContext="true">

9.1.5. TKS subsystem information

This section contains details about the TKS subsystem, which is one of the possible subsystems that can be installed as a web application in a Certificate Server instance.

Expand
Table 9.5. Every time a subsystem is created either through the initial installation or creating additional instances with (pki-tomcat)
SettingValue

Main directory

/var/lib/pki/pki-tomcat/tks/

Configuration directory

/var/lib/pki/pki-tomcat/tks/conf/ [a]

Configuration file

/var/lib/pki/pki-tomcat/tks/conf/CS.cfg

Subsystem certificates

Transport certificate

Storage certificate

TLS server certificate

Audit log signing certificate

Subsystem certificate [b]

Security databases

/var/lib/pki/pki-tomcat/alias/ [c]

Log files

/var/lib/pki/pki-tomcat/tks/logs/

Install log

/var/log/pki/pki-tks-spawn-date.log

Uninstall log

/var/log/pki/pki-tks-destroy-date.log

Audit logs

/var/log/pki/pki-tomcat/tks/logs/signedAudit/

Web services files [d]

Agent services: /usr/share/pki/tks/webapps/tks/agent/

Admin services: /usr/share/pki/tks/webapps/tks/admin/

[a] Linked to /etc/pki/pki-tomcat/tks/
[b] The subsystem certificate is always issued by the security domain so that domain-level operations that require client authentication are based on this subsystem certificate.
[c] Note that all subsystem certificates are stored in the instance security database or the associated HSM, if so dictated at instance creation.
[d] Instead of instance-specific webapp files as with in the past, there are now webapp descriptors that point to the webapp location. E.g. in /var/lib/pki/rhcs10-RSA-SubCA/conf/Catalina/localhost/ca.xml: <Context docBase="/usr/share/pki/ca/webapps/ca" crossContext="true">

9.1.6. TPS subsystem information

This section contains details about the TPS subsystem, which is one of the possible subsystems that can be installed as a web application in a Certificate Server instance.

Expand
Table 9.6. TPS subsystem information for the default instance (pki-tomcat)
SettingValue

Main directory

/var/lib/pki/pki-tomcat/tps

Configuration directory

/var/lib/pki/pki-tomcat/tps/conf/ [a]

Configuration file

/var/lib/pki/pki-tomcat/tps/conf/CS.cfg

Subsystem certificates

Transport certificate

Storage certificate

TLS server certificate

Audit log signing certificate

Subsystem certificate [b]

Security databases

/var/lib/pki/pki-tomcat/alias/ [c]

Log files

/var/lib/pki/pki-tomcat/tps/logs/

Install log

/var/log/pki/pki-tps-spawn-date.log

Uninstall log

/var/log/pki/pki-tps-destroy-date.log

Audit logs

/var/log/pki/pki-tomcat/tps/logs/signedAudit/

Web services files [d]

Agent services: /usr/share/pki/tps/webapps/tps/agent/

Admin services: /usr/share/pki/tps/webapps/tps/admin/

[a] Linked to /etc/pki/pki-tomcat/tps/
[b] The subsystem certificate is always issued by the security domain so that domain-level operations that require client authentication are based on this subsystem certificate.
[c] Note that all subsystem certificates are stored in the instance security database or the associated HSM, if so dictated at instance creation.
[d] Instead of instance-specific webapp files as with in the past, there are now webapp descriptors that point to the webapp location. E.g. in /var/lib/pki/rhcs10-RSA-SubCA/conf/Catalina/localhost/ca.xml: <Context docBase="/usr/share/pki/ca/webapps/ca" crossContext="true">

There are some directories used by or common to all Certificate System subsystem instances for general server operations, listed in Table 9.7, “Subsystem file locations”.

Expand
Table 9.7. Subsystem file locations
Directory LocationContents

/var/lib/pki/instance_name

Contains the main instance directory, which is the location for instance-specific directory locations and customized configuration files, profiles, certificate databases, and other files for the subsystem instance.

/usr/share/java/pki

Contains Java archive files shared by the Certificate System subsystems.

/usr/share/pki

Contains common files and templates used to create Certificate System instances. Along with shared files for all subsystems, there are subsystem-specific files in subfolders:

  • pki/ca/ (CA)
  • pki/kra/ (KRA)
  • pki/ocsp/ (OCSP)
  • pki/tks/ (TKS)
  • pki/tps (TPS)

/usr/bin /usr/sbin

Contains the pki command line scripts and tools (Java, native, and security) shared by the Certificate System subsystems.

9.2. CS.cfg files

The runtime properties of a Certificate System subsystem are governed by a set of configuration parameters. These parameters are stored in a file that is read by the server during startup, CS.cfg.

The CS.cfg, an ASCII file, is created and populated with the appropriate configuration parameters when a subsystem is first installed. The way the instance functions are modified is by making changes through the subsystem console, which is the recommended method. The changes made in the administrative console are reflected in the configuration file.

It is also possible to edit the CS.cfg configuration file directly, and in some cases this is the easiest way to manage the subsystem.

9.2.1. Locating the CS.cfg file

Each instance of a Certificate System subsystem has its own configuration file, CS.cfg. The contents of the file for each subsystem instance is different depending on the way the subsystem was configured, additional settings and configuration (like adding new profiles or enabling self-tests), and the type of subsystem.

The CS.cfg file is located in the configuration directory for the instance.

/var/lib/pki/instance_name/subsystem_type/conf

For example:

/var/lib/pki/instance_name/ca/conf

9.2.2. Editing the configuration file

WARNING

Do not edit the configuration file directly without being familiar with the configuration parameters or without being sure that the changes are acceptable to the server. The Certificate System fails to start if the configuration file is modified incorrectly. Incorrect configuration can also result in data loss. Therefore, it is highly recommended to save a backup of the configuration file before making any changes.

To modify the CS.cfg file:

  1. Stop the subsystem instance.

    # pki-server stop instance_name

    OR if using the Nuxwdog watchdog:

    # systemctl stop pki-tomcatd-nuxwdog@instance_name.service

    The configuration file is stored in the cache when the instance is started. Any changes made to the instance through the Console are changed in the cached version of the file. When the server is stopped or restarted, the configuration file stored in the cache is written to disk. Stop the server before editing the configuration file or the changes will be overwritten by the cached version when the server is stopped.

  2. Open the /var/lib/pki/instance_name/subsystem_type/conf directory.
  3. Open the CS.cfg file in a text editor.
  4. Edit the parameters in the file, and save the changes.
  5. Start the subsystem instance.

    # pki-server start instance_name

    OR if using the Nuxwdog watchdog:

    # systemctl start pki-tomcatd-nuxwdog@instance_name.service

9.2.3. Overview of the CS.cfg configuration file

Each subsystem instances has its own main configuration file, CS.cfg, which contains all of the settings for the instance, such as plugins and Java classes for configuration. The parameters and specific settings are different depending on the type of subsystem, but, in a general sense, the CS.cfg file defines these parts of the subsystem instance:

  • Basic subsystem instance information, like its name, port assignments, instance directory, and hostname
  • Logging
  • Plug-ins and methods to authenticate to the instance’s user directory (authorization)
  • The security domain to which the instance belongs
  • Subsystem certificates
  • Other subsystems used by the subsystem instance
  • Database types and instances used by the subsystem
  • Settings for PKI-related tasks, like the key profiles in the TKS, the certificate profiles in the CA, and the required agents for key recovery in the KRA

Many of the configuration parameters (aside from the ones for PKI tasks) are very much the same between the CA, OCSP, KRA, and TKS because they all use a Java-based console, so configuration settings which can be managed in the console have similar parameters.

The CS.cfg file a basic parameter=value format.

#comment
parameter=value

In the CS.cfg file, many of the parameter blocks have descriptive comments, commented out with a pound (#) character. Comments, blank lines, unknown parameters, or misspelled parameters are ignored by the server.

Parameters that configure the same area of the instance tend to be grouped together into the same block.

Example 9.1. Logging settings in the CS.cfg file

log.instance.SignedAudit._000=##
log.instance.SignedAudit._001=## Signed Audit Logging
log.instance.SignedAudit._002=##
log.instance.SignedAudit._003=## To list available audit events:
log.instance.SignedAudit._004=## $ pki-server ca-audit-event-find
log.instance.SignedAudit._005=##
log.instance.SignedAudit._006=## To enable/disable audit event:
log.instance.SignedAudit._007=## $ pki-server ca-audit-event-enable/disable <event name>
log.instance.SignedAudit._008=##
log.instance.SignedAudit.bufferSize=512
log.instance.SignedAudit.enable=true
log.instance.SignedAudit.events=ACCESS_SESSION_ESTABLISH,ACCESS_SESSION_TERMINATED,AUDIT_LOG_SIGNING,AUDIT_LOG_STARTUP,AUTH,AUTHORITY_CONFIG,AUTHZ,CERT_PROFILE_APPROVAL,CERT_REQUEST_PROCESSED,CERT_SIGNING_INFO,CERT_STATUS_CHANGE_REQUEST,CERT_STATUS_CHANGE_REQUEST_PROCESSED,CLIENT_ACCESS_SESSION_ESTABLISH,CLIENT_ACCESS_SESSION_TERMINATED,CMC_REQUEST_RECEIVED,CMC_RESPONSE_SENT,CMC_SIGNED_REQUEST_SIG_VERIFY,CMC_USER_SIGNED_REQUEST_SIG_VERIFY,CONFIG_ACL,CONFIG_AUTH,CONFIG_CERT_PROFILE,CONFIG_CRL_PROFILE,CONFIG_ENCRYPTION,CONFIG_ROLE,CONFIG_SERIAL_NUMBER,CONFIG_SIGNED_AUDIT,CONFIG_TRUSTED_PUBLIC_KEY,CRL_SIGNING_INFO,DELTA_CRL_GENERATION,FULL_CRL_GENERATION,KEY_GEN_ASYMMETRIC,LOG_PATH_CHANGE,OCSP_GENERATION,OCSP_SIGNING_INFO,PROFILE_CERT_REQUEST,PROOF_OF_POSSESSION,RANDOM_GENERATION,ROLE_ASSUME,SCHEDULE_CRL_GENERATION,SECURITY_DOMAIN_UPDATE,SELFTESTS_EXECUTION,SERVER_SIDE_KEYGEN_REQUEST,SERVER_SIDE_KEYGEN_REQUEST_PROCESSED
log.instance.SignedAudit.expirationTime=0
log.instance.SignedAudit.fileName=/var/lib/pki/rhcs10-ECC-SubCA/logs/ca/signedAudit/ca_audit
log.instance.SignedAudit.filters.CMC_SIGNED_REQUEST_SIG_VERIFY=(Outcome=Failure)
log.instance.SignedAudit.filters.CMC_USER_SIGNED_REQUEST_SIG_VERIFY=(Outcome=Failure)
log.instance.SignedAudit.filters.DELTA_CRL_GENERATION=(Outcome=Failure)
log.instance.SignedAudit.filters.FULL_CRL_GENERATION=(Outcome=Failure)
log.instance.SignedAudit.filters.OCSP_GENERATION=(Outcome=Failure)
log.instance.SignedAudit.filters.RANDOM_GENERATION=(Outcome=Failure)
log.instance.SignedAudit.flushInterval=5
log.instance.SignedAudit.level=1
log.instance.SignedAudit.logSigning=true
log.instance.SignedAudit.maxFileSize=2000
log.instance.SignedAudit.pluginName=file
log.instance.SignedAudit.rolloverInterval=2592000
log.instance.SignedAudit.signedAudit=_002=##
log.instance.SignedAudit.signedAuditCertNickname=NHSM-CONN-XC:auditSigningCert cert-rhcs10-ECC-SubCA CA
log.instance.SignedAudit.type=signedAudit

Some areas of functionality are implemented through plugins, such as self-tests, jobs, and authorization to access the subsystem. For those parameters, the plugin instance has a unique identifier (since there can be multiple instances of even the same plugin called for a subsystem), the implementation plugin name, and the Java class.

Example 9.2. Subsystem authorization settings

authz.impl._000=##
authz.impl._001=## authorization manager implementations
authz.impl._002=##
authz.impl.BasicAclAuthz.class=com.netscape.cms.authorization.BasicAclAuthz
authz.instance.BasicAclAuthz.pluginName=BasicAclAuthz
NOTE

The values for configuration parameters must be properly formatted, so they must obey two rules:

  • The values that need to be localized must be in UTF8 characters.
  • The CS.cfg file supports forward slashes (/) in parameter values. If a back slash (\) is required in a value, it must be escaped with a back slash, meaning that two back slashes in a row must be used.

The following sections are snapshots of CS.cfg file settings and parameters. These are not exhaustive references or examples of CS.cfg file parameters. Also, the parameters available and used in each subsystem configuration file is very different, although there are similarities.

9.2.3.1. Basic subsystem settings

Basic settings are specific to the instance itself, without directly relating to the functionality or behavior of the subsystem. This includes settings for the instance name, root directory, the user ID for the process, and port numbers. Many of the settings assigned when the instance is first installed or configured are prefaced with pkispawn.

Example 9.3. Basic Instance Parameters for the CA: pkispawn file ca.cfg

[DEFAULT]
pki_admin_password=Secret.123
pki_client_pkcs12_password=Secret.123
pki_ds_password=Secret.123
# Optionally keep client databases
pki_client_database_purge=False
# Separated CA instance name and ports
pki_instance_name=pki-ca
 pki_http_port=18080
pki_https_port=18443
# This Separated CA instance will be its own security domain
pki_security_domain_https_port=18443

[Tomcat]
# Separated CA Tomcat ports
pki_ajp_port=18009
pki_tomcat_server_port=18005
Important

While information like the port settings is included in the CS.cfg file, it is not set in the CS.cfg. The server configuration is set in the server.xml file.

The ports in CS.cfg and server.xml must match for a working RHCS instance.

9.2.3.2. Logging settings

There are several different types of logs that can be configured, depending on the type of subsystem. Each type of log has its own configuration entry in the CS.cfg file.

For example, the CA has this entry for signed audit logs, which allows log rotation, buffered logging, log signing, and log levels, among other settings:

log.instance.SignedAudit._000=##
log.instance.SignedAudit._001=## Signed Audit Logging
log.instance.SignedAudit._002=##
log.instance.SignedAudit._003=## To list available audit events:
log.instance.SignedAudit._004=## $ pki-server ca-audit-event-find
log.instance.SignedAudit._005=##
log.instance.SignedAudit._006=## To enable/disable audit event:
log.instance.SignedAudit._007=## $ pki-server ca-audit-event-enable/disable <event name>
log.instance.SignedAudit._008=##
log.instance.SignedAudit.bufferSize=512
log.instance.SignedAudit.enable=true
log.instance.SignedAudit.events=ACCESS_SESSION_ESTABLISH,ACCESS_SESSION_TERMINATED,AUDIT_LOG_SIGNING,AUDIT_LOG_STARTUP,AUTH,AUTHORITY_CONFIG,AUTHZ,CERT_PROFILE_APPROVAL,CERT_REQUEST_PROCESSED,CERT_SIGNING_INFO,CERT_STATUS_CHANGE_REQUEST,CERT_STATUS_CHANGE_REQUEST_PROCESSED,CLIENT_ACCESS_SESSION_ESTABLISH,CLIENT_ACCESS_SESSION_TERMINATED,CMC_REQUEST_RECEIVED,CMC_RESPONSE_SENT,CMC_SIGNED_REQUEST_SIG_VERIFY,CMC_USER_SIGNED_REQUEST_SIG_VERIFY,CONFIG_ACL,CONFIG_AUTH,CONFIG_CERT_PROFILE,CONFIG_CRL_PROFILE,CONFIG_ENCRYPTION,CONFIG_ROLE,CONFIG_SERIAL_NUMBER,CONFIG_SIGNED_AUDIT,CONFIG_TRUSTED_PUBLIC_KEY,CRL_SIGNING_INFO,DELTA_CRL_GENERATION,FULL_CRL_GENERATION,KEY_GEN_ASYMMETRIC,LOG_PATH_CHANGE,OCSP_GENERATION,OCSP_SIGNING_INFO,PROFILE_CERT_REQUEST,PROOF_OF_POSSESSION,RANDOM_GENERATION,ROLE_ASSUME,SCHEDULE_CRL_GENERATION,SECURITY_DOMAIN_UPDATE,SELFTESTS_EXECUTION,SERVER_SIDE_KEYGEN_REQUEST,SERVER_SIDE_KEYGEN_REQUEST_PROCESSED
log.instance.SignedAudit.expirationTime=0
log.instance.SignedAudit.fileName=/var/lib/pki/rhcs10-ECC-SubCA/logs/ca/signedAudit/ca_audit
log.instance.SignedAudit.filters.CMC_SIGNED_REQUEST_SIG_VERIFY=(Outcome=Failure)
log.instance.SignedAudit.filters.CMC_USER_SIGNED_REQUEST_SIG_VERIFY=(Outcome=Failure)
log.instance.SignedAudit.filters.DELTA_CRL_GENERATION=(Outcome=Failure)
log.instance.SignedAudit.filters.FULL_CRL_GENERATION=(Outcome=Failure)
log.instance.SignedAudit.filters.OCSP_GENERATION=(Outcome=Failure)
log.instance.SignedAudit.filters.RANDOM_GENERATION=(Outcome=Failure)
log.instance.SignedAudit.flushInterval=5
log.instance.SignedAudit.level=1
log.instance.SignedAudit.logSigning=true
log.instance.SignedAudit.maxFileSize=2000
log.instance.SignedAudit.pluginName=file
log.instance.SignedAudit.rolloverInterval=2592000
log.instance.SignedAudit.signedAudit=_002=##
log.instance.SignedAudit.signedAuditCertNickname=NHSM-CONN-XC:auditSigningCert cert-rhcs10-ECC-SubCA CA
log.instance.SignedAudit.type=signedAudit

For more information about these parameters and their values, see Section 13.1, “Log settings”. As long as audit logging is enabled, these values do not affect compliance.

9.2.3.3. Authentication and authorization settings

The CS.cfg file sets how users are identified to access a subsystem instance (authentication) and what actions are approved (authorization) for each authenticated user.

A CS subsystem uses authentication plugins to define the method for logging into the subsystem.

The following example shows an authentication instance named SharedToken that instantiates a JAVA plugin named SharedSecret.

auths.impl.SharedToken.class=com.netscape.cms.authentication.SharedSecret
auths.instance.SharedToken.pluginName=SharedToken
auths.instance.SharedToken.dnpattern=
auths.instance.SharedToken.ldap.basedn=ou=People,dc=example,dc=org
auths.instance.SharedToken.ldap.ldapauth.authtype=BasicAuth
auths.instance.SharedToken.ldap.ldapauth.bindDN=cn=Directory Manager
auths.instance.SharedToken.ldap.ldapauth.bindPWPrompt=Rule SharedToken
auths.instance.SharedToken.ldap.ldapauth.clientCertNickname=
auths.instance.SharedToken.ldap.ldapconn.host=server.example.com
auths.instance.SharedToken.ldap.ldapconn.port=636
auths.instance.SharedToken.ldap.ldapconn.secureConn=true
auths.instance.SharedToken.ldap.ldapconn.version=3
auths.instance.SharedToken.ldap.maxConns=
auths.instance.SharedToken.ldap.minConns=
auths.instance.SharedToken.ldapByteAttributes=
auths.instance.SharedToken.ldapStringAttributes=
auths.instance.SharedToken.shrTokAttr=shrTok

For some authorization settings, it is possible to select an authorization method that uses an LDAP database to store user entries, in which case the database settings are configured along with the plugin as shown below.

authz.impl.DirAclAuthz.class=com.netscape.cms.authorization.DirAclAuthz
authz.instance.DirAclAuthz.ldap=internaldb
authz.instance.DirAclAuthz.pluginName=DirAclAuthz
authz.instance.DirAclAuthz.ldap._000=##
authz.instance.DirAclAuthz.ldap._001=## Internal Database
authz.instance.DirAclAuthz.ldap._002=##
authz.instance.DirAclAuthz.ldap.basedn=dc=server.example.com-pki-ca
authz.instance.DirAclAuthz.ldap.database=server.example.com-pki-ca
authz.instance.DirAclAuthz.ldap.maxConns=15
authz.instance.DirAclAuthz.ldap.minConns=3
authz.instance.DirAclAuthz.ldap.ldapauth.authtype=SslClientAuth
authz.instance.DirAclAuthz.ldap.ldapauth.bindDN=cn=Directory Manager
authz.instance.DirAclAuthz.ldap.ldapauth.bindPWPrompt=Internal LDAP Database
authz.instance.DirAclAuthz.ldap.ldapauth.clientCertNickname=
authz.instance.DirAclAuthz.ldap.ldapconn.host=localhost
authz.instance.DirAclAuthz.ldap.ldapconn.port=11636
authz.instance.DirAclAuthz.ldap.ldapconn.secureConn=true
authz.instance.DirAclAuthz.ldap.multipleSuffix.enable=false

For more information on securely configuring LDAP and an explanation of parameters, refer to Section 7.13.13, “Enabling TLS mutual authentication from CS to DS”. The parameters paths differ than what is shown there, but the same names and values are allowed in both places.

The CA also has to have a mechanism for approving user requests. As with configuring authorization, this is done by identifying the appropriate authentication plugin and configuring an instance for it:

auths.impl.AgentCertAuth.class=com.netscape.cms.authentication.AgentCertAuthentication
auths.instance.AgentCertAuth.agentGroup=Certificate Manager Agents
auths.instance.AgentCertAuth.pluginName=AgentCertAuth
9.2.3.4. Subsystem certificate settings

Several of the subsystems have entries for each subsystem certificate in the configuration file.

ca.sslserver.cert=MIIDmDCCAoCgAwIBAgIBAzANBgkqhkiG9w0BAQUFADBAMR4wHAYDVQQKExVSZWR...
ca.sslserver.certreq=MIICizCCAXMCAQAwRjEeMBwGA1UEChMVUmVkYnVkY29tcHV0ZXIgRG9tYWluMSQwIgYDV...
ca.sslserver.nickname=Server-Cert cert-pki-ca
ca.sslserver.tokenname=Internal Key Storage Token
9.2.3.5. Settings for required subsystems

At a minimum, each subsystem depends on a CA, which means that the CA (and any other required subsystem) has to be configured in the subsystem’s settings. Any connection to another subsystem is prefaced by conn. and then the subsystem type and number. The following is an example “conn” section from a TPS instance’s CS.cfg:

conn.ca1.clientNickname=subsystemCert cert-pki-tps
conn.ca1.hostadminport=server.example.com:8443
conn.ca1.hostagentport=server.example.com:8443
conn.ca1.hostport=server.example.com:9443
conn.ca1.keepAlive=true
conn.ca1.retryConnect=3
conn.ca1.servlet.enrollment=/ca/ee/ca/profileSubmitSSLClient
conn.ca1.servlet.renewal=/ca/ee/ca/profileSubmitSSLClient
conn.ca1.servlet.revoke=/ca/subsystem/ca/doRevoke
conn.ca1.servlet.unrevoke=/ca/subsystem/ca/doUnrevoke
conn.ca1.timeout=100
9.2.3.6. Database settings

All of the subsystems use an LDAP directory to store their information. This internal database is configured in the internaldb parameters. Here is an example of the internaldb section from a CA’s CS.cfg:

internaldb._000=##
internaldb._000=##
internaldb._001=## Internal Database
internaldb._002=##
internaldb.basedn=o=pki-tomcat-ca-SD
internaldb.database=pki-tomcat-ca
internaldb.maxConns=15
internaldb.minConns=3
internaldb.ldapauth.authtype=SslClientAuth
internaldb.ldapauth.clientCertNickname=HSM-A:subsystemCert pki-tomcat-ca
internaldb.ldapconn.host=example.com
internaldb.ldapconn.port=11636
internaldb.ldapconn.secureConn=true
internaldb.multipleSuffix.enable=false

In addition to the internaldb parameter, TPS introduces the tokendb parameters to contain more configuration settings relating to the smartcard tokens. For further information on securely configuring LDAP and an explanation of parameters, refer to Section 7.13.13, “Enabling TLS mutual authentication from CS to DS”. No additional configuration is necessary outside of what is done as part Section 7.13.13, “Enabling TLS mutual authentication from CS to DS”.

Part of the enrollment process includes publishing the issued certificate to any directories or files. This, essentially, closes out the initial certificate request. However, publishing a certificate to an external network can significantly slow down the issuance process -which leaves the request open.

To avoid this situation, administrators can enable a publishing queue. The publishing queue separates the publishing operation (which may involve an external LDAP directory) from the request and enrollment operations, which uses a separate request queue. The request queue is updated immediately to show that the enrollment process is complete, while the publishing queue sends the information at the pace of the network traffic.

The publishing queue sets a defined, limited number of threads that publish generated certificates, rather than opening a new thread for each approved certificate.

Procedure

Enabling the publishing queue by editing the CS.cfg file allows administrators to set other options for publishing, like the number of threads to use for publishing operations and the queue page size.

  1. Stop the CA server, so that you can edit the configuration files.

    # systemctl stop pki-tomcatd-nuxwdog@instance_name.service
  2. Open the CA’s CS.cfg file.

    # vim /var/lib/pki/instance_name/ca/conf/CS.cfg
  3. Set the ca.publish.queue.enable to true. If the parameter is not present, then add a line as follows:

    ca.publish.queue.enable=true
  4. Set other related publishing queue parameters:

    • ca.publish.queue.maxNumberOfThreads sets the maximum number of threads that can be opened for publishing operations. The default is 3.
    • ca.publish.queue.priorityLevel sets the priority for publishing operations. The priority value ranges from -2 (lowest priority) to 2 (highest priority). Zero (0) is normal priority and is also the default.
    • ca.publish.queue.pageSize sets the maximum number of requests that can be stored in the publishing queue page. The default is 40.
    • ca.publish.queue.saveStatus sets the interval to save its status every specified number of publishing operations. This allows the publishing queue to be recovered if the CA is restarted or crashes. The default is 200, but any non-zero number will recover the queue when the CA restarts. Setting this parameter to 0 disables queue recovery.

      ca.publish.queue.maxNumberOfThreads=1
      	ca.publish.queue.priorityLevel=0
      	ca.publish.queue.pageSize=100
      	ca.publish.queue.saveStatus=200
      TIP

      Setting ca.publish.queue.enable to false and ca.publish.queue.maxNumberOfThreads to 0 disables both the publishing queue and using separate threads for publishing issued certificates.

  5. Restart the CA server.

    # systemctl start pki-tomcatd-nuxwdog@instance_name.service
9.2.3.8. Settings for PKI tasks

The CS.cfg file is used to configure the PKI tasks for every subsystem. The parameters are different for every single subsystem, without any overlap.

For example, the KRA has settings for a required number of agents to recover a key.

kra.noOfRequiredRecoveryAgents=1

Review the CS.cfg file for each subsystem to become familiar with its PKI task settings; the comments in the file are a decent guide for learning what the different parameters are.

  • The CA configuration file lists all of the certificate profiles and policy settings, as well as rules for generating CRLs.
  • The TPS configures different token operations.
  • The TKS lists profiles for deriving keys from different key types.
  • The OCSP sets key information for different key sets.

In certificates issued by the Certificate System, DNs identify the entity that owns the certificate. In all cases, if the Certificate System is connected with a Directory Server, the format of the DNs in the certificates should match the format of the DNs in the directory. It is not necessary that the names match exactly; certificate mapping allows the subject DN in a certificate to be different from the one in the directory.

In the Certificate System, the DN is based on the components, or attributes, defined in the X.509 standard. Table 9.8, “Allowed characters for value types” lists the attributes supported by default. The set of attributes is extensible.

Expand
Table 9.8. Allowed characters for value types
AttributeValue TypeObject Identifier

cn

DirectoryString

2.5.4.3

ou

DirectoryString

2.5.4.11

o

DirectoryString

2.5.4.10

c

PrintableString , two-character

2.5.4.6

l

DirectoryString

2.5.4.7

st

DirectoryString

2.5.4.8

street

DirectoryString

2.5.4.9

title

DirectoryString

2.5.4.12

uid

DirectoryString

0.9.2342.19200300.100.1.1

mail

IA5String

1.2.840.113549.1.9.1

dc

IA5String

0.9.2342.19200300.100.1.2.25

serialnumber

PrintableString

2.5.4.5

unstructuredname

IA5String

1.2.840.113549.1.9.2

unstructuredaddress

PrintableString

1.2.840.113549.1.9.8

By default, the Certificate System supports the attributes identified in Table 9.8, “Allowed characters for value types”. This list of supported attributes can be extended by creating or adding new attributes. The syntax for adding additional X.500Name attributes, or components, is as follows:

X500Name.NEW_ATTRNAME.oid=n.n.n.n
X500Name.NEW_ATTRNAME.class=string_to_DER_value_converter_class

The value converter class converts a string to an ASN.1 value; this class must implement the netscape.security.x509.AVAValueConverter interface. The string-to-value converter class can be one of the following:

  • netscape.security.x509.PrintableConverter converts a string to a PrintableString value. The string must have only printable characters.
  • netscape.security.x509.IA5StringConverter converts a string to an IA5String value. The string must have only IA5String characters.
  • netscape.security.x509.DirStrConverter converts a string to a DirectoryString. The string is expected to be in DirectoryString format according to RFC 2253.
  • netscape.security.x509.GenericValueConverter converts a string character by character in the following order, from the smallest characterset to the largest:

    • PrintableString
    • IA5String
    • BMPString
    • Universal String

An attribute entry looks like the following:

X500Name.MY_ATTR.oid=1.2.3.4.5.6
X500Name.MY_ATTR.class=netscape.security.x509.DirStrConverter
9.2.3.9.1. Adding new or custom attributes

To add a new or proprietary attribute to the Certificate System schema, do the following:

  1. Stop the Certificate Manager.

    # systemctl stop pki-tomcatd-nuxwdog@instance_name.service
  2. Open the /var/lib/pki/cs_instance/conf/ directory.
  3. Open the configuration file, CS.cfg.
  4. Add the new attributes to the configuration file.

    For example, to add three proprietary attributes, MYATTR1 that is a DirectoryString, MYATTR2 that is an IA5String, and MYATTR3 that is a PrintableString, add the following lines at the end of the configuration file:

    X500Name.attr.MYATTR1.oid=1.2.3.4.5.6
    X500Name.attr.MYATTR1.class=netscape.security.x509.DirStrConverter
    X500Name.attr.MYATTR2.oid=11.22.33.44.55.66
    X500Name.attr.MYATTR2.class=netscape.security.x509.IA5StringConverter
    X500Name.attr.MYATTR3.oid=111.222.333.444.555.666
    X500Name.attr.MYATTR3.class=netscape.security.x509.PrintableConverter
  5. Save the changes, and close the file.
  6. Restart the Certificate Manager.

    # systemctl start pki-tomcatd-nuxwdog@instance_name.service
  7. Reload the enrollment page and verify the changes; the new attributes should show up in the form.
  8. To verify that the new attributes are in effect, request a certificate using the manual enrollment form.

    Enter values for the new attributes so that it can be verified that they appear in the certificate subject names. For example, enter the following values for the new attributes and look for them in the subject name:

    MYATTR1: a_value
    MYATTR2: a.Value
    MYATTR3: aValue
    cn: John Doe
    o: Example Corporation
  9. Open the agent services page, and approve the request.
  10. When the certificate is issued, check the subject name. The certificate should show the new attribute values in the subject name.
9.2.3.9.2. Changing the DER-encoding order

It is possible to change the DER-encoding order of a DirectoryString, so that the string is configurable since different clients support different encodings.

The syntax for changing the DER-encoding order of a DirectoryString is as follows:

X500Name.directoryStringEncodingOrder=encoding_list_separated_by_commas

The possible encoding values are as follows:

  • PrintableString
  • IA5String
  • UniversalString
  • BMPString
  • UTF8String

For example, the DER-encoding ordered can be listed as follows:

X500Name.directoryStringEncodingOrder=PrintableString,BMPString

To change the DirectoryString encoding, do the following:

  1. Stop the Certificate Manager.

    # systemctl stop pki-tomcatd-nuxwdog@instance_name.service
  2. Open the /var/lib/pki/cs_instance/conf/ directory.
  3. Open the CS.cfg configuration file.
  4. Add the encoding order to the configuration file.

    For example, to specify two encoding values, PrintableString and UniversalString, and the encoding order is PrintableString first and UniversalString next, add the following line at the end of the configuration file:

    X500Name.directoryStringEncodingOrder=PrintableString,UniversalString
  5. Save the changes, and close the file.
  6. Start the Certificate Manager.

    # systemctl start pki-tomcatd-nuxwdog@instance_name.service
  7. To verify that the encoding orders are in effect, enroll for a certificate using the manual enrollment form. Use John_Doe for the cn.
  8. Open the agent services page, and approve the request.
  9. When the certificate is issued, use the dumpasn1 tool to examine the encoding of the certificate.

    The cn component of the subject name should be encoded as a UniversalString.

  10. Create and submit a new request using John Smith for the cn.

    The cn component of the subject name should be encoded as a PrintableString.

A Certificate Manager uses the key pair corresponding to its OCSP signing certificate for signing certificates and certificate revocation lists (CRLs). To use a different key pair to sign the CRLs that the Certificate Manager generates, then a CRL signing certificate can be created. The Certificate Manager’s CRL signing certificate must be signed or issued by itself.

To enable a Certificate Manager to sign CRLs with a different key pair, do the following:

  1. Request and install a CRL signing certificate for the Certificate Manager using CMC. For details about requesting a system certificate, see Section 5.3.2.1 Obtaining system and server certificates in the Administration Guide (Common Criteria Edition).

    Note that the profile used to obtain the certificate must use the keyUsageExtDefaultImpl class id and the corresponding keyUsageCrlSign parameter set to true:

    policyset.userCertSet.6.default.class_id=keyUsageExtDefaultImpl
    policyset.userCertSet.6.default.params.keyUsageCrlSign=true
  2. After you have generated the CRL signing certificate, install the certificate in the Certificate Manager’s crypto module database.

  3. Stop the Certificate Manager.

    # pki-server stop instance_name
  4. Update the Certificate Manager’s configuration to recognize the new key pair and certificate.

    1. Change to the Certificate Manager instance configuration directory.

      # cd /var/lib/pki/instance-name/ca/conf/
    2. Open the CS.cfg file and add the following lines:

      ca.crl_signing.cacertnickname=nickname cert-instance_ID
      ca.crl_signing.defaultSigningAlgorithm=signing_algorithm
      ca.crl_signing.tokenname=token_name

      nickname is the name assigned to the CRL signing certificate.

      instance_ID is the name of the Certificate Manager instance.

      If the installed CA is a RSA-based CA, signing_algorithm can be SHA256withRSA, SHA384withRSA, or SHA512withRSA. If the installed CA is an EC-based CA, signing_algorithm can be SHA256withEC, SHA384withEC, SHA512withEC.

      token_name is the name of the token used for generating the key pair and the certificate. If the internal/software token is used, use Internal Key Storage Token as the value.

      For example, the entries might look like this:

      ca.crl_signing.cacertnickname=crlSigningCert cert-pki-ca
      ca.crl_signing.defaultSigningAlgorithm=SHA512withRSA
      ca.crl_signing.tokenname=Internal Key Storage Token
    3. Save the changes, and close the file.
  5. Restart the Certificate Manager.

    # pki-server restart instance_name

    Now the Certificate Manager is ready to use the CRL signing certificate to sign the CRLs it generates.

The CRL cache is a simple mechanism that allows cert revocation information to be taken from a collection of revocation information maintained in memory. For best performance, it is recommended that this feature be enabled, which already represents the default behavior. The following configuration information (which is the default) is presented for information purposes or if changes are desired.

  1. Stop the CA server.

    systemctl stop pki-tomcatd-nuxwdog@instance_name.service*
  2. Open the CA configuration directory.

    # cd /var/lib/instance_name/conf/
  3. Edit the CS.cfg file, setting the enableCRLCache and enableCacheRecovery parameters to true:

    ca.crl.MasterCRL.enableCRLCache=true
    ca.crl.MasterCRL.enableCacheRecovery=true
  4. Start the CA server.

    # systemctl start pki-tomcatd-nuxwdog@instance_name.service

The following describes how to configure the CRL system flexibly to reflect desired behavior. The goal is to configure CRL updates according to some schedule of two types. One type allows for a list of explicit times and the other consists of a length of time interval between updates. There is also a hybrid scenario where both are enabled to account for drift. The Note entry just below actually represents the default out of the box scenario.

The default scenario is listed as follows:

ca.crl.MasterCRL.updateSchema=3
ca.crl.MasterCRL.enableDailyUpdates=true
ca.crl.MasterCRL.enableUpdateInterval=true
ca.crl.MasterCRL.autoUpdateInterval=240
ca.crl.MasterCRL.dailyUpdates=1:00
ca.crl.MasterCRL.nextUpdateGracePeriod=0

Deviate from this only when a more detailed and specific update schedule is desired. The rest of the section will talk about how that is accomplished.

Configuring the settings for full and delta CRLs in the CS.cfg file involves editing parameters.

Expand
Table 9.9. CRL extended interval parameters
ParameterDescriptionAccepted Values

updateSchema

Sets the ratio for how many delta CRLs are generated per full CRL

An integer value

enableDailyUpdates

Enables and disables setting CRL updates based on set times

true or false

enableUpdateInterval

Enables and disables setting CRL updates based on set intervals

true or false

dailyUpdates

Sets the times the CRLs should be updated

A comma-delimited list of times

autoUpdateInterval

Sets the interval in minutes to update the CRLs

An integer value

autoUpdateInterval.effectiveAtStart

Allows the system to attempt to use the new value of auto update immediately instead of waiting for the currently scheduled nextUpdate time

true or false

nextUpdateGracePeriod

Adds the time in minutes to the CRL validity period to ensure that CRLs remain valid throughout the publishing or replication period

An integer value

refreshInSec

Sets the periodicity in seconds of the thread on the clone OCSP to check LDAP for any updates of the CRL

An integer value

Important

The autoUpdateInterval.effectiveAtStart parameter requires a system restart in order for a new value to apply. The default value of this parameter is false, it should only be changed by users who are sure of what they are doing.

Procedure: How to configure CRL update intervals in CS.cfg

  1. Stop the CA server.

    # systemctl stop pki-tomcatd-nuxwdog@instance_name.service
  2. Change to the CA configuration directory.

    # cd /var/lib/instance_name/conf/
  3. Edit the CS.cfg file, and add the following line to set the update interval:

    ca.crl.MasterCRL.updateSchema=3

    The default interval is 1, meaning a full CRL is generated every time a CRL is generated. The updateSchema interval can be set to any integer.

  4. Set the update frequency, either by specifying a cyclical interval or set times for the updates to occur:

    • Specify set times by enabling the enableDailyUpdates parameter, and add the desired times to the dailyUpdates parameter:

      ca.crl.MasterCRL.enableDailyUpdates=true
      	ca.crl.MasterCRL.enableUpdateInterval=false
      	ca.crl.MasterCRL.dailyUpdates=0:50,04:55,06:55

      This field sets a daily time when the CRL should be updated. To specify multiple times, enter a comma-separated list of times, such as 01:50,04:55,06:55. To enter a schedule for multiple days, enter a comma-separated list to set the times within the same day, and then a semicolon separated list to identify times for different days. For example, set 01:50,04:55,06:55;02:00,05:00,17:00 to configure revocation on Day 1 of the cycle at 1:50am, 4:55am, and 6:55am and then Day 2 at 2am, 5am, and 5pm.

      Specify intervals by enabling the enableUpdateInterval parameter, and add the required interval in minutes to the autoUpdateInterval parameter:

      ca.crl.MasterCRL.enableDailyUpdates=false
      	ca.crl.MasterCRL.enableUpdateInterval=true
      	ca.crl.MasterCRL.autoUpdateInterval=240
  5. Set the following parameters depending on your environment:

    • If you run a CA without an OCSP subsystem, set:

      ca.crl.MasterCRL.nextUpdateGracePeriod=0
    • If you run a CA with an OCSP subsystem, set:

      ca.crl.MasterCRL.nextUpdateGracePeriod=time_in_minutes

      The ca.crl.MasterCRL.nextUpdateGracePeriod parameter defines the time in minutes, and the value must be big enough to enable the CA to propagate the new CRL to the OCSP. You must set the parameter to a non-zero value.

      If you additionally have OCSP clones in your environment, also set:

      ocsp.store.defStore.refreshInSec=time_in_seconds

      The ocsp.store.defStore.refreshInSec parameter sets the frequency in seconds with which the clone OCSP instances are informed of CRL updates through LDAP replication updates from the master OCSP instance.

    See Table 9.9, “CRL extended interval parameters” for details on the parameters.

  6. Restart the CA server.

    systemctl start pki-tomcatd-nuxwdog@instance_name.service
NOTE

Schedule drift can occur when updating CRLs by interval. Typically, drift occurs as a result of manual updates and CA restarts.

To prevent schedule drift, set both enableDailyUpdates and enableUpdateInterval parameters to true, and add the required values to autoUpdateInterval and dailyUpdates:

ca.crl.MasterCRL.enableDailyUpdates=true
ca.crl.MasterCRL.enableUpdateInterval=true
ca.crl.MasterCRL.autoUpdateInterval=240
ca.crl.MasterCRL.dailyUpdates=1:00

Only one dailyUpdates value will be accepted when updating CRLs by interval.

The interval updates will resynchronize with the dailyUpdates value every 24 hours preventing schedule drift.

By default, access control rules are applied by evaluating deny rules first and then by evaluating allow rules. To change the order, change the authz.evaluateOrder parameter in the CS.cfg.

authz.evaluateOrder=deny,allow

Additionally, access control rules can be evaluated from the local web.xml file (basic ACLs) or more complex ACLs can be accessed by checking the LDAP database. The authz.sourceType parameter identifies what type of authorization to use.

authz.sourceType=web.xml
Note

Always restart the subsystem after editing the CS.cfg file to load the updated settings.

When random serial numbers are not used, in case of cloned systems, administrators could specify the ranges Certificate System will use for requests and serial numbers in the /etc/pki/instance_name/subsystem/CS.cfg file:

dbs.beginRequestNumber=1001001007001
			dbs.endRequestNumber=11001001007000
			dbs.requestIncrement=10000000000000
			dbs.requestLowWaterMark=2000000000000
			dbs.requestCloneTransferNumber=10000
			dbs.requestDN=ou=ca, ou=requests
			dbs.requestRangeDN=ou=requests, ou=ranges
			dbs.beginSerialNumber=1001001007001
			dbs.endSerialNumber=11001001007000
			dbs.serialIncrement=10000000000000
			dbs.serialLowWaterMark=2000000000000
			dbs.serialCloneTransferNumber=10000
			dbs.serialDN=ou=certificateRepository, ou=ca
			dbs.serialRangeDN=ou=certificateRepository, ou=ranges
			dbs.beginReplicaNumber=1
			dbs.endReplicaNumber=100
			dbs.replicaIncrement=100
			dbs.replicaLowWaterMark=20
			dbs.replicaCloneTransferNumber=5
			dbs.replicaDN=ou=replica
			dbs.replicaRangeDN=ou=replica, ou=ranges
			dbs.ldap=internaldb
			dbs.newSchemaEntryAdded=true
Note

Certificate System supports BigInteger values for the ranges.

Note

pkiconsole is being deprecated and will be replaced by a new browser-based UI in a future major release. Although pkiconsole will continue to be available until the replacement UI is released, we encourage using the command line equivalent of pkiconsole at this time, as the pki CLI will continue to be supported and improved upon even when the new browser-based UI becomes available in the future.

Edit the CS.cfg file of each subsystem, search for the authType parameter and set it as follows:

authType=sslclientauth
9.2.3.16. Changing the signing algorithms

The signing algorithms for various PKI objects (certificates, CRLs, and OCSP responses) are first set at the time of installation via the pkispawn configuration file. It is then possible to change these settings post-installation, by editing the CS.cfg file of the instance involved, as follows:

CA: default signing algorithm for signing certificates
Open the CA’s CS.cfg, and edit ca.signing.defaultSigningAlgorithm to assign the desired signing algorithm. For example:
ca.signing.defaultSigningAlgorithm=SHA256withRSA
CA: default signing algorithm for signing CRLs
Open the CA’s CS.cfg, and edit ca.crl.MasterCRL.signingAlgorithm to assign the desired signing algorithm. For example:
ca.crl.MasterCRL.signingAlgorithm=SHA256withRSA
CA: default signing algorithm for signing OCSP responses
Open the CA’s CS.cfg, and edit ca.ocsp_signing.defaultSigningAlgorithm to assign the desired signing algorithm. For example:
ca.ocsp_signing.defaultSigningAlgorithm=SHA256withRSA
OCSP: default signing algorithm for signing OCSP responses
Open the OCSP’s CS.cfg, and edit ocsp.signing.defaultSigningAlgorithm to assign the desired signing algorithm. For example:
ocsp.signing.defaultSigningAlgorithm=SHA256withRSA

Make sure to stop the CS instance before editing its CS.cfg file, and to restart it once you are done with the changes.

Note

When configuring the OCSP manager to use an LDAP directory, you need to disable the direct CA→OCSP CRL publishing method :

  1. Stop the SubCA:

    # pki-server stop rhcs10-RSA-SubCA
  2. Edit the CA’s CS.cfg configuration file (e.g. /var/lib/pki/rhcs10-RSA-SubCA/ca/conf/CS.cfg) and set the following to false:

    ca.publish.rule.instance.ocsprule-<host/port info>.enable=false

    For example:

    ca.publish.rule.instance.ocsprule-rhcs10-example-com-32443.enable=false
  3. Start the CA for the configuration change to take effect:

    # pki-server start rhcs10-RSA-SubCA
Note

This is an alternative method for enabling revocation checks in an OCSP subsystem. The preferred method is detailed in Section 7.13.10.2, “Enabling OCSP for the CA / KRA / TKS / TPS”.

When set up correctly, the OCSP system has the advantage of having the latest CRL internally to verify its own clients. To do so, you need to enable both the ocsp.store.ldapStore.validateConnCertWithCRL and auths.revocationChecking.enabled parameters.

  • Edit the OCSP’s CS.cfg configuration file (e.g. /var/lib/pki/rhcs10-OCSP-subca/ca/conf/CS.cfg) and set the following:

    ocsp.store.ldapStore.validateConnCertWithCRL=true
    
    auths.revocationChecking.enabled=true

    In addition to enabling these two parameters in the CS.cfg, the enableOCSP parameter should remain set to false in /var/lib/pki/<ocsp instance directory>/conf/server.xml.

Red Hat Certificate System enables certificate authorities to publish certificates and, certificate revocation lists (CRLs).

To configure the Certificate Authority (CA) settings for publishing certificates or Certificate Revocation Lists (CRLs) in the CS.cfg configuration file, follow this example:

  • Example of CA’s CS.cfg file with certificate and CRL publishing enabled:

    ca.publish.enable=true
    ca.publish.cert.enable=true
    ca.publish.crl.enable=true
  • Example of CA’s CS.cfg file with Certificate publishing disabled:

    ca.publish.enable=true
    ca.publish.cert.enable=false
  • Example of CA’s CS.cfg file with CRL publishing disabled:

    ca.publish.enable=true
    ca.publish.crl.enable=false

9.3. Managing system passwords

As explained in Section 2.3.10, “Passwords and watchdog (nuxwdog)”, Certificate System uses passwords bind to servers or to unlock tokens when the server starts.

The password.conf file stores system passwords in plain text. However, some administrators prefer to remove the password file entirely to allow nuxwdog to prompt for manual entry of each password initially and store for auto-restart in case of an unplanned shutdown.

When a Certificate System instance starts, the subsystem automatically checks for the password.conf file. If the file exists, then it uses those passwords to connect to other services, such as the internal LDAP database. If that file does not exist, then the watchdog daemon prompts for all of the passwords required by the PKI server to start.

Note

If the password.conf file is present, the subsystem assumes that all the required passwords are present and properly formatted in clear text. If any passwords are missing or wrongly formatted, then the system fails to start correctly.

The required passwords are listed in the cms.passwordlist parameter in the CS.cfg file:

cms.passwordlist=internaldb,replicationdb,CA LDAP Publishing
cms.password.ignore.publishing.failure=true
Note

The cms.password.ignore.publishing.failure parameter allows a CA subsystem to start up successfully even if it has a failed connection to one of its LDAP publishing directories.

For the CA, KRA, OCSP, and TKS subsystems, the default expected passwords are:

  • internal for the NSS database
  • internaldb for the internal LDAP database
  • replicationdb for the replication password
  • Any passwords to access external LDAP databases for publishing (CA only)

    Note

    If a publisher is configured after the password.conf file is removed, nothing is written to the password.conf file. Unless nuxwdog is configured, the server will not have access to the prompts for the new publishing password the next time that the instance restarts.

  • Any external hardware token passwords

For the TPS, this prompts for three passwords:

  • internal for the NSS database
  • tokendbpass for the internal LDAP database
  • Any external hardware token passwords

This section describes the two mechanisms provided for Certificate System to retrieve these passwords:

  • password.conf file (the default)
  • nuxwdog (watchdog)

9.3.1. Configuring the password.conf file

Note

This section is here for reference only. Correct and secure operation must involve using the nuxwdog watchdog. Please refer to Section 9.3.2, “Using the Certificate System watchdog service” to enable nuxwdog, as it is required for full compliance.

By default, passwords are stored in a plain text file, password.conf, in the subsystem conf/ directory. Therefore, it is possible to modify them simply through a text editor.

The list of passwords stored in this file includes the following:

  • The bind password used by the Certificate System instance to access and update the internal database.
  • The password to the HSM
  • The bind password used by the Certificate System instance to access the authentication directory, in case of CMC Shared Token.
  • The bind password used by the subsystem to access and update the LDAP publishing directory; this is required only if the Certificate System instance is configured for publishing certificates and CRLs to an LDAP-compliant directory.
  • the bind password used by the subsystem to access its replication database.
  • For a TPS instance, the bind password used to access and update the token database.

The password.conf file also contains the token passwords needed to open the private keys of the subsystem.

The name and location password file to use for the subsystem is configured in the CS.cfg file:

passwordFile=/var/lib/pki/instance_name/conf/password.conf

The internal password store and replication database have randomly-generated PINs which were set when the subsystem was installed and configured; the internal LDAP database password was defined by the administrator when the instance was configured.

The password entries in the password.conf file are in the following format:

name=password

For example:

internal=413691159497

In cases where an HSM token is required, use the following format:

hardware-name=password

For example:

hardware-NHSM-CONN-XC=MyHSM$S8cret

Example content of a password.conf file:

internal=376577078151
internaldb=secret12
replicationdb=1535106826
hardware-NHSM-CONN-XC=MyHSM$S8cret

In Certificate System, the watchdog service is used to start services which require passwords to access the security database in order to start. In case there is a requirement not to store the unencrypted passwords on the system, the watchdog service:

  • prompts for the relevant passwords during server startup and caches them.
  • uses cached passwords in case of a failure when the server is automatically restarted due to a crash.
9.3.2.1. Enabling the watchdog service

To enable the watchdog service:

  1. If you also want to use the Shared Secret feature on this host, enable the Shared Secret feature as described in Section 9.6.3, “Enabling the CMC Shared Secret feature”.
  2. Backup the server.xml and password.conf files from the /var/lib/pki/instance_name/conf/ directory. For example:

    # cp -p /var/lib/pki/instance_name/conf/server.xml /root/
    # cp -p /var/lib/pki/instance_name/conf/password.conf /root/
  3. Stop and disable the Certificate System instance’s service:

    # systemctl stop pki-tomcatd@instance_name.service
    # systemctl disable pki-tomcatd@instance_name.service
  4. If you use a Hardware Security Module (HSM), enable the watchdog service to prompt for the password of the hardware token:

    • Display the name of the hardware token:

      # egrep "^hardware-" /var/lib/pki/instance_name/conf/password.conf
      
      hardware-HSM_token_name=password

      The highlighted string in the previous example is the hardware token name.

    • Add the cms.tokenList parameter to the /var/lib/pki/instance_name/conf/ca/CS.cfg file and set it to the name of the hardware token. For example:

      cms.tokenList=HMS_token_name
  5. Enable the watchdog configuration for the instance:

    # pki-server instance-nuxwdog-enable instance_name

    Alternatively, enable the watchdog for all instances:

    # pki-server nuxwdog-enable

    For further details, see the pki-server-nuxwdog(8) man page.

  6. By default, nuxwdog starts the server as the user configured in the TOMCAT_USER variable in the /etc/sysconfig/pki-tomcat file. Optionally, to modify the user and group:

    • Copy the watchdog systemd unit file of the instance to the /etc/systemd/system/ directory:

      # cp -p /usr/lib/systemd/system/instance_name-nuxwdog@.service /etc/systemd/system/
      Note

      Unit files in the /etc/systemd/system/ directory have a higher priority and are not replaced during updates.

    • Add the following entries to the [Service] section in the /etc/pki/instance_name/nuxwdog.conf file:

      User new_user_name
    • Reload the systemd configuration:

      # systemctl daemon-reload
  7. Enable the Certificate System service that uses the watchdog:

    # systemctl enable pki-tomcatd-nuxwdog@instance_name.service
  8. Optionally: See Section 9.3.2.3, “Verifying that the Certificate System watchdog service is enabled”.
  9. To start the Certificate System instance, run the following command and enter the prompted passwords:

    # systemctl start pki-tomcatd-nuxwdog@instance_name.service

For information how to manage a Certificate System instance refer to Section 2.2.3, “Execution management (systemctl)”.

To verify that the watchdog service is enabled:

  1. Verify that the pki-tomcatd-nuxwdog service is enabled:

    # systemctl is-enabled pki-tomcatd-nuxwdog@instance_name.service
    
    enabled
  2. Verify that the pki-tomcatd service is disabled:

    # systemctl is-disabled pki-tomcatd@instance_name.service
    
    disabled
  3. In the /etc/pki/instance_name/server.xml file:

    • verify that the passwordFile parameter refers to the CS.cfg file. For example:

      passwordFile="/var/lib/pki/instance_name/ca/CS.cfg"
    • verify that the passwordClass parameter is set to com.netscape.cms.tomcat.NuxwdogPasswordStore:

      passwordClass="com.netscape.cms.tomcat.NuxwdogPasswordStore"
9.3.2.4. Disabling the watchdog service

To disable the watchdog service:

  1. Stop and disable the Certificate System instance’s service that uses the watchdog:

    # systemctl stop pki-tomcatd-nuxwdog@instance_name.service
    # systemctl disable pki-tomcatd-nuxwdog@instance_name.service
  2. Enable the regular service without watch dog for the instance:

    # pki-server instance-nuxwdog-disable instance_name
  3. Disable the watchdog configuration for the instance:

    # systemctl enable pki-tomcatd@instance_name.service

    For further details, see the pki-server-nuxwdog(8) man page.

  4. Restore the password.conf file to its original location. For example:

    # cp /root/password.conf.bak /var/lib/pki/instance_name/conf/password.conf
  5. Start the Certificate System instance:

    # systemctl start pki-tomcatd@instance_name.service

All of the user and administrative (administrators, agents, and auditors) services for the subsystems are accessed over web protocols.

This section discusses the two major sets of configuration files that apply to all Red Hat Certificate System subsystems (CA, KRA, OCSP, TKS, and TPS):

  • /var/lib/pki/instance_name/conf/server.xml provides the configuration for the Tomcat engine.
  • /usr/share/pki/subsystem_type/webapps/WEB-INF/web.xml provides the configuration for the web services offered by this instance.

9.4.1. Tomcatjss

Note

The later subsections include important configuration information on required changes to parameter values. Ensure they are followed for strict compliance.

The following configuration in the server.xml file found in the example pki-tomcat/conf directory can be used to explain how Tomcatjss fits into the entire Certificate System ecosystem. Portions of the Connector entry for the secure port and its corresponding SSLHostConfig parameters are shown below.

    <Connector name="Secure" port="21443"
protocol="org.dogtagpki.tomcat.Http11NioProtocol" SSLEnabled="true"
sslImplementationName="org.dogtagpki.tomcat.JSSImplementation" scheme="https"
secure="true" connectionTimeout="3000000" keepAliveTimeout="300000"
maxHttpHeaderSize="8192" acceptCount="100" maxThreads="150" minSpareThreads="25"
enableLookups="false" disableUploadTimeout="true" enableOCSP="true"
ocspCacheSize="1000" ocspMinCacheEntryDuration="7200"
ocspMaxCacheEntryDuration="14400" ocspTimeout="10"
serverCertNickFile="/var/lib/pki/rhcs10-ECC-SubCA/conf/serverCertNick.conf"
passwordFile="/var/lib/pki/rhcs10-ECC-SubCA/conf/password.conf"
passwordClass="org.apache.tomcat.util.net.jss.PlainPasswordFile"
certdbDir="/var/lib/pki/rhcs10-ECC-SubCA/alias">
  	<SSLHostConfig sslProtocol="TLS" protocols="TLSv1.2"
certificateVerification="optional"
ciphers="ECDHE-ECDSA-AES128-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-
AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384">
   	<Certificate certificateKeystoreType="pkcs11" certificateKeystoreProvider="Mozilla-JSS"
certificateKeyAlias="NHSM-CONN-XC:Server-Cert cert-rhcs10-ECC-SubCA"/>
    </SSLHostConfig>
	</Connector>

In the server.xml configuration file for the Tomcat engine, there is this Connector configuration element that contains the pointer to the tomcatjss implementation, which can be plugged into the sslImplementation property of this Connector object.

Each key parameter element is explained in the subsections below.

9.4.1.1. TLS cipher configuration

Red Hat Certificate System supports TLS 1.2 cipher suites. These are defined in the instance’s server.xml when the CS instance acts as a server, and in CS.cfg when the CS instance acts as a client.

Revocation checks are supported/enabled in the CA in the same way as all other RHCS subsystems (see Section 9.4.1.3, “Enabling certificate revocation checking for RHCS subsystems”). In general, RHCS recommends OCSP for more efficient certificate revocation checks. However, one thing that sets the CA apart from the other CS subsystems is that the CAs are the creators of the CRLs for the certificates they issue, and therefore are the sources of the CRLs that are needed by the OCSP subsystems. For this reason, they need to be able to start up independently before the OCSP or other RHCS subsystems.

In the case when the CA’s own internal LDAP server-cert is issued by the CA itself, it is very important that the CRL Distribution Point extension is used instead of the AIA (OCSP) so as not to fall victim to the chicken and egg issue during startup of the CA.

For the purpose of mitigating propagation and reducing storage of large CRLs, it is important to note that RHCS recommends partitioning of the CRL to allow the certificates that utilize the CRL Distribution Point to be grouped into a smaller subset.

See Section 7.3.8, “Configure support for CRL Distribution Point” for information on how to set up the CA to support partitioned CRL for server-certs that are issued using the CRL Distribution Point certificate enrollment profile.

Certificate revocation check is a vital part of certificate validation in a PKI environment. RHCS provides two types of certificate revocation validation methods: OCSP and CRL by means of detecting/processing either the AIA (OCSP) or the CRL Distribution Point extension of its peer certificate.

RHCS recommends OCSP for more efficient certificate revocation checks.

Note

The usage of CRL Distribution Point is unavoidable in cases when the use of OCSP is not plausible. Such a case can be exemplified in Section 9.4.1.2, “Enabling automatic revocation checking on the CA” above.

Applications (in this case, PKI subsystems) adopting OCSP need to know how to contact the OCSP system in order to verify the certificates in question. The PKI subsystems do not have OCSP checking enabled by default. You can enable OCSP checking for a PKI subsystem by editing its server.xml file.

NOTE

If you have configured the subsystem to use an SSL/TLS connection with its internal database, then the SSL/TLS server certificate of the LDAP internal database must be recognized by the OCSP responder. If the OCSP responder does not recognize the LDAP server certificate, then the subsystem will not start properly. This configuration is covered in the Red Hat Certificate System Planning, Installation and Deployment Guide, since subsystem-LDAP SSL/TLS server connections are configured as part of the subsystem setup.

The following procedure aims to configure your PKI subsystem instances to verify its peer certificates according to their AIA extensions using OCSP. This method of OCSP certificate verification is more flexible than the default static OCSP responder URL.

Procedure

  1. Stop the instance:

    # systemctl stop pki-tomcatd@<instance_name>.service
  2. Edit the /var/lib/pki/<instance_name>/conf/server.xml file to configure the Connector name="Secure" section:

    1. Set the enableOCSP parameter to true
    2. Make sure you remove these two parameters and their assigned values:

      • ocspResponderURL
      • ocspResponderCertNickname

      For example:

    <Connector name="Secure"
         enableOCSP="true"
         ocspCacheSize="1000"
         ocspMinCacheEntryDuration="60"
         ocspMaxCacheEntryDuration="120"
         ocspTimeout="10"
         ...
    />
  3. Start the instance:

    # systemctl start pki-tomcatd@<instance_name>.service
Note

By default, all PKI system certificates created during installation are generated with an AIA (Authority Information Access) extension pointing to its issuing CA’s internal OCSP service.
If you follow the steps in Section 9.4.1.4, “Adding an AIA extension to a certificate”, to point to the external OCSP prior to installing PKI subsystems, then all their certificates (and all other certificates issued by its CA thereon) should bear the correct AIA pointing to the external OCSP instead.

Each OCSP signing certificate must chain up to a trusted root in the Certificate System’s NSS database. In RHCS, during validation, each OCSP response includes the OCSP signer certificate chain. Therefore, the following consideration is required.

  • If the OCSP responder being used has been configured to provide the entire certificate chain of the OCSP signing certificate with each OCSP response, as is the default case for RHCS OCSP services, then no further action is required. NSS knows how to validate this chain from the given information.
  • If on the other hand the OCSP is known to not return the full chain, you then need to import the chain manually during installation setup. For details, see Section 10.5.3, “Importing an OCSP responder”.

The Certificate System OCSP responder already includes the chain with every response. This includes the Certificate System external OCSP responder and the internal OCSP service that comes with each CA. This behavior is by default and cannot be changed.

9.4.1.3.2. OCSP parameters for server.xml

The following table provides information on each parameter relevant to certificate revocation checks (that is, OCSP and CRL) in the server.xml file.

Expand
Table 9.10. OCSP parameters for server.xml
ParameterDescription

enableRevocationCheck (also known as enableOCSP)

Enables (or disables) revocation checking for the subsystem.

ocspResponderURL

Sets the URL where the OCSP requests are sent.

For an OCSP Manager, this can be another OCSP service in another OCSP or in a CA. For a TKS or KRA, this always points to an external OCSP service in an OCSP or a CA.

ocspResponderCertNickname

Sets the nickname of the signing certificate for the responder, either the OCSP signing certificate or the CA’s OCSP signing certificate. The certificate must be imported into the subsystem’s NSS database and have the appropriate trust settings set.

ocspCacheSize

Sets the maximum number of cache entries.

ocspMinCacheEntryDuration

Sets minimum seconds before another fetch attempt can be made. For example, if this is set to 120, then the validity of a certificate cannot be checked again until at least 2 minutes after the last validity check.

ocspMaxCacheEntryDuration

Sets the maximum number of seconds to wait before making the next fetch attempt. This prevents having too large a window between validity checks.

ocspTimeout

Sets the timeout period, in seconds, for the OCSP request.

NOTE

If a nextUpdate field is sent with the OCSP response, it can affect the next fetch time with ocspMinCacheEntryDuration and ocspMaxCacheEntryDuration as follows:

  • If the value in nextUpdate has been reached before the value set in ocspMinCacheEntryDuration, the fetch will not be started until the value set in ocspMinCacheEntryDuration has been reached.
  • If ocspMinCacheEntryDuration has been reached, the server checks if the value in nextUpdate has been reached. If the value has been reached, the fetch will happen.
  • Regardless of the value in nextUpdate, if the setting in ocspMaxCacheEntryDuration has been reached, the fetch will happen.
NOTE

Due to the underlying SSL/TLS session caches kept by NSS, which follows the industry standard to prevent very expensive full handshakes as well as provide stronger privacy, OCSP requests are only made when NSS determines that a validation is required. The SSL/TLS session caches are independent of the OCSP status cache. Once NSS determines that an OCSP request is to be made, the request will be made and the response received will be kept in the OCSP certificate status cache. Due to the SSL/TLS session caches, these OCSP cache parameters only come into play when allowed by NSS.

9.4.1.4. Adding an AIA extension to a certificate

By default, unless explicitly specified, the CA issues certificates with an AIA (Authority Information Access) extension pointing to the CA’s own internal OCSP. Once you have set up an OCSP instance, you can configure the CA to start issuing certificates with an AIA extension that points to the OCSP instance instead.

Prerequisite

  • You are logged in as root user.

Procedure

  1. Stop the CA:

    # systemctl stop pki-tomcatd@<instance_name>.service
  2. Edit the CA’s CS.cfg and set the ca.defaultOcspUri variable to point to the OCSP. For example:

    ca.defaultOcspUri=http://hostname:32080/ocsp/ee/ocsp
  3. Start the CA:

    # systemctl start pki-tomcatd@<instance_name>.service
Note

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. For more information on using the AIA extension, refer to Section 9.4.1.3, “Enabling certificate revocation checking for RHCS subsystems”.

To add the CRL Distribution Point extension to a certificate, you need to use a certificate enrollment profile equipped with the CRL Distribution Point extension. To enable a certificate enrollment profile, see Section 7.3.8.3, “CA’s enrollment profile configuration with CRL Distribution Points”.

Note that the CA needs to be configured to handle CRL Distribution Points for such profiles to work. See Section 7.3.8, “Configure support for CRL Distribution Point”.

9.4.2. Session timeout

When a user connects to PKI server through a client application, the server will create a session to keep track of the user. As long as the user remains active, the user can execute multiple operations over the same session without having to re-authenticate.

Session timeout determines how long the server will wait since the last operation before terminating the session due to inactivity. Once the session is terminated, the user will be required to re-authenticate to continue accessing the server, and the server will create a new session.

There are two types of timeouts:

  • TLS session timeout
  • HTTP session timeout

Due to differences in the way clients work, the clients will be affected differently by these timeouts.

Note

Certain clients have their own timeout configuration. For example, Firefox has a keep-alive timeout setting. For details, see http://kb.mozillazine.org/Network.http.keep-alive.timeout. If the value is different from the server’s setting for TLS Session Timeout or HTTP Session Timeout, different behavior can be observed.

9.4.2.1. TLS session timeout

A TLS session is a secure communication channel over a TLS connection established through TLS handshake protocol.

PKI server generates audit events for TLS session activities. The server generates an ACCESS_SESSION_ESTABLISH audit event with Outcome=Success when the connection is created. If the connection fails to be created, the server will generate an ACCESS_SESSION_ESTABLISH audit event with Outcome=Failure. When the connection is closed, the server will generate an ACCESS_SESSION_TERMINATED audit event.

TLS session timeout (that is TLS connection timeout) is configured in the keepAliveTimeout parameter in the Secure Connector element in the /etc/pki/instance/server.xml file:

...
Server
	Service
		Connector name="Secure"
			...
			keepAliveTimeout="300000"
			...
			/
	/Service
/Server
...

By default the timeout value is set to 300000 milliseconds (that is 5 minutes). To change this value, edit the /etc/pki/instance/server.xml file and then restart the server.

Note

Note that this value will affect all TLS connections to the server. A large value may improve the efficiency of the clients since they can reuse existing connections that have not expired. However, it may also increase the number of connections that the server has to support simultaneously since it takes longer for abandoned connections to expire.

9.4.2.2. HTTP session timeout

An HTTP session is a mechanism to track a user across multiple HTTP requests using HTTP cookies. PKI server does not generate audit events for the HTTP sessions.

Note

For the purpose of auditing consistency, set the session-timeout value in this section to match the keepAliveTimeout value in Section 9.4.2.1, “TLS session timeout”. For example if keepAliveTimeout was set to 300000 (5 minutes), then set session-timeout to 30.

The HTTP session timeout can be configured in the session-timeout element in the /etc/pki/instance/web.xml file:

...
web-app
	session-config
		session-timeout30/session-timeout
	/session-config
/web-app
...

By default the timeout value is set to 30 minutes. To change the value, edit the /etc/pki/instance/web.xml file and then restart the server.

Note

Note that this value affects all sessions in all web applications on the server. A large value may improve the experience of the users since they will not be required to re-authenticate or view the access banner again so often. However, it may also increase the security risk since it takes longer for abandoned HTTP sessions to expire.

9.4.2.3. Session timeout for PKI Web UI

PKI Web UI is an interactive web-based client that runs in a browser. Currently it only supports client certificate authentication.

When the Web UI is opened, the browser may create multiple TLS connections to a server. These connections are associated to a single HTTP session.

To configure a timeout for the Web UI, see Section 9.4.2.2, “HTTP session timeout”. The TLS session timeout is normally irrelevant since the browser caches the client certificate so it can recreate the TLS session automatically.

When the HTTP session expires, the Web UI does not provide any immediate indication. However, the Web UI will display an access banner (if enabled) before a user executes an operation.

9.4.2.4. Session timeout for PKI Console

PKI Console is an interactive standalone graphical UI client. It supports username/password and client certificate authentication.

When the console is started, it will create a single TLS connection to the server. The console will display an access banner (if enabled) before opening the graphical interface. Unlike the Web UI, the console does not maintain an HTTP session with the server.

To configure a timeout for the console, see Section 9.4.2.1, “TLS session timeout”. The HTTP session timeout is irrelevant since the console does not use HTTP session.

When the TLS session expires, the TLS connection will close, and the console will exit immediately to the system. If the user wants to continue, the user will need to restart the console.

9.4.2.5. Session timeout for PKI CLI

PKI CLI is a command-line client that executes a series of operations. It supports username/password and client certificate authentication.

When the CLI is started, it will create a single TLS connection to the server and an HTTP session. The CLI will display an access banner (if enabled) before executing operations.

Both timeouts are generally irrelevant to PKI CLI since the operations are executed in sequence without delay and the CLI exits immediately upon completion. However, if the CLI waits for user inputs, is slow, or becomes unresponsive, the TLS session or the HTTP session may expire and the remaining operations fail. If such delay is expected, see Section 9.4.2.1, “TLS session timeout” and Section 9.4.2.2, “HTTP session timeout” to accommodate the expected delay.

Several legacy interfaces (for features like bulk issuance or the policy framework) are still included in the CA’s web.xml file. However, since these features are deprecated and no longer in use, then they can be removed from the CA configuration to increase security.

Procedure

  1. Stop the CA.

    # pki-server stop instance_name

    OR if using the Nuxwdog watchdog:

    # systemctl stop pki-tomcatd-nuxwdog@instance_name.service
  2. Open the web files directory for the CA. For example:

    # cd /var/lib/pki/instance_name/ca/webapps/ca/WEB-INF
  3. Back up the current web.xml file.

    # cp web.xml web.xml.servlets
  4. Edit the web.xml file and remove the entire <servlet> entries for each of the following deprecated servlets:

    • caadminEnroll
    • cabulkissuance
    • cacertbasedenrollment
    • caenrollment
    • caProxyBulkIssuance

      For example, remove the caadminEnroll servlet entry:

      <servlet>
            <servlet-name>  caadminEnroll  </servlet-name>
            <servlet-class> com.netscape.cms.servlet.cert.EnrollServlet
      </servlet-class>
                   <init-param><param-name>  GetClientCert  </param-name>
                               <param-value> false       </param-value> </init-param>
                   <init-param><param-name>  successTemplate  </param-name>
                               <param-value> /admin/ca/EnrollSuccess.template
      </param-value> </init-param>
                   <init-param><param-name>  AuthzMgr    </param-name>
                               <param-value> BasicAclAuthz </param-value>
      </init-param>
                   <init-param><param-name>  authority   </param-name>
                               <param-value> ca          </param-value> </init-param>
                   <init-param><param-name>  interface   </param-name>
                               <param-value> admin          </param-value>
      </init-param>
                   <init-param><param-name>  ID          </param-name>
                               <param-value> caadminEnroll </param-value>
      </init-param>
                   <init-param><param-name>  resourceID  </param-name>
                               <param-value> certServer.admin.request.enrollment
      </param-value> </init-param>
                   <init-param><param-name>  AuthMgr     </param-name>
                               <param-value> passwdUserDBAuthMgr </param-value>
      </init-param>
         </servlet>
  5. After removing the servlet entries, remove the corresponding <servlet-mapping> entries.

    <servlet-mapping>
          <servlet-name>  caadminEnroll  </servlet-name>
          <url-pattern>   /admin/ca/adminEnroll  </url-pattern>
    </servlet-mapping>
  6. Remove three <filter-mapping> entries for an end-entity request interface.

       <filter-mapping>
          <filter-name>  EERequestFilter              </filter-name>
          <url-pattern>  /certbasedenrollment         </url-pattern>
       </filter-mapping>
    
       <filter-mapping>
          <filter-name>  EERequestFilter              </filter-name>
          <url-pattern>  /enrollment                  </url-pattern>
       </filter-mapping>
    
       <filter-mapping>
          <filter-name>  EERequestFilter              </filter-name>
          <url-pattern>  /profileSubmit               </url-pattern>
       </filter-mapping>
  7. Start the CA again.

    # pki-server start instance_name

    OR if using the Nuxwdog watchdog:

    # systemctl start pki-tomcatd-nuxwdog@instance_name.service

9.4.4. Customizing Web Services

All of the subsystems (with the exception of the TKS) have some kind of a web-based services page for agents and some for other roles, like administrators or end entities. These web-based services pages use basic HTML and JavaScript, which can be customized to use different colors, logos, and other design elements to fit in with an existing site or intranet.

9.4.4.1. Customizing subsystem web applications

Each PKI subsystem has a corresponding web application, which contains:

  • HTML pages containing texts, JavaScript codes, page layout, CSS formatting, and so on
  • A web.xml file, which defines servlets, paths, security constraints, and other
  • Links to PKI libraries.

The subsystem web applications are deployed using context files located in the /var/lib/pki/pki-tomcat/conf/Catalina/localhost/ directory, for example, the ca.xml file:

<Context docBase="/usr/share/pki/ca/webapps/ca" crossContext="true" allowLinking="true"
    ...
</Context

The docBase points to the location of the default web application directory, /usr/share/pki/.

To customize the web application, copy the web application directory into the instance’s webapps directory:

$ cp -r /usr/share/pki/ca/webapps/ca /var/lib/pki/pki-tomcat/webapps

Then change the docBase to point to the custom web application directory relative from the webapps directory:

<Context docBase="ca" crossContext="true" allowLinking="true"
    ...
</Context

The change will be effective immediately without the need to restart the server.

To remove the custom web application, simply revert the docBase and delete the custom web application directory:

$ rm -rf /var/lib/pki/pki-tomcat/webapps/ca
9.4.4.2. Customizing the Web UI theme

The subsystem web applications in the same instance share the same theme, which contains:

  • CSS files, which determine the global appearance
  • Image files including logo, icons, and other
  • Branding properties, which determine the page title, logo link, title color, and other.

The Web UI theme is deployed using the pki.xml context file in the /var/lib/pki/pki-tomcat/conf/Catalina/localhost/ directory:

<Context docBase="/usr/share/pki/common-ui" crossContext="true" allowLinking="true"
    ...
</Context

The docBase points to the location of the default theme directory, /usr/share/pki/.

To customize the theme, copy the default theme directory into the pki directory in the instance’s webapps directory:

$ cp -r /usr/share/pki/common-ui /var/lib/pki/pki-tomcat/webapps/pki

Then change the docBase to point to the custom theme directory relative from the webapps directory:

<Context docBase="pki" crossContext="true" allowLinking="true"
    ...
</Context

The change will be effective immediately without the need to restart the server.

To remove the custom theme, simply revert the docBase and delete the custom theme directory:

$ rm -rf /var/lib/pki/pki-tomcat/webapps/pki
9.4.4.3. Customizing TPS token state labels

The default token state labels are stored in the /usr/share/pki/tps/conf/token-states.properties file and described in Section 2.5.2.4.1.4, “Token state and transition labels”.

To customize the labels, copy the file into the instance directory:

$ cp /usr/share/pki/tps/conf/token-states.properties /var/lib/pki/pki-tomcat/tps/conf

The change will be effective immediately without the need to restart the server.

To remove the customized labels, simply delete the customized file:

$ rm /var/lib/pki/pki-tomcat/tps/conf/token-states.properties

9.5. Using an access banner

In Certificate System, Administrators can configure a banner with customizable text. The banner will be displayed in the following situations:

Expand
ApplicationWhen the banner is displayed

PKI Console

  • Before the console is displayed.
  • After the session has expired.

Web interface

  • When you connect to the web interface.
  • After the session expired.

pki command-line utility

  • Before the actual operation proceeds.

You can use the banner to display important information to the users before they can use Certificate System. The user must agree to the displayed text to continue.

Example 9.4. When the access banner is displayed

The following example shows when the access banner is displayed if you are using the pki utility:

$ pki ca-cert-show 0x1

WARNING!
Access to this service is restricted to those individuals with
specific permissions. If you are not an authorized user, disconnect
now. Any attempts to gain unauthorized access will be prosecuted to
the fullest extent of the law.

Do you want to proceed (y/N)? y
-----------------
Certificate "0x1"
-----------------
  Serial Number: 0x1
  Issuer: CN=CA Signing Certificate,OU=instance_name,O=EXAMPLE
  Subject: CN=CA Signing Certificate,OU=instance_name,O=EXAMPLE
  Status: VALID
  Not Before: Mon Feb 20 18:21:03 CET 2017
  Not After: Fri Feb 20 18:21:03 CET 2037

9.5.1. Enabling an access banner

To enable the access banner, create the /etc/pki/instance_name/banner.txt file and enter the text to displayed.

Important

The text in the /etc/pki/instance_name/banner.txt file must use the UTF-8 format. To validate, see Section 9.5.4, “Validating the banner”.

9.5.2. Disabling an access banner

To disable the 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

9.5.3. Displaying the banner

To display the currently configured banner:

# pki-server banner-show -i instance_name

9.5.4. Validating the banner

To validate that the banner does not contain invalid characters:

# pki-server banner-validate -i instance_name
---------------
Banner is valid
---------------

9.6. Configuration for CMC

This section describes how to configure Certificate System for Certificate Management over CMS (CMC).

9.6.1. Understanding how CMC works

Before configuring CMC, read the following documentation to learn more about the subject:

9.6.2. Enabling the PopLinkWitnessV2 feature

For a high-level security on the Certificate Authority (CA), enable the following option in the /var/lib/pki/instance_name/ca/conf/CS.cfg file:

cmc.popLinkWitnessRequired=true

9.6.3. Enabling the CMC Shared Secret feature

To enable the shared token feature in a Certificate Authority (CA):

  1. If the watchdog service is enabled on the host, temporarily disable it. See Section 9.3.2.4, “Disabling the watchdog service”.
  2. Add the shrTok attribute to Directory Server’s schema:

    # ldapmodify -D "cn=Directory Manager" -H ldaps://server.example.com:636 -W -x
    
    dn: cn=schema
    changetype: modify
    add: attributetypes
    attributetypes: ( 2.16.840.1.117370.3.1.123 NAME 'shrTok' DESC 'User
     Defined ObjectClass for SharedToken' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40
     SINGLE-VALUE X-ORIGIN 'custom for sharedToken')
  3. If the system keys are stored on a Hardware Security Module (HSM), set the cmc.token parameter in the /var/lib/pki/instance_name/ca/conf/CS.cfg file. For example:

    cmc.token=NHSM-CONN-XC
  4. Enable the shared token authentication plugin by adding the following settings into the /var/lib/pki/instance_name/ca/conf/CS.cfg file:

    auths.impl.SharedToken.class=com.netscape.cms.authentication.SharedSecret
    auths.instance.SharedToken.dnpattern=
    auths.instance.SharedToken.ldap.basedn=ou=People,dc=example,dc=org
    auths.instance.SharedToken.ldap.ldapauth.authtype=BasicAuth
    auths.instance.SharedToken.ldap.ldapauth.bindDN=cn=Directory Manager
    auths.instance.SharedToken.ldap.ldapauth.bindPWPrompt=Rule SharedToken
    auths.instance.SharedToken.ldap.ldapauth.clientCertNickname=
    auths.instance.SharedToken.ldap.ldapconn.host=server.example.com
    auths.instance.SharedToken.ldap.ldapconn.port=636
    auths.instance.SharedToken.ldap.ldapconn.secureConn=true
    auths.instance.SharedToken.ldap.ldapconn.version=3
    auths.instance.SharedToken.ldap.maxConns=
    auths.instance.SharedToken.ldap.minConns=
    auths.instance.SharedToken.ldapByteAttributes=
    auths.instance.SharedToken.ldapStringAttributes=
    auths.instance.SharedToken.pluginName=SharedToken
    auths.instance.SharedToken.shrTokAttr=shrTok
  5. Set the nickname of an RSA issuance protection certificate in the ca.cert.issuance_protection.nickname parameter in the /var/lib/pki/instance_name/ca/conf/CS.cfg file. For example:

    ca.cert.issuance_protection.nickname=issuance_protection_certificate

    This step is:

    • Optional if you use an RSA certificate in the ca.cert.subsystem.nickname parameter.
    • Required if you use an ECC certificate in the ca.cert.subsystem.nickname parameter.
    Important

    If the ca.cert.issuance_protection.nickname parameter is not set, Certificate System automatically uses the certificate of the subsystem specified in the ca.cert.subsystem.nickname. However, the issuance protection certificate must be an RSA certificate.

  6. Restart Certificate System:

    # systemctl restart pki-tomcatd@instance_name.service

    When the CA starts, Certificate System prompts for the LDAP password used by the Shared Token plugin.

  7. If you temporarily disabled the watchdog service at the beginning of this procedure, re-enable it. See Section 9.3.2.1, “Enabling the watchdog service”.
Note

For information on how to use the CMC Shared Token, see 8.4 "CMC SharedSecret authentication" in the Administration Guide (Common Criteria Edition).

As described in 6.2.1 "Performing a CMC Revocation" in the Administration Guide (Common Criteria Edition), there are two ways to submit CMC revocation requests.

In cases when you use the CMCRevoke utility to create revocation requests to be submitted through the web UI, add the following setting to the /var/lib/pki/instance_name/ca/conf/CS.cfg file:

cmc.bypassClientAuth=true

Chapter 10. Managing certificate/key crypto token

This chapter contains instructions on how to manage certificate/key token database on the crypto tokens, specifically on how to import and verify certificates for various scenarios.

10.1. About certutil and PKICertImport

The certutil command is provided by Netscape Security Services (NSS). certutil is used for validating and importing certificates. A basic overview of how we use certutil is presented below, however, PKICertImport is our wrapper script of choice for safely validating and importing certificates. Using certutil to do so requires multiple command invocations and correct usage is outside the scope of this documentation.

10.1.1. certutil basic usage

certutil [command] [opt][options]

Each certutil invocation takes a command flag, usually denoted by a capital letter, and a series of options which control what the command does. If an option takes a value, that value is named between "<" and ">" symbols.

10.1.2. PKICertImport basic usage

PKICertImport [opt][options]

Each PKICertImport invocation takes a series of options to validate and import a specified certificate. Unlike the broad use cases of certutil, PKICertImport is only focused on safely importing and validating certificates. See Section 10.1.4, “Common certutil and PKICertImport options” for more information about available options.

Note

PKICertImport prompts for the nssdb and/or HSM passwords multiple times throughout the course of its execution. This is expected as PKICertImport has to interact with the nssdb multiple times. To avoid having to input the nssdb password repetitively, specify a password file via -f <filename>. When done, be sure to delete the password file.

10.1.3. certutil common commands

The following commands are specific to certutil and provide a brief overview of several common commands. PKICertImport is not compatible with nor require these command flags.

certutil -A

The -A command denotes "adding" a certificate. It requires a certificate to import (-i), a nickname (-n) for that certificate, and a series of trust flags (-t) for the certificate.

certutil -V

The -V command denotes "verifying" a certificate. It requires a certificate nickname to validate (-n) and a type of verification (-u) to perform.

certutil -D

The -D command denotes "deleting" a certificate. It requires a certificate nickname (-n) to remove.

Note that it ONLY removes the PUBLIC KEY portion of the certificate, and WILL NOT remove any private keys, if present.

certutil -M

The -M command denotes "modifying" a certificate. It requires a certificate nickname (-n) to modify, and a series of trust flags (-t) to give the certificate.

certutil -L

The -L command denotes "listing" a certificate or all certificates. If given the nickname option (-n), it will list detailed information about that certificate, else if omitted, it will list general information about all certificates present.

The result of certutil -L would show each certificate by its nickname along with its trust info. For example:

Expand
Table 10.1. Certificate nickname and trust info
Certificate NicknameTrust Attributes SSL, S/MIME, JAR/XPI

caSigningCert pki-ca1

CT, C, C

Note

The trust attributes displayed by certutil -L correspond to what is specified with the -t option.

The certutil -L does not modify the database, and can thus be executed safely as many times as desired.

10.1.4. Common certutil and PKICertImport options

When following the steps below, ensure the values are relevant and correct for your specific deployment scenario. Many of these options are available to PKICertImport as well.

-n <nickname>

The -n <nickname> option specifies the nickname for a certificate. This can be any text and is only used as a reference to the certificate. It MUST be unique.

Update this value as appropriate for your configuration.

-d <directory>

The -d <directory> option specifies the path to the nssdb directory in use. We usually assume you are already in this directory and use "." to refer to the current directory.

Update this value as appropriate for your configuration.

-t <trust>

The -t <trust> option specifies the trust level for the certificate.

There are three main categories of trust:

  • trust for TLS
  • trust for email
  • trust for object signing

Each trust position can have one or more trust letters which specify the desired level of trust. The trust letters we use below are c, C, and T.

  • c states that this certificate should be a Certificate Authority (CA).
  • C states that this is a trusted certificate authority for signing server certificates (C implies lowercase c, hence you do not need to specify both).
  • T states that this certificate is a trusted authority for signing client certificates (T implies lowercase c, hence you do not need to specify both T and c).

To specify the trust flags for each position, join the letters with commas. For example, the option -t CT,C,c means that the certificate is trusted for signing client and server TLS certificates, signing server email certificates (S/MIME), and is a valid CA for object signing (though untrusted).

  • This ensures that, if this certificate signs another certificate, which in turn is used for object signing, it will be deemed invalid.

No trust (or the lack of trust) can be specified by using -t ,,.

To see the trust levels of all certificates in the database, run:

  • certutil -L -d
  • Each certificate’s nickname will be listed and the trust flags will be specified at the end of the line.

See the notes about HSMs in the -h option.

Note that more trust levels are specified in the certutil man page. To reference this documentation, please run the man certutil command on a system with certutil properly installed.

-h <HSM>

The -h <HSM> option specifies the name of the HSM to perform operations on.

-h option is incompatible with the -t option, as HSMs cannot store trust. Only an nssdb can store trust, so using the certutil -A command or the certutil -M command in conjunction with -h <HSM> will fail. Instead, specify the desired trust level on a separate certutil -M command without the -h option.

Update this value as appropriate for your configuration.

-e

The -e option specifies that the validity of the signature is checked as well, when used in conjunction with the certutil -V command. PKICertImport always performs the certificate signature validation and does not understand the -e option.

-a

The -a option specifies that the key in question is in PEM (ASCII) format.

-i <certificate>

The -i <certificate> option specifies the path to the certificate. This is only used in the certutil -A command to specify the path to the certificate to import.

Update this value as appropriate for your configuration.

-u <usage>

The -u <usage> option specifies that usage of the certificate to verify when used in conjunction with the certutil -V command.

There are several usage letters referenced in the following sections.

  • -u C stands for verify a client TLS certificate. Note that this mostly accepts any certificate, but will check expiration date and signature.
  • -u V stands for verify a server TLS certificate. Note that this will reject CA certificates and will check expiration date and signature.
  • -u L stands for verify a CA TLS certificate. Note that this will validate trust flags (to see if c is present) and will check key usage to ensure that the key is a CA key. This also checks expiration and signatures.
  • -u O stands for verify a OCSP status responder certificate. Note that this checks expiry and signatures.
  • -u J stands for verify an object signing certificate. Note that this checks expiry and signatures.

If the wrong usage option is specified or the trust flags on the certificate are wrong (such as a missing c flag for an CA TLS certificate), certutil -V will give incorrect results.

Note

More usage options are specified in the certutil man page. To reference this documentation, run the man certutil command on a system with certutil properly installed.

10.2. Importing a root certificate

Ensure that your web service is taken offline (stopped, disabled, etc.) while performing these steps and ensure no concurrent access to the nssdb by other processes (such as a browser). Doing so may corrupt the nssdb or result in improper usage of these certificates.

When needing to import a new root certificate, ensure you acquire this certificate in a secure manner as it will be able to sign a number of certificates. We assume you already have it in a file named ca_root.crt. Please substitute the correct name and path to this file as appropriate for your scenario.

For more information about the certutil and PKICertImport options used below, see Section 10.1, “About certutil and PKICertImport.

Procedure

  1. First, change directories into the nssdb:

    # cd /path/to/nssdb
  2. To import the root certificate:

    # PKICertImport -d . -n "CA Root" -t "CT,C,C" -a -i ca_root.crt -u L

    This command validates and imports the root certificate into your nssdb. The validation succeeds when no error message is printed and the return code is 0. To check the return code, execute echo $? immediately after executing the previous command above. In most cases, a visual error message is printed. The certificate usually fails to validate because it is expired or because it is not a CA certificate. Therefore, make sure your certificate file is correct and up-to-date. Contact the issuer and ensure that all intermediate and root certificates are present on your system.

10.3. Importing an intermediate certificate chain

Ensure that your web service is offline (stopped, disabled, etc.) while performing these steps and ensure no concurrent access to the nssdb by other processes (such as a browser). Doing so may corrupt the nssdb or result in improper usage of these certificates.

If you have not imported and trusted the root certificate, see Section 10.2, “Importing a root certificate”.

When given a series of intermediate certificates between your root and end server or client certificates, we need to import and validate the signed certificate chain in order from closest to furthest from the root CA certificate. We assume the Intermediate CAs are in files named ca_sub_<num>.crt (for example ca_sub_1.crt, ca_sub_2.crt, and so on). Substitute names and paths for your certificates as appropriate to your deployment.

Note

In the unlikely scenario that you are instead given a single file named fullchain.crt, fullchain.pem, or similar and it contains multiple certificates, split it into the above format by copying each block (between and including the ----BEGIN CERTIFICATE----- and an -----END CERTIFICATE----- markers) to its own file. The first ones should be named ca_sub_<num>.crt and the last will be your server cert named service.crt. Server certificates are discussed in later sections.

First, we will import and validate any intermediate CAs in order of closest to furthest from the root CA certificate. If you don’t have any, you can skip to the next section.

For more information about the certutil and PKICertImport options used below, see Section 10.1, “About certutil and PKICertImport.

Procedure

  1. Before beginning, please change directories into the nssdb:

    # cd /path/to/nssdb
  2. For every intermediate certificate in the chain, run the following command:

    # PKICertImport -d . -n "CA Sub $num" -t "CT,C,C" -a -i ca_sub_$num.crt -u L

    This command validates and imports the Intermediate CA certificate into your nssdb. The validation succeeds when no error message is printed and the return code is 0. To check the return code, execute echo $? immediately after executing the previous command above. In most cases, a visual error message is printed. If the validation does not succeed, contact the issuer and ensure that all intermediate and root certificates are present on your system.

10.4. Hardware Security Module

This section provides information on how to detect, view and import certificates into a hardware cryptographic module (HSM).

10.4.1. Detecting Tokens

Once you have installed Certificate System, to see if a token can be detected, use the TokenInfo utility, pointing to the alias directory for the subsystem instance. This tool is available after you install the Certificate System packages.

  • For example:

    # TokenInfo /var/lib/pki/rhcs10-ECC-SubCA/alias
    
    Database Path: .
    Found external module 'NSS Internal PKCS #11 Module'
    Found external module 'nfast'
    Found external module 'p11-kit-proxy'
    Found external token 'accelerator'
    Found external token 'NHSM-CONN-XC'

    This utility returns all tokens that can be detected by the Certificate System, not only tokens that are installed in the Certificate System.

10.4.2. Viewing tokens

Once you have installed Certificate System, to view the list of the tokens, use the modutil utility.

  1. Change to the instance alias directory. For example:

    # cd /var/lib/pki/pki-tomcat/alias
  2. Show the information about the installed PKCS #11 modules installed as well as information on the corresponding tokens using the modutil tool.

    # modutil -dbdir . -nocertdb -list

10.4.3. Importing certificates onto the HSM

The following procedure describes how to import a certificate into an HSM after gaining a newly issued certificate (such as when a TLS server certificate is newly issued or renewed) whose keys were generated on the same HSM token as the process of creating a CSR.

Note

Normally, for a Certificate System server, pkispawn takes care of all system certificate creations and imports during installation. However, this procedure can still be useful when for instance you need to replace one of your system certificates.

Here we give examples to four types of certificates to import onto a HSM:

  • server certificate
  • client certificate
  • object signing certificate:
  • OCSP response signing certificate

Before beginning, please change directories into the nssdb:

# cd /path/to/nssdb

For example:

# cd /var/lib/pki/pki-ca/alias

Ensure that your web service is taken offline (stopped, disabled, etc.) while performing these steps and ensure no concurrent access to the nssdb by other processes (such as a browser). Doing so may corrupt the nssdb or result in improper usage of these certificates.

If you have not imported and trusted the root certificate, see Section 10.2, “Importing a root certificate”. If you have not imported and validated the intermediate certificates, see Section 10.3, “Importing an intermediate certificate chain”.

Note that which set of instructions you follow will depend on the usage for the certificate in question.

  • For TLS server certs for all PKI substems, follow the server certificate steps.
  • For any subsystem’s audit signing cert, follow the steps below for validating an object Signing certificate.
  • For the CA subsystem’s signing cert, follow the steps above for importing and validating an intermediate certificate chain, but do so only with the caSigningCert.
  • For the CA subsystem’s OCSP signing cert, follow the steps below for validating an OCSP certificate.
  • For all other system certs of the PKI subsystems, follow the Client Certificate steps.

For more information about the certutil and PKICertImport options used below, see Section 10.1, “About certutil and PKICertImport.

NOTE

On a system set in FIPS mode, PKICertImport will return a superfluous error message, which you can ignore (BZ#1393668):

certutil: could not change trust on certificate: SEC_ERROR_TOKEN_NOT_LOGGED_IN: The operation failed because the PKCS#11 token is not logged in.
e: certutil returned non-zero value: 255
e: Unable to import certificate to NSS DB: ..

To import a server certificate:

  • PKICertImport -d . -h HSM -f password_file -n "host.name.example.com" -t ",," -a -i service.crt -u V

    This command validates and imports the server certificate onto the HSM. The validation succeeds when no error message is printed and the return code is 0. To check the return code, execute echo $? immediately after executing the previous command above. In most cases, a visual error message is printed. The certificate usually fails to validate due to expiry of a parent certificate or a missing CA trust chain (such as a missing intermediate certificate or a missing CA Root). If the validation does not succeed, contact the issuer and ensure that all intermediate and root certificates are present on your system.

To import a client certificate:

  • PKICertImport -d . -h HSM -f password_file -n "client name" -t ",," -a -i client.crt -u C

    This command validates and imports the client certificate onto the HSM. The validation succeeds when no error message is printed and the return code is 0. To check the return code, execute echo $? immediately after executing the previous command above. In most cases, a visual error message is printed. If the validation does not succeed, contact the issuer and ensure that all intermediate and root certificates are present on your system.

To import an object signing certificate:

  • PKICertImport -d . -h HSM -f password_file -n "certificate name" -t ",,P" -a -i objectsigning.crt -u J

    This command validates and imports the object signing certificate onto the HSM. The validation succeeds when no error message is printed and the return code is 0. To check the return code, execute echo $? immediately after executing the previous command above. In most cases, a visual error message is printed. If the validation does not succeed, contact the issuer and ensure that all intermediate and root certificates are present on your system.

To import an OCSP response signing certificate:

  • PKICertImport -d . -h HSM -f password_file -n "certificate name" -t ",," -a -i ocsp.crt -u O

    This command validates and imports the OCSP responder certificate onto the HSM. The validation succeeds when no error message is printed and the return code is 0. To check the return code, execute echo $? immediately after executing the previous command above. In most cases, a visual error message is printed. If the validation does not succeed, contact the issuer and ensure that all intermediate and root certificates are present on your system.

10.5. Importing a certificate into an NSS database

Ensure that your web service is taken offline (stopped, disabled, etc.) while performing these steps and ensure no concurrent access to the NSS database by other processes (such as a browser). Doing so may corrupt the NSS database or result in improper usage of these certificates.

Note that which set of instructions you follow will depend on the usage for the certificate in question.

  • For any subsystem’s auditSigningCert, please follow the steps below for validating an object Signing certificate.
  • For the CA subsystem’s caSigningCert, please follow the steps above for importing and validating an intermediate certificate chain, but do so only with the caSigningCert.
  • For the CA subsystem’s ocspSigningCert, please follow the steps below for validating an OCSP certificate.
  • For user’s client or S/MIME certificate, follow the Client Certificate steps.

For more information about the certutil and PKICertImport options used below, see Section 10.1, “About certutil and PKICertImport.

To import a client certificate into the NSS database:

  1. Change into the NSS database directory. For example:

    # cd /path/to/nssdb/
  2. Import and trust the root certificate, if it is not already imported and trusted. For details, see Section 10.2, “Importing a root certificate”.
  3. Import and validate the intermediate certificates, if not already imported and validated. For details, see Section 10.3, “Importing an intermediate certificate chain”.
  4. Validate and import the client certificate:

    # PKICertImport -d . -n "client name" -t ",," -a -i client.crt -u C

    The validation succeeds when no error message is printed and the return code is 0. To check the return code, execute echo $? immediately after executing the previous command above. In most cases, a visual error message is printed. If the validation does not succeed, contact the issuer and ensure that all intermediate and root certificates are present on your system.

10.5.2. Importing an object signing certificate

To import an object signing certificate:

  1. Change into the NSS database directory. For example:

    # cd /path/to/nssdb/
  2. Import and trust the root certificate, if it is not already imported and trusted. For details, see Section 10.2, “Importing a root certificate”.
  3. Import and validate the intermediate certificates, if not already imported and validated. For details, see Section 10.3, “Importing an intermediate certificate chain”.
  4. Validate and import the object signing certificate:

    # PKICertImport -d . -n "certificate name" -t ",,P" -a -i objectsigning.crt -u J

    The validation succeeds when no error message is printed and the return code is 0. To check the return code, execute echo $? immediately after executing the previous command above. In most cases, a visual error message is printed. If the validation does not succeed, contact the issuer and ensure that all intermediate and root certificates are present on your system.

10.5.3. Importing an OCSP responder

To import an OCSP responder:

  1. Change into the NSS database directory. For example:

    # cd /path/to/nssdb/
  2. Import and trust the root certificate, if it is not already imported and trusted. For details, see Section 10.2, “Importing a root certificate”.
  3. Import and validate the intermediate certificates, if not already imported and validated. For details, see Section 10.3, “Importing an intermediate certificate chain”.
  4. Validate and import the OCSP responder certificate:

    # PKICertImport -d . -n "certificate name" -t ",," -a -i ocsp.crt -u O

    The validation succeeds when no error message is printed and the return code is 0. To check the return code, execute echo $? immediately after executing the previous command above. In most cases, a visual error message is printed. If the validation does not succeed, contact the issuer and ensure that all intermediate and root certificates are present on your system.

Chapter 11. Configuring certificate profiles

As part of the installation process of a CA, the certificate enrollment profiles can be modified directly on the file system by modifying the profiles' configuration files. Default files exist for the default profiles at installation; when new profiles are needed, new profile configuration files are to be created. The configuration files are stored in the CA profile directory, instance_directory/ca/profiles/ca/, such as /var/lib/pki/pki-ca/ca/profiles/ca/. The file is named profile_name.cfg. All of the parameters for profile rules can be set or modified in those profile configuration files. Profile rules can be inputs, outputs, authentication, authorization, defaults, and constraints.

The enrollment profiles for the CA certificates are located in the /var/lib/pki/instance_name/ca/conf directory with the name *.profile.

Note

For audit reasons, use this method only during the CA installation prior to deployment.

Restart the server after editing the profile configuration file for the changes to take effect.

11.1.1. Profile configuration parameters

All of the parameters for a profile rule - defaults, inputs, outputs, and constraints - are configured within a single policy set. A policy set for a profile has the name policyset.policyName.policyNumber. For example:

policyset.cmcUserCertSet.6.constraint.class_id=noConstraintImpl
policyset.cmcUserCertSet.6.constraint.name=No Constraint
policyset.cmcUserCertSet.6.default.class_id=userExtensionDefaultImpl
policyset.cmcUserCertSet.6.default.name=User Supplied Key Default
policyset.cmcUserCertSet.6.default.params.userExtOID=2.5.29.15

The common profile configuration parameters are described in Table 11.1, “Profile configuration file parameters”.

Expand
Table 11.1. Profile configuration file parameters
ParameterDescription

desc

Gives a free text description of the certificate profile, which is shown on the end-entities page. For example, desc=This certificate profile is for enrolling server certificates with agent authentication.

enable

Sets whether the profile is enabled, and therefore accessible through the end-entities page. For example, enable=true.

auth.instance_id

Sets which authentication manager plugin to use to authenticate the certificate request submitted through the profile. For automatic enrollment, the CA issues a certificate immediately if the authentication is successful. If authentication fails or there is no authentication plugin specified, the request is queued to be manually approved by an agent. For example, auth.instance_id=CMCAuth. The authentication method must be one of the registered authentication instances from CS.cfg.

authz.acl

Specifies the authorization constraint. Most commonly, this us used to set the group evaluation ACL. For example, this caCMCUserCert parameter requires that the signer of the CMC request belong to the Certificate Manager Agents group:

authz.acl=group="Certificate Manager Agents"

In directory-based user certificate renewal, this option is used to ensure that the original requester and the currently-authenticated user are the same.

An entity must authenticate (bind or, essentially, log into the system) before authorization can be evaluated. The authorization method specified must be one of the registered authorization instances from CS.cfg.

name

Gives the name of the profile. For example, name=Agent-Authenticated Server Certificate Enrollment. This name is displayed in the end users enrollment or renewal page.

input.list

Lists the allowed inputs for the profile by name. For example, input.list=i1,i2.

input.input_id.class_id

Gives the java class name for the input by input ID (the name of the input listed in input.list). For example, input.i1.class_id=cmcCertReqInputImpl.

output.list

Lists the possible output formats for the profile by name. For example, output.list=o1.

output.output_id.class_id

Gives the java class name for the output format named in output.list. For example, output.o1.class_id=certOutputImpl.

policyset.list

Lists the configured profile rules. For dual certificates, one set of rules applies to the signing key and the other to the encryption key. Single certificates use only one set of profile rules. For example, policyset.list=serverCertSet.

policyset.policyset_id.list

Lists the policies within the policy set configured for the profile by policy ID number in the order in which they should be evaluated. For example, policyset.serverCertSet.list=1,2,3,4,5,6,7,8.

policyset._policyset_id.policy_number._constraint.class_id

Gives the java class name of the constraint plugin set for the default configured in the profile rule. For example, policyset.serverCertSet.1.constraint.class_id=subjectNameConstraintImpl.

policyset._policyset_id.policy_number._constraint.name

Gives the user-defined name of the constraint. For example, policyset.serverCertSet.1.constraint.name=Subject Name Constraint.

policyset.policyset_id.policy_number._constraint.params._attribute

Specifies a value for an allowed attribute for the constraint. The possible attributes vary depending on the type of constraint. For example, policyset.serverCertSet.1.constraint.params.pattern=CN=.*.

policyset._policyset_id.policy_number._default.class_id

Gives the java class name for the default set in the profile rule. For example, policyset.serverCertSet.1.default.class_id=userSubjectNameDefaultImpl

policyset._policyset_id.policy_number._default.name

Gives the user-defined name of the default. For example, policyset.serverCertSet.1.default.name=Subject Name Default

policyset.policyset_id.policy_number._default.params._attribute

Specifies a value for an allowed attribute for the default. The possible attributes vary depending on the type of default. For example, policyset.serverCertSet.1.default.params.name=CN=(Name)$request.requestor_name$.

Changing constraints changes the restrictions on the type of information which can be supplied. Changing the defaults and constraints can also add, delete, or modify the extensions which are accepted or required from a certificate request.

For example, the default caFullCMCUserCert profile is set to create a Key Usage extension from information in the request.

policyset.cmcUserCertSet.6.constraint.class_id=keyUsageExtConstraintImpl
policyset.cmcUserCertSet.6.constraint.name=Key Usage Extension Constraint
policyset.cmcUserCertSet.6.constraint.params.keyUsageCritical=true
policyset.cmcUserCertSet.6.constraint.params.keyUsageCrlSign=false
policyset.cmcUserCertSet.6.constraint.params.keyUsageDataEncipherment=false
policyset.cmcUserCertSet.6.constraint.params.keyUsageDecipherOnly=false
policyset.cmcUserCertSet.6.constraint.params.keyUsageDigitalSignature=true
policyset.cmcUserCertSet.6.constraint.params.keyUsageEncipherOnly=false
policyset.cmcUserCertSet.6.constraint.params.keyUsageKeyAgreement=false
policyset.cmcUserCertSet.6.constraint.params.keyUsageKeyCertSign=false
policyset.cmcUserCertSet.6.constraint.params.keyUsageKeyEncipherment=true
policyset.cmcUserCertSet.6.constraint.params.keyUsageNonRepudiation=true
policyset.cmcUserCertSet.6.default.class_id=keyUsageExtDefaultImpl
policyset.cmcUserCertSet.6.default.name=Key Usage Default
policyset.cmcUserCertSet.6.default.params.keyUsageCritical=true
policyset.cmcUserCertSet.6.default.params.keyUsageCrlSign=false
policyset.cmcUserCertSet.6.default.params.keyUsageDataEncipherment=false
policyset.cmcUserCertSet.6.default.params.keyUsageDecipherOnly=false
policyset.cmcUserCertSet.6.default.params.keyUsageDigitalSignature=true
policyset.cmcUserCertSet.6.default.params.keyUsageEncipherOnly=false
policyset.cmcUserCertSet.6.default.params.keyUsageKeyAgreement=false
policyset.cmcUserCertSet.6.default.params.keyUsageKeyCertSign=false
policyset.cmcUserCertSet.6.default.params.keyUsageKeyEncipherment=true
policyset.cmcUserCertSet.6.default.params.keyUsageNonRepudiation=true

The default is updated to allow user-supplied key extensions:

policyset.cmcUserCertSet.6.default.class_id=userExtensionDefaultImpl
policyset.cmcUserCertSet.6.default.name=User Supplied Key Default
policyset.cmcUserCertSet.6.default.params.userExtOID=2.5.29.15

This sets the server to accept the extension OID 2.5.29.15 in the certificate request.

Other constraints and defaults can be changed similarly. Make sure that any required constraints are included with appropriate defaults, that defaults are changed when a different constraint is required, and that only allowed constraints are used with the default. For more information, see the B.1 Defaults Reference and B.2 Constraints Reference reference sections in the Administration Guide (Common Criteria Edition).

Red Hat Certificate System provides a flexible infrastructure for administrators to create customized enrollment profiles to meet the requirements of their environment. However, it is important that profiles do not allow issuing certificates that violate the requirements defined in RFC 5280. When creating an enrollment profile where both Key Usage (KU) and Extended Key Usage (EKU) extensions are present, it is important to make sure that the consistency between the two extensions is maintained as per section 4.2.1.12. Extended Key Usage of RFC 5280.

For details about the KU extension, see:

The following table provides the guidelines that maps consistent Key Usage bits to the Extended Key Usage Extension for each purpose:

Expand
Purpose / Extended Key UsagesKey Usages

TLS Server Authentication command

id-kp-serverAuth

digitalSignature, keyEncipherment, or KeyAgreement

TLS Client (Mutual) Authentication

id-kp-clientAuth

digitalSignature, keyEncipherment, and/or KeyAgreement

Code Signing

id-kp-codeSigning

digitalSignature

Email Protection

id-kp-emailProtection

digitalSignature, nonRepudiation, and/or (keyEncipherment or keyAgreement)

OCSP Response Signing

id-kp-OCSPSigning

KeyAgreement and/or nonRepudiation

The following shows two examples of inconsistent EKU/KU:

  • An enrollment profile that is intended for purpose of OCSP response signing contains Extended key usage id-kp-OCSPSigning but with keyEncipherment key usage bit:

    policyset.ocspCertSet.6.default.class_id=keyUsageExtDefaultImpl
    policyset.ocspCertSet..6.default.name=Key Usage Default
    policyset.ocspCertSet..6.default.params.keyUsageCritical=true
    policyset.ocspCertSet..6.default.params.keyUsageCrlSign=false
    policyset.ocspCertSet..6.default.params.keyUsageDataEncipherment=false
    policyset.ocspCertSet..6.default.params.keyUsageDecipherOnly=false
    policyset.ocspCertSet..6.default.params.keyUsageDigitalSignature=true
    policyset.ocspCertSet..6.default.params.keyUsageEncipherOnly=false
    policyset.ocspCertSet..6.default.params.keyUsageKeyAgreement=false
    policyset.ocspCertSet..6.default.params.keyUsageKeyCertSign=false
    policyset.ocspCertSet..6.default.params.keyUsageKeyEncipherment=true
    policyset.ocspCertSet..6.default.params.keyUsageNonRepudiation=true
    policyset.ocspCertSet.7.constraint.params.exKeyUsageOIDs=1.3.6.1.5.5.7.3.9
    policyset.ocspCertSet.7.default.class_id=extendedKeyUsageExtDefaultImpl
    policyset.ocspCertSet.7.default.name=Extended Key Usage Default
    policyset.ocspCertSet.7.default.params.exKeyUsageCritical=false
    policyset.ocspCertSet.7.default.params.exKeyUsageOIDs=1.3.6.1.5.5.7.3.9
  • An enrollment profile that is intended for the purpose of TLS server authentication contains Extended key usage id-kp-serverAuth but with CRL signing key usage bit:

    policyset.serverCertSet.6.default.name=Key Usage Default
    policyset.serverCertSet.6.default.params.keyUsageCritical=true
    policyset.serverCertSet.6.default.params.keyUsageDigitalSignature=true
    policyset.serverCertSet.6.default.params.keyUsageNonRepudiation=false
    policyset.serverCertSet.6.default.params.keyUsageDataEncipherment=true
    policyset.serverCertSet.6.default.params.keyUsageKeyEncipherment=false
    policyset.serverCertSet.6.default.params.keyUsageKeyAgreement=true
    policyset.serverCertSet.6.default.params.keyUsageKeyCertSign=false
    policyset.serverCertSet.6.default.params.keyUsageCrlSign=true
    policyset.serverCertSet.6.default.params.keyUsageEncipherOnly=false
    policyset.serverCertSet.6.default.params.keyUsageDecipherOnly=false
    policyset.cmcUserCertSet.7.default.class_id=extendedKeyUsageExtDefaultImpl
    policyset.cmcUserCertSet.7.default.name=Extended Key Usage Extension Default
    policyset.cmcUserCertSet.7.default.params.exKeyUsageCritical=false
    policyset.serverCertSet.7.default.params.exKeyUsageOIDs=1.3.6.1.5.5.7.3.1

For details about the KU extension, see:

For details about the EKU extension, see:

11.1.2.2. Configuring cross-pair profiles

Cross-pair certificates are distinct CA signing certificates that establish a trust partner relationship whereby entities from these two distinct PKIs will trust each other. Both partner CAs store the other CA signing certificate in its database, so all of the certificates issued within the other PKI are trusted and recognized.

Two extensions supported by the Certificate System can be used to establish such a trust partner relationship (cross-certification):

  • The Certificate Policies Extension (CertificatePoliciesExtension) specifies the terms that the certificate fall under, which is often unique for each PKI.
  • The Policy Mapping Extension (PolicyMappingExtension) seals the trust between two PKI’s by mapping the certificate profiles of the two environments.

Issuing cross-pair certificates requires the Certificate Policies Extension, explained in the B.3.4 certificatePoliciesExt annex in the Administration Guide (Common Criteria Edition).

To ensure that the issued certificate contains the CertificatePoliciesExtension, the enrollment profile needs to include an appropriate policy rule, for example:

policyset.userCertSet.p7.constraint.class_id=noConstraintImpl
policyset.userCertSet.p7.constraint.name=No Constraint
policyset.userCertSet.p7.default.class_id=certificatePoliciesExtDefaultImpl
policyset.userCertSet.p7.default.name=Certificate Policies Extension Default
policyset.userCertSet.p7.default.params.Critical=false
policyset.userCertSet.p7.default.params.PoliciesExt.num=1
policyset.userCertSet.p7.default.params.PoliciesExt.certPolicy0.enable=true
policyset.userCertSet.p7.default.params.PoliciesExt.certPolicy0.policyId=1.1.1.1
policyset.userCertSet.p7.default.params.PoliciesExt.certPolicy0.PolicyQualifiers0.CPSURI.enable=false
policyset.userCertSet.p7.default.params.PoliciesExt.certPolicy0.PolicyQualifiers0.CPSURI.value=
policyset.userCertSet.p7.default.params.PoliciesExt.certPolicy0.PolicyQualifiers0.usernotice.enable=false
policyset.userCertSet.p7.default.params.PoliciesExt.certPolicy0.PolicyQualifiers0.usernotice.explicitText.value=
policyset.userCertSet.p7.default.params.PoliciesExt.certPolicy0.PolicyQualifiers0.usernotice.noticeReference.noticeNumbers=
policyset.userCertSet.p7.default.params.PoliciesExt.certPolicy0.PolicyQualifiers0.usernotice.noticeReference.organization=

Certificates issued with the enrollment profile in this example would contain the following information:

Identifier: Certificate Policies: - 2.5.29.32
Critical: no
Certificate Policies:
Policy Identifier: 1.1.1.1

For more information on using cross-pair certificates, see 13.4 Using Cross-Pair Certificates in the Administration Guide (Common Criteria Edition).

For more information on publishing cross-pair certificates, see 7.8 Publishing Cross-Pair Certificates in the Administration Guide (Common Criteria Edition).

The certificate profile configuration file in the CA’s profiles/ca directory contains the input information for that particular certificate profile form. Inputs are the fields in the end-entities page enrollment forms. There is a parameter, input.list, which lists the inputs included in that profile. Other parameters define the inputs; these are identified by the format input.ID. For example, this adds a generic input to a profile:

input.list=i1,i2,i3,i4
...
input.i4.class_id=genericInputImpl
input.i4.params.gi_display_name0=Name0
input.i4.params.gi_display_name1=Name1
input.i4.params.gi_display_name2=Name2
input.i4.params.gi_display_name3=Name3
input.i4.params.gi_param_enable0=true
input.i4.params.gi_param_enable1=true
input.i4.params.gi_param_enable2=true
input.i4.params.gi_param_enable3=true
input.i4.params.gi_param_name0=gname0
input.i4.params.gi_param_name1=gname1
input.i4.params.gi_param_name2=gname2
input.i4.params.gi_param_name3=gname3
input.i4.params.gi_num=4

For more information on what inputs, or form fields, are available, see the A.1 Input Reference annex in the Administration Guide (Common Criteria Edition).

In each profile on a Certificate Authority (CA), you can set how long certificates issued using a profile are valid. You can change this value for security reasons.

For example, to set the validity of the generated Certificate Authority (CA) signing certificate to 825 days (approximately 27 months), open the /var/lib/pki/instance_name/ca/profiles/ca/caCACert.cfg file in an editor and set:

policyset.caCertSet.2.default.params.range=825

Each profile has a Signing Algorithm Default extension defined. The default has two settings: a default algorithm and a list of allowed algorithms, if the certificate request specifies a different algorithm. If no signing algorithms are specified, then the profile uses whatever is set as the default for the CA.

In the profile’s .cfg file, the algorithm is set with two parameters:

policyset.cmcUserCertSet.8.constraint.class_id=signingAlgConstraintImpl
policyset.cmcUserCertSet.8.constraint.name=No Constraint
policyset.cmcUserCertSet.8.constraint.params.signingAlgsAllowed=SHA256withRSA,SHA512withRSA,SHA256withEC,SHA384withRSA,SHA384withEC,SHA512withEC
policyset.cmcUserCertSet.8.default.class_id=signingAlgDefaultImpl
policyset.cmcUserCertSet.8.default.name=Signing Alg
policyset.cmcUserCertSet.8.default.params.signingAlg=-
Note

The - value for the policyset.cmcUserCertSet.8.default.params.signingAlg parameter means that the default signing algorithm will be used.

11.4. Configuring CA system certificate profiles

Unlike the non-CA subsystems, the enrollment profiles for CA’s own system certificates are kept in the /var/lib/pki/[instance name]/ca/conf file. Those profiles are:

  • caAuditSigningCert.profile
  • eccAdminCert.profile
  • rsaAdminCert.profile
  • caCert.profile
  • eccServerCert.profile
  • saServerCert.profile
  • caOCSPCert.profile
  • eccSubsystemCert.profile
  • rsaSubsystemCert.profile

If you wish to change the default values in the profiles above, make changes to the profiles before you perform the second step of a two-step installation (as described in Between step customization). The following is an example that demonstrates:

  • How to change validity to CA signing certificate.
  • How to add extensions (e.g. Certificate policies extension).

    1. Back up the original CA certificate profile used by pkispawn.

      # cp -p /usr/share/pki/ca/conf/caCert.profile /usr/share/pki/ca/conf/caCert.profile.orig
    2. Open the CA certificate profile used by the configuration wizard.

      # vim /usr/share/pki/ca/conf/caCert.profile
    3. Reset the validity period in the Validity Default to your desired value. For example, to change the period to two years:

      2.default.class=com.netscape.cms.profile.def.ValidityDefault
      2.default.name=Validity Default
      2.default.params.range=720
    4. Add any extensions by creating a new default entry in the profile and adding it to the list. For example, to add the Certificate Policies Extension, add the default (which, in this example, is default #9):

      9.default.class_id=certificatePoliciesExtDefaultImpl
      9.default.name=Certificate Policies Extension Default
      9.default.params.Critical=false
      9.default.params.PoliciesExt.certPolicy0.enable=false
      9.default.params.PoliciesExt.certPolicy0.policyId=
      9.default.params.PoliciesExt.certPolicy0.PolicyQualifiers0.CPSURI.enable=true
      9.default.params.PoliciesExt.certPolicy0.PolicyQualifiers0.CPSURI.value=CertificatePolicies.example.com
      9.default.params.PoliciesExt.certPolicy0.PolicyQualifiers0.usernotice.enable=false
      9.default.params.PoliciesExt.certPolicy0.PolicyQualifiers0.usernotice.explicitText.value=
      9.default.params.PoliciesExt.certPolicy0.PolicyQualifiers0.usernotice.noticeReference.noticeNumbers=
      9.default.params.PoliciesExt.certPolicy0.PolicyQualifiers0.usernotice.noticeReference.organization=

      Then, add the default number to the list of defaults to use the new default:

      list=2,4,5,6,7,8,9

Normally, a certificate cannot be issued with a validity period that ends after the issuing CA certificate’s expiration date. If a CA certificate has an expiration date of December 31, 2023, then all of the certificates it issues must expire by or before December 31, 2023.

This rule applies to other CA signing certificates issued by a CA - and this makes renewing a root CA certificate almost impossible. Renewing a CA signing certificate means it would necessarily have to have a validity period past its own expiration date.

This behavior can be altered using the CA Validity Default. This default allows a setting (bypassCAnotafter) which allows a CA certificate to be issued with a validity period that extends past the issuing CA’s expiration (notAfter) date.

Figure 11.1. CA validity default configuration

cavalidity console

In real deployments, what this means is that a CA certificate for a root CA can be renewed, when it might otherwise be prevented.

To enable CA certificate renewals past the original CA’s validity date:

  1. Stop the CA:

    # systemctl stop pki-tomcatd@instance_name.service

    OR if using the Nuxwdog watchdog:

    # systemctl stop pki-tomcatd-nuxwdog@instance_name.service
  2. Open the caCACert.cfg file.

    # var/lib/pki/instance_name/ca/profiles/ca/caCACert.cfg
  3. The CA Validity Default should be present by default. Set the value to true to allow a CA certificate to be renewed past the issuing CA’s validity period.

    policyset.caCertSet.2.default.name=CA Certificate Validity Default
    policyset.caCertSet.2.default.params.range=2922
    policyset.caCertSet.2.default.params.startTime=0
    policyset.caCertSet.2.default.params.bypassCAnotafter=true
  4. Start the CA to apply the changes.

    # systemctl start pki-tomcatd@instance_name.service

    OR if using the Nuxwdog watchdog:

    # systemctl start pki-tomcatd-nuxwdog@instance_name.service

When an agent reviews a renewal request, there is an option in the Extensions/Fields area that allows the agent to choose to bypass the normal validity period constraint. If the agent selects false, the constraint is enforced, even if bypassCAnotafter=true is set in the profile. If the agent selects true when the bypassCAnotafter value is not enabled, then the renewal request is rejected by the CA.

Figure 11.2. Bypass CA constraints option in the agent services page

cavalidity after
NOTE

The CA Validity Default only applies to CA signing certificate renewals. Other certificates must still be issued and renewed within the CA’s validity period.

A separate configuration setting for the CA, ca.enablePastCATime, can be used to allow certificates to be renewed past the CA’s validity period. However, this applies to every certificate issued by that CA. Because of the potential security issues, this setting is not recommended for production environments.

11.5. Managing smart card CA profiles

Note

Features in this section on TMS are not tested in the evaluation. This section is for reference only.

The TPS does not generate or approve certificate requests; it sends any requests approved through the Enterprise Security Client to the configured CA to issue the certificate. This means that the CA actually contains the profiles to use for tokens and smart cards. The profiles to use can be automatically assigned, based on the card type.

The profile configuration files are in the /var/lib/instance_name/ca/profiles/ca/ directory with the other CA profiles. The default profiles are listed in Table 11.2, “Default token certificate profiles”.

Expand
Table 11.2. Default token certificate profiles
Profile NameConfiguration FileDescription

Regular Enrollment Profiles

Token Device Key Enrollment

caTokenDeviceKeyEnrollment.cfg

For enrolling tokens used for devices or servers.

Token User Encryption Certificate Enrollment

caTokenUserEncryptionKeyEnrollment.cfg

For enrolling encryption certificates on the token for a user.

Token User Signing Certificate Enrollment

caTokenUserSigningKeyEnrollment.cfg

For enrolling signing certificates on the token for a user.

Token User MS Login Certificate Enrollment

caTokenMSLoginEnrollment.cfg

For enrolling user certificates to use for single sign-on to a Windows domain or PC.

Temporary Token Profiles

Temporary Device Certificate Enrollment

caTempTokenDeviceKeyEnrollment.cfg

For enrolling certificates for a device on a temporary token.

Temporary Token User Encryption Certificate Enrollment

caTempTokenUserEncryptionKeyEnrollment.cfg

For enrolling an encryption certificate on a temporary token for a user.

Temporary Token User Signing Certificate Enrollment

caTempTokenUserSigningKeyEnrollment.cfg

For enrolling a signing certificates on a temporary token for a user.

Renewal Profiles

Token User Encryption Certificate Enrollment (Renewal)

caTokenUserEncryptionKeyRenewal.cfg

For renewing encryption certificates on the token for a user, if renewal is allowed.

Token User Signing Certificate Enrollment (Renewal)

caTokenUserSigningKeyRenewal.cfg

For renewing signing certificates on the token for a user, if renewal is allowed.

Note

Renewal profiles can only be used in conjunction with the profile that issued the original certificate. There are two settings that are beneficial:

  • It is important the original enrollment profile name does not change.
  • The Renew Grace Period Constraint should be set in the original enrollment profile. This defines the amount of time before and after the certificate’s expiration date when the user is allowed to renew the certificate. There are only a few examples of these in the default profiles, and they are mostly not enabled by default.

11.5.1. Editing enrollment profiles for the tps

Administrators have the ability to customize the default smart card enrollment profiles, used with the TPS. For instance, a profile could be edited to include the user’s email address in the Subject Alternative Name extension. The email address for the user is retrieved from the authentication directory. To configure the CA for LDAP access, change the following parameters in the profile files, with the appropriate directory information:

policyset.set1.p1.default.params.dnpattern=UID=$request.uid$, O=Token Key User
policyset.set1.p1.default.params.ldap.enable=true
policyset.set1.p1.default.params.ldap.basedn=ou=people,dc=host,dc=example,dc=com
policyset.set1.p1.default.params.ldapStringAttributes=uid,mail
policyset.set1.p1.default.params.ldap.ldapconn.host=localhost.example.com
policyset.set1.p1.default.params.ldap.ldapconn.port=389

These CA profiles come with LDAP lookup disabled by default. The ldapStringAttributes parameter tells the CA which LDAP attributes to retrieve from the company directory. For example, if the directory contains uid as an LDAP attribute name, and this will be used in the subject name of the certificate, then uid must be listed in the ldapStringAttributes parameter, and request.uid listed as one of the components in the dnpattern.

Editing certificate profiles is covered in 3.2 Setting up Certificate Profiles in the Administration Guide (Common Criteria Edition).

The format for the dnpattern parameter is covered in the B.2.11 Subject Name Constraint annex and B.1.27 Subject Name Default references in the Administration Guide (Common Criteria Edition).

11.5.2. Creating custom TPS profiles

Certificate profiles are created as normal in the CA, but they also have to be configured in the TPS for it to be available for token enrollments.

TIP

New profiles are added with new releases of Red Hat Certificate System. If you migrate an instance to Red Hat Certificate System 10, then you need to add the new profiles to the migrated instance as if they are custom profiles.

  1. Create a new token profile for the issuing CA. Setting up profiles is covered in 3.2 Setting up Certificate Profiles in the Administration Guide (Common Criteria Edition).
  2. Copy the profile into the CA’s profiles directory, /var/lib/instance_name/ca/profiles/ca/.
  3. Edit the CA’s CS.cfg file, and add the new profile references and the profile name to the CA’s list of profiles. For example:

    # vim etc/pki/instance_name/ca/CS.cfg
    
    				profile.list=caUserCert,...,caManualRenewal,tpsExampleEnrollProfile
    				...
    				profile.caTokenMSLoginEnrollment.class_id=caUserCertEnrollImpl
    				profile.caTokenMSLoginEnrollment.config=/var/lib/pki/instance_name/profiles/ca/tpsExampleEnrollProfile.cfg
  4. Edit the TPS CS.cfg file, and add a line to point to the new CA enrollment profile. For example:

    # vim /etc/pki/instance_name/tps/CS.cfg
    
    				op.enroll.userKey.keyGen.signing.ca.profileId=tpsExampleEnrollProfile
  5. Restart the instance after editing the smart card profiles:

    # systemctl restart pki-tomcatd-nuxwdog@instance_name.service

    If the CA and TPS are in separate instances, restart both instances.

Note

Enrollment profiles for the External Registration (externalReg) setting are configured in the user LDAP entry.

11.5.3. Using the Windows smart card logon profile

The TPS uses a profile to generate certificates to use for single sign-on to a Windows domain or PC; this is the Token User MS Login Certificate Enrollment profile (caTokenMSLoginEnrollment.cfg).

However, there are some special considerations that administrators must account for when configuring Windows smart card login.

  • Issue a certificate to the domain controller, if it is not already configured for TLS.
  • Configure the smart card login per user, rather than as a global policy, to prevent locking out the domain administrator.
  • Enable CRL publishing to the Active Directory server because the domain controller checks the CRL at every login.

11.6. Disabling certificate enrollment profiles

This section provides instructions on how to disable selected profiles.

To disable a certificate profile, edit the corresponding *.cfg file in the /var/lib/pki/instance_name/ca/profiles/ca/ directory and set the visible and enable parameters to false.

For example, to disable all non-CMC profiles:

  1. List all non-CMC profiles:

    # ls -l /var/lib/pki/instance_name/ca/profiles/ca/ | grep -v "CMC"
  2. In each of the displayed files, set the following parameters to false:

    visible=false
    enable=false

Additionally, set visible=false in all CMC profiles to make them invisible on the end entity page:

  1. List all CMC profiles:

    # ls -l /var/lib/pki/instance_name/ca/profiles/ca/*CMC*
  2. In each of the displayed files, set:

    visible=false

For an alternative way to disable non-CMC profiles, also see Section 7.6.5, “Disable non-CMC and non-installation profiles”.

This chapter describes recovering keys with the Key Recovery Authority (KRA).

12.1. Manually setting up key archival

IMPORTANT

This procedure is unnecessary if the CA and KRA are in the same security domain. This procedure is only required for CAs outside the security domain.

Configuring key archival manually demands two things:

  • Having a trusted relationship between a CA and a KRA.
  • Having the enrollment form enabled for key archival, meaning it has key archival configured and the KRA transport certificate stored in the form.

In the same security domain, both of these configuration steps are done automatically when the KRA is configured because it is configured to have a trusted relationship with any CA in its security domain. It is possible to create that trusted relationship with Certificate Managers outside its security domain by manually configuring the trust relationships and profile enrollment forms.

  1. If necessary, create a trusted manager to establish a relationship between the Certificate Manager and the KRA.

    For the CA to be able to request key archival of the KRA, the two subsystems must be configured to recognize, trust, and communicate with each other. Verify that the Certificate Manager has been set up as a privileged user, with an appropriate TLS mutual authentication certificate, in the internal database of the KRA. By default, the Certificate Manager uses its subsystem certificate for TLS mutual authentication to the KRA.

  2. Copy the base-64 encoded transport certificate for the KRA.

    • The transport certificate is stored in the KRA’s certificate database, which can be retrieved using the certutil utility. If the transport certificate is signed by a Certificate Manager, then a copy of the certificate is available through the Certificate Manager end-entities page in the Retrieval tab.
    • Alternatively, download the transport certificate using the pki utility:

      1. List the certificate, using the pki ca-cert-find command and the KRA transport certificate’s subject common name. For example:

        # pki -p <Security Domain Port> -d <nss_db> -w <password> ca-cert-find --name "DRM Transport Certificate"
      2. Show the details of the certificate and save it as a .pem file:

        # pki ca-cert-show <serial_number> --output transport.pem
        Note

        For more information on the pki command options, run the pki --help command.

  3. Add the transport certificate to the CA’s CS.cfg file.

    ca.connector.KRA.enable=true
    ca.connector.KRA.host=server.example.com
    ca.connector.KRA.local=false
    ca.connector.KRA.nickName=subsystemCert cert-pki-ca
    ca.connector.KRA.port=8443
    ca.connector.KRA.timeout=30
    ca.connector.KRA.transportCert=MIIDbDCCAlSgAwIBAgIBDDANBgkqhkiG9w0BAQUFADA6MRgwFgYDVQQKEw9Eb21haW4gc28gbmFtZWQxHjAcBgNVBAMTFUNlcnRpZmljYXRlIEF1dGhvcml0eTAeFw0wNjExMTQxODI2NDdaFw0wODEwMTQxNzQwNThaMD4xGDAWBgNVBAoTD0RvbWFpbiBzbyBuYW1lZDEiMCAGA1UEAxMZRFJNIFRyYW5zcG9ydCBDZXJ0aWZpY2F0ZTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKnMGB3WkznueouwZjrWLFZBLpKt6TimNKV9iz5s0zrGUlpdt81/BTsU5A2sRUwNfoZSMs/d5KLuXOHPyGtmC6yVvaY719hr9EGYuv0Sw6jb3WnEKHpjbUO/vhFwTufJHWKXFN3V4pMbHTkqW/x5fu/3QyyUre/5IhG0fcEmfvYxIyvZUJx+aQBW437ATD99Kuh+I+FuYdW+SqYHznHY8BqOdJwJ1JiJMNceXYAuAdk+9t70RztfAhBmkK0OOP0vH5BZ7RCwE3Y/6ycUdSyPZGGc76a0HrKOz+lwVFulFStiuZIaG1pv0NNivzcj0hEYq6AfJ3hgxcC1h87LmCxgRWUCAwEAAaN5MHcwHwYDVR0jBBgwFoAURShCYtSg+Oh4rrgmLFB/Fg7X3qcwRAYIKwYBBQUHAQEEODA2MDQGCCsGAQUFBzABhihodHRwOi8vY2x5ZGUucmR1LnJlZGhhdC5jb206OTE4MC9jYS9vY3NwMA4GA1UdDwEB/wQEAwIE8DANBgkqhkiG9w0BAQUFAAOCAQEAFYz5ibujdIXgnJCbHSPWdKG0T+FmR67YqiOtoNlGyIgJ42fi5lsDPfCbIAe3YFqmF3wU472h8LDLGyBjy9RJxBj+aCizwHkuoH26KmPGntIayqWDH/UGsIL0mvTSOeLqI3KM0IuH7bxGXjlION83xWbxumW/kVLbT9RCbL4216tqq5jsjfOHNNvUdFhWyYdfEOjpp/UQZOhOM1d8GFiw8N8ClWBGc3mdlADQp6tviodXueluZ7UxJLNx3HXKFYLleewwIFhC82zqeQ1PbxQDL8QLjzca+IUzq6Cd/t7OAgvv3YmpXgNR0/xoWQGdM1/YwHxtcAcVlskXJw5ZR0Y2zA==
    ca.connector.KRA.uri=/kra/agent/kra/connector
  4. Then edit the enrollment form and add or replace the transport certificate value in the keyTransportCert method.

    # vim /var/lib/pki/pki-tomcat/ca/webapps/ca/ee/ca/ProfileSelect.template
    
    var keyTransportCert = MIIDbDCCAlSgAwIBAgIBDDANBgkqhkiG9w0BAQUFADA6MRgwFgYDVQQKEw9Eb21haW4gc28gbmFtZWQxHjAcBgNVBAMTFUNlcnRpZmljYXRlIEF1dGhvcml0eTAeFw0wNjExMTQxODI2NDdaFw0wODEwMTQxNzQwNThaMD4xGDAWBgNVBAoTD0RvbWFpbiBzbyBuYW1lZDEiMCAGA1UEAxMZRFJNIFRyYW5zcG9ydCBDZXJ0aWZpY2F0ZTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKnMGB3WkznueouwZjrWLFZBLpKt6TimNKV9iz5s0zrGUlpdt81/BTsU5A2sRUwNfoZSMs/d5KLuXOHPyGtmC6yVvaY719hr9EGYuv0Sw6jb3WnEKHpjbUO/vhFwTufJHWKXFN3V4pMbHTkqW/x5fu/3QyyUre/5IhG0fcEmfvYxIyvZUJx+aQBW437ATD99Kuh+I+FuYdW+SqYHznHY8BqOdJwJ1JiJMNceXYAuAdk+9t70RztfAhBmkK0OOP0vH5BZ7RCwE3Y/6ycUdSyPZGGc76a0HrKOz+lwVFulFStiuZIaG1pv0NNivzcj0hEYq6AfJ3hgxcC1h87LmCxgRWUCAwEAAaN5MHcwHwYDVR0jBBgwFoAURShCYtSg+Oh4rrgmLFB/Fg7X3qcwRAYIKwYBBQUHAQEEODA2MDQGCCsGAQUFBzABhihodHRwOi8vY2x5ZGUucmR1LnJlZGhhdC5jb206OTE4MC9jYS9vY3NwMA4GA1UdDwEB/wQEAwIE8DANBgkqhkiG9w0BAQUFAAOCAQEAFYz5ibujdIXgnJCbHSPWdKG0T+FmR67YqiOtoNlGyIgJ42fi5lsDPfCbIAe3YFqmF3wU472h8LDLGyBjy9RJxBj+aCizwHkuoH26KmPGntIayqWDH/UGsIL0mvTSOeLqI3KM0IuH7bxGXjlION83xWbxumW/kVLbT9RCbL4216tqq5jsjfOHNNvUdFhWyYdfEOjpp/UQZOhOM1d8GFiw8N8ClWBGc3mdlADQp6tviodXueluZ7UxJLNx3HXKFYLleewwIFhC82zqeQ1PbxQDL8QLjzca+IUzq6Cd/t7OAgvv3YmpXgNR0/xoWQGdM1/YwHxtcAcVlskXJw5ZR0Y2zA==;

12.2. Encryption of KRA operations

Certificate System encrypts the following key operations in the Key Recovery Authority (KRA):

  • Archival:

    • Encryption of keys to archive in a Certificate Request Message Format (CRMF) package for transport to the KRA.
    • Encryption of the key for storage in the KRA LDAP database.
  • Recovery:

    • Encryption of a user-provided session key for transport to the key.
    • Decryption of the secret and re-encryption using the user provided session key or creation of a PKCS#12 package.
  • Generation:

    • Encryption of a generated key for storage.

The Certificate System client automatically uses the encryption algorithm set in the KRA’s configuration and no further actions are required.

Note

Only AES CBC (in case when kra.allowEncDecrypt.archival=true and kra.allowEncDecrypt.recovery=true) and AES Key Wrap (in case when kra.allowEncDecrypt.archival=false and kra.allowEncDecrypt.recovery=false) are allowed in the following configuration. Any FIPS 140-2 validated HSM that supports either algorithm is allowed for the key archival and recovery feature provided by KRA.

Certificate System defines groups of configuration parameters related to key operation encryption in the /var/lib/pki/pki-instance_name/conf/kra/CS.cfg file. We recommend the following set of parameters (see note above for other option):

kra.allowEncDecrypt.archival=false
kra.allowEncDecrypt.recovery=false
kra.storageUnit.wrapping.1.payloadEncryptionAlgorithm=AES
kra.storageUnit.wrapping.1.payloadEncryptionIVLen=16
kra.storageUnit.wrapping.1.payloadEncryptionMode=CBC
kra.storageUnit.wrapping.1.payloadEncryptionPadding=PKCS5Padding
kra.storageUnit.wrapping.1.payloadWrapAlgorithm=AES KeyWrap/Padding
kra.storageUnit.wrapping.1.sessionKeyKeyGenAlgorithm=AES
kra.storageUnit.wrapping.1.sessionKeyLength=128
kra.storageUnit.wrapping.1.sessionKeyType=AES
kra.storageUnit.wrapping.1.sessionKeyWrapAlgorithm=RSA
kra.storageUnit.wrapping.choice=1

Each group (kra.storageUnit.wrapping.0.* vs kra.storageUnit.wrapping.1.*) has individual settings, and the number defines which settings belong to the same configuration group. The current configuration group is set in the kra.storageUnit.wrapping.choice parameter in the /var/lib/pki/pki-instance_name/conf/kra/CS.cfg file.

Ensure that kra.storageUnit.wrapping.choice=1 is set in the configuration file before continuing.

Note

Certificate System adds the information required to decrypt the data to the record in the KRA database. Therefore, even after changing the encryption algorithm, Certificate System is still able to decrypt data previously stored in the KRA using a different encryption algorithm.

Each secret (a "payload") is encrypted with a session key. Parameters controlling this encryption are prefixed with payload. The set of parameters to be used depends on the value of kra.allowEncDecrypt.archival and kra.allowEncDecrypt.recovery. By default, both of these are false. See Section 12.2.2.2, “Solving limitations of HSMs when using AES encryption in KRAs” for the effect of these two parameters on HSMs.

When kra.allowEncDecrypt.archival and kra.allowEncDecrypt.recovery are both false:

  • payloadWrapAlgorithm determines the wrapping algorithm used. The only one valid choice is AES KeyWrap.
  • When payloadWrapAlgorithm=AES/CBC/PKCS5Padding, then payloadWrapIVLength=16 has to be specified to tell PKI that we need to generate an IV (as CBC requires one).

When kra.allowEncDecrypt.archival and kra.allowEncDecrypt.recovery are both true:

  • payloadEncryptionAlgorithm determines the encryption algorithm used. The only valid choice is AES.
  • payloadEncryptionMode determines the block chaining mode. The only valid choice is CBC.
  • payloadEncryptionPadding determines the padding scheme. The only valid choice is PKCS5Padding.

The session key is then wrapped with the KRA Storage Certificate, an RSA token. Parameters controlling the session key and its encryption are prefixed with sessionKey.

  • sessionKeyType is the type of key to generate. The only valid choice is AES.
  • sessionKeyLength is the length of the generated session key. Valid choices are 128 and 256, to encrypt the payload with 128-bit AES or 256-bit AES respectively.
  • sessionKeyWrapAlgorithm is the type of key the KRA Storage Certificate is. The only valid choice in this guide is RSA.

If you run Certificate System with AES enabled in the KRA, but the Hardware Security Module (HSM) does not support the AES key wrapping feature, key archival fails. To solve the problem, the following solutions are supported:

Selecting a different algorithm for the key wrapping

Sometimes the KRA does not support the default key wrapping algorithm, but it supports other algorithms. For example, to use AES-128-CBC as the key wrapping algorithm:

  1. Set the following parameters in the /var/lib/pki/pki-instance_name/conf/kra/CS.cfg file:

    kra.storageUnit.wrapping.1.payloadWrapAlgorithm=AES KeyWrap/Padding
    kra.storageUnit.wrapping.1.payloadWrapIVLen=16
    kra.storageUnit.wrapping.1.sessionKeyLength=128
  2. Restart the instance:

    # systemctl restart pki-tomcatd@instance_name.service

    OR if using the Nuxwdog watchdog:

    # systemctl restart pki-tomcatd-nuxwdog@instance_name.service

    If the KRA runs in a difference instance then the CA, you need to restart both instances.

Selecting a different algorithm for the key wrapping has the benefit that if the HSM later adds support for AES key wrapping, you can revert the settings because the key records have the relevant information set.

This configuration uses the kra.storageUnit.wrapping.1.payloadWrap{Algorithm,IVLen} and kra.storageUnit.wrapping.1.payloadEncryption{Algorithm,Mode,Padding} parameters.

Setting the KRA into encryption mode

If the HSM does not support any KeyWrap algorithms, on some occasions it is necessary to place the KRA into Encryption Mode. When setting the KRA into encryption mode, all keys will be stored using encryption algorithms rather than key wrapping algorithms.

To set the KRA into encryption mode:

  1. Set the following parameters in the /var/lib/pki/pki-instance_name/conf/kra/CS.cfg file to true:

    kra.allowEncDecrypt.archival=true
    kra.allowEncDecrypt.recovery=true
  2. Restart the service:

    # systemctl restart pki-tomcatd@instance_name.service

    OR if using the Nuxwdog watchdog:

    # systemctl restart pki-tomcatd-nuxwdog@instance_name.service

    If the KRA runs in a difference instance than the CA, you need to restart both instances.

This configuration uses kra.storageUnit.wrapping.1.payloadEncryption{Algorithm,Mode,Padding} and kra.storageUnit.wrapping.1.payloadWrap{Algorithm,IVLen} parameters.

Note

If you later switch to a different algorithm for the key wrapping according to the section called “Selecting a different algorithm for the key wrapping”, you must manually add the appropriate meta data to records created before you set the KRA into encryption mode.

Key recovery agents collectively authorize and retrieve private encryption keys and associated certificates in a PKCS#12 package. To authorize key recovery, the required number of recovery agents access the KRA agent services page and use the Authorize Recovery area to enter each authorization separately.

One of the agents initiates the key recovery process. For a synchronous recovery, each approving agent uses the reference number (which was returned with the initial request) to open the request and then authorizes key recovery separately. For an asynchronous recovery, the approving agents all search for the key recovery request and then authorize the key recovery. Either way, when all of the authorizations are entered, the KRA checks the information. If the information presented is correct, it retrieves the requested key and returns it along with the corresponding certificate in the form of a PKCS #12 package to the agent who initiated the key recovery process.

The key recovery agent scheme configures the KRA to recognize to which group the key recovery agents belong and specifies how many of these agents are required to authorize a key recovery request before the archived key is restored.

To set up agent-initiated key recovery, edit two parameters in the KRA configuration:

  • Set the number of recovery managers to require to approve a recovery.
  • Set the group to which these users must belong.

These parameters are set in the KRA’s CS.cfg configuration file.

  1. Stop the server before editing the configuration file.

    # systemctl stop pki-tomcatd@instance_name.service

    OR if using the Nuxwdog watchdog:

    # systemctl stop pki-tomcatd-nuxwdog@instance_name.service
  2. Open the KRA’s CS.cfg file.

    # vim /var/lib/pki/pki-tomcat/kra/conf/CS.cfg
  3. Edit the two recovery scheme parameters.

    kra.noOfRequiredRecoveryAgents=3
    kra.recoveryAgentGroup=Key Recovery Authority Agents
  4. Restart the server.

    # systemctl start pki-tomcatd@instance_name.service

    OR

    # systemctl start pki-tomcatd-nuxwdog@instance_name.service
Note

For more information on how to configure agent-approved key recovery in the console, see 4.1 Configuring Agent-Approved Key Recovery in the Console in the Administration Guide (Common Criteria Edition).

12.3.2. Customizing the Key Recovery Form

The default key agent scheme requires a single agent from the Key Recovery Authority Agents group to be in charge of authorizing key recovery.

It is also possible to customize the appearance of the key recovery form. Key recovery agents need an appropriate page to initiate the key recovery process. By default, the KRA’s agent services page includes the appropriate HTML form to allow key recovery agents to initiate key recovery, authorize key recovery requests, and retrieve the encryption keys. This form is located in the /var/lib/pki/pki-tomcat/kra/webapps/kra/agent/kra/ directory, called confirmRecover.html.

IMPORTANT

If the key recovery confirmation form is customized, do not to delete any of the information for generating the response. This is vital to the functioning of the form. Restrict any changes to the content in and appearance of the form.

Some private keys (mainly in older deployments) were wrapped in SHA-1, 1024-bit storage keys when they were archived in the KRA. These algorithms have become less secure as processor speeds improve and algorithms have been broken. As a security measure, it is possible to rewrap the private keys in a new, stronger storage key (SHA-256, 2048-bit keys).

12.3.3.1. About KRATool

Rewrapping and moving keys and key enrollment and recovery requests is done using the KRATool utility (known in previous versions of Red Hat Certificate System as DRMTool).

The KRATool performs two operations: it can rewrap keys with a new private key, and it can renumber attributes in the LDIF file entries for key records, including enrollment and recovery requests. At least one operation (rewrap or renumber) must be performed and both can be performed in a single invocation.

For rewrapping keys, the tool accesses the key entries in an exported LDIF file for the original KRA, unwraps the keys using the original KRA storage key, and then rewraps the keys in the new KRA’s stronger storage key.

Example 12.1. Rewrapping Keys

# KRATool -kratool_config_file "/usr/share/pki/java-tools/KRATool.cfg" -source_ldif_file "/tmp/files/originalKRA.ldif" -target_ldif_file "/tmp/files/newKRA.ldif" -log_file "/tmp/kratool.log" -source_pki_security_database_path "/tmp/files/" -source_storage_token_name "Internal Key Storage Token" -source_storage_certificate_nickname "storageCert cert-pki-tomcat KRA" -target_storage_certificate_file "/tmp/files/omega.cert"

When multiple KRA instances are being merged into a single instance, it is important to make sure that no key or request records have conflicting CNs, DNs, serial numbers, or request ID numbers. These values can be processed to append a new, larger number to the existing values.

Example 12.2. Renumbering keys

# KRATool -kratool_config_file "/usr/share/pki/java-tools/KRATool.cfg" -source_ldif_file "/tmp/files/originalKRA.ldif" -target_ldif_file "/tmp/files/newKRA.ldif" -log_file "/tmp/kratool.log" -append_id_offset 100000000000 -source_kra_naming_context "pki-tomcat-KRA" -target_kra_naming_context "pki-tomcat-2-KRA" -process_requests_and_key_records_only

The KRATool options and its configuration file are discussed in more detail in the KRATool(1) man page.

This procedure rewraps the keys stored in one or more Certificate System KRA (for example, pki-tomcat on sourcekra.example.com) and stores them into another Certificate System KRA (for example, pki-tomcat-2 on targetkra.example.com). This is not the only use case; the tool can be run on the same instance as both the source and target, to rewrap existing keys, or it can be used simply to copy keys from multiple KRA instances into a single instance without rewrapping the keys at all.

IMPORTANT

The storage key size and type in the pki-tomcat-2 KRA must be set to 2048-bit and RSA.

  1. Log in to targetkra.example.com.
  2. Stop the pki-tomcat-2 KRA.

    [root@targetkra ~]# systemctl stop pki-tomcatd@pki-tomcat-2.service
  3. Create a data directory to store the key data that will be imported from the pki-tomcat KRA instance residing on sourcekra.example.com.

    [root@targetkra ~]# mkdir -p /export/pki
  4. Export the public storage certificate for the pki-tomcat-2 KRA to a flat file in the new data directory.

    [root@targetkra ~]# certutil -L -d /var/lib/pki/pki-tomcat-2/alias -n "storageCert cert-pki-tomcat-2 KRA" -a > /export/pki/targetKRA.cert
  5. Stop the Directory Server instance for the pki-tomcat-2 KRA, if it is on the same machine.

    [root@newkra ~]# systemctl stop dirsrv.target
  6. Export the configuration information for the pki-tomcat-2 KRA.

    [root@targetkra ~]# grep nsslapd-localuser /etc/dirsrv/slapd-instanceName/dse.ldif
    
      nsslapd-localuser: dirsrv
    
    [root@targetkra ~]# chown dirsrv:dirsrv /export/pki
    
    [root@targetkra ~]# /usr/lib64/dirsrv/slapd-instanceName/db2ldif -n pki-tomcat-2-KRA -a /export/pki/pki-tomcat-2.ldif
    IMPORTANT

    Make sure that the LDIF file contains a single blank line at the end.

  7. Log in to sourcekra.example.com.
  8. Stop the pki-tomcat KRA.

    [root@sourcekra ~]# systemctl stop pki-tomcatd@pki-tomcat.service
  9. Create a data directory to store the key data that will be exported to the pki-tomcat-2 KRA instance residing on targetkra.example.com.

    [root@sourcekra ~]# mkdir -p /export/pki
  10. Stop the Directory Server instance for the pki-tomcat KRA, if it is on the same machine.

    [root@sourcekra ~]# systemctl stop dirsrv.target
  11. Export the configuration information for the pki-tomcat KRA.

    [root@sourcekra ~]# grep nsslapd-localuser /etc/dirsrv/slapd-instanceName/dse.ldif
    
      nsslapd-localuser: dirsrv
    
    [root@sourcekra ~]# chown dirsrv:dirsrv /export/pki
    
    [root@sourcekra ~]# /usr/lib64/dirsrv/slapd-instanceName/db2ldif -n pki-tomcat-KRA -a /export/pki/pki-tomcat.ldif
    IMPORTANT

    Make sure that the LDIF file contains a single blank line at the end.

  12. Copy the pki-tomcat KRA NSS security databases to this directory.

    [root@sourcekra ~]# cp -p /var/lib/pki/pki-tomcat/alias/cert9.db /export/pki
    
    [root@sourcekra ~]# cp -p /var/lib/pki/pki-tomcat/alias/key4.db /export/pki
    
    [root@sourcekra ~]# cp -p /var/lib/pki/pki-tomcat/alias/pkcs11.txt /export/pki
  13. Copy the file with the public storage key from the pki-tomcat-2 KRA machine to this machine. For example:

    [root@sourcekra ~]# cd /export/pki
    
    [root@sourcekra ~]# sftp root@targetkra.example.com
    
      sftp> cd /export/pki
      sftp> get targetKRA.cert
      sftp> quit
  14. If necessary, edit the default KRATool.cfg file to use with the tool. The default file can also be used without changes.
  15. Run the KRATool; all of these parameters should be on a single line:

    [root@sourcekra ~]# KRATool -kratool_config_file "/usr/share/pki/java-tools/KRATool.cfg"
              -source_ldif_file /export/pki/pki-tomcat.ldif \
              -target_ldif_file /export/pki/source2targetKRA.ldif \
              -log_file /export/pki/kratool.log \
              -source_pki_security_database_path /export/pki \
              -source_storage_token_name 'Internal Key Storage Token' \
              -source_storage_certificate_nickname 'storageCert cert-pki-tomcat KRA' \
              -target_storage_certificate_file /export/pki/targetKRA.cert \
              -append_id_offset 100000000000 \
              -source_kra_naming_context "pki-tomcat-KRA" \
              -target_kra_naming_context "pki-tomcat-2-KRA" \
              -process_requests_and_key_records_only
    Note

    The command may prompt for the password to the token stored in the pki-tomcat KRA NSS security databases.

    When it is done, the command creates the file specified in the -target_ldif_file parameter, source2targetKRA.ldif.

  16. Copy this LDIF file over to the pki-tomcat-2 KRA machine. For example:

    [root@sourcekra ~]# scp /export/pki/source2targetKRA.ldif root@targetkra.example.com:/export/pki
    Important

    Make sure that the LDIF file contains a single blank line at the end.

  17. If multiple KRA instances are being merged, their data can be merged into a single import operation. Simply perform the same procedure for every KRA, which will be merged.

    Important

    Make sure to specify unique values for the -target_ldif_file parameter to create separate LDIF files, and to specify unique -append_id_offset values so that there are no conflicts when the LDIF files are concatenated.

  18. On the pki-tomcat-2 KRA machine, import the LDIF file(s) with the other key data by concatenating the pki-tomcat-2 KRA configuration LDIF file and every exported LDIF file for the other KRA instances. For example:

    [root@targetkra ~]# cd /export/pki
    [root@targetkra ~]# cat pki-tomcat-2.ldif source2targetKRA.ldif > combined.ldif
  19. Import this combined LDIF file into the Directory Server database for the pki-tomcat-2 KRA instance.

    [root@targetkra ~]# /usr/lib64/dirsrv/slapd-instanceName/ldif2db -n pki-tomcat-2-KRA -i /export/pki/combined.ldif
  20. Start the Directory Server instance for the pki-tomcat-2 KRA.

    [root@targetkra ~]# systemctl start dirsrv.target
  21. Start the pki-tomcat-2 KRA.

    [root@targetkra ~]# systemctl start pki-tomcatd@pki-tomcat-2.service

Chapter 13. Configuring logs

The Certificate System subsystem log files record events related to operations within that specific subsystem instance. For each subsystem, different logs are kept for issues such as installation, access, and web servers.

All subsystems have similar log configuration, options, and administrative paths.

For details about log administration after the installation, see Chapter 12 Configuring Subsystem Logs in the Administration Guide (Common Criteria Edition).

For an overview on logs, see Section 2.3.14, “Logs”.

13.1. Log settings

The way that logs are configured can affect Certificate System performance. For example, log file rotation keeps logs from becoming too large, which slows down subsystem performance. This section explains the different kinds of logs recorded by Certificate System subsystems and covers important concepts such as log file rotation, buffered logging, and available log levels.

13.1.1. Services that are logged

All major components and protocols of Certificate System log messages to log files. The following table lists services that are logged by default. To view messages logged by a specific service, customize log settings accordingly. For details, see Section 13.1.5, “Signing log files”

Expand
Table 13.1. Services logged
ServiceDescription

ACLs

Logs events related to access control lists.

Administration

Logs events related to administration activities, such as HTTPS communication between the Console and the instance.

All

Logs events related to all the services.

Authentication

Logs events related to activity with the authentication module.

Certificate Authority

Logs events related to the Certificate Manager.

Database

Logs events related to activity with the internal database.

HTTP

Logs events related to the HTTP activity of the server. Note that HTTP events are actually logged to the errors log belonging to the Apache server incorporated with the Certificate System to provide HTTP services.

Key Recovery Authority

Logs events related to the KRA.

LDAP

Logs events related to activity with the LDAP directory, which is used for publishing certificates and CRLs.

OCSP

Logs events related to OCSP, such as OCSP status GET requests.

Others

Logs events related to other activities, such as command-line utilities and other processes.

Request Queue

Logs events related to the request queue activity.

User and Group

Logs events related to users and groups of the instance.

13.1.2. Log levels (message categories)

The different events logged by Certificate System services are determined by the log levels, which makes identifying and filtering events simpler. The different Certificate System log levels are listed in Table 13.2, “Log levels and corresponding log messages”.

Log levels are represented by numbers 0 to 10, each number indicating the level of logging to be performed by the server. The level sets how detailed the logging should be.

A higher priority level means less detail because only events of high priority are logged.

Note

The default log level is 1 and this value should not be changed. To enable debug logging, see Section 13.3.3, “Additional configuration for debug log”.

The following table is provided for reference to better understand log messages.

Expand
Table 13.2. Log levels and corresponding log messages
Log levelMessage categoryDescription

0

Debugging

These messages contain debugging information. This level is not recommended for regular use because it generates too much information.

1

Informational (default selection for audit log)

These messages provide general information about the state of the Certificate System, including status messages such as Certificate System initialization complete and Request for operation succeeded.

2

Warning

These messages are warnings only and do not indicate any failure in the normal operation of the server.

3

Failure; the default selection for system and error logs

These messages indicate errors and failures that prevent the server from operating normally, including failures to perform a certificate service operation (User authentication failed or Certificate revoked) and unexpected situations that can cause irrevocable errors (The server cannot send back the request it processed for a client through the same channel the request came from the client).

4

Misconfiguration

These messages indicate that a misconfiguration in the server is causing an error.

5

Catastrophic failure

These messages indicate that, because of an error, the service cannot continue running.

6

Security-related events

These messages identify occurrences that affect the security of the server. For example, Privileged access attempted by user with revoked or unlisted certificate.

7

PDU-related events (debugging)

These messages contain debugging information for PDU events. This level is not recommended for regular use because it generates more information than is normally useful.

8

PDU-related events

These messages relate transactions and rules processed on a PDU, such as creating MAC tokens.

9

PDU-related events

This log levels provides verbose log messages for events processed on a PDU, such as creating MAC tokens.

10

All logging levels

This log level enables all logging levels.

Log levels can be used to filter log entries based on the severity of an event.

The log level is successive; specifying a value of 3 causes levels 4, 5, and 6 to be logged. Log data can be extensive, especially at lower (more verbose) logging levels. Make sure that the host machine has sufficient disk space for all the log files. It is also important to define the logging level, log rotation, and server-backup policies appropriately so that all the log files are backed up and the host system does not get overloaded; otherwise, information can be lost.

13.1.3. Buffered and unbuffered logging

The Java subsystems support buffered logging for all types of logs. The server can be configured for either buffered or unbuffered logging.

If buffered logging is configured, the server creates buffers for the corresponding logs and holds the messages in the buffers for as long as possible. The server flushes out the messages to the log files only when one of the following conditions occurs:

  • The buffer gets full. The buffer is full when the buffer size is equal to or greater than the value specified by the bufferSize configuration parameter. The default value for this parameter is 512 KB.
  • The flush interval for the buffer is reached. The flush interval is reached when the time interval since the last buffer flush is equal to or greater than the value specified by the flushInterval configuration parameter. The default value for this parameter is 5 seconds.
  • When current logs are read from Console. The server retrieves the latest log when it is queried for current logs.

If the server is configured for unbuffered logging, the server flushes out messages as they are generated to the log files. Because the server performs an I/O operation (writing to the log file) each time a message is generated, configuring the server for unbuffered logging decreases performance.

Setting log parameters is described in Chapter 13, Configuring logs.

13.1.4. Log file rotation

The subsystem logs have an optional log setting that allows them to be rotated and start a new log file instead of letting log files grow indefinitely. Log files are rotated when either of the following occur:

  • The size limit for the corresponding file is reached. The size of the corresponding log file is equal to or greater than the value specified by the maxFileSize configuration parameter. The default value for this parameter is 2000 KB.
  • The age limit for the corresponding file is reached. The corresponding log file is equal to or older than the interval specified by the rolloverInterval configuration parameter. The default value for this parameter is 2592000 seconds (every thirty days).
Note

Setting both these parameters to 0 effectively disables the log file rotation.

When a log file is rotated, the old file is named using the name of the file with an appended time stamp. The appended time stamp is an integer that indicates the date and time the corresponding active log file was rotated. The date and time have the forms YYYYMMDD (year, month, day) and HHMMSS (hour, minute, second).

Log files, especially the audit log file, contain critical information. These files should be periodically archived to some backup medium by copying the entire log directory to an archive medium.

Note

Certificate System does not provide any tool or utility for archiving log files. Section 13.1.5, “Signing log files” suggests ways to ensure the integrity of the log files to be archived.

13.1.5. Signing log files

As an alternative to the signed audit log feature (Section 13.3.1.1, “Enabling signed audit logging”), which creates audit logs where audit entries are automatically signed, log files can be signed by using COTS tools such as gpg, before they are archived or distributed for audit purposes. Doing so will allow to check files for tampering.

13.2.1. Enabling OS-level audit logs

Warning

All operations in the following sections have to be performed as root or a privileged user via sudo.

The auditd logging framework provides many additional audit capabilities. These OS-level audit logs complement functionality provided by Certificate System directly. Before performing any of the following steps in this section, make sure the audit package is installed:

# sudo yum install audit

Auditing of system package updates (using yum and rpm and including Certificate System) is automatically performed and requires no additional configuration.

Note

After adding each audit rule and restarting the auditd service, validate the new rules were added by running:

# auditctl -l

The contents of the new rules should be visible in the output.

For instructions on viewing the resulting audit logs, see 12.2.3 Displaying OS-level audit logs in the Administration Guide (Common Criteria Edition).

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:

-a always,exit -F arch=b32 -S unlink -F dir=/var/log/pki -F key=rhcs_audit_deletion
-a always,exit -F arch=b32 -S rename -F dir=/var/log/pki -F key=rhcs_audit_deletion
-a always,exit -F arch=b32 -S rmdir -F dir=/var/log/pki -F key=rhcs_audit_deletion
-a always,exit -F arch=b32 -S unlinkat -F dir=/var/log/pki -F key=rhcs_audit_deletion
-a always,exit -F arch=b32 -S renameat -F dir=/var/log/pki -F key=rhcs_audit_deletion
-a always,exit -F arch=b64 -S unlink -F dir=/var/log/pki -F key=rhcs_audit_deletion
-a always,exit -F arch=b64 -S rename -F dir=/var/log/pki -F key=rhcs_audit_deletion
-a always,exit -F arch=b64 -S rmdir -F dir=/var/log/pki -F key=rhcs_audit_deletion
-a always,exit -F arch=b64 -S unlinkat -F dir=/var/log/pki -F key=rhcs_audit_deletion
-a always,exit -F arch=b64 -S renameat -F dir=/var/log/pki -F key=rhcs_audit_deletion

Then restart auditd:

# service auditd restart

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:

-w /etc/pki/<instance name>/alias -p warx -k rhcs_audit_nssdb

<instance name> is the name of the current instance. For each file (<file>) in /etc/pki/<instance name>/alias, add to /etc/audit/rules.d/rhcs-audit-nssdb-access.rules the following line :

-w /etc/pki/<instance name>/alias/<file> -p warx -k rhcs_audit_nssdb

For example, if the instance name is pki-ca121318ec and cert9.db, key4.db, NHSM-CONN-XCcert9.db, NHSM-CONN-XCkey4.db, and pkcs11.txt are files, then the configuration file would contain:

-w /etc/pki/pki-ca121318ec/alias -p warx -k rhcs_audit_nssdb
-w /etc/pki/pki-ca121318ec/alias/cert9.db -p warx -k rhcs_audit_nssdb
-w /etc/pki/pki-ca121318ec/alias/key4.db -p warx -k rhcs_audit_nssdb
-w /etc/pki/pki-ca121318ec/alias/NHSM-CONN-XCcert9.db -p warx -k rhcs_audit_nssdb
-w /etc/pki/pki-ca121318ec/alias/NHSM-CONN-XCkey4.db -p warx -k rhcs_audit_nssdb
-w /etc/pki/pki-ca121318ec/alias/pkcs11.txt -p warx -k rhcs_audit_nssdb

Then restart auditd:

# service auditd restart
13.2.1.3. 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:

-a always,exit -F arch=b32 -S adjtimex,settimeofday,stime -F key=rhcs_audit_time_change
-a always,exit -F arch=b64 -S adjtimex,settimeofday -F key=rhcs_audit_time_change
-a always,exit -F arch=b32 -S clock_settime -F a0=0x0 -F key=rhcs_audit_time_change
-a always,exit -F arch=b64 -S clock_settime -F a0=0x0 -F key=rhcs_audit_time_change
-a always,exit -F arch=b32 -S clock_adjtime -F key=rhcs_audit_time_change
-a always,exit -F arch=b64 -S clock_adjtime -F key=rhcs_audit_time_change
-w /etc/localtime -p wa -k rhcs_audit_time_change

Then restart auditd:

# service auditd restart

For instructions on how to set time, see Section 7.13.1, “Setting date and time for RHCS”.

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

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

Example 13.1. rhcs-audit-config-access.rules configuration file

For example, if the instance name is pki-ca121318ec and only a CA is installed, the /etc/audit/rules.d/rhcs-audit-config-access.rules file would contain:

-w /etc/pki/pki-ca121318ec/server.xml -p wax -k rhcs_audit_config
-w /etc/pki/pki-ca121318ec/ca/CS.cfg -p wax -k rhcs_audit_config

Note that access to the PKI NSS database is already audited under rhcs_audit_nssdb.

13.3. Configuring Logs in the CS.cfg File

During the installation configuration, you can configure the logging by directly editing the CS.cfg for the instance.

  1. Stop the subsystem instance.

    # systemctl stop pki-tomcatd-nuxwdog@instance_name.service
  2. Open the CS.cfg file in the /var/lib/pki/<instance_name>/<subsystem_type>/conf directory.
  3. Create a new log.
  4. To configure a log instance, modify the parameters associated with that log. These parameters begin with log.instance.

    Expand
    Table 13.3. Log entry parameters
    ParameterDescription

    type

    The type of log file. e.g. signedAudit.

    enable

    Sets whether the log is active. Only enabled logs actually record events.

    level

    Sets the log level in the text field. The level must be manually entered in the field; there is no selection menu. The log level setting is a numeric value, as listed in Section 13.1.2, “Log levels (message categories)”.

    fileName

    The full path, including the file name, to the log file. The subsystem user should have read/write permission to the file.

    bufferSize

    The buffer size in kilobytes (KB) for the log. Once the buffer reaches this size, the contents of the buffer are flushed out and copied to the log file. The default size is 512 KB. For more information on buffered logging, see Section 13.1.3, “Buffered and unbuffered logging”.

    flushInterval

    The amount of time, in seconds, before the contents of the buffer are flushed out and added to the log file. The default interval is 5 seconds.

    maxFileSize

    The size, kilobytes (KB), a log file can become before it is rotated. Once it reaches this size, the file is copied to a rotated file, and the log file is started new. For more information on log file rotation, see Section 13.1.4, “Log file rotation”. The default size is 2000 KB.

    rolloverInterval

    The frequency which the server rotates the active log file. The available choices are hourly, daily, weekly, monthly, and yearly. The default value is 2592000, which represents monthly in seconds. is monthly. For more information, see Section 13.1.4, “Log file rotation”.

    register [a]

    This variable is set to false by default and should remain so due to feature improvements. The self-test messages are only logged to the log file specified by selftests.container.logger.fileName.

    logSigning [b]

    Enables signed logging. When this parameter is enabled, provide a value for the signedAuditCertNickname parameter. This option means the log can only be viewed by an auditor. The value is either true or false.

    signedAuditCertNickname [c]

    The nickname of the certificate used to sign audit logs. The private key for this certificate must be accessible to the subsystem in order for it to sign the log.

    events [d]

    Specifies which events are logged to the audit log. Log events are separated by commas with no spaces.

    [a] register is for self-test logs only.
    [b] logSigning is for audit logs only.
    [c] signedAuditCertNickname is for audit logs only.
    [d] events is for audit logs only.
  5. Save the file.
  6. Start the subsystem instance.

    # systemctl start pki-tomcatd@instance_name.service

    OR if using the Nuxwdog watchdog:

    # systemctl start pki-tomcatd-nuxwdog@instance_name.service

13.3.1. Enabling and configuring signed audit log

13.3.1.1. Enabling signed audit logging

By default, audit logging is enabled upon installation. However, log signing needs to be enabled manually after installation.

  • To display the current audit logging configuration, use the following command:
    pki-server subsystem-audit-config-show -i <instance_name>.

    For example, for a CA subsystem:

    # pki-server ca-audit-config-show -i rhcs10-RSA-SubCA
    
      Enabled: True
      Log File: var/lib/pki/rhcs10-RSA-SubCA/logs/ca/signedAudit/ca_audit
      Buffer Size (bytes): 512
      Flush Interval (seconds): 5
      Max File Size (bytes): 2000
      Rollover Interval (seconds): 2592000
      Expiration Time (seconds): 0
      Log Signing: False
      Signing Certificate: NHSM-CONN-XC:auditSigningCert cert-rhcs10-RSA-SubCA CA
  • To enable signed audit logging, use the pki-server utility to set the --logSigning option to true:

    # pki-server subsystem-audit-config-mod --logSigning True -i instance_name
    1. Stop the instance:

      # systemctl stop pki-tomcatd@instance_name.service

      OR if using the Nuxwdog watchdog:

      # systemctl stop pki-tomcatd-nuxwdog@instance_name.service
    2. Run the pki-server <subsystem>-audit-config-mod command, for example for a CA subsystem:

      # pki-server ca-audit-config-mod --logSigning True -i rhcs10-RSA-SubCA
        ...
        Log Signing: True
        ...
    3. Start the instance:

      # systemctl start pki-tomcatd@instance_name.service

      OR if using the Nuxwdog watchdog:

      # systemctl start pki-tomcatd-nuxwdog@instance_name.service
13.3.1.2. Configuring audit events
13.3.1.2.1. Enabling and disabling audit events

For details about enabling and disabling audit events, see 12.1.2.3 Configuring a Signed Audit Log in the Console in the Administration Guide (Common Criteria Edition).

In addition, audit event filters can be set to finer grained selection. See Section 13.3.1.2.2, “Filtering audit events”.

For a complete list of auditable events in Certificate System, see Appendix E Audit events appendix in the Administration Guide (Common Criteria Edition).

13.3.1.2.2. Filtering audit events

In Certificate System administrators can set filters to configure which audit events will be logged in the audit file based on the event attributes.

The format of the filters is the same as for LDAP filters. However, Certificate System only supports the following filters:

Expand
Table 13.4. Supported audit event filters
TypeFormatExample

Presence

(attribute=*)

(ReqID=*)

Equality

(attribute=value)

(Outcome=Failure)

Substring

(attribute=initial*any*…​*any*final)

(SubjectID=*admin*)

AND operation

(&(filter_1)(filter_2)…​(filter_n))

(&(SubjectID=admin)(Outcome=Failure))

OR operation

(|(filter_1)(filter_2)…​(filter_n))

(|(SubjectID=admin)(Outcome=Failure))

NOT operation

(!(filter))

(!(SubjectID=admin))

For further details on LDAP filters, see the Using Compound Search Filters in the Red Hat Directory Server Administration Guide.

Example 13.2. Filtering audit events

  • To display the current settings for profile certificate requests:

    $ pki-server ca-audit-event-show PROFILE_CERT_REQUEST -i <instance_name>
    
      Event Name: PROFILE_CERT_REQUEST
      Enabled: True
      Filter: None
  • To display the current settings for processed certificate requests:

    $ *pki-server ca-audit-event-show CERT_REQUEST_PROCESSED -i <instance_name>*
    
      Event Name: CERT_REQUEST_PROCESSED
      Enabled: True
      Filter: None
  • To log only failed events for profile certificate requests and events for processed certificate requests that have the InfoName field set to rejectReason or cancelReason:

    1. Stop Certificate System:

      # systemctl stop pki-tomcatd@instance_name.service

      OR if using the Nuxwdog watchdog:

      # systemctl stop pki-tomcatd-nuxwdog@instance_name.service
    2. Run the following command for profile certificate requests,:

      $ pki-server ca-audit-event-update PROFILE_CERT_REQUEST --filter "(Outcome=Failure)" i <instance_name>
        ...
        Filter: (Outcome=Failure)

      This results in the following entry in the CA’s CS.cfg:

      log.instance.SignedAudit.filters.PROFILE_CERT_REQUEST=(Outcome=Failure)
    3. Run the following command for processed certificate requests:

      $ pki-server ca-audit-event-update CERT_REQUEST_PROCESSED --filter "(|(InfoName=rejectReason)(InfoName=cancelReason))" i <instance_name>
        ...
        Filter: (|(InfoName=rejectReason)(InfoName=cancelReason))

      This results in the following entry in the CA’s CS.cfg:

      log.instance.SignedAudit.filters.CERT_REQUEST_PROCESSED=(|(InfoName=rejectReason)(InfoName=cancelReason))
    4. Start Certificate System:

      # systemctl start pki-tomcatd@instance_name.service

      OR if using the Nuxwdog watchdog:

      # systemctl start pki-tomcatd-nuxwdog@instance_name.service

13.3.2. Configuring self-tests

The self-tests feature and individual self-tests are registered and configured in the CS.cfg file. If a self-test is enabled, that self-test is listed for either on-demand or start up and is either empty or set as critical.

Critical self-tests have a colon and the word critical after the name of the self-test. Otherwise, nothing is in this place. The server shuts down when a critical self-test fails during on demand self-tests; the server will not start when a critical self-test fails during start up.

The implemented self-tests are automatically registered and configured when the instance was installed. The self-tests that are registered and configured are those associated with the subsystem type.

A self-test’s criticality is changed by changing the respective settings in the CS.cfg file.

13.3.2.1. Default self-tests at startup

The following self-tests are enabled by default at startup.

For the CA subsystem, the following self-tests are enabled by default at startup:

  • CAPresence - used to verify the presence of the CA subsystem.
  • CAValidity - used to determine that the CA subsystem is currently valid and has not expired. This involves checking the expiration of the CA certificate.
  • SystemCertsVerification - used to determine that the system certificates are currently valid and have not expired or been revoked. For the CA subsystem, only validity tests for each certificate are done, leaving out certificate verification tests which could result in an OCSP request. This behavior can be overridden with the following config parameter:

    selftests.plugin.SystemCertsVerification.FullCAandOCSPVerify=true

    By default, this configuration parameter is considered false if not present at all.

For the KRA subsystem, the following-self-tests are enabled:

  • KRAPresence - used to verify the presence of the KRA subsystem.
  • SystemCertsVerification - used to determine that the system certificates are currently valid and have not expired or been revoked.

For the OCSP subsystem, the following self-tests are enabled:

  • OCSPPresence - used to verify the presence of the OCSP subsystem.
  • OCSPValidity - used to determine that the OCSP subsystem is currently valid and has not expired. This involves checking the expiration of the OCSP certificate.
  • SystemCertsVerification - used to determine that the system certificates are currently valid and have not expired or been revoked. For the OCSP subsystem, only validity tests for each certificate are done, leaving out certificate verification tests which could result in an OCSP request. This behavior can be overridden with the following config parameter:

    selftests.plugin.SystemCertsVerification.FullCAandOCSPVerify=true

    By default, this configuration parameter is considered false if not present at all.

For the TKS subsystem, the following-self-tests are enabled:

  • SystemCertsVerification - used to determine that the system certificates are currently valid and have not expired or been revoked.

For the TPS subsystem, the following-self-tests are enabled:

  • TPSPresence - used to verify the presence of the TPS subsystem.
  • TPSValidity - used to determine that the TPS subsystem is currently valid and has not expired. This involves checking the expiration of the TPS certificate.
  • SystemCertsVerification - used to determine that the system certificates are currently valid and have not expired or been revoked.
13.3.2.2. Modifying self-test configuration

By default, the self-test configuration is compliant. However, some settings can change the visibility of self-test logging or improve performance. To modify the configuration settings for self-tests:

  1. Stop the subsystem instance.
  2. Open the CS.cfg file located in the instance’s conf/ directory.
  3. To edit the settings for the self-test log, edit the entries that begin with selftests.container.logger. Unless otherwise specified, these parameters do not affect compliance. These include the following parameters:

    • bufferSize- Specify the buffer size in kilobytes (KB) for the log. The default size is 512 KB. Once the buffer reaches this size, the contents of the buffer are flushed out and copied to the log file.
    • enable- Specify true to enable. Only enabled logs actually record events. This value must be enabled for compliance.
    • fileName- Specify the full path, including the filename, to the file to write messages. The server must have read/write permission to the file. By default, the self-test log file is /selftests.log
    • flushInterval- Specify the interval, in seconds, to flush the buffer to the file. The default interval is 5 seconds. The flushInterval is the amount of time before the contents of the buffer are flushed out and added to the log file.
    • level- The default selection is 1; this log is not set up for any level beside 1.
    • maxFileSize- Specify the file size in kilobytes (KB) for the error log. The default size is 2000 KB. The maxFileSize determines how large a log file can become before it is rotated. Once it reaches this size, the file is copied to a rotated file, and a new log file is started.
    • register- This variable is set to false by default and should remain so due to feature improvements. The self-test messages are only logged to the log file specified by selftests.container.logger.fileName.
    • rolloverInterval- Specify the frequency at which the server rotates the active error log file. The choices are hourly, daily, weekly, monthly, and yearly. The default value is 2592000, which represents monthly in seconds.
  4. To edit the order in which the self-test are run, specify the order by listing any of the self-test as the value of the following parameters separated by a comma and a space.

    To mark a self-test critical, add a colon and the word critical to the name of the self-test in the list.

    To disable a self-test, remove it as the value of either the selftests.container.order.onDemand or selftests.container.order.startup parameters.

  5. Save the file.
  6. Start the subsystem.

13.3.3. Additional configuration for debug log

13.3.3.1. Enabling and disabling debug logging

By default, debug logging is enabled in Certificate System. However, in certain situations, Administrators want to disable or re-enable this feature:

  1. Stop the Certificate System instance:

    # systemctl stop pki-tomcatd@instance-name.service

    OR if using the Nuxwdog watchdog:

    # systemctl stop pki-tomcatd-nuxwdog@instance-name.service
  2. Edit the /CS.cfg file and set the debug.enabled parameter:

    • To disable debug logging, set:

      debug.enabled=false
      Note

      Debug logs are not part of audit logging. Debug logs are helpful when trying to debug specific failures in Certificate System or a failing installation.

      By default, debug logs are enabled. If it is not desired, the administrator can safely disable debug logging to turn down verbosity.

    • To enable debug logging, set:

      debug.enabled=true
  3. Start the Certificate System instance:

    # systemctl start pki-tomcatd@instance-name.service

    OR if using the Nuxwdog watchdog:

    # systemctl start pki-tomcatd-nuxwdog@instance-name.service
13.3.3.2. Setting up rotation of debug log files

Certificate System is not able to rotate debug logs. Debug logging is enabled by default and these logs grow until the file system is full. Use an external utility, such as logrotate, to rotate the logs.

Example 13.3. Using logrotate to Rotate Debug Logs

Create a configuration file, such as /etc/logrotate.d/rhcs_debug with the following content:

/var/log/pki/instance_name/subsystem/debug {
     copytruncate
     weekly
     rotate 5
     notifempty
     missingok
}

To rotate debug logs for multiple subsystems in one configuration file, list the paths to the logs, each separated by white space, before the opening curly bracket. For example:

/var/log/pki/instance_name/ca/debug /var/log/pki/instance_name/kra/debug {
     ...
}

For further details about logrotate and the parameters used in the example, see the logrotate(8) man page.

13.4. Audit retention

Audit data are required to be retained in a way according to their retention categories:

  • Extended Audit Retention: Audit data that is retained for necessary maintenance for a certificate’s lifetime (from issuance to its expiration or revocation date). In Certificate System, they appear in the following areas:

    • Signed audit logs: All events defined in Appendix E Audit events in the Administration Guide (Common Criteria Edition).
    • In the CA’s internal LDAP server, certificate request records received by the CA and the certificate records as the requests are approved.
  • Normal Audit Retention: Audit data that is typically retained only to support normal operation. This includes all events that do not fall under the extended audit retention category.
Note

Certificate System does not provide any interface to modify or delete audit data.

13.4.1. Location of audit data

This section explains where Certificate System stores audit data and where to find the expiration date which plays a crucial role to determine the retention category.

13.4.1.1. Location of audit logs

Certificate System stores audit logs in the /var/log/pki/instance_name/subsystem_type/signedAudit/ directory. For example, the audit logs of a CA are stored in the /var/log/pki/instance_name/ca/signedAudit/ directory. Normal users cannot access files in this directory. See 12.1.2 Managing Audit logs in the Administration Guide (Common Criteria Edition).

For a list of audit log events that need to follow the extended audit retention period, see Appendix E Audit events in the Administration Guide (Common Criteria Edition).

Important

Do not delete any audit logs that contain any events listed in the "Extended Audit Events" appendix.

These audit logs will consume storage space potentially up to all space available in the disk partition.

When certificate signing requests (CSR) are submitted, the CA stores the CSRs in the request repository provided by the CA’s internal Directory Server. When these requests are approved, each certificate issued successfully, will result in an LDAP record being created in the certificate repository by the same internal Directory Server.

The CA’s internal Directory Server was specified in the following parameters when the CA was created using the pkispawn utility:

  • pki_ds_hostname
  • pki_ds_ldap_port
  • pki_ds_database
  • pki_ds_base_dn

If a certificate request has been approved successfully, the validity of the certificate can be viewed by accessing the CA EE portal either by request ID or by serial number.

To display the validity for a certificate request record:

  1. Log into the CA EE portal under https://host_name:_port_/ca/ee/ca/.
  2. Click Check Request Status.
  3. Enter the Request Identifier.
  4. Click Issued Certificate.
  5. Search for Validity.

To display the validity from a certificate record:

  1. Log into the CA EE portal under https://host_name:_port_/ca/ee/ca/.
  2. Enter the serial number range. If you search for one specific record, enter the record’s serial number in both the lowest and highest serial number field.
  3. Click on the search result.
  4. Search for Validity.
Important

Do not delete the request of the certificate records of the certificates that have not yet expired.

Chapter 14. Creating a role user

As explained in Section 2.6.6.1, “Default administrative roles”, a bootstrap user was created during the installation. After the installation, create real users and assign them proper system privileges. For compliance, each user must be a member of only one role (group).

This chapter instructs you how to:

  • Create a Certificate System administrative user on the operating system
  • Create a PKI role in Certificate System

This section is for administrative role users. Agent and Auditor role users, see Section 14.2, “Creating a PKI role user in Certificate System”.

In general, administrators, agents, and auditors in Certificate System can manage the Certificate System instance remotely using client applications, such as command-line utilities, the Java Console, and browsers. For the majority of CS management tasks, a Certificate System role user does not need to log on to the host machine where the instance runs. For example, an auditor role user is allowed to retrieve signed audit logs remotely for verification, and an agent role user can use the agent interface to approve a certificate issuance, while an administrator role user can use command-line utilities to configure a profile.

In certain cases, however, a Certificate System administrator requires to log in to the host system to modify configuration files directly, or to start or stop a Certificate System instance. Therefore, on the operating system, the administrator role user should be someone who is allowed to make changes to the configuration files and read various logs associated with Red Hat Certificate System.

Note

Do not allow the Certificate System administrators or anyone other than the auditors to access the audit log files.

  1. Create the pkiadmin group on the operating system.

    # groupadd -r pkiadmin
  2. Add the pkiuser to the pkiadmin group:

    # usermod -a -G pkiadmin pkiuser
  3. Create a user on the operating system. For example, to create the jsmith account:

    # useradd -g pkiadmin -d /home/jsmith -s /bin/bash -c "Red Hat Certificate System Administrator John Smith" -m jsmith

    For details, see the useradd(8) man page.

  4. Add the user jsmith to the pkiadmin group:

    # usermod -a -G pkiadmin jsmith

    For details, see the usermod(8) man page.

    If you are using a nShield hardware security module (HSM), add the user who manages the HSM device to the nfast group:

    # usermod -a -G nfast pkiuser
    # usermod -a -G nfast jsmith
  5. Add proper sudo rules to allow the pkiadmin group to Certificate System and other system services.

    For both simplicity of administration and security, the Certificate System and Directory Server processes can be configured so that PKI administrators (instead of only root) can start and stop the services.

    A recommended option when setting up subsystems is to use a pkiadmin system group. (Details are Section 7.1.1, “Creating OS users and groups”). All of the operating system users which will be Certificate System administrators are then added to this group. If this pkiadmin system group exists, then it can be granted sudo access to perform certain tasks.

    1. Edit the /etc/sudoers file; on Red Hat Enterprise Linux, this can be done using the visudo command:

      # visudo
    2. Depending on what is installed on the machine, add a line for the Directory Server, PKI management tools, and each PKI subsystem instance, granting sudo rights to the pkiadmin group:

      # For Directory Server services
      %pkiadmin ALL = PASSWD: /usr/bin/systemctl * dirsrv.target
      %pkiadmin ALL = PASSWD: /usr/bin/systemctl * dirsrv-admin.service
      
      # For PKI instance management
      %pkiadmin ALL = PASSWD: /usr/sbin/pkispawn *
      %pkiadmin ALL = PASSWD: /usr/sbin/pkidestroy *
      
      # For PKI instance services
      %pkiadmin ALL = PASSWD: /usr/bin/systemctl * pki-tomcatd@instance_name.service
    Important

    Make sure to set sudo permissions for every Certificate System and Directory Server on the machine -and only for those instances on the machine. There could be multiple instances of the same subsystem type on a machine or no instance of a subsystem type. It depends on the deployment.

  6. Set the group on the following files to pkiadmin:

    # chgrp pkiadmin /etc/pki/instance_name/server.xml
    # chgrp -R pkiadmin /etc/pki/instance_name/alias
    # chgrp pkiadmin /etc/pki/instance_name/subsystem/CS.cfg
    # chgrp pkiadmin /var/log/pki/instance_name/subsystem/debug

After creating the administrative user on the operating system, follow Section 14.2, “Creating a PKI role user in Certificate System”.

To create a PKI role user, see Chapter 11 Managing Certificate System Users and Groups in the Administration Guide (Common Criteria Edition).

Chapter 15. Deleting the Bootstrap User

Important

Before you delete the bootstrap user, create a real PKI administrative user as described in Chapter 14, Creating a role user.

To delete the bootstrap user, follow the procedure described in 11.3.2.4 Deleting a Certificate System User in the Administration Guide (Common Criteria Edition).

15.1. Disabling multi-roles support

By default, users can belong to more than one subsystem group at once, allowing the user to act as more than one role. For example, John Smith could belong to both an agent and an administrator group. However, for highly secure environments, the subsystem roles should be restricted so that a user can only belong to one role. This can be done by disabling the multirole attribute in the instance’s configuration.

For all subsystems:

  1. Stop the server:

    # systemctl stop pki-tomcatd@instance_name.service

    OR if using the Nuxwdog watchdog:

    # systemctl stop pki-tomcatd-nuxwdog@instance_name.service
  2. Open the CS.cfg file:

    # vim /var/lib/pki/instance_name/ca/conf/CS.cfg
  3. Change the multiroles.enable parameter value from true to false.
  4. Add or edit the list of default roles in Certificate System that are affected by the multi-roles setting. If multi-roles is disabled and a user belongs to one of the roles listed in the multiroles.false.groupEnforceList parameter, then the user cannot be added to any group for any of the other roles in the list.

    multiroles.false.groupEnforceList=Administrators,Auditors,Trusted Managers,Certificate Manager Agents,Registration Manager Agents,Key Recovery Authority Agents,Online Certificate Status Manager Agents,Token Key Service Manager Agents,Enterprise CA Administrators,Enterprise KRA Adminstrators,Enterprise OCSP Administrators,Enterprise TKS Administrators,Enterprise TPS Administrators,Security Domain Administrators,Subsystem Group
  5. Restart the server:

    # systemctl start pki-tomcatd@instance_name.service

    OR if using the Nuxwdog watchdog:

    # systemctl start pki-tomcatd-nuxwdog@instance_name.service

This part provides information on the maintenance of Red Hat Certificate System.

It is possible to remove individual subsystems or to uninstall all packages associated with an entire subsystem. Subsystems are installed and uninstalled individually. For example, it is possible to uninstall a KRA subsystem while leaving an installed and configured CA subsystem. It is also possible to remove a single CA subsystem while leaving other CA subsystems on the machine.

16.1. Removing a subsystem

Removing a subsystem requires specifying the subsystem type and the name of the server in which the subsystem is running. This command removes all files associated with the subsystem (without removing the subsystem packages).

# pkidestroy -s subsystem_type -i instance_name

The -s option specifies the subsystem to be removed (such as CA, KRA, OCSP, TKS, or TPS). The -i option specifies the instance name, such as pki-tomcat.

For example, to remove a CA subsystem:

# pkidestroy -s CA -i pki-tomcat

Loading deployment configuration from /var/lib/pki/pki-tomcat/ca/registry/ca/deployment.cfg.
Uninstalling CA from /var/lib/pki/pki-tomcat.
Removed symlink /etc/systemd/system/multi-user.target.wants/pki-tomcatd.target.

Uninstallation complete.

The pkidestroy utility removes the subsystem and any related files, such as the certificate databases, certificates, keys, and associated users. It does not uninstall the subsystem packages. If the subsystem is the last subsystem on the server instance, the server instance is removed as well.

A number of subsystem-related packages and dependencies are installed with Red Hat Certificate System; these are listed in Section 6.9, “Installing RHCS and RHDS packages”. Removing a subsystem removes only the files and directories associated with that specific subsystem. It does not remove the actual installed packages that are used by that instance. Completely uninstalling Red Hat Certificate System or one of its subsystems requires using package management tools, like yum, to remove each package individually.

To uninstall an individual Certificate System subsystem package:

  1. Remove all the associated subsystems. For example:

    # pkidestroy -s CA -i pki-tomcat
  2. Run the uninstall utility. For example:

    # yum remove pki-subsystem_type

    The subsystem type can be ca, kra, ocsp, tks, or tps.

  3. To remove other packages and dependencies, remove the packages specifically, using yum. The complete list of installed packages is at Section 6.9, “Installing RHCS and RHDS packages”.

Part V. Part V: References

Appendix A. Glossary

A.1. A

access control
The process of controlling what particular users are allowed to do. For example, access control to servers is typically based on an identity, established by a password or a certificate, and on rules regarding what that entity can do. See also ???TITLE???.
access control instructions (ACI)
An access rule that specifies how subjects requesting access are to be identified or what rights are allowed or denied for a particular subject. See ???TITLE???.
access control list (ACL)
A collection of access control entries that define a hierarchy of access rules to be evaluated when a server receives a request for access to a particular resource. See ???TITLE???.
administrator
The person who installs and configures one or more Certificate System managers and sets up privileged users, or agents, for them. See also ???TITLE???.
Advanced Encryption Standard (AES)
The Advanced Encryption Standard (AES), like its predecessor Data Encryption Standard (DES), is a FIPS-approved symmetric-key encryption standard. AES was adopted by the US government in 2002. It defines three block ciphers, AES-128, AES-192 and AES-256. The National Institute of Standards and Technology (NIST) defined the AES standard in U.S. FIPS PUB 197. For more information, see http://csrc.nist.gov/publications/fips/fips197/fips-197.pdf.
agent
A user who belongs to a group authorized to manage ???TITLE??? for a Certificate System manager. See also ???TITLE???, ???TITLE???.
agent-approved enrollment
An enrollment that requires an agent to approve the request before the certificate is issued.
agent services
  1. Services that can be administered by a Certificate System ???TITLE??? through HTML pages served by the Certificate System subsystem for which the agent has been assigned the necessary privileges.
  2. The HTML pages for administering such services.
APDU
Application protocol data unit. A communication unit (analogous to a byte) that is used in communications between a smart card and a smart card reader.
attribute value assertion (AVA)
An assertion of the form attribute = value, where attribute is a tag, such as o (organization) or uid (user ID), and value is a value such as "Red Hat, Inc." or a login name. AVAs are used to form the ???TITLE??? that identifies the subject of a certificate, called the ???TITLE??? of the certificate.
audit log
A log that records various system events. This log can be signed, providing proof that it was not tampered with, and can only be read by an auditor user.
auditor
A privileged user who can view the signed audit logs.
authentication
Confident identification; assurance that a party to some computerized transaction is not an impostor. Authentication typically involves the use of a password, certificate, PIN, or other information to validate identity over a computer network. See also ???TITLE???, ???TITLE???, ???TITLE???, ???TITLE???.
authentication module
A set of rules (implemented as a Java™ class) for authenticating an end entity, agent, administrator, or any other entity that needs to interact with a Certificate System subsystem. In the case of typical end-user enrollment, after the user has supplied the information requested by the enrollment form, the enrollment servlet uses an authentication module associated with that form to validate the information and authenticate the user’s identity. See ???TITLE???.
authorization
Permission to access a resource controlled by a server. Authorization typically takes place after the ACLs associated with a resource have been evaluated by a server. See ???TITLE???.
automated enrollment
A way of configuring a Certificate System subsystem that allows automatic authentication for end-entity enrollment, without human intervention. With this form of authentication, a certificate request that completes authentication module processing successfully is automatically approved for profile processing and certificate issuance.

A.2. B

bind DN
A user ID, in the form of a distinguished name (DN), used with a password to authenticate to Red Hat Directory Server.

A.3. C

CA certificate
A certificate that identifies a certificate authority. See also ???TITLE???, ???TITLE???, ???TITLE???.
CA hierarchy
A hierarchy of CAs in which a root CA delegates the authority to issue certificates to subordinate CAs. Subordinate CAs can also expand the hierarchy by delegating issuing status to other CAs. See also ???TITLE???, ???TITLE???, ???TITLE???.
CA server key
The SSL server key of the server providing a CA service.
CA signing key
The private key that corresponds to the public key in the CA certificate. A CA uses its signing key to sign certificates and CRLs.
certificate
Digital data, formatted according to the X.509 standard, that specifies the name of an individual, company, or other entity (the ???TITLE??? of the certificate) and certifies that a ???TITLE???, which is also included in the certificate, belongs to that entity. A certificate is issued and digitally signed by a ???TITLE???. A certificate’s validity can be verified by checking the CA’s ???TITLE??? through ???TITLE??? techniques. To be trusted within a ???TITLE???, a certificate must be issued and signed by a CA that is trusted by other entities enrolled in the PKI.
certificate authority (CA)
A trusted entity that issues a ???TITLE??? after verifying the identity of the person or entity the certificate is intended to identify. A CA also renews and revokes certificates and generates CRLs. The entity named in the issuer field of a certificate is always a CA. Certificate authorities can be independent third parties or a person or organization using certificate-issuing server software, such as Red Hat Certificate System.
certificate-based authentication
Authentication based on certificates and public-key cryptography. See also ???TITLE???.
certificate chain
A hierarchical series of certificates signed by successive certificate authorities. A CA certificate identifies a ???TITLE??? and is used to sign certificates issued by that authority. A CA certificate can in turn be signed by the CA certificate of a parent CA, and so on up to a ???TITLE???. Certificate System allows any end entity to retrieve all the certificates in a certificate chain.
certificate extensions
An X.509 v3 certificate contains an extensions field that permits any number of additional fields to be added to the certificate. Certificate extensions provide a way of adding information such as alternative subject names and usage restrictions to certificates. A number of standard extensions have been defined by the PKIX working group.
certificate fingerprint
A ???TITLE??? associated with a certificate. The number is not part of the certificate itself, but is produced by applying a hash function to the contents of the certificate. If the contents of the certificate changes, even by a single character, the same function produces a different number. Certificate fingerprints can therefore be used to verify that certificates have not been tampered with.
Certificate Management Messages over Cryptographic Message Syntax (CMC)
Message format used to convey a request for a certificate to a Certificate Manager. A proposed standard from the Internet Engineering Task Force (IETF) PKIX working group. For detailed information, see https://tools.ietf.org/html/draft-ietf-pkix-cmc-02.
Certificate Management Message Formats (CMMF)
Message formats used to convey certificate requests and revocation requests from end entities to a Certificate Manager and to send a variety of information to end entities. A proposed standard from the Internet Engineering Task Force (IETF) PKIX working group. CMMF is subsumed by another proposed standard, ???TITLE???. For detailed information, see https://tools.ietf.org/html/draft-ietf-pkix-cmmf-02.
Certificate Manager
An independent Certificate System subsystem that acts as a certificate authority. A Certificate Manager instance issues, renews, and revokes certificates, which it can publish along with CRLs to an LDAP directory. It accepts requests from end entities. See ???TITLE???.
Certificate Manager agent
A user who belongs to a group authorized to manage agent services for a Certificate Manager. These services include the ability to access and modify (approve and reject) certificate requests and issue certificates.
certificate profile
A set of configuration settings that defines a certain type of enrollment. The certificate profile sets policies for a particular type of enrollment along with an authentication method in a certificate profile.
Certificate Request Message Format (CRMF)
Format used for messages related to management of X.509 certificates. This format is a subset of CMMF. See also ???TITLE???. For detailed information, see https://tools.ietf.org/html/rfc2511.
certificate revocation list (CRL)
As defined by the X.509 standard, a list of revoked certificates by serial number, generated and signed by a ???TITLE???.
Certificate System
See ???TITLE???, ???TITLE???.
Certificate System subsystem
One of the five Certificate System managers: ???TITLE???, Online Certificate Status Manager, ???TITLE???, Token Key Service, or Token Processing System.
Certificate System console
A console that can be opened for any single Certificate System instance. A Certificate System console allows the Certificate System administrator to control configuration settings for the corresponding Certificate System instance.
chain of trust
See ???TITLE???.
chained CA
See ???TITLE???.
cipher
See ???TITLE???.
client authentication
The process of identifying a client to a server, such as with a name and password or with a certificate and some digitally signed data. See ???TITLE???, ???TITLE???, ???TITLE???.
client SSL certificate
A certificate used to identify a client to a server using the SSL protocol. See ???TITLE???.
CMC
See ???TITLE???.
CMC Enrollment
Features that allow either signed enrollment or signed revocation requests to be sent to a Certificate Manager using an agent’s signing certificate. These requests are then automatically processed by the Certificate Manager.
CMMF
See ???TITLE???.
CRL
See ???TITLE???.
cross-pair certificate
A certificate issued by one CA to another CA which is then stored by both CAs to form a circle of trust. The two CAs issue certificates to each other, and then store both cross-pair certificates as a certificate pair.
CRMF
See ???TITLE???.
cross-certification
The exchange of certificates by two CAs in different certification hierarchies, or chains. Cross-certification extends the chain of trust so that it encompasses both hierarchies. See also ???TITLE???.
cryptographic algorithm
A set of rules or directions used to perform cryptographic operations such as ???TITLE??? and ???TITLE???.
Cryptographic Message Syntax (CS)
The syntax used to digitally sign, digest, authenticate, or encrypt arbitrary messages, such as CMMF.
cryptographic module
See ???TITLE???.
cryptographic service provider (CSP)
A cryptographic module that performs cryptographic services, such as key generation, key storage, and encryption, on behalf of software that uses a standard interface such as that defined by PKCS #11 to request such services.
CSP
See ???TITLE???.

A.4. D

Key Recovery Authority
An optional, independent Certificate System subsystem that manages the long-term archival and recovery of RSA encryption keys for end entities. A Certificate Manager can be configured to archive end entities' encryption keys with a Key Recovery Authority before issuing new certificates. The Key Recovery Authority is useful only if end entities are encrypting data, such as sensitive email, that the organization may need to recover someday. It can be used only with end entities that support dual key pairs: two separate key pairs, one for encryption and one for digital signatures.
Key Recovery Authority agent
A user who belongs to a group authorized to manage agent services for a Key Recovery Authority, including managing the request queue and authorizing recovery operation using HTML-based administration pages.
Key Recovery Authority recovery agent
One of the m of n people who own portions of the storage key for the ???TITLE???.
Key Recovery Authority storage key
Special key used by the Key Recovery Authority to encrypt the end entity’s encryption key after it has been decrypted with the Key Recovery Authority’s private transport key. The storage key never leaves the Key Recovery Authority.
Key Recovery Authority transport certificate
Certifies the public key used by an end entity to encrypt the entity’s encryption key for transport to the Key Recovery Authority. The Key Recovery Authority uses the private key corresponding to the certified public key to decrypt the end entity’s key before encrypting it with the storage key.
decryption
Unscrambling data that has been encrypted. See ???TITLE???.
delta CRL
A CRL containing a list of those certificates that have been revoked since the last full CRL was issued.
digital ID
See ???TITLE???.
digital signature
To create a digital signature, the signing software first creates a ???TITLE??? from the data to be signed, such as a newly issued certificate. The one-way hash is then encrypted with the private key of the signer. The resulting digital signature is unique for each piece of data signed. Even a single comma added to a message changes the digital signature for that message. Successful decryption of the digital signature with the signer’s public key and comparison with another hash of the same data provides ???TITLE???. Verification of the ???TITLE??? for the certificate containing the public key provides authentication of the signer. See also ???TITLE???, ???TITLE???.
distribution points
Used for CRLs to define a set of certificates. Each distribution point is defined by a set of certificates that are issued. A CRL can be created for a particular distribution point.
distinguished name (DN)
A series of AVAs that identify the subject of a certificate. See ???TITLE???.
dual key pair
Two public-private key pairs, four keys altogether, corresponding to two separate certificates. The private key of one pair is used for signing operations, and the public and private keys of the other pair are used for encryption and decryption operations. Each pair corresponds to a separate ???TITLE???. See also ???TITLE???, ???TITLE???, ???TITLE???.

A.5. E

eavesdropping
Surreptitious interception of information sent over a network by an entity for which the information is not intended.
Elliptic Curve Cryptography (ECC)
A cryptographic algorithm which uses elliptic curves to create additive logarithms for the mathematical problems which are the basis of the cryptographic keys. ECC ciphers are more efficient to use than RSA ciphers and, because of their intrinsic complexity, are stronger at smaller bits than RSA ciphers.
encryption
Scrambling information in a way that disguises its meaning. See ???TITLE???.
encryption key
A private key used for encryption only. An encryption key and its equivalent public key, plus a ???TITLE??? and its equivalent public key, constitute a ???TITLE???.
enrollment
The process of requesting and receiving an X.509 certificate for use in a ???TITLE???. Also known as registration.
end entity
In a ???TITLE???, a person, router, server, or other entity that uses a ???TITLE??? to identify itself.
extensions field
See ???TITLE???.

A.6. F

Federal Bridge Certificate Authority (FBCA)
A configuration where two CAs form a circle of trust by issuing cross-pair certificates to each other and storing the two cross-pair certificates as a single certificate pair.
fingerprint
See ???TITLE???.
FIPS PUBS 140
Federal Information Standards Publications (FIPS PUBS) 140 is a US government standard for implementations of cryptographic modules, hardware or software that encrypts and decrypts data or performs other cryptographic operations, such as creating or verifying digital signatures. Many products sold to the US government must comply with one or more of the FIPS standards. See http://www.nist.gov/itl/fipscurrent.cfm.
firewall
A system or combination of systems that enforces a boundary between two or more networks.

A.7. H

Hypertext Transport Protocol (HTTP) and Hypertext Transport Protocol Secure (HTTPS)
Protocols used to communicate with web servers. HTTPS consists of communication over HTTP (Hypertext Transfer Protocol) within a connection encrypted by Transport Layer Security (TLS). The main purpose of HTTPS is authentication of the visited website and protection of privacy and integrity of the exchanged data.

A.8. I

impersonation
The act of posing as the intended recipient of information sent over a network. Impersonation can take two forms: ???TITLE??? and ???TITLE???.
input
In the context of the certificate profile feature, it defines the enrollment form for a particular certificate profile. Each input is set, which then dynamically creates the enrollment form from all inputs configured for this enrollment.
intermediate CA
A CA whose certificate is located between the root CA and the issued certificate in a ???TITLE???.
IP spoofing
The forgery of client IP addresses.
IPv4 and IPv6
Certificate System supports both IPv4 and IPv6 address namespaces for communications and operations with all subsystems and tools, as well as for clients, subsystem creation, and token and certificate enrollment.

A.9. J

JAR file
A digital envelope for a compressed collection of files organized according to the ???TITLE???.
Java™ archive (JAR) format
A set of conventions for associating digital signatures, installer scripts, and other information with files in a directory.
Java™ Cryptography Architecture (JCA)
The API specification and reference developed by Sun Microsystems for cryptographic services. See http://java.sun.com/products/jdk/1.2/docs/guide/security/CryptoSpec.Introduction.
Java™ Development Kit (JDK)
Software development kit provided by Sun Microsystems for developing applications and applets using the Java™ programming language.
Java™ Native Interface (JNI)
A standard programming interface that provides binary compatibility across different implementations of the Java™ Virtual Machine (JVM) on a given platform, allowing existing code written in a language such as C or C++ for a single platform to bind to Java™. See http://java.sun.com/products/jdk/1.2/docs/guide/jni/index.html.
Java™ Security Services (JSS)
A Java™ interface for controlling security operations performed by Network Security Services (NSS).

A.10. K

KEA
See ???TITLE???.
key
A large number used by a ???TITLE??? to encrypt or decrypt data. A person’s ???TITLE???, for example, allows other people to encrypt messages intended for that person. The messages must then be decrypted by using the corresponding ???TITLE???.
key exchange
A procedure followed by a client and server to determine the symmetric keys they will both use during an SSL session.
Key Exchange Algorithm (KEA)
An algorithm used for key exchange by the US Government.
KEYGEN tag
An HTML tag that generates a key pair for use with a certificate.

A.11. L

Lightweight Directory Access Protocol (LDAP)
A directory service protocol designed to run over TCP/IP and across multiple platforms. LDAP is a simplified version of Directory Access Protocol (DAP), used to access X.500 directories. LDAP is under IETF change control and has evolved to meet Internet requirements.
linked CA
An internally deployed ???TITLE??? whose certificate is signed by a public, third-party CA. The internal CA acts as the root CA for certificates it issues, and the third- party CA acts as the root CA for certificates issued by other CAs that are linked to the same third-party root CA. Also known as "chained CA" and by other terms used by different public CAs.

A.12. M

manual authentication
A way of configuring a Certificate System subsystem that requires human approval of each certificate request. With this form of authentication, a servlet forwards a certificate request to a request queue after successful authentication module processing. An agent with appropriate privileges must then approve each request individually before profile processing and certificate issuance can proceed.
MD5
A message digest algorithm that was developed by Ronald Rivest. See also ???TITLE???.
message digest
See ???TITLE???.
misrepresentation
The presentation of an entity as a person or organization that it is not. For example, a website might pretend to be a furniture store when it is really a site that takes credit-card payments but never sends any goods. Misrepresentation is one form of ???TITLE???. See also ???TITLE???.

A.13. N

Network Security Services (NSS)
A set of libraries designed to support cross-platform development of security-enabled communications applications. Applications built using the NSS libraries support the ???TITLE??? protocol for authentication, tamper detection, and encryption, and the PKCS #11 protocol for cryptographic token interfaces. NSS is also available separately as a software development kit.
nonrepudiation
The inability by the sender of a message to deny having sent the message. A ???TITLE??? provides one form of nonrepudiation.
non-TMS
Non-token management system. Refers to a configuration of subsystems (the CA and, optionally, KRA and OCSP) which do not handle smart cards directly. See also ???TITLE???.

A.14. O

object signing
A method of file signing that allows software developers to sign Java code, JavaScript scripts, or any kind of file and allows users to identify the signers and control access by signed code to local system resources.
object-signing certificate
A certificate whose associated private key is used to sign objects; related to ???TITLE???.
OCSP
Online Certificate Status Protocol.
one-way hash
  1. A number of fixed-length generated from data of arbitrary length with the aid of a hashing algorithm. The number, also called a message digest, is unique to the hashed data. Any change in the data, even deleting or altering a single character, results in a different value.
  2. The content of the hashed data cannot be deduced from the hash.
operation
The specific operation, such as read or write, that is being allowed or denied in an access control instruction.
output
In the context of the certificate profile feature, it defines the resulting form from a successful certificate enrollment for a particular certificate profile. Each output is set, which then dynamically creates the form from all outputs configured for this enrollment.

A.15. P

password-based authentication
Confident identification by means of a name and password. See also ???TITLE???, ???TITLE???.
PKCS #7
The public-key cryptography standard that governs signing and encryption.
PKCS #10
The public-key cryptography standard that governs certificate requests.
PKCS #11
The public-key cryptography standard that governs cryptographic tokens such as smart cards.
PKCS #11 module
A driver for a cryptographic device that provides cryptographic services, such as encryption and decryption, through the PKCS #11 interface. A PKCS #11 module, also called a cryptographic module or cryptographic service provider, can be implemented in either hardware or software. A PKCS #11 module always has one or more slots, which may be implemented as physical hardware slots in some form of physical reader, such as for smart cards, or as conceptual slots in software. Each slot for a PKCS #11 module can in turn contain a token, which is the hardware or software device that actually provides cryptographic services and optionally stores certificates and keys. Red Hat provides a built-in PKCS #11 module with Certificate System.
PKCS #12
The public-key cryptography standard that governs key portability.
private key
One of a pair of keys used in public-key cryptography. The private key is kept secret and is used to decrypt data encrypted with the corresponding ???TITLE???.
proof-of-archival (POA)
Data signed with the private Key Recovery Authority transport key that contains information about an archived end-entity key, including key serial number, name of the Key Recovery Authority, ???TITLE??? of the corresponding certificate, and date of archival. The signed proof-of-archival data are the response returned by the Key Recovery Authority to the Certificate Manager after a successful key archival operation. See also ???TITLE???.
public key
One of a pair of keys used in public-key cryptography. The public key is distributed freely and published as part of a ???TITLE???. It is typically used to encrypt data sent to the public key’s owner, who then decrypts the data with the corresponding ???TITLE???.
public-key cryptography
A set of well-established techniques and standards that allow an entity to verify its identity electronically or to sign and encrypt electronic data. Two keys are involved, a public key and a private key. A ???TITLE??? is published as part of a certificate, which associates that key with a particular identity. The corresponding private key is kept secret. Data encrypted with the public key can be decrypted only with the private key.
public-key infrastructure (PKI)
The standards and services that facilitate the use of public-key cryptography and X.509 v3 certificates in a networked environment.

A.16. R

RC2, RC4
Cryptographic algorithms developed for RSA Data Security by Rivest. See also ???TITLE???.
Red Hat Certificate System
A highly configurable set of software components and tools for creating, deploying, and managing certificates. Certificate System is comprised of five major subsystems that can be installed in different Certificate System instances in different physical locations: ???TITLE???, Online Certificate Status Manager, ???TITLE???, Token Key Service, and Token Processing System.
registration
See ???TITLE???.
root CA
The ???TITLE??? with a self-signed certificate at the top of a certificate chain. See also ???TITLE???, ???TITLE???.
RSA algorithm
Short for Rivest-Shamir-Adleman, a public-key algorithm for both encryption and authentication. It was developed by Ronald Rivest, Adi Shamir, and Leonard Adleman and introduced in 1978.
RSA key exchange
A key-exchange algorithm for SSL based on the RSA algorithm.

A.17. S

sandbox
A Java™ term for the carefully defined limits within which Java™ code must operate.
Simple Certificate Enrollment Protocol (SCEP)
A protocol designed by Cisco to specify a way for a router to communicate with a CA for router certificate enrollment. Certificate System supports SCEP’s CA mode of operation, where the request is encrypted with the CA signing certificate.
secure channel
A security association between the TPS and the smart card which allows encrypted communciation based on a shared master key generated by the TKS and the smart card APDUs.
Secure Sockets Layer (SSL)
A protocol that allows mutual authentication between a client and server and the establishment of an authenticated and encrypted connection. SSL runs above TCP/IP and below HTTP, LDAP, IMAP, NNTP, and other high-level network protocols.
security domain
A centralized repository or inventory of PKI subsystems. Its primary purpose is to facilitate the installation and configuration of new PKI services by automatically establishing trusted relationships between subsystems.
Security-Enhanced Linux (SELinux)
Security-enhanced Linux (SELinux) is a set of security protocols enforcing mandatory access control on Linux system kernels. SELinux was developed by the United States National Security Agency to keep applications from accessing confidential or protected files through lenient or flawed access controls.
self tests
A feature that tests a Certificate System instance both when the instance starts up and on-demand.
server authentication
The process of identifying a server to a client. See also ???TITLE???.
server SSL certificate
A certificate used to identify a server to a client using the ???TITLE??? protocol.
servlet
Java™ code that handles a particular kind of interaction with end entities on behalf of a Certificate System subsystem. For example, certificate enrollment, revocation, and key recovery requests are each handled by separate servlets.
SHA
Secure Hash Algorithm, a hash function used by the US government.
signature algorithm
A cryptographic algorithm used to create digital signatures. Certificate System supports the MD5 and ???TITLE??? signing algorithms. See also ???TITLE???, ???TITLE???.
signed audit log
See ???TITLE???.
signing certificate
A certificate whose public key corresponds to a private key used to create digital signatures. For example, a Certificate Manager must have a signing certificate whose public key corresponds to the private key it uses to sign the certificates it issues.
signing key
A private key used for signing only. A signing key and its equivalent public key, plus an ???TITLE??? and its equivalent public key, constitute a ???TITLE???.
single sign-on
  1. In Certificate System, a password that simplifies the way to sign on to Red Hat Certificate System by storing the passwords for the internal database and tokens. Each time a user logs on, he is required to enter this single password.
  2. The ability for a user to log in once to a single computer and be authenticated automatically by a variety of servers within a network. Partial single sign-on solutions can take many forms, including mechanisms for automatically tracking passwords used with different servers. Certificates support single sign-on within a ???TITLE???. A user can log in once to a local client’s private-key database and, as long as the client software is running, rely on ???TITLE??? to access each server within an organization that the user is allowed to access.
slot
The portion of a ???TITLE???, implemented in either hardware or software, that contains a ???TITLE???.
smart card
A small device that contains a microprocessor and stores cryptographic information, such as keys and certificates, and performs cryptographic operations. Smart cards implement some or all of the ???TITLE??? interface.
spoofing
Pretending to be someone else. For example, a person can pretend to have the email address jdoe@example.com or a computer can identify itself as a site called www.redhat.com when it is not. Spoofing is one form of ???TITLE???. See also ???TITLE???.
SSL
See ???TITLE???.
subject
The entity identified by a ???TITLE???. In particular, the subject field of a certificate contains a ???TITLE??? that uniquely describes the certified entity.
subject name
A ???TITLE??? that uniquely describes the ???TITLE??? of a ???TITLE???.
subordinate CA
A certificate authority whose certificate is signed by another subordinate CA or by the root CA. See ???TITLE???, ???TITLE???.
symmetric encryption
An encryption method that uses the same cryptographic key to encrypt and decrypt a given message.

A.18. T

tamper detection
A mechanism ensuring that data received in electronic form entirely corresponds with the original version of the same data.
token
A hardware or software device that is associated with a ???TITLE??? in a ???TITLE???. It provides cryptographic services and optionally stores certificates and keys.
token key service (TKS)
A subsystem in the token management system which derives specific, separate keys for every smart card based on the smart card APDUs and other shared information, like the token CUID.
token management system (TMS)
The interrelated subsystems — CA, TKS, TPS, and, optionally, the KRA - which are used to manage certificates on smart cards (tokens).
transport layer security (TLS)
A set of rules governing server authentication, client authentication, and encrypted communication between servers and clients.
token processing system (TPS)
A subsystem which interacts directly the Enterprise Security Client and smart cards to manage the keys and certificates on those smart cards.
tree hierarchy
The hierarchical structure of an LDAP directory.
trust
Confident reliance on a person or other entity. In a ???TITLE???, trust refers to the relationship between the user of a certificate and the ???TITLE??? that issued the certificate. If a CA is trusted, then valid certificates issued by that CA can be trusted.

A.19. U

UTF-8
The certificate enrollment pages support all UTF-8 characters for specific fields (common name, organizational unit, requester name, and additional notes). The UTF-8 strings are searchable and correctly display in the CA, OCSP, and KRA end user and agents services pages. However, the UTF-8 support does not extend to internationalized domain names, such as those used in email addresses.

A.20. V

virtual private network (VPN)
A way of connecting geographically distant divisions of an enterprise. The VPN allows the divisions to communicate over an encrypted channel, allowing authenticated, confidential transactions that would normally be restricted to a private network.

A.21. X

X.509 version 1 and version 3
Digital certificate formats recommended by the International Telecommunications Union (ITU).

Legal Notice

Copyright © 2024 Red Hat, Inc.
The text of and illustrations in this document are licensed by Red Hat under a Creative Commons Attribution–Share Alike 3.0 Unported license ("CC-BY-SA"). An explanation of CC-BY-SA is available at http://creativecommons.org/licenses/by-sa/3.0/. In accordance with CC-BY-SA, if you distribute this document or an adaptation of it, you must provide the URL for the original version.
Red Hat, as the licensor of this document, waives the right to enforce, and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent permitted by applicable law.
Red Hat, Red Hat Enterprise Linux, the Shadowman logo, the Red Hat logo, JBoss, OpenShift, Fedora, the Infinity logo, and RHCE are trademarks of Red Hat, Inc., registered in the United States and other countries.
Linux® is the registered trademark of Linus Torvalds in the United States and other countries.
Java® is a registered trademark of Oracle and/or its affiliates.
XFS® is a trademark of Silicon Graphics International Corp. or its subsidiaries in the United States and/or other countries.
MySQL® is a registered trademark of MySQL AB in the United States, the European Union and other countries.
Node.js® is an official trademark of Joyent. Red Hat is not formally related to or endorsed by the official Joyent Node.js open source or commercial project.
The OpenStack® Word Mark and OpenStack logo are either registered trademarks/service marks or trademarks/service marks of the OpenStack Foundation, in the United States and other countries and are used with the OpenStack Foundation's permission. We are not affiliated with, endorsed or sponsored by the OpenStack Foundation, or the OpenStack community.
All other trademarks are the property of their respective owners.
Red Hat logoGithubredditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust. Explore our recent updates.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

Theme

© 2026 Red Hat
Back to top