Type to search.

APM agent TLS communication

Stack

The Elastic Stack includes Elastic's core products such as Elasticsearch, Kibana, Logstash, and Beats.

Availability

  • Generally available

    This functionality is generally available and ready for production usage.

Unless stated otherwise on the page, this functionality is available when your Elastic Stack is deployed on Elastic Cloud Hosted, Elastic Cloud Enterprise, Elastic Cloud on Kubernetes, and self-managed environments.

This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes.

TLS is disabled by default. When TLS is enabled for APM Server inbound communication, agents will verify the identity of the APM Server by authenticating its certificate.

When TLS is enabled, a certificate and corresponding private key are required. The certificate and private key can either be issued by a trusted certificate authority (CA) or be self-signed.

The Elasticsearch distribution offers the certutil tool for the creation of self-signed certificates:

  1. Create a CA: ./bin/elasticsearch-certutil ca --pem. You’ll be prompted to enter the desired location of the output zip archive containing the certificate and the private key.
  2. Extract the contents of the CA archive.
  3. Create the self-signed certificate: ./bin/elasticsearch-certutil cert --ca-cert <path-to-ca-crt>/ca.crt --ca-key <path-to-ca-key>/ca.key --pem --name localhost
  4. Extract the certificate and key from the resulted zip archive.

Enable TLS and configure the APM Server to point to the extracted certificate and key:

Enable TLS in the APM integration settings and use the SSL/TLS input settings to set the path to the server certificate and key.

The following is a basic APM Server SSL config with secure communication enabled. This will make APM Server serve HTTPS requests instead of HTTP.

YAML
apm-server.ssl.enabled: true
apm-server.ssl.certificate: "/path/to/apm-server.crt"
apm-server.ssl.key: "/path/to/apm-server.key"

A full list of configuration options is available in SSL/TLS input settings.

Tip

If APM agents are authenticating themselves using a certificate that cannot be authenticated through known CAs (e.g. self signed certificates), use the ssl.certificate_authorities to set a custom CA. This will automatically modify the ssl.client_authentication configuration to require authentication.

When the APM server uses a certificate that is not chained to a publicly-trusted certificate (e.g. self-signed), additional configuration is required in the APM agent:

We do not recommend disabling APM agent verification of the server’s certificate, but it is possible:

APM Server does not require agents to provide a certificate for authentication, and there is no dedicated support for SSL/TLS client certificate authentication in Elastic’s backend agents.