Enable OpenSSL secure signing for plugins
Create a self-signed certificate for an Agent Client Collector plugin. The following procedure gives an example of how to create an x509 certificate using OpenSSL. For other certificate types, consult OpenSSL documentation.
Before you begin
- Ensure that the verify-plugin-signature property is set to True in the agent's
acc.ymlfile to verify plugin signing. - Ensure OpenSSL is installed on your system.
Role required: agent_client_collector_admin
About this task
Enabling an OpenSSL secure signing mechanism for plugins works with an Agent Client Collector installed on a Linux system.
Procedure
Create a plugin file with a
tar.gzextension.For more information, see Create and edit Agent Client Collector plugins.
Generate your own secure self-certificate for the plugin file.
Create an x509 certificate.
openssl req -nodes -x509 -sha256 -newkey rsa:2048 -keyout "sign.key" -out "sign.crt" -days 365 -subj "/C=<CountryName>/ST=<StateOrProvinceName>/L=<Locality>/O=<Organization>/OU=<OrganizationalUnit>/CN=sign"Sign the plugin file.
openssl dgst -sha256 -sign "sign.key" -out sign.txt.sha256 <plugin-name>.tar.gzAlternatively, you can sign plugins using a certificate authority. When doing so, assign the certificate .pem format and place it in the agent's
certdirectory.Verify that the signature is configured correctly.
openssl dgst -sha256 -verify <(openssl x509 -in "sign.crt" -pubkey -noout) -signature sign.txt.sha256 <plugin-name>.tar.gzIf the file is valid, the output is
Verified OK.Encode the signature's certificate with base64 coding.
base64 sign.txt.sha256 > sign.txt.sha256_encode64.sigA
sign.txt.sha256_encode64.sigfile is created.
Run the following commands to create a new directory and insert the
tar.gzandsign.txt.sha256_encode64.sigfiles.mkdir signed-pluginmv <plugin-name>.tar.gz signed-pluginmv sign.txt.sha256_encode64.sig signed-plugincd signed-plugin
Create another
tar.gzfile by running the same commands as you ran for the firsttar.gzfile.tar -C . -zcvf ../<plugin-name>.tar.gz *cd..Note: Save the new file as
../<plugin-name>.tar.gzto avoid naming collisions with the original<plugin-name>.tar.gzfile that exists in the current directory.
Upload the new
tar.gzplugin file to the instance.Set the plugin file as active=true.
Place the
sign.crtfile into one of the following locations:- The Agent Client Collector's
certdirectory, located in theconfigfolder. - On the MID Server, compress the file into a
.zipfile and place it in theagent/static/cert/customerfolder. - In the
acc.ymlfile, setverify-plugin-signatureto true.
- The Agent Client Collector's
What to do next
Add the self-signed sign.crt file to the agent host trust store, as described in Add a self-signed certificate to the OS truststore.
Parent Topic:Agent Client Collector certificates