2019-03-22 17:59:53 +01:00
[[uptime-security]]
2019-07-12 18:02:58 +02:00
== Elasticsearch Security
2019-03-22 17:59:53 +01:00
2020-03-16 15:58:16 +01:00
If you use Elasticsearch security, you'll need to enable certain privileges for users
that would like to access the Uptime app. For example, create user and support roles to implement the privileges:
2019-03-22 17:59:53 +01:00
[float]
=== Create a role
You'll need a role that lets you access the Heartbeat indices, which by default are `heartbeat-*`.
You can create this with the following request:
["source","sh",subs="attributes,callouts"]
---------------------------------------------------------------
PUT /_security/role/uptime
{ "indices" : [
{
"names" : [
"heartbeat-*"
],
"privileges" : [
"read",
"view_index_metadata"
],
"field_security" : {
"grant" : [
"*"
]
},
"allow_restricted_indices" : false
}
],
"transient_metadata" : {
"enabled" : true
}
}
---------------------------------------------------------------
// CONSOLE
[float]
=== Assign the role to a user
2019-10-30 12:08:01 +01:00
Next, you'll need to create a user with both the `uptime` role, and another role with sufficient {kibana-ref}/kibana-privileges.html[Kibana privileges],
2020-01-31 20:26:12 +01:00
such as the `kibana_admin` role.
2019-03-22 17:59:53 +01:00
You can do this with the following request:
["source","sh",subs="attributes,callouts"]
---------------------------------------------------------------
PUT /_security/user/jacknich
{
"password" : "j@rV1s",
2020-01-31 20:26:12 +01:00
"roles" : [ "uptime", "kibana_admin" ],
2019-03-22 17:59:53 +01:00
"full_name" : "Jack Nicholson",
"email" : "jacknich@example.com",
"metadata" : {
"intelligence" : 7
}
}
---------------------------------------------------------------
2019-07-12 18:02:58 +02:00
// CONSOLE