MID Server unified key store
The MID Server unified key store allows all products on the MID Server to use common certificates and key pairs. This feature allows applications to use the same secure communication channel to the MID Server that the MID Server uses to connect to the instance.
When the MID Server starts, the common name (CN) of the certificate is inspected to identify if a custom certificate has been installed. If a custom certificate is detected, the creation of the certificate/keypair will be skipped and an attribute is set on the ecc_agent record to indicate the usage of a custom certificate.
When a custom certificate is used, the Re-key UI-action is disabled on the instance for the MID Server. A new UI action called Remove custom keypair is available to switch back to using a self-signed certificate. Using this action will cause the MID Server to remove the custom certificate and generate a new self-signed certificate, similar to the re-key option.
When a MID is upgraded, any custom certificates that were installed will be retained.
PEM bundle support
MID Server unified key store supports PEM bundle certificate and key pairs.
Sample PEM bundle
-----BEGIN PRIVATE KEY-----
MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC0pj5O8QKFpHy9
...
oPdU+h0grs9SJp6rFx0PzDY=
-----END PRIVATE KEY-----
Bag Attributes
friendlyName: <myCustomCert>
localKeyID: 54 69 6D 65 20 31 35 39 35 33 35 34 32 30 38 30 35 31
subject=/C=US/ST=CA/L=Santa Clara/CN=epic1016883
issuer=/C=US/ST=CA/L=Santa Clara/CN=epic1016883
-----BEGIN CERTIFICATE-----
MIIDKzCCAhOgAwIBAgIEPqMQqDANBgkqhkiG9w0BAQsFADBGMQswCQYDVQQGEwJV
...
4g53RN+LqtJVeeQkZvIbZOfuSqypdVfudkS8dqxQALb8IuHUV7JOcBvOT79mSTs=
-----END CERTIFICATE-----
Install custom certificates in the MID Server unified key store
Install custom certificates to unify the security channels for various applications.
Before you begin
Role required: admin
install-certificate.sh can be unresponsive if the Linux entropy
pool count is less than a few hundred. Check the entropy count of the Linux pseudo
random number generator (PRNG) with the following command:
cat /proc/sys/kernel/random/entropy_availIf the entropy count
is too low, you can install an entropy generator such as RNGD or Haveged. For more
information about installing Haveged for CentOS and Ubuntu, see How to Setup Additional Entropy for Cloud Servers
Using Haveged.Procedure
What to do next
- Enable mutual authentication
For Windows, use the command:
bin\scripts\manage-certificates.bat -mFor Linux, use the command:
./bin/scripts/manage-certificates.sh -m- Remove mutual authentication and restore back basic authentication
For Windows, use the command:
bin\scripts\manage-certificates.bat -b <myUserName myPassword>For Linux, use the command:
./bin/scripts/manage-certificates.sh -b <myUserName myPassword>- Add new certificates and certificate chains with a specified alias
For Windows, use the command:
bin\scripts\manage-certificates.bat -a <alias> <fileName>For Linux, use the command:
./bin/scripts/manage-certificates.sh -a <alias> <fileName>The
aliasis a unique name given to the certificate being imported. The MID Server requires a custom certificate for mutual authentication, with the default alias namedefaultsecuritykeypairhandle. To configure MTLS communication between the MID Server and instance, the certificate entry must be added to the key store using the alias namedefaultsecuritykeypairhandle.The
fileNameis a file path that can contain a PEM certificate, or certificate chain, and a PCKS#8 private key. The file path to the PEM bundle can contain multiple certificates and a single private key. The header and footer of each PEM certificate must be the following:-----BEGIN CERTIFICATE----------END CERTIFICATE-----The header and footer of the PKCS#8 syntax must be the following:
-----BEGIN PRIVATE KEY----------END PRIVATE KEY-----An exception is thrown if the certificate chain fails validation. If the file contains multiple certificates, they must be ordered: leaf certificate, intermediate certificates, then root certificates.
- Display certificate details for the specified alias
For Windows, use the command:
bin\scripts\manage-certificates.bat -g <alias> For Linux, use the command:
./bin/scripts/manage-certificates.sh -g <alias> This command displays information such as subject distinguished name, issuer name, and expiry date from the certificate.
- List all existing aliases
For Windows, use the command:
bin\scripts\manage-certificates.bat -lFor Linux, use the command:
./bin/scripts/manage-certificates.sh -lThis command lists all the alias names available in the agent_keystore.
- Delete certificates using an alias
For Windows, use the command:
bin\scripts\manage-certificates.bat -d <alias>For Linux, use the command:
./bin/scripts/manage-certificates.sh -d <alias>This command deletes the alias and record from the keystore. The entry for alias DefaultSecurityKeyPairHandle can be deleted using this command.
- Remove all entries from the keystore
For Windows, use the command:
bin\scripts\manage-certificates.bat -r For Linux, use the command:
./bin/scripts/manage-certificates.sh -r This command deletes the existing entries from the keystore, except alias DefaultSecurityKeyPairHandle.
Restore the MID Server key store with a backup
If the key store becomes corrupted or is accidentally deleted you can restore a backup of the MID Server key store. This is especially useful for key stores with custom key-pairs, because otherwise recreating custom key-pair data can be difficult and time consuming.
Before you begin
Role required: Agent admin
About this task
Starting with the Tokyo release, the MID Server automatically makes a backup of the agent_keystore file when it is changed. Backups are stored in security_backup under the agent folder. They are stored outside the security folder to protect against accidental deletions or corruptions of the security folder.
In the backup folder, there is a dedicated backup log file: keystore_backup_audit_trail.log. This log keeps track of backup files and backup activities. Each backup log entry has backup file name with a time stamp, a matching keypairs.mid_id, and a list of aliases of key-pairs in the backup.
The key store backups can be modified with the MID Server properties mid.keystore.max_backups, mid.keystore.max_live_backups, and mid.keystore.backup_overwrite_timespan. See MID Server properties for more information.