ElasticSearch没有[indices:data/read/msearch]的权限,尽管有权限

ujv3wf0j  于 2023-11-17  发布在  ElasticSearch
关注(0)|答案(4)|浏览(288)

我遇到了_msearch最奇怪的权限问题。
当对同一个查询运行simple _search时,一切都运行得很完美。
POST /job/_search

{"query":{"bool":{"must":[{"bool":{"must":{"bool":{"should":[{"multi_match":{"query":"s","fields":["title"],"type":"best_fields","operator":"or","fuzziness":2}},{"multi_match":{"query":"s","fields":["title"],"type":"phrase","operator":"or"}},{"multi_match":{"query":"s","fields":["title"],"type":"phrase_prefix","operator":"or"}}],"minimum_should_match":"1"}}}}]}},"size":10,"_source":{"includes":["*"],"excludes":[]}}

字符串
当使用_msearch运行它时,我得到权限错误
POST /job/_msearch

{}
{"query":{"bool":{"must":[{"bool":{"must":{"bool":{"should":[{"multi_match":{"query":"s","fields":["title"],"type":"best_fields","operator":"or","fuzziness":2}},{"multi_match":{"query":"s","fields":["title"],"type":"phrase","operator":"or"}},{"multi_match":{"query":"s","fields":["title"],"type":"phrase_prefix","operator":"or"}}],"minimum_should_match":"1"}}}}]}},"size":10,"_source":{"includes":["*"],"excludes":[]}}
{
    "error": {
        "root_cause": [
            {
                "type": "security_exception",
                "reason": "no permissions for [indices:data/read/msearch] and User [name=public_api, backend_roles=[], requestedTenant=null]"
            }
        ],
        "type": "security_exception",
        "reason": "no permissions for [indices:data/read/msearch] and User [name=public_api, backend_roles=[], requestedTenant=null]"
    },
    "status": 403
}

的数据
以下是我在Kibana的权限:


的数据
我正在AWS ElasticSearch服务中运行OpenDistro。

w1jd8yoj

w1jd8yoj1#

我使用以下步骤解决了上述权限问题

  • 使用admin或使用higher previledges登录到Kibana

1.单击security选项
x1c 0d1x的数据
1.单击roles选项,然后根据您的要求为用户选择所需的角色。在我的情况下,用户需要所有访问权限,因此选择all_access角色
1.单击Mapped users,然后单击Manage mapping选项。
1.在Users部分中,键入/粘贴IAM-arn/internal-user,然后按Enter键
1.最后,单击Map
就这样,用户将被Map到角色和相应的权限,此后您将不会面临问题中提到的权限问题


的数据

6qfn3psc

6qfn3psc2#

通过设置以下群集权限进行修复:


的数据

yebdmbv4

yebdmbv43#

我通过不使用细粒度访问控制解决了这个问题。

6l7fqoea

6l7fqoea4#

基于来自@Bolein95的答案,它完美地工作,如果有人在寻找Terraform,你可以添加以下集群:

cluster_permissions = ["indices:data/read*", "indices:admin/mappings/fields/get*"]

字符串

相关问题