Challenge - 5 Problems
Elasticsearch RBAC Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediate2:00remaining
What is the output of this role definition query?
Given the following Elasticsearch role definition, what will be the effective cluster privileges for the role named
data_analyst?Elasticsearch
{
"data_analyst": {
"cluster": ["monitor"],
"indices": [
{
"names": ["sales-*"],
"privileges": ["read", "view_index_metadata"]
}
]
}
}Attempts:
2 left
💡 Hint
Cluster privileges and index privileges are separate in Elasticsearch roles.
✗ Incorrect
The
cluster field defines cluster-wide privileges, here only monitor. The indices field defines index-level privileges, which do not affect cluster privileges.❓ Predict Output
intermediate2:00remaining
What error occurs when assigning an invalid privilege?
Consider this role definition snippet in Elasticsearch. What error will Elasticsearch return when trying to create this role?
Elasticsearch
{
"invalid_role": {
"cluster": ["invalid_privilege"],
"indices": [
{
"names": ["logs-*"],
"privileges": ["read"]
}
]
}
}Attempts:
2 left
💡 Hint
Elasticsearch validates privileges strictly when creating roles.
✗ Incorrect
Elasticsearch returns a 400 error if an unknown cluster privilege is specified, indicating the privilege is invalid.
🚀 Application
advanced3:00remaining
How to restrict a role to only write access on specific indices?
You want to create a role that allows users to only write data to indices starting with
app-logs- but no read or delete access. Which role definition below achieves this?Attempts:
2 left
💡 Hint
Cluster privileges are not needed for index write access. Use only index privileges.
✗ Incorrect
Option D grants only the
write privilege on the specified indices, which allows writing but not reading or deleting. Other options either add read or invalid cluster privileges.🔧 Debug
advanced3:00remaining
Why does this role fail to grant read access on indices?
This role is intended to allow read access on indices named
user-data-*, but users report they cannot read those indices. What is the cause?Elasticsearch
{
"user_reader": {
"cluster": ["monitor"],
"indices": [
{
"names": ["user-data-*"],
"privileges": ["read"]
}
]
}
}Attempts:
2 left
💡 Hint
Check the data type of the 'names' field in the indices array.
✗ Incorrect
The 'names' field must be an array of strings. Using a string causes the role to be invalid and not grant privileges.
🧠 Conceptual
expert3:00remaining
What is the effect of overlapping roles with conflicting privileges?
If a user is assigned two roles: one grants
read access on logs-* indices, and another denies read access on logs-2023-* indices, what will be the user's effective access to logs-2023-01?Attempts:
2 left
💡 Hint
In Elasticsearch, deny rules override allow rules when conflicts occur.
✗ Incorrect
Elasticsearch uses a deny-overrides policy. If any role denies access to a resource, that denial takes precedence over any allow.