Elasticsearch

你能幫我理解這個 ElasticSearch 權限錯誤嗎?

  • July 10, 2020

我正在嘗試向 Elastic.co 託管的 ElasticSearch 實例發出請求。我收到此錯誤:

AuthorizationException(403, 'security_exception', 'action [indices:monitor/stats] is unauthorized for user [my-username]')

這具體告訴我我無法訪問的內容是什麼?是什麼indices:意思,是什麼monitor意思monitor/stats?此錯誤消息試圖告訴我什麼?

我認為這些是索引權限

https://www.elastic.co/guide/en/elasticsearch/reference/current/security-privileges.html

monitor - 
All cluster read-only operations, like cluster health and state, hot threads, node info, node and cluster stats, and pending cluster tasks.

根據您希望使用的 Andrei 共享的安全權限,您需要首先創建一個新的自定義角色,選擇其中的權限 -> https://www.elastic.co/guide/en/elasticsearch/reference/current/定義-roles.html

我想知道您是否可以使用內置角色來到達您想要的位置-> https://www.elastic.co/guide/en/elasticsearch/reference/current/built-in-roles.html

嘗試使用使用者 api 更新現有使用者以分配新角色 -> https://www.elastic.co/guide/en/elasticsearch/reference/6.8/security-api.html#security-user-apis

POST /_xpack/security/user/jacknich
{
 "password" : "j@rV1s",
 "roles" : [ "admin", "other_role1" ],
 "full_name" : "Jack Nicholson",
 "email" : "jacknich@example.com",
 "metadata" : {
   "intelligence" : 7
 }
}

引用自:https://serverfault.com/questions/1024816