0
0
Elasticsearchquery~10 mins

Role-based access control in Elasticsearch - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to define a role with read privileges on the index 'logs'.

Elasticsearch
{
  "role": {
    "indices": [
      {
        "names": ["logs"],
        "privileges": ["[1]"]
      }
    ]
  }
}
Drag options to blanks, or click blank then click option'
Amanage
Bwrite
Cdelete
Dread
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'write' instead of 'read' privilege.
Confusing 'manage' with 'read'.
2fill in blank
medium

Complete the code to assign the role 'log_reader' to the user 'alice'.

Elasticsearch
{
  "username": "alice",
  "roles": ["[1]"]
}
Drag options to blanks, or click blank then click option'
Alog_reader
Bguest
Cuser
Dadmin
Attempts:
3 left
💡 Hint
Common Mistakes
Assigning 'admin' role instead of 'log_reader'.
Using a role that does not exist.
3fill in blank
hard

Fix the error in the role definition by completing the missing privilege to allow document deletion.

Elasticsearch
{
  "role": {
    "indices": [
      {
        "names": ["logs"],
        "privileges": ["[1]"]
      }
    ]
  }
}
Drag options to blanks, or click blank then click option'
Adelete
Bwrite
Cread
Dmanage
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'write' which allows indexing but not deletion.
Using 'manage' which is broader than needed.
4fill in blank
hard

Fill both blanks to create a role that allows reading and writing on the 'metrics' index.

Elasticsearch
{
  "role": {
    "indices": [
      {
        "names": ["metrics"],
        "privileges": ["[1]", "[2]"]
      }
    ]
  }
}
Drag options to blanks, or click blank then click option'
Aread
Bwrite
Cdelete
Dmanage
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'delete' instead of 'write'.
Using only one privilege instead of both.
5fill in blank
hard

Fill all three blanks to define a user with username 'bob', password 'secret', and assign the role 'metrics_admin'.

Elasticsearch
{
  "username": "[1]",
  "password": "[2]",
  "roles": ["[3]"]
}
Drag options to blanks, or click blank then click option'
Aalice
Bsecret
Cmetrics_admin
Dbob
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up username and password values.
Assigning wrong role to the user.