This section helps user to configure OpenXPKI CA version 3.x.x using EST protocol..
Notes:
Connect the machine using PuTTY or another client.
From the client, run the
command to go to the root user.Enter the root password.
In nano /etc/apt/sources.list , change the source for installing the updates.
Update the file. For example:
# # deb cdrom:[Debian GNU/Linux testing _Buster_ - Official Snapshot amd64 DVD Binary-1 20190527-04:04]/ buster contrib main # deb cdrom:[Debian GNU/Linux testing _Buster_ - Official Snapshot amd64 DVD Binary-1 20190527-04:04]/ buster contrib main deb http://security.debian.org/debian-security buster/updates main contrib deb-src http://security.debian.org/debian-security buster/updates main contrib # buster-updates, previously known as 'volatile' # A network mirror was not selected during install. The following entries # are provided as examples, but you should amend them as appropriate # for your mirror of choice. # deb http://ftp.debian.org/debian/ buster-updates main deb-src http://ftp.debian.org/debian/ buster-updates main deb http://ftp.us.debian.org/debian/ buster main
Save the file.
Run the following commands:
Update the CA certificate lists in the server using
.Install en_US.utf8 locale using
.Select the en_US.UTF-8 UTF-8 locale, and then make it the default locale for the system.
Check the locales that you have generated using
.C C.UTF-8 en_IN en_IN.utf8 en_US.utf8 POSIX
Copy the fingerprint of the OpenXPKI package using
. For this instance, copy the key in /home .Type
as the value.Run the following command:
Add the package using the
command.Add the repository to your source list (buster) using
, and then .Install MySQL and Perl MySQL binding using
.Install apache2.2-common using
.In nano /etc/apt/sources.list , install the fastcgi module to speed up the user interface.
Add the
line in the file, and then save it.Run the following commands:
Enable the fastcgi module using
.Install the OpenXPKI core package using
.Restart the Apache server using
.Check whether the installation is successful using
.Create the empty database, and then assign the database user using
.Notes:
CREATE DATABASE openxpki CHARSET utf8; CREATE USER 'openxpki'@'localhost' IDENTIFIED BY 'openxpki'; GRANT ALL ON openxpki.* TO 'openxpki'@'localhost'; flush privileges;
If the MySQL service is not running, then run
to start the service.Type
to exit from MySQL.Store the used credentials in /etc/openxpki/config.d/system/database.yaml .
main: debug: 0 type: MariaDB name: openxpki host: localhost port: 3306 user: openxpki passwd: openxpki
Save the file.
For empty database schema, run
from the provided schema file.Type the password for the database.
Run the script using
.Confirm the setup using
.=== functional token === scep (scep): Alias : scep-1 Identifier: YsBNZ7JYTbx89F_-Z4jn_RPFFWo NotBefore : 2015-01-30 20:44:40 NotAfter : 2016-01-30 20:44:40 vault (datasafe): Alias : vault-1 Identifier: lZILS1l6Km5aIGS6pA7P7azAJic NotBefore : 2015-01-30 20:44:40 NotAfter : 2016-01-30 20:44:40 ca-signer (certsign): Alias : ca-signer-1 Identifier: Sw_IY7AdoGUp28F_cFEdhbtI9pE NotBefore : 2015-01-30 20:44:40 NotAfter : 2018-01-29 20:44:40 === root ca === current root ca: Alias : root-1 Identifier: fVrqJAlpotPaisOAsnxa9cglXCc NotBefore : 2015-01-30 20:44:39 NotAfter : 2020-01-30 20:44:39 upcoming root ca: not set
Check whether the installation is successful using
.Starting OpenXPKI... OpenXPKI Server is running and accepting requests. DONE.
Do the following to access the OpenXPKI server:
From a web browser, type
.Add the user name and their corresponding passwords in a
file. To add the user name and the password, do the following:Check out to /home/pkiadm , and then nano userdb.yaml .
Paste the following:
estRA: digest:"{ssha256}somePassword” role: RA Operator
Enter the user name and password.
Create one certificate request, and then test it.
To configure OpenXPKI CA manually, create the following:
Root CA certificate. For more information, see Creating a root CA certificate .
CA signer certificate, signed by the root CA. For more information, see Creating a signer certificate .
Data vault certificate, self-signed. For more information, see Creating a vault certificate .
Web certificate, signed by the signer certificate. For more information, see Setting up the webserver .
Notes:
For version 3.10 or later, you can manage the keys directly using the openxpkiadm alias command:
Run mkdir -p /etc/openxpki/local/keys to create the directory. The default location of the directory is /etc/openxpki/local/keys .
Run openxpkictl start to start the server.
For this instance, we are using the /etc/certs/openxpki_democa/ directory for certificate generation. However, you can use any directory.
The OpenSSL configuration file contains X.509 extensions for generating and signing certificate requests.
Run the following command:
# x509_extensions = v3_ca_extensions # x509_extensions = v3_issuing_extensions # x509_extensions = v3_datavault_extensions # x509_extensions = v3_scep_extensions # x509_extensions = v3_web_extensions # x509_extensions = v3_ca_reqexts # not for root self-signed, only for issuing ## x509_extensions = v3_datavault_reqexts # not required self-signed # x509_extensions = v3_scep_reqexts # x509_extensions = v3_web_reqexts [ req ] default_bits = 4096 distinguished_name = req_distinguished_name [ req_distinguished_name ] domainComponent = Domain Component commonName = Common Name [ v3_ca_reqexts ] subjectKeyIdentifier = hash keyUsage = digitalSignature, keyCertSign, cRLSign [ v3_datavault_reqexts ] subjectKeyIdentifier = hash keyUsage = keyEncipherment extendedKeyUsage = emailProtection [ v3_scep_reqexts ] subjectKeyIdentifier = hash [ v3_web_reqexts ] subjectKeyIdentifier = hash keyUsage = critical, digitalSignature, keyEncipherment extendedKeyUsage = serverAuth, clientAuth [ v3_ca_extensions ] subjectKeyIdentifier = hash keyUsage = digitalSignature, keyCertSign, cRLSign basicConstraints = critical,CA:TRUE authorityKeyIdentifier = keyid:always,issuer [ v3_issuing_extensions ] subjectKeyIdentifier = hash keyUsage = digitalSignature, keyCertSign, cRLSign basicConstraints = critical,CA:TRUE authorityKeyIdentifier = keyid:always,issuer:always crlDistributionPoints = URI:https://FQDN of your system/openxpki/CertEnroll/MYOPENXPKI.crl authorityInfoAccess = caIssuers;URI:https://FQDN of your system/download/MYOPENXPKI.crt [ v3_datavault_extensions ] subjectKeyIdentifier = hash keyUsage = keyEncipherment extendedKeyUsage = emailProtection basicConstraints = CA:FALSE authorityKeyIdentifier = keyid:always,issuer [ v3_scep_extensions ] subjectKeyIdentifier = hash basicConstraints = CA:FALSE authorityKeyIdentifier = keyid,issuer [ v3_web_extensions ] subjectKeyIdentifier = hash keyUsage = critical, digitalSignature, keyEncipherment extendedKeyUsage = serverAuth, clientAuth basicConstraints = critical,CA:FALSE subjectAltName = DNS:FQDN of est server crlDistributionPoints = URI:https://FQDN of your system/openxpki/CertEnroll/MYOPENXPKI_ISSUINGCA.cr authorityInfoAccess = caIssuers;URI:https://FQDN of your system/download/MYOPENXPKI_ISSUINGCA.crt
Replace the IP address and CA certificate name with your setup information.
Save the file.
Run the following command:
Type your password.
Save the file.
You can create a self-signed root CA certificate, or generate a certificate request and then get it signed by the root CA.
Run the following command:
Replace the subject in the request with your CA information using
.Get the certificate signed by the root CA using
.Go to /etc/certs/openxpki_democa/ where ca-root-1.crt is saved.
Run the following command:
Run the following command:
Replace the subject in the request with your CA information using
.Get the certificate signed by the root CA using
.Run the following command:
Notes:
Run the following command:
Change the subject in the request with your CA information using
.Run the following command:
Run the following command:
Replace the subject in the request with your CA information using
.Run the following command:
Run the following commands:
Restart the Apache service using apache2 restart .
Run the following command to check the successful import of the files:
=== functional token === ca-signer (certsign): Alias : ca-signer-2 Identifier: XjC6MPbsnyfLZkI9Poi9vm4Z5rk NotBefore : 2022-04-06 10:03:01 NotAfter : 2032-04-03 10:03:01 vault (datasafe): Alias : vault-2 Identifier: G8ekluAsskGVC0N-jZhB2n9kvdM NotBefore : 2022-04-06 09:53:57 NotAfter : 2025-04-10 09:53:57 scep (scep): not set ratoken (cmcra): not set === root ca === current root ca: Alias : root-2 Identifier: prTHU5vCfcJuCnQWyb5wUknvXQM NotBefore : 2022-04-06 09:40:27 NotAfter : 2032-01-04 09:40:27
Change the value in the
file.Uncomment the cache:
:secret: default: label: Global Secret group export: 0 method: literal value: root cache: daemon
Run the
command.Starting OpenXPKI... OpenXPKI Server is running and accepting requests. DONE.
Access the OpenXPKI server:
From a web browser, type
.Add the user names and corresponding passwords in a
file:Check out to /home/pkiadm and then to nano userdb.yaml .
Paste the following:
estRA: digest:"{ssha256}somePassword” role: RA Operator
To generate the password, type
. A message showing the password and an ssha256 encrypted password appears.Copy the password, and then paste it in the digest of any user.
Type the user name and password.
Create one certificate request, and then test it.
Stop the OpenXPKI service using
.In nano /etc/openxpki/config.d/realm/democa/publishing.yaml , update the
section to the following:class: Connector::Builtin::File::Path LOCATION: /var/www/openxpki/CertEnroll/ file: "[% ARGS.0 %].crl" content: "[% pem %]"
In nano /etc/openxpki/config.d/realm/democa/profile/default.yaml , update the following:
section
critical: 0 uri: - https://FQDN of the est/openxkpi/CenrtEnroll/[% ISSUER.CN.0 %].crl - ldap://localhost/[% ISSUER.DN %]
section
critical: 0 ca_issuers: http://FQDN of the est/download/MYOPENXPKI.crt ocsp: http://ocsp.openxpki.org/
Change the IP address and CA certificate name according to your CA server.
In nano /etc/openxpki/config.d/realm/democa/crl/default.yaml , do the following:
If necessary, update
and .Add
to the following section:extensions: authority_info_access: critical: 0 # ca_issuers and ocsp can be scalar or list ca_issuers: https://FQDN of the est/download/MYOPENXPKI.crt #ocsp: http://ocsp.openxpki.org/
Change the IP address and CA certificate name according to your CA server.
Start the OpenXPKI service using
.After creating the CRLs, you must publish them to be accessed by all.
Stop the Apache service using
.Create a CertEnroll directory for the CRL in the /var/www/openxpki/ directory.
Set openxpki as the owner of this directory, and then configure the permissions to let Apache read and execute, and other services to read only.
chown openxpki /var/www/openxpki/CertEnroll
chmod 755 /var/www/openxpki/CertEnroll
Add a reference to the Apache alias.conf file using
.After the
section, add the following:Alias /CertEnroll/ "/var/www/openxpki/CertEnroll/" <Directory "/var/www/openxpki/CertEnroll"> Options FollowSymlinks AllowOverride None Require all granted </Directory>
Add a reference in the apache2.conf file using nano /etc/apache2/apache2.conf .
Add the following in the
section:<Directory /var/www/openxpki/CertEnroll> Options FollowSymlinks AllowOverride None Allow from all </Directory>
Start the Apache service using
.Stop the OpenXPKI service using
.In /etc/openxpki/config.d/realm/democa/est/default.yaml , update the
section:eligible: initial: value@: connector:scep.generic.connector.initial args: '[% context.cert_subject_parts.CN.0 %]' expect: - Build - New
eligible: initial: value: 1 # value@: connector:scep.generic.connector.initial # args: '[% context.cert_subject_parts.CN.0 %]' # expect: # - Build # - New
Notes:
Save the file.
Start the OpenXPKI service using
.Run the following command:
Replace
with .Start the OpenXPKI service using
.In OpenXPKI, you can configure multiple PKI structures in the same system. The following topics show how to create another realm for MVE named democa-two .
Create a directory, namely democa2 , for the second realm inside /etc/openxpki/config.d/realm .
Copy the /etc/openxpki/config.d/realm/ca-one sample directory tree to a new directory ( cp -r /etc/openxpki/config.d/realm.tpl/*/etc/openxpki/config.d/realm/democa2 ) within the realm directory.
In /etc/openxpki/config.d/system/realms.yaml , update the following section:
# This is the list of realms in this PKI # You only need to enable the realms which are visible on the server democa: label: Verbose name of this realm baseurl: https://pki.example.com/openxpki/ #democa2: # label: Verbose name of this realm # baseurl: https://pki.acme.org/openxpki/
# This is the list of realms in this PKI # You only need to enable the realms which are visible on the server democa: label: Example.org Demo CA baseurl: https://pki.example.com/openxpki/ democa2: label: Example.org Demo CA2 baseurl: https://pki.example.com/openxpki/
Save the file.
You can configure the EST endpoint with a tuple composed of the authority portion of the URI and the optional label (for example, www.example.com:80 and arbitraryLabel1). In the following instructions, we use two PKI realms,
and .Copy the default configuration file in cp /etc/openxpki/est/default.conf /etc/openxpki/est/democa.conf .
In nano /etc/openxpki/est/democa.conf , change the realm value to
.Create another configuration file in cp /etc/openxpki/est/default.conf /etc/openxpki/est/democa2.conf .
In nano /etc/openxpki/est/democa2.conf , change the realm value to
.Copy the default.yaml file in the following locations:
cp /etc/openxpki/config.d/realm/democa/est/default.yaml
/etc/openxpki/config.d/realm/democa/est/democa.yaml
Copy the default.yaml file in the following locations:
cp /etc/openxpki/config.d/realm/democa2/est/default.yaml
/etc/openxpki/config.d/realm/democa2/est/democa2.yaml
Restart the OpenXPKI service using
.Select the following URLs to open the EST server corresponding to a realm via a web browser:
— http://ipaddress/est/democa
— http://ipaddress/est/democa2
If you want to differentiate between login credentials and default certificate templates for different PKI realms, then you may need advanced configuration.
The following instructions show how to generate a signer certificate in the second realm. You can use the same root and vault certificates as those in the first realm.
Create an OpenSSL configuration file in nano /etc/certs/openxpki_democa2/openssl.conf .
Go to the directory of the vault certificate in the first realm, and then import the certificate from the first realm.
Run the following code:
Run the following command:
Type your password.
Create a signer certificate. For more information, see Creating a signer certificate .
Check whether the import is successful using openxpkiadm alias --realm democa2 .
Generate the CRLs for the second realm. For more information, see Generating CRL information .
Publish the CRLs for this realm. For more information, see Publishing CRL information .
Restart the OpenXPKI service using openxpkictl restart .
Stopping OpenXPKI Stopping gracefully, 3 (sub)processes remaining... DONE. Starting OpenXPKI... OpenXPKI Server is running and accepting requests. DONE.
By default, in OpenXPKI only one certificate with the same subject name can be active at a time. But when you are enforcing multiple Named Certificates, multiple active certificates with the same subject name must be present at a time.
In /etc/openxpki/config.d/realm/REALM NAME/est/< REALM NAME >.yaml , from the
section, change the value of from to .Notes:
Restart the OpenXPKI service using
.By default, Apache listens in port number 443 for https. Set the default port number for OpenXPKI CA to avoid conflicts.
In /etc/apache2/ports.conf , modify the 443 port to any other port. For example:
Listen 80 <IfModule ssl_module> Listen 443 </IfModule> <IfModule mod_gnutls.c> Listen 443 </IfModule>
Listen 80 <IfModule ssl_module> Listen 9443 </IfModule> <IfModule mod_gnutls.c> Listen 9443 </IfModule>
In /etc/apache2/sites-available/openxpki.conf , add or modify the
section to map a new port. For example, to .In /etc/apache2/sites-available/default-ssl.conf , add or modify the
section to map a new port. For example, change to .Restart the Apache server using
.In tinddopenxpkiweb01.dhcp.dev.lexmark.com:9443 (RSA): , enter the passphrase for the SSL/TLS keys.
To check the status, run
. The OpenXPKI SCEP URL is now https://ipaddress , and the web URL is FQDN:9443/openxpki .Run the following command:
Create a user account that has access to the server. Enter the following details:
htpasswd -c /etc/apache2/.htpasswd <username> New password: Re-type new password: Adding password for user <username>
Go to directory
.In nano openxpki.conf , add the following lines in
:#HTTPS BASIC AUTH FOR LABELS Location /.well-known/est/*/simpleenroll AuthType Basic AuthName "estrealm" AuthUserFile /etc/apache2/.htpasswd require valid-user </Location> #HTTPS BASIC AUTH FOR NO LABEL <Location /.well-known/est/simpleenroll> AuthType Basic AuthName "estrealm" AuthUserFile /etc/apache2/.htpasswd require valid-user </Location>
Add
before SSLEngine in the same virtual Host block.ServerAlias * DocumentRoot /var/www/ ErrorDocument 401 %{unescape:%00} SSLEngine On
Restart the apache2 service using service apache2 restart .
Go to the following directory:
.For the required host in nano openxpki.conf , add SSLVerifyClient require .
For example, if you are using port 443, modify the VirtualHost section to:
<VirtualHost *:443> SSLVerifyClient require </VirtualHost>
Remove the SSLVerifyClient optional_no_ca command.
Save the file, and then type
to exit from MySQL.Go to the following directory:
.Open default.yaml and democa.yaml .
Run the following command:
In the authorized_signer section, add the following:
authorized_signer: rule2: subject: CN=,.
For example, if your client certificate subject name is test123 , then add the following in the
section:authorized_signer: rule1: # Full DN subject: CN=.+:pkiclient,. rule2: subject: CN=test123,.*
Save the file, and then type
to exit MySQL.Restart the OpenXPKI service using
.Restart the Apache service using
.The SAN mismatch error may occur when you are enabling the CRL information. This error indicates that the IP or host name does not match the value of the SAN in the web certificate. To avoid getting this error, use the FQDN in the path of the CRL instead of the IP. You can also configure the web certificate and use the FQDN of your system in the SAN field.
If the System Status page shows that your ca-signer-1 and vault-1 tokens are offline, then do the following:
In /etc/openxpki/config.d/realm/realm name/crypto.yaml , change the corresponding key value.
Restart the OpenXPKI service.