ms-graph-authz.asciidoc 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. [[ms-graph-authz]]
  2. === Microsoft Graph Authz
  3. The Microsoft Graph Authz plugin uses https://learn.microsoft.com/en-us/graph/api/user-list-memberof[Microsoft Graph] to look up group membership information from Microsoft Entra ID.
  4. This is primarily intended to work around the Microsoft Entra ID maximum group size limit (see https://learn.microsoft.com/en-us/security/zero-trust/develop/configure-tokens-group-claims-app-roles#group-overages[Group overages]).
  5. [discrete]
  6. [id="microsoft-graph-authz-install"]
  7. ==== Installation
  8. ifeval::["{release-state}"=="unreleased"]
  9. WARNING: Version {version} of the Elastic Stack has not yet been released.
  10. endif::[]
  11. If you're using a self-managed Elasticsearch cluster, then this plugin can be installed using the plugin manager:
  12. ["source","sh",subs="attributes,callouts"]
  13. ----------------------------------------------------------------
  14. sudo bin/elasticsearch-plugin install microsoft-graph-authz
  15. ----------------------------------------------------------------
  16. The plugin must be installed on every node in the cluster, and each node must
  17. be restarted after installation.
  18. You can download this plugin for <<plugin-management-custom-url,offline
  19. install>> from {plugin_url}/microsoft-graph-authz/microsoft-graph-authz-{version}.zip. To verify
  20. the `.zip` file, use the
  21. {plugin_url}/microsoft-graph-authz/microsoft-graph-authz-{version}.zip.sha512[SHA hash] or
  22. {plugin_url}/microsoft-graph-authz/microsoft-graph-authz-{version}.zip.asc[ASC key].
  23. For all other deployment types, refer to <<plugin-management,plugin management>>.
  24. [discrete]
  25. [id="microsoft-graph-authz-remove"]
  26. ==== Removal
  27. The plugin can be removed with the following command:
  28. ["source","sh",subs="attributes,callouts"]
  29. ----------------------------------------------------------------
  30. sudo bin/elasticsearch-plugin remove {plugin_name}
  31. ----------------------------------------------------------------
  32. The node must be stopped before removing the plugin.
  33. [discrete]
  34. ==== Configuration
  35. To learn how to configure the Microsoft Graph Authz plugin, refer to <<configure-elasticsearch,configuration properties>>.
  36. [[configure-azure]]
  37. ==== Configure Azure
  38. To make API calls to Microsoft Graph, Elasticsearch requires Azure credentials with the correct permissions.
  39. [discrete]
  40. ==== Create a custom Azure application
  41. . Log in to the https://portal.azure.com[Azure portal] and go to Microsoft Entra ID.
  42. . To register a new application, click *Enterprise applications* > *New application*.
  43. . Click *Create your own application*, provide a name, and select the *Integrate any other application you don’t find in the gallery* option.
  44. image::images/01-create-enterprise-application.png["create your own application" page]
  45. [discrete]
  46. ==== Configure the custom Application
  47. . In the https://portal.azure.com[Azure portal], go to Microsoft Entra ID.
  48. . Under *App registrations*, select the *All applications* tab, and then find the application created in the previous section.
  49. +
  50. image::images/02-find-app-registration.png[find your app registration]
  51. . Take note of the *Application (client) ID* and *Tenant ID* shown here.
  52. These will be needed to configure Elasticsearch later.
  53. +
  54. image::images/03-get-application-id.png[get your application ID]
  55. . Under *Manage* > *Certificates & secrets*
  56. - Create a new client secret.
  57. - Take note of your new client secret's *Value*.
  58. This is needed later, and is only displayed once.
  59. +
  60. image::images/04-create-client-secret.png[get your client secret]
  61. . Under *Manage* > *API permissions*, do the following:
  62. .. Go to *Add a permission*.
  63. .. Choose *Microsoft Graph*.
  64. .. Choose *Application permissions*.
  65. .. Select `Directory.ReadWrite.All`, `Group.ReadWrite.All`, `User.Read.All`.
  66. +
  67. NOTE: An Azure Admin must approve these permissions before the credentials can be used.
  68. +
  69. image::images/05-configure-api-permissions.png[configure api permissions]
  70. [[configure-elasticsearch]]
  71. ==== Configuration properties
  72. After the plugin is installed, the following configuration settings are available:
  73. xpack.security.authc.realms.microsoft_graph.*.order::
  74. The priority of the realm within the realm chain.
  75. Realms with a lower order are consulted first.
  76. The value must be unique for each realm.
  77. This setting is required.
  78. xpack.security.authc.realms.microsoft_graph.*.tenant_id::
  79. Your Microsoft Entra ID https://learn.microsoft.com/en-us/entra/fundamentals/how-to-find-tenant[Tenant ID].
  80. This setting is required.
  81. xpack.security.authc.realms.microsoft_graph.*.client_id::
  82. The Application ID of the Enterprise Application you registered in the previous section.
  83. This setting is required.
  84. xpack.security.authc.realms.microsoft_graph.*.client_secret::
  85. The client secret value for the Application you registered in the previous section.
  86. This is a sensitive setting, and must be configured in the Elasticsearch keystore.
  87. This setting is required.
  88. xpack.security.authc.realms.microsoft_graph.*.access_token_host::
  89. A Microsoft login URL.
  90. Defaults to `https://login.microsoftonline.com`.
  91. xpack.security.authc.realms.microsoft_graph.*.graph_host::
  92. The Microsoft Graph base address.
  93. Defaults to `https://graph.microsoft.com/v1.0`.
  94. xpack.security.authc.realms.microsoft_graph.*.http_request_timeout::
  95. The timeout for individual Graph HTTP requests.
  96. Defaults to `10s`.
  97. xpack.security.authc.realms.microsoft_graph.*.execution_timeout::
  98. The overall timeout for authorization requests to this plugin.
  99. Defaults to `30s`.
  100. Create a Microsoft Graph realm, following the above settings, then configure an existing realm to delegate to it using `authorization_realms`.
  101. For example, the following configuration authenticates via Microsoft Entra with SAML, and uses the Microsoft Graph plugin to look up group membership:
  102. [source,yaml]
  103. ----
  104. xpack.security.authc.realms.saml.kibana-realm:
  105. order: 2
  106. attributes.principal: nameid
  107. attributes.groups: "http://schemas.microsoft.com/ws/2008/06/identity/claims/groups"
  108. idp.metadata.path: "https://login.microsoftonline.com/<Tenant ID>/federationmetadata/2007-06/federationmetadata.xml?appid=<Application_ID>"
  109. idp.entity_id: "https://sts.windows.net/<Tenant_ID>/"
  110. sp.entity_id: "<Kibana_Endpoint_URL>"
  111. sp.acs: "<Kibana_Endpoint_URL>/api/security/saml/callback"
  112. sp.logout: "<Kibana_Endpoint_URL>/logout"
  113. authorization_realms: microsoft_graph1
  114. xpack.security.authc.realms.microsoft_graph.microsoft_graph1:
  115. order: 3
  116. tenant_id: "<Tenant_ID>"
  117. client_id: "<Graph_Application_ID>"
  118. ----