Configure authentication credentials
editConfigure authentication credentials
editWhen sending data to a secured cluster through the elasticsearch
output, APM Server must either provide basic authentication credentials
or present a client certificate.
To configure authentication credentials for APM Server:
-
Create a writer role that has the following privileges:
-
Cluster:
manage_index_templatesandmonitor -
Index:
writeandcreate_indexon the APM Server indices
You can create roles from the Management / Roles UI in Kibana or through the
roleAPI. For example, the following request creates a role namedapm_writer: -
Cluster:
-
Assign the writer role to the user that APM Server will use to connect to Elasticsearch. Make sure you also assign any roles that are required for specific features. For the list of features and required roles, see APM Server features that require authorization.
-
To authenticate as a native user, create a user for APM Server to use internally and assign it the writer role, plus any other roles that are needed.
You can create users from the Management / Users UI in Kibana or through the
userAPI. For example, following request creates a user namedapm_internalthat has theapm_writerandkibana_userroles:POST /_security/user/apm_internal { "password" : "YOUR_PASSWORD", "roles" : [ "apm_writer","kibana_user"], "full_name" : "Internal APM Server User" } -
To use PKI authentication, assign the writer role, plus any other roles that are needed, in the
role_mapping.ymlconfiguration file. Specify the user by the distinguished name that appears in its certificate:apm_writer: - "cn=Internal APM Server User,ou=example,o=com" kibana_user: - "cn=Internal APM Server User,ou=example,o=com"
For more information, see Using Role Mapping Files.
-
-
In the APM Server configuration file, specify authentication credentials for the
elasticsearchoutput:-
To use basic authentication, configure the
usernameandpasswordsettings. For example, the following APM Server output configuration uses the nativeapm_internaluser to connect to Elasticsearch:You created this user earlier.
The example shows a hard-coded password, but you should store sensitive values in the secrets keystore.
-
To use PKI authentication, configure the
certificateandkeysettings:
-