Keyfactor / pem-pkcs12-remote-orchestrator

The remote PEM / PKCS12 Orchestrator allows for the remote management of PEM and PKCS12 based certificate stores. The orchestrator performs operations by issuing remote commands over SSH to Linux based systems and via WinRM to Windows based systems.
Apache License 2.0
0 stars 1 forks source link
certificate-stores certificates keyfactor keyfactor-integration keyfactor-orchestrator pem

Remote PEM / PKCS12

PLEASE NOTE: This integration has been deprecated and replaced by The RemoteFile Orchestrator Extension - https://github.com/Keyfactor/remote-file-orchestrator.

The remote PEM / PKCS12 Orchestrator allows for the remote management of PEM and PKCS12 based certificate stores. Discovery, Inventory, and Management functions are supported. The orchestrator performs operations by issuing remote commands over SSH to Linux based systems and via WinRM to Windows based systems.

Integration status: Production - Ready for use in production environments.

About the Keyfactor Universal Orchestrator Capability

This repository contains a Universal Orchestrator Capability which is a plugin to the Keyfactor Universal Orchestrator. Within the Keyfactor Platform, Orchestrators are used to manage “certificate stores” — collections of certificates and roots of trust that are found within and used by various applications.

The Universal Orchestrator is part of the Keyfactor software distribution and is available via the Keyfactor customer portal. For general instructions on installing Capabilities, see the “Keyfactor Command Orchestrator Installation and Configuration Guide” section of the Keyfactor documentation. For configuration details of this specific Capability, see below in this readme.

The Universal Orchestrator is the successor to the Windows Orchestrator. This Capability plugin only works with the Universal Orchestrator and does not work with the Windows Orchestrator.

Support for Remote PEM / PKCS12

Remote PEM / PKCS12 is supported by Keyfactor for Keyfactor customers. If you have a support issue, please open a support ticket with your Keyfactor representative.

To report a problem or suggest a new feature, use the Issues tab. If you want to contribute actual bug fixes or proposed enhancements, use the Pull requests tab.



Use Cases

The PEM_PKCS12 Windows Orchestrator implements the following capabilities:

  1. Create - Create either a PEM or PKCS12 certificate store.
  2. Discovery - Discover all PEM or PKCS12 certificate stores in a set of paths based on optional list of file extensions and partial name matching.
  3. Inventory - Return all certificates for a defined certificate store.
  4. Management (Add) - Add a certificate to a defined certificate store.
  5. Management (Remove) - Remove a certificate from a defined certificate store.

The PEM_PKCS12 Windows Orchestrator supports the following types of certificate stores:

  1. PEM trust stores (multiple public (most likely CA) certificates with no private keys).
  2. PEM certificate stores containing one public certificate and one private key.
  3. PEM certificate stores containing one public certificate and an external private key stored in a separate file.
  4. PKCS12 certificate stores containing one certificate with a private key.

Versioning

The version number of a the PEM_PKCS12 Windows Orchestrator can be verified by right clicking on the PEMStoreSSH.dll file in the Plugins installation folder, selecting Properties, and then clicking on the Details tab.

Keyfactor Version Supported

The PEM_PKCS12 Windows Orchestrator has been tested against Keyfactor Universal Orchestrator version 9.2, but should work against earlier or later versions of the Keyfactor Universal Orchestrator.

Security Considerations

For Linux orchestrated servers:

  1. The PEM-PKCS12 AnyAgent makes use of a few common Linux commands. If the credentials you will be connecting with will need elevated access to run these commands, you must set the id up as a sudoer with no password necessary and set the config.json "UseSudo" value to "Y" (See Section 4 regarding the config.json file). The full list of these commands below:
    • echo
    • grep
    • find
  2. The PEM_PKCS12 AnyAgent makes use of SFTP to transfer files to and from the orchestrated server. SFTP will not make use of sudo, so all folders containing certificate stores will need to allow SFTP file transfer. If this is not possible, set the values in the config.json apprpriately to use an alternative upload/download folder that does have SFTP file transfer (See Section 4 regarding the config.json file).

For Windows orchestrated servers:

  1. Make sure that WinRM is set up on the orchestrated server and that the WinRM port is part of the certificate store path when setting up your certificate stores (See Section 3a below).

PEM_PKCS12 Orchestrator Configuration

1. Create the New Certificate Store Type for the New PEM_PKCS12 Orchestrator

In Keyfactor Command create a new Certificate Store Type similar to the one below:

2. Register the PEM_PKCS12 Orchestrator with Keyfactor

Download the desired AnyAgent version at https://github.com/Keyfactor/pem-pkcs12-remote-orchestrator. Within Windows File Explorer, navigate to the Keyfactor Orchestrator installation folder (usually C:\Program Files\Keyfactor\Keyfactor Orchestrator), find the "extensions" folder, and under that create a new folder named "PEM-SSH". Under the PEM-SSH folder copy all of the files from the downloaded release to this location.

3a. (Optional) Create a PEM_PKCS12 Certificate Store within Keyfactor Command

If you choose to manually create a PEM_PKCS12 store In Keyfactor Command rather than running a Discovery job to automatically find the store, you can navigate to Certificate Locations => Certificate Stores within Keyfactor Command to add the store. Below are the values that should be entered.

3b. (Optional) Schedule a PEM_PKCS12 Discovery Job

Rather than manually creating PEM_PKCS12 certificate stores, you can schedule a Discovery job to search an orchestrated server and find them.

First, in Keyfactor Command navigate to Certificate Locations => Certificate Stores. Select the Discover tab and then the Schedule button. Complete the dialog and click Done to schedule.

Once the Discovery job has completed, a list of PEM/PKCS12 store locations should show in the Certificate Stores Discovery tab in Keyfactor Command. Right click on a store and select Approve to bring up a dialog that will ask for the Keystore Password. Enter the store password, click Save, and the Certificate Store should now show up in the list of stores in the Certificate Stores tab.

From the Certificate Store list, edit the newly added store to enter the PEM_PKCS12 store type (PEM or PKCS12), whether the store has a separate private key file, and if necessary, the FULL PATH to that file. NOTE: You will not be able to successfully process an Inventory or Management job for this store until this has been completed.

4. Update Settings in config.json

The PEM_PKCS12 Orchestrator uses a JSON config file:

{
"UseSudo": "N",
"CreateStoreOnAddIfMissing": "N",
"UseSeparateUploadFilePath": "N",
"SeparateUploadFilePath": "/path/to/upload/folder/",
"UseNegotiateAuth": "N",
"UseSCP": "N",
"DefaultLinuxPermissionsOnStoreCreation": "600"
}

UseSudo - Y/N - Determines whether to prefix certain Linux command with "sudo". This can be very helpful in ensuring that the user id running commands ssh uses "least permissions necessary" to process each task. Setting this value to "Y" will prefix all Linux commands with "sudo" with the expectation that the command being executed on the orchestrated Linux server will look in the sudoers file to determine whether the logged in ID has elevated permissions for that specific command. For orchestrated Windows servers, this setting has no effect. Setting this value to "N" will result in "sudo" not being added to Linux commands.
CreateStoreOnAddIfMissing - Y/N - Determines if during a Management-Add job if a certificate store should be created if it does not already exist. If set to "N", the job will return an error with a message stating that the store does not exist.
UseSeparateUploadFilePath (Linux only) – When adding a certificate to a PEM or PKCS12 store, the PEM_PKCS12 Orchestrator must upload the certificate being deployed to the server where the certificate store resides. Setting this value to "Y" looks to the next setting, SeparateUploadFilePath, to determine where this file should be uploaded. Set this value to "N" to use the same path where the certificate store being managed resides.
SeparateUploadFilePath (Linux only) – Only used when UseSeparateUploadFilePath is set to "Y". Set this to the path you wish to use as the location to upload and later remove PEM/PKCS12 certificate store data before being moved to the final destination.
UseNegotiateAuth (Windows only) – Y/N - Determines if WinRM should use Negotiate (Y) when connecting to the remote server.
UseSCP (Optional, Linux only) - Y/N - Detemines if SCP (Y) or SFTP (N) should be used in uploading certificate files during Management-Add jobs.
DefaultLinuxPermissionsOnStoreCreation (Linux only) - Optional. Value must be 3 digits all between 0-7. The Linux file permissions that will be set on a new certificate store created via a Management Create job. This value will be used for all certificate stores managed by this orchestrator instance unless overridden by the optional "Linux File Permissions on Store Creation" custom parameter setting on a specific certificate store. If "Linux File Permissions on Store Creation" and DefaultLinuxPermissionsOnStoreCreation are not set, a default permission of 600 will be used.


License

Apache