Warn if role grants access to Kibana index #28342
Labels
enhancement
New value added to drive a business result
Feature:Users/Roles/API Keys
impact:low
Addressing this issue will have a low level of impact on the quality/strength of our product.
loe:small
Small Level of Effort
Team:Security
Team focused on: Auth, Users, Roles, Spaces, Audit Logging, and more!
Summary
We should surface a warning on the Role Management UI when users specify an index privilege that grants access to the Kibana index (
.kibana
by default).Motivation
Granting direct access to this index is something we have required for Kibana users up until version 6.4, but is no longer necessary or recommended. The introduction of Kibana Application Privileges removes this requirement, and is deprecated when used to grant access to Kibana itself.
Granting direct index access bypasses the security controls put in place for Spaces and Feature Controls, so it is important that we educate users when they grant direct index access.
Challenges
Most users specify the index privileges using either a specific index name (e.g.
.kibana
) or a rudimentary wildcard (e.g..kibana*
). These two scenarios are easy enough for us to work with, and aren't problematic.This gets non-trivial though for any other pattern. Elasticsearch allows index privilege names to use the Lucene Regex syntax, which is something we can't replicate in a browser/Node environment.
Possible solutions
1) Ignore complex patterns
We can easily determine if a pattern like
.kibana*
matches, and warn appropriately. The problem is that more complex patterns would be ignored, so we would have a whole class of false negatives where we would not warn when we should be. This could give users a false sense of security.Pros
Cons
2) Query a placeholder document
We could leverage the Regexp query to make this determination. Kibana could create a document within the
.kibana
index which contains the name of the kibana index. We could then test to see if any of the patterns match the kibana index by issuing regex queries against that document, to see if it is returned.Pros
Cons
3) Allow a dry run of
_has_privileges
from ElasticsearchElasticsearch exposes a
_has_privileges
API today which can answer this question. The problem is that it is meant to run in the context of a user, so it answers the question for a user, rather than for a particular role (or a role definition that hasn't even been created yet).Pros
Cons
4) Expose lucene regex tester from Elasticsearch
Elasticsearch could expose a regex tester which wraps the Lucene Regex syntax. Kibana could then use this to make a determination.
Pros
Cons
The text was updated successfully, but these errors were encountered: