Get builtin privileges API

Get builtin privileges API

New API reference

For the most up-to-date API details, refer to Security APIs.

Retrieves the list of cluster privileges and index privileges that are available in this version of Elasticsearch.

Request

GET /_security/privilege/_builtin

Prerequisites

  • To use this API, you must have the read_security cluster privilege (or a greater privilege such as manage_security or all).

Description

This API retrieves the set of cluster and index privilege names that are available in the version of Elasticsearch that is being queried.

To check whether a user has particular privileges, use the has privileges API.

Response body

The response is an object with two fields:

cluster

(array of string) The list of cluster privileges that are understood by this version of Elasticsearch.

index

(array of string) The list of index privileges that are understood by this version of Elasticsearch.

remote_cluster

(array of string) The list of remote_cluster privileges that are understood by this version of Elasticsearch.

Examples

The following example retrieves the names of all builtin privileges:

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

A successful call returns an object with “cluster”, “index”, and “remote_cluster” fields.

  1. {
  2. "cluster" : [
  3. "all",
  4. "cancel_task",
  5. "create_snapshot",
  6. "cross_cluster_replication",
  7. "cross_cluster_search",
  8. "delegate_pki",
  9. "grant_api_key",
  10. "manage",
  11. "manage_api_key",
  12. "manage_autoscaling",
  13. "manage_behavioral_analytics",
  14. "manage_ccr",
  15. "manage_connector",
  16. "manage_data_frame_transforms",
  17. "manage_data_stream_global_retention",
  18. "manage_enrich",
  19. "manage_ilm",
  20. "manage_index_templates",
  21. "manage_inference",
  22. "manage_ingest_pipelines",
  23. "manage_logstash_pipelines",
  24. "manage_ml",
  25. "manage_oidc",
  26. "manage_own_api_key",
  27. "manage_pipeline",
  28. "manage_rollup",
  29. "manage_saml",
  30. "manage_search_application",
  31. "manage_search_query_rules",
  32. "manage_search_synonyms",
  33. "manage_security",
  34. "manage_service_account",
  35. "manage_slm",
  36. "manage_token",
  37. "manage_transform",
  38. "manage_user_profile",
  39. "manage_watcher",
  40. "monitor",
  41. "monitor_connector",
  42. "monitor_data_frame_transforms",
  43. "monitor_data_stream_global_retention",
  44. "monitor_enrich",
  45. "monitor_inference",
  46. "monitor_ml",
  47. "monitor_rollup",
  48. "monitor_snapshot",
  49. "monitor_stats",
  50. "monitor_text_structure",
  51. "monitor_transform",
  52. "monitor_watcher",
  53. "none",
  54. "post_behavioral_analytics_event",
  55. "read_ccr",
  56. "read_connector_secrets",
  57. "read_fleet_secrets",
  58. "read_ilm",
  59. "read_pipeline",
  60. "read_security",
  61. "read_slm",
  62. "transport_client",
  63. "write_connector_secrets",
  64. "write_fleet_secrets"
  65. ],
  66. "index" : [
  67. "all",
  68. "auto_configure",
  69. "create",
  70. "create_doc",
  71. "create_index",
  72. "cross_cluster_replication",
  73. "cross_cluster_replication_internal",
  74. "delete",
  75. "delete_index",
  76. "index",
  77. "maintenance",
  78. "manage",
  79. "manage_data_stream_lifecycle",
  80. "manage_follow_index",
  81. "manage_ilm",
  82. "manage_leader_index",
  83. "monitor",
  84. "none",
  85. "read",
  86. "read_cross_cluster",
  87. "view_index_metadata",
  88. "write"
  89. ],
  90. "remote_cluster" : [
  91. "monitor_enrich",
  92. "monitor_stats"
  93. ]
  94. }