Skip to main content

Build automation plugins

Automation plugins are used to discover and manage certificates on network appliances and cloud services. Each automation plugin defines how to access, authenticate, and manage certificates on a particular system type. This article covers the Java classes and development process for building automation plugins.

Before you begin

  • Follow the steps in the Prepare your development environment topic to:

    • Access the example repository for this plugin type.

    • Configure the required development tools and settings.

    • Run a test build.

  • Make sure you understand the common project files for custom plugins.

  • Review the README file for the example plugin repository in detail.

プロジェクトファイル

以下のファイルには、プラグインプロジェクトの重要な設定、依存関係、情報が含まれています。以下のファイルは、自動化プラグインサンプルが格納された最上位ディレクトリに含まれています。

  • Each plugin should target a particular type of managed system, for example a specific network appliance model, load balancer, or cloud service.

  • The target system must support remote management through APIs, SSH, or similar mechanisms. Your custom logic specifies how to connect to and authenticate with that system type to discover, install, and validate certificates.

  • When you add a connector (instance) of the plugin in Trust Lifecycle Manager, the discovery component of the workflow is triggered and must include steps to:

    • Connect to and authenticate with the managed system.

    • Retrieve current certificate and system configuration data from the managed system and return it to Trust Lifecycle Manager to import into inventory, both on initial setup and when a refresh is requested.

  • When you manage a certificate endpoint through that connector, the main automation workflow is triggered and must include steps to:

    • Generate the certificate signing request (CSR) and return the CSR to Trust Lifecycle Manager to initiate certificate issuance.

    • Download the resulting certificate from Trust Lifecycle Manager to the sensor, install it on the target system, and confirm successful installation.

Main Java classes

The example automation plugin provides the following Java source files under src/main/java/com/example/automation and its subdirectories. These classes define the core workflow logic, utility methods, and connector configuration for the plugin. To create your custom plugin, modify or extend the applicable class and method definitions in these files.

ヒント

Review the included Javadocs in the source files for details about expected inputs, outputs, and behavior for each method.

MyAutomationPlugin.java

Description

The primary class that defines the custom logic for each automation plugin. It extends the AbstractAutomationWorkflow class and implements custom integration, discovery, and certificate lifecycle automation tasks for managing a particular system type from Trust Lifecycle Manager.

Customizations

To implement custom integration, discovery, and automation logic, update the code in the following methods, annotated with @Override.

MyAutomationPluginHelper.java

Description

Found in the helper subdirectory, this class provides static utility methods for CSR generation, self-signed certificate generation, configuration refresh response population, and certificate downloads and extraction.

Helper methods

The helper class provides the following public utility methods, which you can use in your custom plugin code.

MyAutomationPluginRunner.java

Description

Acts as the entry point for the plugin, invoking the plugin object defined in MyAutomationPlugin.java, along with the required SDK context object for sharing information across different methods and storing results at different execution points.

Customizations

This class should not typically be modified. If you do customize it, make sure the fully qualified class name matches the one in the pom.xml file.

MyPluginConfiguration.java

Description

Found in the extended/configuration subdirectory, this class defines the main configuration properties for the plugin instance. All properties you define here should have matching fields in the config_settings section of the configuration.json file for the plugin. This ensures that users provide values for these properties when configuring each instance (connector) of the plugin in Trust Lifecycle Manager.

Customizations

By default, this class defines variables to store user credentials (userName and password) and network connection settings (managementIp and managementPort) for accessing the target system.

To customize:

  • Adjust the default variables if the target system uses an authentication method other than user credentials.

  • Add or modify variables to store any required network properties for connecting to the target system.

  • Define additional variables as needed to configure different settings for connecting and using each instance of the custom plugin.

Extended request/response classes

The following Lombok-annotated Java classes define extended fields for the request and response types used in different automation workflow steps. These source files are found in the src/main/java/com/example/automation/extended directory. By default, each class is empty. To extend the request or response for a given workflow step, add the applicable field definitions to these classes.

MyGenerateCertificateRequest.java

Description

Defines extended request parameters for the generateCsr() workflow step. By default, the generateCsr() method uses JsonNode as the generic type parameter of the GenerateCsrRequest wrapper. To deserialize extended request fields, you can use this class as the type parameter instead.

Customizations

Add fields here to capture any additional parameters sent by Trust Lifecycle Manager for the CSR generation step that go beyond the standard GenerateCsrRequest fields. If you add fields here, also update the generateCsr() method in MyAutomationPlugin.java to use MyGenerateCertificateRequest as the generic type parameter of GenerateCsrRequest, following the same pattern used by MyRefreshRequest in refreshConfiguration().

MyInstallCertificateRequest.java

Description

Defines extended request parameters for the installCertificate() workflow step. By default, the installCertificate() method uses JsonNode as the generic type parameter of the InstallCertificateRequest wrapper. To deserialize extended request fields, you can use this class as the type parameter instead.

Customizations

Add fields here to capture any additional parameters sent by Trust Lifecycle Manager for the certificate installation step that go beyond the standard InstallCertificateRequest fields. If you add fields here, also update the installCertificate() method in MyAutomationPlugin.java to use MyInstallCertificateRequest as the generic type parameter of InstallCertificateRequest, following the same pattern used by MyRefreshRequest in refreshConfiguration().

MyValidateRequest.java

Description

Defines extended request parameters for the validateCertificate() workflow step. By default, the validateCertificate() method uses JsonNode as the generic type parameter of the ValidateCertificateRequest wrapper. To deserialize extended request fields, you can use this class as the type parameter instead.

Customizations

Add fields here to capture any additional parameters sent by Trust Lifecycle Manager for the certificate validation step that go beyond the standard ValidateCertificateRequest fields. If you add fields here, also update the validateCertificate() method in MyAutomationPlugin.java to use MyValidateRequest as the generic type parameter of ValidateCertificateRequest, following the same pattern used by MyRefreshRequest in refreshConfiguration().

MyRefreshRequest.java

Description

Defines extended request parameters for the refreshConfiguration() workflow step. It is used as the generic type parameter of the RefreshConfigurationRequest wrapper when deserializing the incoming request.

Customizations

Add fields here to capture any additional parameters sent by Trust Lifecycle Manager for the configuration refresh step that go beyond the standard RefreshConfigurationRequest fields.

MyRefreshResponse.java

Description

Defines extended response fields for the refreshConfiguration() workflow step. It is used as the generic type parameter of the RefreshConfigurationResponse wrapper.

Customizations

Add fields here to include any additional data in the refresh configuration response returned to Trust Lifecycle Manager that goes beyond the standard RefreshConfigurationResponse fields. Any fields defined here can be set and retrieved using the corresponding Lombok-generated getter and setter methods.

Build the plugin ZIP file

重要

Before building the plugin, make sure your development environment includes the required software and settings. For details, see Prepare your development environment.

After adding your custom logic, build the plugin ZIP file on the development system as follows:

  1. From the top-level project directory, run the build script by making the ./build.sh command.

  2. The script prints status messages to the console as it executes. At the end, it generates and prints the SHA-256 checksum for the ZIP file, confirming a successful build.

  3. Find the final ZIP file for the plugin in the plugin-dist subdirectory. The ZIP file contains the plugin JAR file and metadata JSON file required by Trust Lifecycle Manager.

What's next

To add the plugin to Trust Lifecycle Manager, you must upload both the plugin ZIP file and corresponding JSON configuration file.

For details about the required JSON configuration format, see Create the plugin configuration.