Secret token

edit

This documentation refers to configuring the standalone (legacy) APM Server. This method of running APM Server will be deprecated and removed in a future release. Please consider upgrading to Fleet and the APM integration. If you’ve already upgraded, see Secret token.

You can configure a secret token to authorize requests to the APM Server. This ensures that only your agents are able to send data to your APM servers. Both the agents and the APM servers have to be configured with the same secret token.

Secret tokens are sent as plain-text, so they only provide security when used in combination with SSL/TLS.

To secure the communication between APM agents and the APM Server with a secret token:

Secret tokens are not applicable for the RUM Agent, as there is no way to prevent them from being publicly exposed.

Set a secret token

edit

APM Server configuration

Elasticsearch Service and Elastic Cloud Enterprise deployments provision a secret token when the deployment is created. The secret token can be found and reset in the Elastic Cloud console under Deployments — APM & Fleet.

Here’s how you set the secret token in APM Server:

apm-server.auth.secret_token: <secret-token>

We recommend saving the token in the APM Server Secrets keystore.

Secret tokens are not applicable for the RUM agent, as there is no way to prevent them from being publicly exposed.

Agent specific configuration

Each Agent has a configuration for setting the value of the secret token:

HTTPS communication in APM agents

edit

To enable secure communication in your agents, you need to update the configured server URL to use HTTPS instead of HTTP.

Some agents also allow you to specify a custom certificate authority for connecting to APM Server.

Agents that don’t allow you specify a custom certificate will allow you to disable verification of the SSL certificate. This ensures encryption, but does not verify that you are sending data to the correct APM Server.