【问题标题】:ElasticSearch no permissions for [indices:data/read/msearch] despite having the permission尽管有权限,但 ElasticSearch 没有 [indices:data/read/msearch] 的权限
【发布时间】:2021-03-24 04:09:10
【问题描述】:

我遇到了_msearch 最奇怪的权限问题。

当使用相同的查询运行简单的 _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 Service 中运行 OpenDistro。

【问题讨论】:

标签: elasticsearch aws-elasticsearch


【解决方案1】:

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

  • 使用admin 或使用higher previledges 的用户登录Kibana
  1. 点击security选项

  2. 单击roles 选项,然后根据您的要求为您的用户选择所需的角色。就我而言,用户需要所有访问权限,因此选择了all_access 角色

  3. 点击Mapped users,然后点击Manage mapping选项。

  4. Users 部分中输入/粘贴IAM-arn/internal-user,然后按回车键

  5. 最后,点击地图

就是这样,用户将被映射到角色和相应的权限,之后您将不会遇到问题中提到的权限问题

【讨论】:

    【解决方案2】:

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

    【讨论】:

      【解决方案3】:

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

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2022-01-02
        • 1970-01-01
        • 2021-02-28
        • 2021-08-12
        • 1970-01-01
        • 2014-12-06
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多