How Can We Help?

FreeIPA: CSR Generation and SSL installation

You are here:

Fedora

The Dogtag packages are now available in Fedora. The required packages should be retrieved as dependencies when installing ipa-server.

This only makes the binary files available for the IPA installation script. The installer creates and configures the necessary dogtag components to a certification authority.

Installation

A Dogtag certification body is installed by default by IPA. To install with a self-signed certification authority instead of dogtag, pass the --selfsign argument to ipa-server-install .

The certification authority uses a separate instance of DS that is used only for the certification authority. This instance is called PKI-IPA.

A CA instance is installed in / var / lib / pki-ca.

A copy of the CA root certificate and private key is placed in /root/cacert.p12.

A copy of the CA agent certificate is stored in /root/ca-agent.p12. This agent certificate can be imported into a browser and used to manage CS via the web interface (not recommended).

Use another certification authority (Sectigo / Secorio) to sign the IPA certification authority certificate

If you have an existing certification authority, you can use it to make the IPA certification authority a subordinate user.

This is a three step process:

  • Have ipa-server-install generate a Certificate Signing Request (CSR)
  • Bring the CSR to your certification body and have it signed
  • Provide the resulting certificate for ipa-server-install to complete the installation

Detailed instructions

Run ipa-server-install the appropriate arguments for your environment and add the --external_ca flag:

# ipa-server-install --external-ca

This creates a CSR in /root/ipa.csr . This is the file that you must provide to your CA for signing. You also need a PEM copy of your CA trust chain.

Once you have both, you can continue the installer:

# ipa-server-install --external_cert_file = / root / ipa.crt --external_ca_file = / root / bestehende_ca.crt

The server caches the answers the first time you run the installer, so you don't have to answer the questions again. This cache is removed when the installer is run again.

The paths to the certificate and the certification body must be absolute paths. The dogtag silent installer will fail if this is not the case.

After completing the installation, you have the same files as an independent IPA certification authority: /root/cacert.p12 and /root/ca-agent.p12.

The only difference is that the CA certificate is self-signed in this mode by your external certification authority and in standard mode.

Use certificates from another certification authority (Sectigo)

If you don't want to use the new IPA-CA features, that's fine, but you need to take some extra steps.

There are two ways to do this:

  • Install IPA with the self-signing certification authority and replace the server certificates after installation
  • Provide the installer with PKCS # 12 files (and still use the self-signing certificate authority, but no certificates are generated).

The step setting enable_ra for False deactivating the cert plugin in the XML-RPC interface. Your IPA server cannot issue certificates.

Install and replace

To use the Install and Replace method, do the following:

  • Install the IPA server with the --selfsign option
  • Once the IPA is active, run it ipa-server-certinstall once for the DS and once for Apache to replace the server certificates
  • If you want automatic Firefox configuration to work, use an object signing certificate to sign the JAR file /usr/share/ipa/html/configure.jar
  • Replace the CA certificate in /etc/ipa/ca.crt and /usr/share/ipa/html/ca.crt
  • Edit /etc/ipa/default.conf and set enable_ra to False
  • Restart Apache

Install with your own certificates

To use the Install your own method, do the following:

  • Install the IPA server with the --http_pkcs12 and --dirsrv_pkcs12 and the corresponding pin arguments. Your PKCS # 12 files should include the server certificate, key, and CA certification chain.
  • If you want automatic Firefox configuration to work, use an object signing certificate to sign the JAR file /usr/share/ipa/html/configure.jar
  • Make sure that the CA certificate in /etc/ipa/ca.crt and /usr/share/ipa/html/ca.crt is correct
  • Edit /etc/ipa/default.conf and set enable_ra to False
  • Restart Apache

Work with certificates

Once your certification authority is configured, authorized users can perform a number of operations.

Request a certificate

You start with a Certificate Signing Request (CSR). In our case, it is a base 64 encoded PKCS # 10 request that looks something like this:

----- BEGIN CERTIFICATE REQUEST ----- 
MIIBnTCCAQYCAQAwXTELMAkGA1UEBhMCU0cxETAPBgNVBAoTCE0yQ3J5cHRvMRIw 
EAYDVQQDEwlsb2NhbGhvc3QxJzAlBgkqhkiG9w0BCQEWGGFkbWluQHNlcnZlci5l 
... 
... 
9rsQkRc9Urv9mRBIsredGnYECNeRaK5R1yzpOowninXC 
----- END CERTIFICATE REQUEST -----

How to generate a CSR with OpenSSL run:

% openssl req -new -nodes -out host.csr

You will be asked to provide the subject of the certificate (country, state, organization, etc.). The only critical point is the common name. This must be set on the FQDN of your host.

The CSR is in the host.csr file and the key for this request is in privkey.pem

In NSS, you need to start with a cert database to get an extra step. An NSS-CSR generation looks like this:

% certutil -N -d / tmp / test 
% certutil -R -s 'CN = ipa.example.com' -d / tmp / test -o test.csr -g 2048 -a

The CSR must be passed as a single string on the command line:

$ ipa cert-request –principal=ldap2/zeus.example.com –add ‹MIIBejCB5AIBADA7MQw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YWsuY29tOjkxODAvY2Evb2NzcDAOBgNVHQ8BAf8EBAMCBPAwEwYDVR0lBAwwCgYIKwYBBQUHAwEwDQYJKoZIhvcNAQEFBQADggEBAGljf00jgdkyivJFOONlu/lNb25vpWnM/Wu3N6F6hcYC722YjzAFFAFA6wJf4QybrUGQiihh4veqRlknZeoR8Wlc9491E+lGwyk4SZxmSWMHc/TEoTDKPqrngTaf3YsjzBqPhQQF6TkM1TL68uMsU4uHl7mWtD9ueDVQkWlWmTJEJXcT8OdvIFOC/Wb+Vq9FV1lgJAosXmt8poZyHPGX+GiVxdtdZpoZSb7vyMg0FvjhSHNoX8tVo5QKlzxsci+xRkT4tcAe+ReFyQ7+aX851QMluttEUT1Gz1OxnfGojvHbiqYkH92fk+eUJtTZHGpK5H1U5gJVFauCKf/8SzU4awE= request_id: 11 serial_number: 0xb status: 0 subject: CN=zeus.example.com,OU=pki-ipa,O=IPA </pre>

There is also a shortcut method, although it doesn't work today (October 9).

ipa cert-request file://test.csr --principal=ldap3/zeus.example.com --add

Put a cert on hold

$ ipa cert-revoke --revocation-reason=6 0xb

Remove a cert from hold

$ ipa cert-revoke --revocation-reason=6 0xb

Revoke a certificate

$ ipa cert-revoke --revocation-reason=1 0xb
revoked: True
status: 0

Retrieve a revoked certificate

$ ipa cert-get 0xb
certificate: MIIC7D...
revocation_reason: 1
status: 0

Revocation

If you want a certificate to be removed, revoke it. RFC 5280 defines the following reasons for the revocation:

  • 0 – unspecified
  • 1 – keyCompromise
  • 2 – cACompromise
  • 3 – affiliationChanged
  • 4 – superseded
  • 5 – cessationOfOperation
  • 6 – certificateHold
  • 8 – removeFromCRL
  • 9 – privilegeWithdrawn
  • 10 – aACompromise

Note that reason code 7 is not used.

A CRL is generated by the CA that contains a list of revoked certificates. This may be retrieved from an IPA server at: http://ipa.example.com/ipa/crl/MasterCRL.bin

Note that reason code 7 is not used.

A CRL is generated by the certification authority, which contains a list of the revoked certificates. This can be done from an IPA server at http : //ipa.example.com/ipa/crl/MasterCRL.bin

Work with services

Note that this service feature is not in Alpha 1

When you request a certificate:

  • The server checks the ACI virtual request certificate to determine whether the requester has permission to request certificates.
  • The applicant for the certificate is compared to the host name of the requested principal. You have to match.
  • The requested service record is retrieved. If the service already has a userCertificate attribute, the request is stopped
  • If the service is absent and the –add argument is omitted, the request is paused
  • If the –add option has been requested and the requester is not authorized to add services, the request is paused
  • Der Anforderer muss im Attribut ‹managedBy› des Service-Datensatzes aufgeführt sein.

managedBy-Attribut

This is a multi-valued attribute that contains the distinguished name of all hosts that are allowed to write the userCertificate attribute of this service. Use the add-host and service-remove-host services to control access.

Example

This example shows the steps that must be performed by an administrator and a client computer that is trying to request a certificate for itself. This assumes that the CSR has already been generated and is in the web.csr file in the current directory.

Administrator

ipa host-add client.example.com --password = secret123 
ipa service-add HTTP / client.example.com 
ipa service-add-host --hosts = client.example.com HTTP / client.example.com 
ipa rolegroup- add-member --hosts = client.example.com certadmin

Customer

ipa-client-install 
ipa-join -w secret123 
kinit -kt /etc/krb5.keytab host / client.example.com 
ipa -d cert-request-Datei: //web.csr --principal = HTTP / client.example. com

What does it make?

Administrator

  • Add a new host with a unique password
  • Create an HTTP service principal for the host
  • Allow the host to manage its own userCertificate attribute
  • Allow the host to manage certificates (request, revoke, etc.)

Customer

  • Configure the client to use the IPA range
  • Connect the host to the realm and get a keytab
  • Get a Kerberos ticket for the machine
  • request a certificate

VPN-Example

Let us consider the case of a VPN server. On an IPA client we want to set up a VPN tunnel to a remote host, maybe at another company. To do this, we need to create an entry for this remote host, a service principal to save the certificate, and then issue the certificate.

Some of these jobs need to be done as an administrator:

% kinit admin 
% ipa host-add vpn.remote.com 
% ipa service-add vpn / vpn.remote.com 
% ipa service-add-host --hosts = ipa.example.com vpn / vpn.remote.com

We created the remote host and a service principal for it and gave the host ipa.example.com permission to request a certificate on behalf of vpn.remote.com. This requires that the certificate request for vpn.remote.com is in the vpn.csr file .

On ipa.example com:

% kinit -kt /etc/krb5.keytab host/ipa.example.com@EXAMPLE.COM% 
ipa cert-request --principal = vpn / vpn.remote.com vpn.csr 
% ipa service-show vpn / vpn.remote.com
Previous CSR generation and certificate installation: Glassfish 4.x
Next Installation of the Lotus Domino 8.5 SSL certificate
Table of Contents