获取内置权限 API

编辑

检索此 Elasticsearch 版本中可用的集群权限索引权限的列表。

请求

编辑

GET /_security/privilege/_builtin

先决条件

编辑
  • 要使用此 API,您必须具有 read_security 集群权限(或更高的权限,例如 manage_securityall)。

描述

编辑

此 API 检索正在查询的 Elasticsearch 版本中可用的一组集群和索引权限名称。

要检查用户是否具有特定权限,请使用具有权限 API

响应体

编辑

响应是一个包含两个字段的对象

cluster
(字符串数组)此 Elasticsearch 版本理解的集群权限列表。
index
(字符串数组)此 Elasticsearch 版本理解的索引权限列表。
remote_cluster
(字符串数组)此 Elasticsearch 版本理解的remote_cluster 权限列表。

示例

编辑

以下示例检索所有内置权限的名称

resp = client.security.get_builtin_privileges()
print(resp)
const response = await client.security.getBuiltinPrivileges();
console.log(response);
GET /_security/privilege/_builtin

成功调用会返回一个包含“cluster”、“index”和“remote_cluster”字段的对象。

{
  "cluster" : [
    "all",
    "cancel_task",
    "create_snapshot",
    "cross_cluster_replication",
    "cross_cluster_search",
    "delegate_pki",
    "grant_api_key",
    "manage",
    "manage_api_key",
    "manage_autoscaling",
    "manage_behavioral_analytics",
    "manage_ccr",
    "manage_connector",
    "manage_data_frame_transforms",
    "manage_data_stream_global_retention",
    "manage_enrich",
    "manage_ilm",
    "manage_index_templates",
    "manage_inference",
    "manage_ingest_pipelines",
    "manage_logstash_pipelines",
    "manage_ml",
    "manage_oidc",
    "manage_own_api_key",
    "manage_pipeline",
    "manage_rollup",
    "manage_saml",
    "manage_search_application",
    "manage_search_query_rules",
    "manage_search_synonyms",
    "manage_security",
    "manage_service_account",
    "manage_slm",
    "manage_token",
    "manage_transform",
    "manage_user_profile",
    "manage_watcher",
    "monitor",
    "monitor_connector",
    "monitor_data_frame_transforms",
    "monitor_data_stream_global_retention",
    "monitor_enrich",
    "monitor_inference",
    "monitor_ml",
    "monitor_rollup",
    "monitor_snapshot",
    "monitor_stats",
    "monitor_text_structure",
    "monitor_transform",
    "monitor_watcher",
    "none",
    "post_behavioral_analytics_event",
    "read_ccr",
    "read_connector_secrets",
    "read_fleet_secrets",
    "read_ilm",
    "read_pipeline",
    "read_security",
    "read_slm",
    "transport_client",
    "write_connector_secrets",
    "write_fleet_secrets"
  ],
  "index" : [
    "all",
    "auto_configure",
    "create",
    "create_doc",
    "create_index",
    "cross_cluster_replication",
    "cross_cluster_replication_internal",
    "delete",
    "delete_index",
    "index",
    "maintenance",
    "manage",
    "manage_data_stream_lifecycle",
    "manage_follow_index",
    "manage_ilm",
    "manage_leader_index",
    "monitor",
    "none",
    "read",
    "read_cross_cluster",
    "view_index_metadata",
    "write"
  ],
  "remote_cluster" : [
    "monitor_enrich",
    "monitor_stats"
  ]
}