Secret token
editSecret token
editYou 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:
- Make sure SSL/TLS is enabled
- Set a secret token in your Agents and Server
- Enable HTTPS in your APM Agents
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
editAPM Server configuration
Here’s how you set the secret token in APM Server:
apm-server.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:
-
Go Agent:
ELASTIC_APM_SECRET_TOKEN
-
Java Agent:
secret_token
-
.NET Agent:
ELASTIC_APM_SECRET_TOKEN
-
Node.js Agent:
Secret Token
-
Python Agent:
secret_token
-
Ruby Agent:
secret_token
HTTPS communication in APM Agents
editTo enable secure communication in your Agents, you need to update the configured server URL to use HTTPS
instead of HTTP
.
-
Go Agent:
ELASTIC_APM_SERVER_URL
-
Java Agent:
server_urls
-
.NET Agent:
ServerUrl
-
Node.js Agent:
serverUrl
-
Python Agent:
server_url
-
Ruby Agent:
server_url
Some Agents also allow you to specify a custom certificate authority for connecting to APM Server.
-
Go Agent:
ELASTIC_APM_SERVER_CERT
-
Python Agent:
ELASTIC_APM_SERVER_CERT
-
Ruby Agent:
server_ca_certedit
Most 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.
-
Java Agent:
verify_server_cert
-
Node.js Agent:
verifyServerCert
-
.NET Agent:
VerifyServerCert