Skip to content

Improve the security permission check in cat indices (_cat/indices) API #2257

@bowenlan-amzn

Description

@bowenlan-amzn

Is your feature request related to a problem? Please describe.

Today, to be able to call _cat/indices successfully, you need to have a permission at least with these permissions:

    "cluster_permissions" : [
      "cluster:monitor/state",
      "cluster:monitor/health"
    ],
    "index_permissions" : [
      {
        "index_patterns" : [
          "*"
        ],
        "allowed_actions" : [
          "indices:monitor/settings/get",
          "indices:monitor/stats"
        ]
      }
    ]

If the index_patterns is not set to "*" but "log-*", _cat/indices fails with a security exception:
"no permissions for [indices:monitor/settings/get] and User [name=bowen, backend_roles=[], requestedTenant=__user__]
I suppose this is because cluster has other indices that don't match "log-*" and security check fails.
You will be able to call _cat/indices/log-* successfully though.

Describe the solution you'd like
Instead of failing the full request, can we improve the user experience of _cat/indices to return the indices user has permission of?
To be specific, if user has index permission on "log-*", calling _cat/indices can return the indices start with log- in the cluster.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestgood first issueThese are recommended starting points for newcomers looking to make their first contributions.triagedIssues labeled as 'Triaged' have been reviewed and are deemed actionable.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions