Versions (relevant - OpenSearch/Dashboard/Server OS/Browser):
- OS: Ubuntu 22.04 LTS
- Version: Docker images 2.11.1
- Firefox
Describe the issue:
When the .kibana
index permission is removed from an OpenSearch role configuration, the user unexpectedly gains access to all indices rather than being restricted to specific index patterns defined in other permissions. Specifically, when the permission setting for .kibana
is present, access is correctly limited to the specified “logstash-*” index patterns and the .kibana
index. However, removing this permission unexpectedly broadens the user’s access to all indices.
How can one reproduce the bug?
Steps to reproduce the behavior:
- Define an OpenSearch role that includes index permissions for “logstash-*” and “.kibana”.
- Assign this role to a user, verifying that the user’s access is correctly limited to “logstash-*” indices and the
.kibana
index. - Remove the index permission for
.kibana
from the role. - Observe that the user now has access to all indices, contrary to the intended restriction to “logstash-*” indices.
What is the expected behavior?
The expected behavior is for the user’s access to be limited to the “logstash-*” index patterns as defined in the role’s index permissions, regardless of whether the .kibana
index permission is present or not. Removing the .kibana
index permission should not affect access to other indices outside of those explicitly defined in the role.
Configuration:
Here’s the role configuration that leads to the described behavior:
resource "opensearch_role" "writer" {
role_name = "logs_writer"
description = "Logs writer role"
cluster_permissions = ["cluster:monitor/health", "cluster:monitor/state"]
index_permissions {
index_patterns = ["logstash-*"]
allowed_actions = ["write"]
}
// When this permission block is removed, the issue occurs.
index_permissions {
index_patterns = [".kibana"]
allowed_actions = ["indices:admin/", "indices:monitor/", "indices:data/*"]
}
tenant_permissions {
tenant_patterns = ["global_tenant"]
allowed_actions = ["kibana_all_write"]
}
}