elasticsearch 8.17.1__py3-none-any.whl → 9.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- elasticsearch/__init__.py +2 -2
- elasticsearch/_async/client/__init__.py +2125 -1053
- elasticsearch/_async/client/_base.py +1 -2
- elasticsearch/_async/client/async_search.py +46 -35
- elasticsearch/_async/client/autoscaling.py +32 -26
- elasticsearch/_async/client/cat.py +244 -176
- elasticsearch/_async/client/ccr.py +268 -128
- elasticsearch/_async/client/cluster.py +191 -164
- elasticsearch/_async/client/connector.py +226 -116
- elasticsearch/_async/client/dangling_indices.py +22 -16
- elasticsearch/_async/client/enrich.py +51 -11
- elasticsearch/_async/client/eql.py +54 -13
- elasticsearch/_async/client/esql.py +351 -7
- elasticsearch/_async/client/features.py +37 -27
- elasticsearch/_async/client/fleet.py +32 -22
- elasticsearch/_async/client/graph.py +10 -9
- elasticsearch/_async/client/ilm.py +115 -77
- elasticsearch/_async/client/indices.py +1119 -772
- elasticsearch/_async/client/inference.py +1933 -84
- elasticsearch/_async/client/ingest.py +83 -50
- elasticsearch/_async/client/license.py +90 -38
- elasticsearch/_async/client/logstash.py +20 -9
- elasticsearch/_async/client/migration.py +26 -17
- elasticsearch/_async/client/ml.py +646 -374
- elasticsearch/_async/client/monitoring.py +6 -3
- elasticsearch/_async/client/nodes.py +52 -54
- elasticsearch/_async/client/query_rules.py +59 -33
- elasticsearch/_async/client/rollup.py +124 -86
- elasticsearch/_async/client/search_application.py +60 -32
- elasticsearch/_async/client/searchable_snapshots.py +25 -12
- elasticsearch/_async/client/security.py +903 -562
- elasticsearch/_async/client/shutdown.py +34 -36
- elasticsearch/_async/client/simulate.py +22 -28
- elasticsearch/_async/client/slm.py +65 -40
- elasticsearch/_async/client/snapshot.py +454 -327
- elasticsearch/_async/client/sql.py +43 -22
- elasticsearch/_async/client/ssl.py +17 -18
- elasticsearch/_async/client/synonyms.py +58 -37
- elasticsearch/_async/client/tasks.py +77 -48
- elasticsearch/_async/client/text_structure.py +65 -56
- elasticsearch/_async/client/transform.py +124 -93
- elasticsearch/_async/client/watcher.py +117 -73
- elasticsearch/_async/client/xpack.py +18 -9
- elasticsearch/_async/helpers.py +1 -2
- elasticsearch/_sync/client/__init__.py +2125 -1053
- elasticsearch/_sync/client/_base.py +1 -2
- elasticsearch/_sync/client/async_search.py +46 -35
- elasticsearch/_sync/client/autoscaling.py +32 -26
- elasticsearch/_sync/client/cat.py +244 -176
- elasticsearch/_sync/client/ccr.py +268 -128
- elasticsearch/_sync/client/cluster.py +191 -164
- elasticsearch/_sync/client/connector.py +226 -116
- elasticsearch/_sync/client/dangling_indices.py +22 -16
- elasticsearch/_sync/client/enrich.py +51 -11
- elasticsearch/_sync/client/eql.py +54 -13
- elasticsearch/_sync/client/esql.py +351 -7
- elasticsearch/_sync/client/features.py +37 -27
- elasticsearch/_sync/client/fleet.py +32 -22
- elasticsearch/_sync/client/graph.py +10 -9
- elasticsearch/_sync/client/ilm.py +115 -77
- elasticsearch/_sync/client/indices.py +1119 -772
- elasticsearch/_sync/client/inference.py +1933 -84
- elasticsearch/_sync/client/ingest.py +83 -50
- elasticsearch/_sync/client/license.py +90 -38
- elasticsearch/_sync/client/logstash.py +20 -9
- elasticsearch/_sync/client/migration.py +26 -17
- elasticsearch/_sync/client/ml.py +646 -374
- elasticsearch/_sync/client/monitoring.py +6 -3
- elasticsearch/_sync/client/nodes.py +52 -54
- elasticsearch/_sync/client/query_rules.py +59 -33
- elasticsearch/_sync/client/rollup.py +124 -86
- elasticsearch/_sync/client/search_application.py +60 -32
- elasticsearch/_sync/client/searchable_snapshots.py +25 -12
- elasticsearch/_sync/client/security.py +903 -562
- elasticsearch/_sync/client/shutdown.py +34 -36
- elasticsearch/_sync/client/simulate.py +22 -28
- elasticsearch/_sync/client/slm.py +65 -40
- elasticsearch/_sync/client/snapshot.py +454 -327
- elasticsearch/_sync/client/sql.py +43 -22
- elasticsearch/_sync/client/ssl.py +17 -18
- elasticsearch/_sync/client/synonyms.py +58 -37
- elasticsearch/_sync/client/tasks.py +77 -48
- elasticsearch/_sync/client/text_structure.py +65 -56
- elasticsearch/_sync/client/transform.py +124 -93
- elasticsearch/_sync/client/utils.py +1 -41
- elasticsearch/_sync/client/watcher.py +117 -73
- elasticsearch/_sync/client/xpack.py +18 -9
- elasticsearch/_version.py +1 -1
- elasticsearch/client.py +2 -0
- elasticsearch/dsl/__init__.py +203 -0
- elasticsearch/dsl/_async/__init__.py +16 -0
- elasticsearch/dsl/_async/document.py +522 -0
- elasticsearch/dsl/_async/faceted_search.py +50 -0
- elasticsearch/dsl/_async/index.py +639 -0
- elasticsearch/dsl/_async/mapping.py +49 -0
- elasticsearch/dsl/_async/search.py +237 -0
- elasticsearch/dsl/_async/update_by_query.py +47 -0
- elasticsearch/dsl/_sync/__init__.py +16 -0
- elasticsearch/dsl/_sync/document.py +514 -0
- elasticsearch/dsl/_sync/faceted_search.py +50 -0
- elasticsearch/dsl/_sync/index.py +597 -0
- elasticsearch/dsl/_sync/mapping.py +49 -0
- elasticsearch/dsl/_sync/search.py +230 -0
- elasticsearch/dsl/_sync/update_by_query.py +45 -0
- elasticsearch/dsl/aggs.py +3734 -0
- elasticsearch/dsl/analysis.py +341 -0
- elasticsearch/dsl/async_connections.py +37 -0
- elasticsearch/dsl/connections.py +142 -0
- elasticsearch/dsl/document.py +20 -0
- elasticsearch/dsl/document_base.py +444 -0
- elasticsearch/dsl/exceptions.py +32 -0
- elasticsearch/dsl/faceted_search.py +28 -0
- elasticsearch/dsl/faceted_search_base.py +489 -0
- elasticsearch/dsl/field.py +4392 -0
- elasticsearch/dsl/function.py +180 -0
- elasticsearch/dsl/index.py +23 -0
- elasticsearch/dsl/index_base.py +178 -0
- elasticsearch/dsl/mapping.py +19 -0
- elasticsearch/dsl/mapping_base.py +219 -0
- elasticsearch/dsl/query.py +2822 -0
- elasticsearch/dsl/response/__init__.py +388 -0
- elasticsearch/dsl/response/aggs.py +100 -0
- elasticsearch/dsl/response/hit.py +53 -0
- elasticsearch/dsl/search.py +20 -0
- elasticsearch/dsl/search_base.py +1053 -0
- elasticsearch/dsl/serializer.py +34 -0
- elasticsearch/dsl/types.py +6453 -0
- elasticsearch/dsl/update_by_query.py +19 -0
- elasticsearch/dsl/update_by_query_base.py +149 -0
- elasticsearch/dsl/utils.py +687 -0
- elasticsearch/dsl/wrappers.py +144 -0
- elasticsearch/helpers/actions.py +1 -1
- elasticsearch/helpers/vectorstore/_async/strategies.py +12 -12
- elasticsearch/helpers/vectorstore/_sync/strategies.py +12 -12
- elasticsearch/helpers/vectorstore/_sync/vectorstore.py +4 -1
- {elasticsearch-8.17.1.dist-info → elasticsearch-9.0.0.dist-info}/METADATA +12 -15
- elasticsearch-9.0.0.dist-info/RECORD +160 -0
- elasticsearch/transport.py +0 -57
- elasticsearch-8.17.1.dist-info/RECORD +0 -119
- {elasticsearch-8.17.1.dist-info → elasticsearch-9.0.0.dist-info}/WHEEL +0 -0
- {elasticsearch-8.17.1.dist-info → elasticsearch-9.0.0.dist-info}/licenses/LICENSE +0 -0
- {elasticsearch-8.17.1.dist-info → elasticsearch-9.0.0.dist-info}/licenses/NOTICE +0 -0
|
@@ -44,23 +44,21 @@ class SecurityClient(NamespacedClient):
|
|
|
44
44
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
45
45
|
) -> ObjectApiResponse[t.Any]:
|
|
46
46
|
"""
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-activate-user-profile.html>`_
|
|
47
|
+
.. raw:: html
|
|
48
|
+
|
|
49
|
+
<p>Activate a user profile.</p>
|
|
50
|
+
<p>Create or update a user profile on behalf of another user.</p>
|
|
51
|
+
<p>NOTE: The user profile feature is designed only for use by Kibana and Elastic's Observability, Enterprise Search, and Elastic Security solutions.
|
|
52
|
+
Individual users and external applications should not call this API directly.
|
|
53
|
+
The calling application must have either an <code>access_token</code> or a combination of <code>username</code> and <code>password</code> for the user that the profile document is intended for.
|
|
54
|
+
Elastic reserves the right to change or remove this feature in future releases without prior notice.</p>
|
|
55
|
+
<p>This API creates or updates a profile document for end users with information that is extracted from the user's authentication object including <code>username</code>, <code>full_name,</code> <code>roles</code>, and the authentication realm.
|
|
56
|
+
For example, in the JWT <code>access_token</code> case, the profile user's <code>username</code> is extracted from the JWT token claim pointed to by the <code>claims.principal</code> setting of the JWT realm that authenticated the token.</p>
|
|
57
|
+
<p>When updating a profile document, the API enables the document if it was disabled.
|
|
58
|
+
Any updates do not change existing content for either the <code>labels</code> or <code>data</code> fields.</p>
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-security-activate-user-profile>`_
|
|
64
62
|
|
|
65
63
|
:param grant_type: The type of grant.
|
|
66
64
|
:param access_token: The user's Elasticsearch access token or JWT. Both `access`
|
|
@@ -117,14 +115,16 @@ class SecurityClient(NamespacedClient):
|
|
|
117
115
|
pretty: t.Optional[bool] = None,
|
|
118
116
|
) -> ObjectApiResponse[t.Any]:
|
|
119
117
|
"""
|
|
120
|
-
|
|
121
|
-
user. Include the user information in a [basic auth header](https://en.wikipedia.org/wiki/Basic_access_authentication).
|
|
122
|
-
A successful call returns a JSON structure that shows user information such as
|
|
123
|
-
their username, the roles that are assigned to the user, any assigned metadata,
|
|
124
|
-
and information about the realms that authenticated and authorized the user.
|
|
125
|
-
If the user cannot be authenticated, this API returns a 401 status code.
|
|
118
|
+
.. raw:: html
|
|
126
119
|
|
|
127
|
-
|
|
120
|
+
<p>Authenticate a user.</p>
|
|
121
|
+
<p>Authenticates a user and returns information about the authenticated user.
|
|
122
|
+
Include the user information in a <a href="https://en.wikipedia.org/wiki/Basic_access_authentication">basic auth header</a>.
|
|
123
|
+
A successful call returns a JSON structure that shows user information such as their username, the roles that are assigned to the user, any assigned metadata, and information about the realms that authenticated and authorized the user.
|
|
124
|
+
If the user cannot be authenticated, this API returns a 401 status code.</p>
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-security-authenticate>`_
|
|
128
128
|
"""
|
|
129
129
|
__path_parts: t.Dict[str, str] = {}
|
|
130
130
|
__path = "/_security/_authenticate"
|
|
@@ -164,11 +164,14 @@ class SecurityClient(NamespacedClient):
|
|
|
164
164
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
165
165
|
) -> ObjectApiResponse[t.Any]:
|
|
166
166
|
"""
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
167
|
+
.. raw:: html
|
|
168
|
+
|
|
169
|
+
<p>Bulk delete roles.</p>
|
|
170
|
+
<p>The role management APIs are generally the preferred way to manage roles, rather than using file-based role management.
|
|
171
|
+
The bulk delete roles API cannot delete roles that are defined in roles files.</p>
|
|
170
172
|
|
|
171
|
-
|
|
173
|
+
|
|
174
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-security-bulk-delete-role>`_
|
|
172
175
|
|
|
173
176
|
:param names: An array of role names to delete
|
|
174
177
|
:param refresh: If `true` (the default) then refresh the affected shards to make
|
|
@@ -222,11 +225,14 @@ class SecurityClient(NamespacedClient):
|
|
|
222
225
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
223
226
|
) -> ObjectApiResponse[t.Any]:
|
|
224
227
|
"""
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
+
.. raw:: html
|
|
229
|
+
|
|
230
|
+
<p>Bulk create or update roles.</p>
|
|
231
|
+
<p>The role management APIs are generally the preferred way to manage roles, rather than using file-based role management.
|
|
232
|
+
The bulk create or update roles API cannot update roles that are defined in roles files.</p>
|
|
233
|
+
|
|
228
234
|
|
|
229
|
-
`<https://www.elastic.co/
|
|
235
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-security-bulk-put-role>`_
|
|
230
236
|
|
|
231
237
|
:param roles: A dictionary of role name to RoleDescriptor objects to add or update
|
|
232
238
|
:param refresh: If `true` (the default) then refresh the affected shards to make
|
|
@@ -280,25 +286,21 @@ class SecurityClient(NamespacedClient):
|
|
|
280
286
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
281
287
|
) -> ObjectApiResponse[t.Any]:
|
|
282
288
|
"""
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
the requested changes and did not require an update, and error details for any
|
|
299
|
-
failed update.
|
|
300
|
-
|
|
301
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-bulk-update-api-keys.html>`_
|
|
289
|
+
.. raw:: html
|
|
290
|
+
|
|
291
|
+
<p>Bulk update API keys.
|
|
292
|
+
Update the attributes for multiple API keys.</p>
|
|
293
|
+
<p>IMPORTANT: It is not possible to use an API key as the authentication credential for this API. To update API keys, the owner user's credentials are required.</p>
|
|
294
|
+
<p>This API is similar to the update API key API but enables you to apply the same update to multiple API keys in one API call. This operation can greatly improve performance over making individual updates.</p>
|
|
295
|
+
<p>It is not possible to update expired or invalidated API keys.</p>
|
|
296
|
+
<p>This API supports updates to API key access scope, metadata and expiration.
|
|
297
|
+
The access scope of each API key is derived from the <code>role_descriptors</code> you specify in the request and a snapshot of the owner user's permissions at the time of the request.
|
|
298
|
+
The snapshot of the owner's permissions is updated automatically on every call.</p>
|
|
299
|
+
<p>IMPORTANT: If you don't specify <code>role_descriptors</code> in the request, a call to this API might still change an API key's access scope. This change can occur if the owner user's permissions have changed since the API key was created or last modified.</p>
|
|
300
|
+
<p>A successful request returns a JSON structure that contains the IDs of all updated API keys, the IDs of API keys that already had the requested changes and did not require an update, and error details for any failed update.</p>
|
|
301
|
+
|
|
302
|
+
|
|
303
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-security-bulk-update-api-keys>`_
|
|
302
304
|
|
|
303
305
|
:param ids: The API key identifiers.
|
|
304
306
|
:param expiration: Expiration time for the API keys. By default, API keys never
|
|
@@ -370,10 +372,13 @@ class SecurityClient(NamespacedClient):
|
|
|
370
372
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
371
373
|
) -> ObjectApiResponse[t.Any]:
|
|
372
374
|
"""
|
|
373
|
-
|
|
374
|
-
|
|
375
|
+
.. raw:: html
|
|
376
|
+
|
|
377
|
+
<p>Change passwords.</p>
|
|
378
|
+
<p>Change the passwords of users in the native realm and built-in users.</p>
|
|
379
|
+
|
|
375
380
|
|
|
376
|
-
`<https://www.elastic.co/
|
|
381
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-security-change-password>`_
|
|
377
382
|
|
|
378
383
|
:param username: The user whose password you want to change. If you do not specify
|
|
379
384
|
this parameter, the password is changed for the current user.
|
|
@@ -433,10 +438,14 @@ class SecurityClient(NamespacedClient):
|
|
|
433
438
|
pretty: t.Optional[bool] = None,
|
|
434
439
|
) -> ObjectApiResponse[t.Any]:
|
|
435
440
|
"""
|
|
436
|
-
|
|
437
|
-
The cache is also automatically cleared on state changes of the security index.
|
|
441
|
+
.. raw:: html
|
|
438
442
|
|
|
439
|
-
|
|
443
|
+
<p>Clear the API key cache.</p>
|
|
444
|
+
<p>Evict a subset of all entries from the API key cache.
|
|
445
|
+
The cache is also automatically cleared on state changes of the security index.</p>
|
|
446
|
+
|
|
447
|
+
|
|
448
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-security-clear-api-key-cache>`_
|
|
440
449
|
|
|
441
450
|
:param ids: Comma-separated list of API key IDs to evict from the API key cache.
|
|
442
451
|
To evict all API keys, use `*`. Does not support other wildcard patterns.
|
|
@@ -475,13 +484,17 @@ class SecurityClient(NamespacedClient):
|
|
|
475
484
|
pretty: t.Optional[bool] = None,
|
|
476
485
|
) -> ObjectApiResponse[t.Any]:
|
|
477
486
|
"""
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
487
|
+
.. raw:: html
|
|
488
|
+
|
|
489
|
+
<p>Clear the privileges cache.</p>
|
|
490
|
+
<p>Evict privileges from the native application privilege cache.
|
|
491
|
+
The cache is also automatically cleared for applications that have their privileges updated.</p>
|
|
481
492
|
|
|
482
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-clear-privilege-cache.html>`_
|
|
483
493
|
|
|
484
|
-
|
|
494
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-security-clear-cached-privileges>`_
|
|
495
|
+
|
|
496
|
+
:param application: A comma-separated list of applications. To clear all applications,
|
|
497
|
+
use an asterism (`*`). It does not support other wildcard patterns.
|
|
485
498
|
"""
|
|
486
499
|
if application in SKIP_IN_PATH:
|
|
487
500
|
raise ValueError("Empty value passed for parameter 'application'")
|
|
@@ -518,13 +531,23 @@ class SecurityClient(NamespacedClient):
|
|
|
518
531
|
usernames: t.Optional[t.Sequence[str]] = None,
|
|
519
532
|
) -> ObjectApiResponse[t.Any]:
|
|
520
533
|
"""
|
|
521
|
-
|
|
522
|
-
|
|
534
|
+
.. raw:: html
|
|
535
|
+
|
|
536
|
+
<p>Clear the user cache.</p>
|
|
537
|
+
<p>Evict users from the user cache.
|
|
538
|
+
You can completely clear the cache or evict specific users.</p>
|
|
539
|
+
<p>User credentials are cached in memory on each node to avoid connecting to a remote authentication service or hitting the disk for every incoming request.
|
|
540
|
+
There are realm settings that you can use to configure the user cache.
|
|
541
|
+
For more information, refer to the documentation about controlling the user cache.</p>
|
|
542
|
+
|
|
523
543
|
|
|
524
|
-
`<https://www.elastic.co/
|
|
544
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-security-clear-cached-realms>`_
|
|
525
545
|
|
|
526
|
-
:param realms:
|
|
527
|
-
|
|
546
|
+
:param realms: A comma-separated list of realms. To clear all realms, use an
|
|
547
|
+
asterisk (`*`). It does not support other wildcard patterns.
|
|
548
|
+
:param usernames: A comma-separated list of the users to clear from the cache.
|
|
549
|
+
If you do not specify this parameter, the API evicts all users from the user
|
|
550
|
+
cache.
|
|
528
551
|
"""
|
|
529
552
|
if realms in SKIP_IN_PATH:
|
|
530
553
|
raise ValueError("Empty value passed for parameter 'realms'")
|
|
@@ -562,11 +585,17 @@ class SecurityClient(NamespacedClient):
|
|
|
562
585
|
pretty: t.Optional[bool] = None,
|
|
563
586
|
) -> ObjectApiResponse[t.Any]:
|
|
564
587
|
"""
|
|
565
|
-
|
|
588
|
+
.. raw:: html
|
|
589
|
+
|
|
590
|
+
<p>Clear the roles cache.</p>
|
|
591
|
+
<p>Evict roles from the native role cache.</p>
|
|
592
|
+
|
|
566
593
|
|
|
567
|
-
`<https://www.elastic.co/
|
|
594
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-security-clear-cached-roles>`_
|
|
568
595
|
|
|
569
|
-
:param name:
|
|
596
|
+
:param name: A comma-separated list of roles to evict from the role cache. To
|
|
597
|
+
evict all roles, use an asterisk (`*`). It does not support other wildcard
|
|
598
|
+
patterns.
|
|
570
599
|
"""
|
|
571
600
|
if name in SKIP_IN_PATH:
|
|
572
601
|
raise ValueError("Empty value passed for parameter 'name'")
|
|
@@ -604,14 +633,23 @@ class SecurityClient(NamespacedClient):
|
|
|
604
633
|
pretty: t.Optional[bool] = None,
|
|
605
634
|
) -> ObjectApiResponse[t.Any]:
|
|
606
635
|
"""
|
|
607
|
-
|
|
608
|
-
account token caches.
|
|
636
|
+
.. raw:: html
|
|
609
637
|
|
|
610
|
-
|
|
638
|
+
<p>Clear service account token caches.</p>
|
|
639
|
+
<p>Evict a subset of all entries from the service account token caches.
|
|
640
|
+
Two separate caches exist for service account tokens: one cache for tokens backed by the <code>service_tokens</code> file, and another for tokens backed by the <code>.security</code> index.
|
|
641
|
+
This API clears matching entries from both caches.</p>
|
|
642
|
+
<p>The cache for service account tokens backed by the <code>.security</code> index is cleared automatically on state changes of the security index.
|
|
643
|
+
The cache for tokens backed by the <code>service_tokens</code> file is cleared automatically on file changes.</p>
|
|
611
644
|
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
645
|
+
|
|
646
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-security-clear-cached-service-tokens>`_
|
|
647
|
+
|
|
648
|
+
:param namespace: The namespace, which is a top-level grouping of service accounts.
|
|
649
|
+
:param service: The name of the service, which must be unique within its namespace.
|
|
650
|
+
:param name: A comma-separated list of token names to evict from the service
|
|
651
|
+
account token caches. Use a wildcard (`*`) to evict all tokens that belong
|
|
652
|
+
to a service account. It does not support other wildcard patterns.
|
|
615
653
|
"""
|
|
616
654
|
if namespace in SKIP_IN_PATH:
|
|
617
655
|
raise ValueError("Empty value passed for parameter 'namespace'")
|
|
@@ -664,31 +702,43 @@ class SecurityClient(NamespacedClient):
|
|
|
664
702
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
665
703
|
) -> ObjectApiResponse[t.Any]:
|
|
666
704
|
"""
|
|
667
|
-
|
|
668
|
-
A successful request returns a JSON structure that contains the API key, its
|
|
669
|
-
unique id, and its name. If applicable, it also returns expiration information
|
|
670
|
-
for the API key in milliseconds. NOTE: By default, API keys never expire. You
|
|
671
|
-
can specify expiration information when you create the API keys.
|
|
705
|
+
.. raw:: html
|
|
672
706
|
|
|
673
|
-
|
|
707
|
+
<p>Create an API key.</p>
|
|
708
|
+
<p>Create an API key for access without requiring basic authentication.</p>
|
|
709
|
+
<p>IMPORTANT: If the credential that is used to authenticate this request is an API key, the derived API key cannot have any privileges.
|
|
710
|
+
If you specify privileges, the API returns an error.</p>
|
|
711
|
+
<p>A successful request returns a JSON structure that contains the API key, its unique id, and its name.
|
|
712
|
+
If applicable, it also returns expiration information for the API key in milliseconds.</p>
|
|
713
|
+
<p>NOTE: By default, API keys never expire. You can specify expiration information when you create the API keys.</p>
|
|
714
|
+
<p>The API keys are created by the Elasticsearch API key service, which is automatically enabled.
|
|
715
|
+
To configure or turn off the API key service, refer to API key service setting documentation.</p>
|
|
674
716
|
|
|
675
|
-
|
|
676
|
-
|
|
717
|
+
|
|
718
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-security-create-api-key>`_
|
|
719
|
+
|
|
720
|
+
:param expiration: The expiration time for the API key. By default, API keys
|
|
721
|
+
never expire.
|
|
677
722
|
:param metadata: Arbitrary metadata that you want to associate with the API key.
|
|
678
723
|
It supports nested data structure. Within the metadata object, keys beginning
|
|
679
724
|
with `_` are reserved for system usage.
|
|
680
|
-
:param name:
|
|
725
|
+
:param name: A name for the API key.
|
|
681
726
|
:param refresh: If `true` (the default) then refresh the affected shards to make
|
|
682
727
|
this operation visible to search, if `wait_for` then wait for a refresh to
|
|
683
728
|
make this operation visible to search, if `false` then do nothing with refreshes.
|
|
684
|
-
:param role_descriptors: An array of role descriptors for this API key.
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
or update roles API.
|
|
729
|
+
:param role_descriptors: An array of role descriptors for this API key. When
|
|
730
|
+
it is not specified or it is an empty array, the API key will have a point
|
|
731
|
+
in time snapshot of permissions of the authenticated user. If you supply
|
|
732
|
+
role descriptors, the resultant permissions are an intersection of API keys
|
|
733
|
+
permissions and the authenticated user's permissions thereby limiting the
|
|
734
|
+
access scope for API keys. The structure of role descriptor is the same as
|
|
735
|
+
the request for the create role API. For more details, refer to the create
|
|
736
|
+
or update roles API. NOTE: Due to the way in which this permission intersection
|
|
737
|
+
is calculated, it is not possible to create an API key that is a child of
|
|
738
|
+
another API key, unless the derived key is created without any privileges.
|
|
739
|
+
In this case, you must explicitly specify a role descriptor with no privileges.
|
|
740
|
+
The derived API key can be used for authentication; it will not have authority
|
|
741
|
+
to call Elasticsearch APIs.
|
|
692
742
|
"""
|
|
693
743
|
__path_parts: t.Dict[str, str] = {}
|
|
694
744
|
__path = "/_security/api_key"
|
|
@@ -741,23 +791,21 @@ class SecurityClient(NamespacedClient):
|
|
|
741
791
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
742
792
|
) -> ObjectApiResponse[t.Any]:
|
|
743
793
|
"""
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-create-cross-cluster-api-key.html>`_
|
|
794
|
+
.. raw:: html
|
|
795
|
+
|
|
796
|
+
<p>Create a cross-cluster API key.</p>
|
|
797
|
+
<p>Create an API key of the <code>cross_cluster</code> type for the API key based remote cluster access.
|
|
798
|
+
A <code>cross_cluster</code> API key cannot be used to authenticate through the REST interface.</p>
|
|
799
|
+
<p>IMPORTANT: To authenticate this request you must use a credential that is not an API key. Even if you use an API key that has the required privilege, the API returns an error.</p>
|
|
800
|
+
<p>Cross-cluster API keys are created by the Elasticsearch API key service, which is automatically enabled.</p>
|
|
801
|
+
<p>NOTE: Unlike REST API keys, a cross-cluster API key does not capture permissions of the authenticated user. The API key’s effective permission is exactly as specified with the <code>access</code> property.</p>
|
|
802
|
+
<p>A successful request returns a JSON structure that contains the API key, its unique ID, and its name. If applicable, it also returns expiration information for the API key in milliseconds.</p>
|
|
803
|
+
<p>By default, API keys never expire. You can specify expiration information when you create the API keys.</p>
|
|
804
|
+
<p>Cross-cluster API keys can only be updated with the update cross-cluster API key API.
|
|
805
|
+
Attempting to update them with the update REST API key API or the bulk update REST API keys API will result in an error.</p>
|
|
806
|
+
|
|
807
|
+
|
|
808
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-security-create-cross-cluster-api-key>`_
|
|
761
809
|
|
|
762
810
|
:param access: The access to be granted to this API key. The access is composed
|
|
763
811
|
of permissions for cross-cluster search and cross-cluster replication. At
|
|
@@ -824,14 +872,26 @@ class SecurityClient(NamespacedClient):
|
|
|
824
872
|
] = None,
|
|
825
873
|
) -> ObjectApiResponse[t.Any]:
|
|
826
874
|
"""
|
|
827
|
-
|
|
828
|
-
requiring basic authentication.
|
|
875
|
+
.. raw:: html
|
|
829
876
|
|
|
830
|
-
|
|
877
|
+
<p>Create a service account token.</p>
|
|
878
|
+
<p>Create a service accounts token for access without requiring basic authentication.</p>
|
|
879
|
+
<p>NOTE: Service account tokens never expire.
|
|
880
|
+
You must actively delete them if they are no longer needed.</p>
|
|
831
881
|
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
882
|
+
|
|
883
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-security-create-service-token>`_
|
|
884
|
+
|
|
885
|
+
:param namespace: The name of the namespace, which is a top-level grouping of
|
|
886
|
+
service accounts.
|
|
887
|
+
:param service: The name of the service.
|
|
888
|
+
:param name: The name for the service account token. If omitted, a random name
|
|
889
|
+
will be generated. Token names must be at least one and no more than 256
|
|
890
|
+
characters. They can contain alphanumeric characters (a-z, A-Z, 0-9), dashes
|
|
891
|
+
(`-`), and underscores (`_`), but cannot begin with an underscore. NOTE:
|
|
892
|
+
Token names must be unique in the context of the associated service account.
|
|
893
|
+
They must also be globally unique with their fully qualified names, which
|
|
894
|
+
are comprised of the service account principal and token name, such as `<namespace>/<service>/<token-name>`.
|
|
835
895
|
:param refresh: If `true` then refresh the affected shards to make this operation
|
|
836
896
|
visible to search, if `wait_for` (the default) then wait for a refresh to
|
|
837
897
|
make this operation visible to search, if `false` then do nothing with refreshes.
|
|
@@ -894,22 +954,19 @@ class SecurityClient(NamespacedClient):
|
|
|
894
954
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
895
955
|
) -> ObjectApiResponse[t.Any]:
|
|
896
956
|
"""
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
access token.
|
|
911
|
-
|
|
912
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-delegate-pki-authentication.html>`_
|
|
957
|
+
.. raw:: html
|
|
958
|
+
|
|
959
|
+
<p>Delegate PKI authentication.</p>
|
|
960
|
+
<p>This API implements the exchange of an X509Certificate chain for an Elasticsearch access token.
|
|
961
|
+
The certificate chain is validated, according to RFC 5280, by sequentially considering the trust configuration of every installed PKI realm that has <code>delegation.enabled</code> set to <code>true</code>.
|
|
962
|
+
A successfully trusted client certificate is also subject to the validation of the subject distinguished name according to thw <code>username_pattern</code> of the respective realm.</p>
|
|
963
|
+
<p>This API is called by smart and trusted proxies, such as Kibana, which terminate the user's TLS session but still want to authenticate the user by using a PKI realm—-as if the user connected directly to Elasticsearch.</p>
|
|
964
|
+
<p>IMPORTANT: The association between the subject public key in the target certificate and the corresponding private key is not validated.
|
|
965
|
+
This is part of the TLS authentication process and it is delegated to the proxy that calls this API.
|
|
966
|
+
The proxy is trusted to have performed the TLS authentication and this API translates that authentication into an Elasticsearch access token.</p>
|
|
967
|
+
|
|
968
|
+
|
|
969
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-security-delegate-pki>`_
|
|
913
970
|
|
|
914
971
|
:param x509_certificate_chain: The X509Certificate chain, which is represented
|
|
915
972
|
as an ordered string array. Each string in the array is a base64-encoded
|
|
@@ -963,12 +1020,21 @@ class SecurityClient(NamespacedClient):
|
|
|
963
1020
|
] = None,
|
|
964
1021
|
) -> ObjectApiResponse[t.Any]:
|
|
965
1022
|
"""
|
|
966
|
-
|
|
1023
|
+
.. raw:: html
|
|
1024
|
+
|
|
1025
|
+
<p>Delete application privileges.</p>
|
|
1026
|
+
<p>To use this API, you must have one of the following privileges:</p>
|
|
1027
|
+
<ul>
|
|
1028
|
+
<li>The <code>manage_security</code> cluster privilege (or a greater privilege such as <code>all</code>).</li>
|
|
1029
|
+
<li>The "Manage Application Privileges" global privilege for the application being referenced in the request.</li>
|
|
1030
|
+
</ul>
|
|
967
1031
|
|
|
968
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-delete-privilege.html>`_
|
|
969
1032
|
|
|
970
|
-
|
|
971
|
-
|
|
1033
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-security-delete-privileges>`_
|
|
1034
|
+
|
|
1035
|
+
:param application: The name of the application. Application privileges are always
|
|
1036
|
+
associated with exactly one application.
|
|
1037
|
+
:param name: The name of the privilege.
|
|
972
1038
|
:param refresh: If `true` (the default) then refresh the affected shards to make
|
|
973
1039
|
this operation visible to search, if `wait_for` then wait for a refresh to
|
|
974
1040
|
make this operation visible to search, if `false` then do nothing with refreshes.
|
|
@@ -1019,11 +1085,17 @@ class SecurityClient(NamespacedClient):
|
|
|
1019
1085
|
] = None,
|
|
1020
1086
|
) -> ObjectApiResponse[t.Any]:
|
|
1021
1087
|
"""
|
|
1022
|
-
|
|
1088
|
+
.. raw:: html
|
|
1089
|
+
|
|
1090
|
+
<p>Delete roles.</p>
|
|
1091
|
+
<p>Delete roles in the native realm.
|
|
1092
|
+
The role management APIs are generally the preferred way to manage roles, rather than using file-based role management.
|
|
1093
|
+
The delete roles API cannot remove roles that are defined in roles files.</p>
|
|
1023
1094
|
|
|
1024
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-delete-role.html>`_
|
|
1025
1095
|
|
|
1026
|
-
|
|
1096
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-security-delete-role>`_
|
|
1097
|
+
|
|
1098
|
+
:param name: The name of the role.
|
|
1027
1099
|
:param refresh: If `true` (the default) then refresh the affected shards to make
|
|
1028
1100
|
this operation visible to search, if `wait_for` then wait for a refresh to
|
|
1029
1101
|
make this operation visible to search, if `false` then do nothing with refreshes.
|
|
@@ -1067,11 +1139,19 @@ class SecurityClient(NamespacedClient):
|
|
|
1067
1139
|
] = None,
|
|
1068
1140
|
) -> ObjectApiResponse[t.Any]:
|
|
1069
1141
|
"""
|
|
1070
|
-
|
|
1142
|
+
.. raw:: html
|
|
1071
1143
|
|
|
1072
|
-
|
|
1144
|
+
<p>Delete role mappings.</p>
|
|
1145
|
+
<p>Role mappings define which roles are assigned to each user.
|
|
1146
|
+
The role mapping APIs are generally the preferred way to manage role mappings rather than using role mapping files.
|
|
1147
|
+
The delete role mappings API cannot remove role mappings that are defined in role mapping files.</p>
|
|
1073
1148
|
|
|
1074
|
-
|
|
1149
|
+
|
|
1150
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-security-delete-role-mapping>`_
|
|
1151
|
+
|
|
1152
|
+
:param name: The distinct name that identifies the role mapping. The name is
|
|
1153
|
+
used solely as an identifier to facilitate interaction via the API; it does
|
|
1154
|
+
not affect the behavior of the mapping in any way.
|
|
1075
1155
|
:param refresh: If `true` (the default) then refresh the affected shards to make
|
|
1076
1156
|
this operation visible to search, if `wait_for` then wait for a refresh to
|
|
1077
1157
|
make this operation visible to search, if `false` then do nothing with refreshes.
|
|
@@ -1117,14 +1197,17 @@ class SecurityClient(NamespacedClient):
|
|
|
1117
1197
|
] = None,
|
|
1118
1198
|
) -> ObjectApiResponse[t.Any]:
|
|
1119
1199
|
"""
|
|
1120
|
-
|
|
1121
|
-
|
|
1200
|
+
.. raw:: html
|
|
1201
|
+
|
|
1202
|
+
<p>Delete service account tokens.</p>
|
|
1203
|
+
<p>Delete service account tokens for a service in a specified namespace.</p>
|
|
1204
|
+
|
|
1122
1205
|
|
|
1123
|
-
`<https://www.elastic.co/
|
|
1206
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-security-delete-service-token>`_
|
|
1124
1207
|
|
|
1125
|
-
:param namespace:
|
|
1126
|
-
:param service:
|
|
1127
|
-
:param name:
|
|
1208
|
+
:param namespace: The namespace, which is a top-level grouping of service accounts.
|
|
1209
|
+
:param service: The service name.
|
|
1210
|
+
:param name: The name of the service account token.
|
|
1128
1211
|
:param refresh: If `true` then refresh the affected shards to make this operation
|
|
1129
1212
|
visible to search, if `wait_for` (the default) then wait for a refresh to
|
|
1130
1213
|
make this operation visible to search, if `false` then do nothing with refreshes.
|
|
@@ -1176,11 +1259,15 @@ class SecurityClient(NamespacedClient):
|
|
|
1176
1259
|
] = None,
|
|
1177
1260
|
) -> ObjectApiResponse[t.Any]:
|
|
1178
1261
|
"""
|
|
1179
|
-
|
|
1262
|
+
.. raw:: html
|
|
1180
1263
|
|
|
1181
|
-
|
|
1264
|
+
<p>Delete users.</p>
|
|
1265
|
+
<p>Delete users from the native realm.</p>
|
|
1182
1266
|
|
|
1183
|
-
|
|
1267
|
+
|
|
1268
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-security-delete-user>`_
|
|
1269
|
+
|
|
1270
|
+
:param username: An identifier for the user.
|
|
1184
1271
|
:param refresh: If `true` (the default) then refresh the affected shards to make
|
|
1185
1272
|
this operation visible to search, if `wait_for` then wait for a refresh to
|
|
1186
1273
|
make this operation visible to search, if `false` then do nothing with refreshes.
|
|
@@ -1224,11 +1311,17 @@ class SecurityClient(NamespacedClient):
|
|
|
1224
1311
|
] = None,
|
|
1225
1312
|
) -> ObjectApiResponse[t.Any]:
|
|
1226
1313
|
"""
|
|
1227
|
-
|
|
1314
|
+
.. raw:: html
|
|
1315
|
+
|
|
1316
|
+
<p>Disable users.</p>
|
|
1317
|
+
<p>Disable users in the native realm.
|
|
1318
|
+
By default, when you create users, they are enabled.
|
|
1319
|
+
You can use this API to revoke a user's access to Elasticsearch.</p>
|
|
1228
1320
|
|
|
1229
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-disable-user.html>`_
|
|
1230
1321
|
|
|
1231
|
-
|
|
1322
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-security-disable-user>`_
|
|
1323
|
+
|
|
1324
|
+
:param username: An identifier for the user.
|
|
1232
1325
|
:param refresh: If `true` (the default) then refresh the affected shards to make
|
|
1233
1326
|
this operation visible to search, if `wait_for` then wait for a refresh to
|
|
1234
1327
|
make this operation visible to search, if `false` then do nothing with refreshes.
|
|
@@ -1272,17 +1365,18 @@ class SecurityClient(NamespacedClient):
|
|
|
1272
1365
|
] = None,
|
|
1273
1366
|
) -> ObjectApiResponse[t.Any]:
|
|
1274
1367
|
"""
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1368
|
+
.. raw:: html
|
|
1369
|
+
|
|
1370
|
+
<p>Disable a user profile.</p>
|
|
1371
|
+
<p>Disable user profiles so that they are not visible in user profile searches.</p>
|
|
1372
|
+
<p>NOTE: The user profile feature is designed only for use by Kibana and Elastic's Observability, Enterprise Search, and Elastic Security solutions.
|
|
1373
|
+
Individual users and external applications should not call this API directly.
|
|
1374
|
+
Elastic reserves the right to change or remove this feature in future releases without prior notice.</p>
|
|
1375
|
+
<p>When you activate a user profile, its automatically enabled and visible in user profile searches. You can use the disable user profile API to disable a user profile so it’s not visible in these searches.
|
|
1376
|
+
To re-enable a disabled user profile, use the enable user profile API .</p>
|
|
1284
1377
|
|
|
1285
|
-
|
|
1378
|
+
|
|
1379
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-security-disable-user-profile>`_
|
|
1286
1380
|
|
|
1287
1381
|
:param uid: Unique identifier for the user profile.
|
|
1288
1382
|
:param refresh: If 'true', Elasticsearch refreshes the affected shards to make
|
|
@@ -1328,11 +1422,16 @@ class SecurityClient(NamespacedClient):
|
|
|
1328
1422
|
] = None,
|
|
1329
1423
|
) -> ObjectApiResponse[t.Any]:
|
|
1330
1424
|
"""
|
|
1331
|
-
|
|
1425
|
+
.. raw:: html
|
|
1426
|
+
|
|
1427
|
+
<p>Enable users.</p>
|
|
1428
|
+
<p>Enable users in the native realm.
|
|
1429
|
+
By default, when you create users, they are enabled.</p>
|
|
1430
|
+
|
|
1332
1431
|
|
|
1333
|
-
`<https://www.elastic.co/
|
|
1432
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-security-enable-user>`_
|
|
1334
1433
|
|
|
1335
|
-
:param username:
|
|
1434
|
+
:param username: An identifier for the user.
|
|
1336
1435
|
:param refresh: If `true` (the default) then refresh the affected shards to make
|
|
1337
1436
|
this operation visible to search, if `wait_for` then wait for a refresh to
|
|
1338
1437
|
make this operation visible to search, if `false` then do nothing with refreshes.
|
|
@@ -1376,16 +1475,18 @@ class SecurityClient(NamespacedClient):
|
|
|
1376
1475
|
] = None,
|
|
1377
1476
|
) -> ObjectApiResponse[t.Any]:
|
|
1378
1477
|
"""
|
|
1379
|
-
|
|
1380
|
-
searches. NOTE: The user profile feature is designed only for use by Kibana and
|
|
1381
|
-
Elastic's Observability, Enterprise Search, and Elastic Security solutions. Individual
|
|
1382
|
-
users and external applications should not call this API directly. Elastic reserves
|
|
1383
|
-
the right to change or remove this feature in future releases without prior notice.
|
|
1384
|
-
When you activate a user profile, it's automatically enabled and visible in user
|
|
1385
|
-
profile searches. If you later disable the user profile, you can use the enable
|
|
1386
|
-
user profile API to make the profile visible in these searches again.
|
|
1478
|
+
.. raw:: html
|
|
1387
1479
|
|
|
1388
|
-
|
|
1480
|
+
<p>Enable a user profile.</p>
|
|
1481
|
+
<p>Enable user profiles to make them visible in user profile searches.</p>
|
|
1482
|
+
<p>NOTE: The user profile feature is designed only for use by Kibana and Elastic's Observability, Enterprise Search, and Elastic Security solutions.
|
|
1483
|
+
Individual users and external applications should not call this API directly.
|
|
1484
|
+
Elastic reserves the right to change or remove this feature in future releases without prior notice.</p>
|
|
1485
|
+
<p>When you activate a user profile, it's automatically enabled and visible in user profile searches.
|
|
1486
|
+
If you later disable the user profile, you can use the enable user profile API to make the profile visible in these searches again.</p>
|
|
1487
|
+
|
|
1488
|
+
|
|
1489
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-security-enable-user-profile>`_
|
|
1389
1490
|
|
|
1390
1491
|
:param uid: A unique identifier for the user profile.
|
|
1391
1492
|
:param refresh: If 'true', Elasticsearch refreshes the affected shards to make
|
|
@@ -1427,10 +1528,15 @@ class SecurityClient(NamespacedClient):
|
|
|
1427
1528
|
pretty: t.Optional[bool] = None,
|
|
1428
1529
|
) -> ObjectApiResponse[t.Any]:
|
|
1429
1530
|
"""
|
|
1430
|
-
|
|
1431
|
-
|
|
1531
|
+
.. raw:: html
|
|
1532
|
+
|
|
1533
|
+
<p>Enroll Kibana.</p>
|
|
1534
|
+
<p>Enable a Kibana instance to configure itself for communication with a secured Elasticsearch cluster.</p>
|
|
1535
|
+
<p>NOTE: This API is currently intended for internal use only by Kibana.
|
|
1536
|
+
Kibana uses this API internally to configure itself for communications with an Elasticsearch cluster that already has security features enabled.</p>
|
|
1432
1537
|
|
|
1433
|
-
|
|
1538
|
+
|
|
1539
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-security-enroll-kibana>`_
|
|
1434
1540
|
"""
|
|
1435
1541
|
__path_parts: t.Dict[str, str] = {}
|
|
1436
1542
|
__path = "/_security/enroll/kibana"
|
|
@@ -1463,10 +1569,15 @@ class SecurityClient(NamespacedClient):
|
|
|
1463
1569
|
pretty: t.Optional[bool] = None,
|
|
1464
1570
|
) -> ObjectApiResponse[t.Any]:
|
|
1465
1571
|
"""
|
|
1466
|
-
|
|
1467
|
-
|
|
1572
|
+
.. raw:: html
|
|
1573
|
+
|
|
1574
|
+
<p>Enroll a node.</p>
|
|
1575
|
+
<p>Enroll a new node to allow it to join an existing cluster with security features enabled.</p>
|
|
1576
|
+
<p>The response contains all the necessary information for the joining node to bootstrap discovery and security related settings so that it can successfully join the cluster.
|
|
1577
|
+
The response contains key and certificate material that allows the caller to generate valid signed certificates for the HTTP layer of all nodes in the cluster.</p>
|
|
1578
|
+
|
|
1468
1579
|
|
|
1469
|
-
`<https://www.elastic.co/
|
|
1580
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-security-enroll-node>`_
|
|
1470
1581
|
"""
|
|
1471
1582
|
__path_parts: t.Dict[str, str] = {}
|
|
1472
1583
|
__path = "/_security/enroll/node"
|
|
@@ -1507,13 +1618,15 @@ class SecurityClient(NamespacedClient):
|
|
|
1507
1618
|
with_profile_uid: t.Optional[bool] = None,
|
|
1508
1619
|
) -> ObjectApiResponse[t.Any]:
|
|
1509
1620
|
"""
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1621
|
+
.. raw:: html
|
|
1622
|
+
|
|
1623
|
+
<p>Get API key information.</p>
|
|
1624
|
+
<p>Retrieves information for one or more API keys.
|
|
1625
|
+
NOTE: If you have only the <code>manage_own_api_key</code> privilege, this API returns only the API keys that you own.
|
|
1626
|
+
If you have <code>read_security</code>, <code>manage_api_key</code> or greater privileges (including <code>manage_security</code>), this API returns all API keys regardless of ownership.</p>
|
|
1627
|
+
|
|
1515
1628
|
|
|
1516
|
-
`<https://www.elastic.co/
|
|
1629
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-security-get-api-key>`_
|
|
1517
1630
|
|
|
1518
1631
|
:param active_only: A boolean flag that can be used to query API keys that are
|
|
1519
1632
|
currently active. An API key is considered active if it is neither invalidated,
|
|
@@ -1585,10 +1698,13 @@ class SecurityClient(NamespacedClient):
|
|
|
1585
1698
|
pretty: t.Optional[bool] = None,
|
|
1586
1699
|
) -> ObjectApiResponse[t.Any]:
|
|
1587
1700
|
"""
|
|
1588
|
-
|
|
1589
|
-
that are available in this version of Elasticsearch.
|
|
1701
|
+
.. raw:: html
|
|
1590
1702
|
|
|
1591
|
-
|
|
1703
|
+
<p>Get builtin privileges.</p>
|
|
1704
|
+
<p>Get the list of cluster privileges and index privileges that are available in this version of Elasticsearch.</p>
|
|
1705
|
+
|
|
1706
|
+
|
|
1707
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-security-get-builtin-privileges>`_
|
|
1592
1708
|
"""
|
|
1593
1709
|
__path_parts: t.Dict[str, str] = {}
|
|
1594
1710
|
__path = "/_security/privilege/_builtin"
|
|
@@ -1623,12 +1739,23 @@ class SecurityClient(NamespacedClient):
|
|
|
1623
1739
|
pretty: t.Optional[bool] = None,
|
|
1624
1740
|
) -> ObjectApiResponse[t.Any]:
|
|
1625
1741
|
"""
|
|
1626
|
-
|
|
1742
|
+
.. raw:: html
|
|
1743
|
+
|
|
1744
|
+
<p>Get application privileges.</p>
|
|
1745
|
+
<p>To use this API, you must have one of the following privileges:</p>
|
|
1746
|
+
<ul>
|
|
1747
|
+
<li>The <code>read_security</code> cluster privilege (or a greater privilege such as <code>manage_security</code> or <code>all</code>).</li>
|
|
1748
|
+
<li>The "Manage Application Privileges" global privilege for the application being referenced in the request.</li>
|
|
1749
|
+
</ul>
|
|
1627
1750
|
|
|
1628
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-get-privileges.html>`_
|
|
1629
1751
|
|
|
1630
|
-
|
|
1631
|
-
|
|
1752
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-security-get-privileges>`_
|
|
1753
|
+
|
|
1754
|
+
:param application: The name of the application. Application privileges are always
|
|
1755
|
+
associated with exactly one application. If you do not specify this parameter,
|
|
1756
|
+
the API returns information about all privileges for all applications.
|
|
1757
|
+
:param name: The name of the privilege. If you do not specify this parameter,
|
|
1758
|
+
the API returns information about all privileges for the requested application.
|
|
1632
1759
|
"""
|
|
1633
1760
|
__path_parts: t.Dict[str, str]
|
|
1634
1761
|
if application not in SKIP_IN_PATH and name not in SKIP_IN_PATH:
|
|
@@ -1670,11 +1797,15 @@ class SecurityClient(NamespacedClient):
|
|
|
1670
1797
|
pretty: t.Optional[bool] = None,
|
|
1671
1798
|
) -> ObjectApiResponse[t.Any]:
|
|
1672
1799
|
"""
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1800
|
+
.. raw:: html
|
|
1801
|
+
|
|
1802
|
+
<p>Get roles.</p>
|
|
1803
|
+
<p>Get roles in the native realm.
|
|
1804
|
+
The role management APIs are generally the preferred way to manage roles, rather than using file-based role management.
|
|
1805
|
+
The get roles API cannot retrieve roles that are defined in roles files.</p>
|
|
1676
1806
|
|
|
1677
|
-
|
|
1807
|
+
|
|
1808
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-security-get-role>`_
|
|
1678
1809
|
|
|
1679
1810
|
:param name: The name of the role. You can specify multiple roles as a comma-separated
|
|
1680
1811
|
list. If you do not specify this parameter, the API returns information about
|
|
@@ -1717,12 +1848,15 @@ class SecurityClient(NamespacedClient):
|
|
|
1717
1848
|
pretty: t.Optional[bool] = None,
|
|
1718
1849
|
) -> ObjectApiResponse[t.Any]:
|
|
1719
1850
|
"""
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1851
|
+
.. raw:: html
|
|
1852
|
+
|
|
1853
|
+
<p>Get role mappings.</p>
|
|
1854
|
+
<p>Role mappings define which roles are assigned to each user.
|
|
1855
|
+
The role mapping APIs are generally the preferred way to manage role mappings rather than using role mapping files.
|
|
1856
|
+
The get role mappings API cannot retrieve role mappings that are defined in role mapping files.</p>
|
|
1724
1857
|
|
|
1725
|
-
|
|
1858
|
+
|
|
1859
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-security-get-role-mapping>`_
|
|
1726
1860
|
|
|
1727
1861
|
:param name: The distinct name that identifies the role mapping. The name is
|
|
1728
1862
|
used solely as an identifier to facilitate interaction via the API; it does
|
|
@@ -1768,15 +1902,19 @@ class SecurityClient(NamespacedClient):
|
|
|
1768
1902
|
pretty: t.Optional[bool] = None,
|
|
1769
1903
|
) -> ObjectApiResponse[t.Any]:
|
|
1770
1904
|
"""
|
|
1771
|
-
|
|
1772
|
-
|
|
1905
|
+
.. raw:: html
|
|
1906
|
+
|
|
1907
|
+
<p>Get service accounts.</p>
|
|
1908
|
+
<p>Get a list of service accounts that match the provided path parameters.</p>
|
|
1909
|
+
<p>NOTE: Currently, only the <code>elastic/fleet-server</code> service account is available.</p>
|
|
1910
|
+
|
|
1773
1911
|
|
|
1774
|
-
`<https://www.elastic.co/
|
|
1912
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-security-get-service-accounts>`_
|
|
1775
1913
|
|
|
1776
|
-
:param namespace:
|
|
1777
|
-
about all service accounts. If you omit this parameter, you must
|
|
1778
|
-
the `service` parameter.
|
|
1779
|
-
:param service:
|
|
1914
|
+
:param namespace: The name of the namespace. Omit this parameter to retrieve
|
|
1915
|
+
information about all service accounts. If you omit this parameter, you must
|
|
1916
|
+
also omit the `service` parameter.
|
|
1917
|
+
:param service: The service name. Omit this parameter to retrieve information
|
|
1780
1918
|
about all service accounts that belong to the specified `namespace`.
|
|
1781
1919
|
"""
|
|
1782
1920
|
__path_parts: t.Dict[str, str]
|
|
@@ -1820,12 +1958,19 @@ class SecurityClient(NamespacedClient):
|
|
|
1820
1958
|
pretty: t.Optional[bool] = None,
|
|
1821
1959
|
) -> ObjectApiResponse[t.Any]:
|
|
1822
1960
|
"""
|
|
1823
|
-
|
|
1961
|
+
.. raw:: html
|
|
1962
|
+
|
|
1963
|
+
<p>Get service account credentials.</p>
|
|
1964
|
+
<p>To use this API, you must have at least the <code>read_security</code> cluster privilege (or a greater privilege such as <code>manage_service_account</code> or <code>manage_security</code>).</p>
|
|
1965
|
+
<p>The response includes service account tokens that were created with the create service account tokens API as well as file-backed tokens from all nodes of the cluster.</p>
|
|
1966
|
+
<p>NOTE: For tokens backed by the <code>service_tokens</code> file, the API collects them from all nodes of the cluster.
|
|
1967
|
+
Tokens with the same name from different nodes are assumed to be the same token and are only counted once towards the total number of service tokens.</p>
|
|
1968
|
+
|
|
1824
1969
|
|
|
1825
|
-
`<https://www.elastic.co/
|
|
1970
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-security-get-service-credentials>`_
|
|
1826
1971
|
|
|
1827
|
-
:param namespace:
|
|
1828
|
-
:param service:
|
|
1972
|
+
:param namespace: The name of the namespace.
|
|
1973
|
+
:param service: The service name.
|
|
1829
1974
|
"""
|
|
1830
1975
|
if namespace in SKIP_IN_PATH:
|
|
1831
1976
|
raise ValueError("Empty value passed for parameter 'namespace'")
|
|
@@ -1866,10 +2011,19 @@ class SecurityClient(NamespacedClient):
|
|
|
1866
2011
|
pretty: t.Optional[bool] = None,
|
|
1867
2012
|
) -> ObjectApiResponse[t.Any]:
|
|
1868
2013
|
"""
|
|
1869
|
-
|
|
1870
|
-
internal index (`.security` and associated indices).
|
|
2014
|
+
.. raw:: html
|
|
1871
2015
|
|
|
1872
|
-
|
|
2016
|
+
<p>Get security index settings.</p>
|
|
2017
|
+
<p>Get the user-configurable settings for the security internal index (<code>.security</code> and associated indices).
|
|
2018
|
+
Only a subset of the index settings — those that are user-configurable—will be shown.
|
|
2019
|
+
This includes:</p>
|
|
2020
|
+
<ul>
|
|
2021
|
+
<li><code>index.auto_expand_replicas</code></li>
|
|
2022
|
+
<li><code>index.number_of_replicas</code></li>
|
|
2023
|
+
</ul>
|
|
2024
|
+
|
|
2025
|
+
|
|
2026
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-security-get-settings>`_
|
|
1873
2027
|
|
|
1874
2028
|
:param master_timeout: Period to wait for a connection to the master node. If
|
|
1875
2029
|
no response is received before the timeout expires, the request fails and
|
|
@@ -1931,16 +2085,39 @@ class SecurityClient(NamespacedClient):
|
|
|
1931
2085
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
1932
2086
|
) -> ObjectApiResponse[t.Any]:
|
|
1933
2087
|
"""
|
|
1934
|
-
|
|
2088
|
+
.. raw:: html
|
|
1935
2089
|
|
|
1936
|
-
|
|
2090
|
+
<p>Get a token.</p>
|
|
2091
|
+
<p>Create a bearer token for access without requiring basic authentication.
|
|
2092
|
+
The tokens are created by the Elasticsearch Token Service, which is automatically enabled when you configure TLS on the HTTP interface.
|
|
2093
|
+
Alternatively, you can explicitly enable the <code>xpack.security.authc.token.enabled</code> setting.
|
|
2094
|
+
When you are running in production mode, a bootstrap check prevents you from enabling the token service unless you also enable TLS on the HTTP interface.</p>
|
|
2095
|
+
<p>The get token API takes the same parameters as a typical OAuth 2.0 token API except for the use of a JSON request body.</p>
|
|
2096
|
+
<p>A successful get token API call returns a JSON structure that contains the access token, the amount of time (seconds) that the token expires in, the type, and the scope if available.</p>
|
|
2097
|
+
<p>The tokens returned by the get token API have a finite period of time for which they are valid and after that time period, they can no longer be used.
|
|
2098
|
+
That time period is defined by the <code>xpack.security.authc.token.timeout</code> setting.
|
|
2099
|
+
If you want to invalidate a token immediately, you can do so by using the invalidate token API.</p>
|
|
1937
2100
|
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
:param
|
|
1942
|
-
|
|
1943
|
-
:param
|
|
2101
|
+
|
|
2102
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-security-get-token>`_
|
|
2103
|
+
|
|
2104
|
+
:param grant_type: The type of grant. Supported grant types are: `password`,
|
|
2105
|
+
`_kerberos`, `client_credentials`, and `refresh_token`.
|
|
2106
|
+
:param kerberos_ticket: The base64 encoded kerberos ticket. If you specify the
|
|
2107
|
+
`_kerberos` grant type, this parameter is required. This parameter is not
|
|
2108
|
+
valid with any other supported grant type.
|
|
2109
|
+
:param password: The user's password. If you specify the `password` grant type,
|
|
2110
|
+
this parameter is required. This parameter is not valid with any other supported
|
|
2111
|
+
grant type.
|
|
2112
|
+
:param refresh_token: The string that was returned when you created the token,
|
|
2113
|
+
which enables you to extend its life. If you specify the `refresh_token`
|
|
2114
|
+
grant type, this parameter is required. This parameter is not valid with
|
|
2115
|
+
any other supported grant type.
|
|
2116
|
+
:param scope: The scope of the token. Currently tokens are only issued for a
|
|
2117
|
+
scope of FULL regardless of the value sent with the request.
|
|
2118
|
+
:param username: The username that identifies the user. If you specify the `password`
|
|
2119
|
+
grant type, this parameter is required. This parameter is not valid with
|
|
2120
|
+
any other supported grant type.
|
|
1944
2121
|
"""
|
|
1945
2122
|
__path_parts: t.Dict[str, str] = {}
|
|
1946
2123
|
__path = "/_security/oauth2/token"
|
|
@@ -1990,15 +2167,19 @@ class SecurityClient(NamespacedClient):
|
|
|
1990
2167
|
with_profile_uid: t.Optional[bool] = None,
|
|
1991
2168
|
) -> ObjectApiResponse[t.Any]:
|
|
1992
2169
|
"""
|
|
1993
|
-
|
|
2170
|
+
.. raw:: html
|
|
2171
|
+
|
|
2172
|
+
<p>Get users.</p>
|
|
2173
|
+
<p>Get information about users in the native realm and built-in users.</p>
|
|
1994
2174
|
|
|
1995
|
-
|
|
2175
|
+
|
|
2176
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-security-get-user>`_
|
|
1996
2177
|
|
|
1997
2178
|
:param username: An identifier for the user. You can specify multiple usernames
|
|
1998
2179
|
as a comma-separated list. If you omit this parameter, the API retrieves
|
|
1999
2180
|
information about all users.
|
|
2000
|
-
:param with_profile_uid:
|
|
2001
|
-
if
|
|
2181
|
+
:param with_profile_uid: Determines whether to retrieve the user profile UID,
|
|
2182
|
+
if it exists, for the users.
|
|
2002
2183
|
"""
|
|
2003
2184
|
__path_parts: t.Dict[str, str]
|
|
2004
2185
|
if username not in SKIP_IN_PATH:
|
|
@@ -2041,9 +2222,16 @@ class SecurityClient(NamespacedClient):
|
|
|
2041
2222
|
username: t.Optional[t.Union[None, str]] = None,
|
|
2042
2223
|
) -> ObjectApiResponse[t.Any]:
|
|
2043
2224
|
"""
|
|
2044
|
-
|
|
2225
|
+
.. raw:: html
|
|
2226
|
+
|
|
2227
|
+
<p>Get user privileges.</p>
|
|
2228
|
+
<p>Get the security privileges for the logged in user.
|
|
2229
|
+
All users can use this API, but only to determine their own privileges.
|
|
2230
|
+
To check the privileges of other users, you must use the run as feature.
|
|
2231
|
+
To check whether a user has a specific list of privileges, use the has privileges API.</p>
|
|
2232
|
+
|
|
2045
2233
|
|
|
2046
|
-
`<https://www.elastic.co/
|
|
2234
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-security-get-user-privileges>`_
|
|
2047
2235
|
|
|
2048
2236
|
:param application: The name of the application. Application privileges are always
|
|
2049
2237
|
associated with exactly one application. If you do not specify this parameter,
|
|
@@ -2091,13 +2279,16 @@ class SecurityClient(NamespacedClient):
|
|
|
2091
2279
|
pretty: t.Optional[bool] = None,
|
|
2092
2280
|
) -> ObjectApiResponse[t.Any]:
|
|
2093
2281
|
"""
|
|
2094
|
-
|
|
2095
|
-
user profile feature is designed only for use by Kibana and Elastic's Observability,
|
|
2096
|
-
Enterprise Search, and Elastic Security solutions. Individual users and external
|
|
2097
|
-
applications should not call this API directly. Elastic reserves the right to
|
|
2098
|
-
change or remove this feature in future releases without prior notice.
|
|
2282
|
+
.. raw:: html
|
|
2099
2283
|
|
|
2100
|
-
|
|
2284
|
+
<p>Get a user profile.</p>
|
|
2285
|
+
<p>Get a user's profile using the unique profile ID.</p>
|
|
2286
|
+
<p>NOTE: The user profile feature is designed only for use by Kibana and Elastic's Observability, Enterprise Search, and Elastic Security solutions.
|
|
2287
|
+
Individual users and external applications should not call this API directly.
|
|
2288
|
+
Elastic reserves the right to change or remove this feature in future releases without prior notice.</p>
|
|
2289
|
+
|
|
2290
|
+
|
|
2291
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-security-get-user-profile>`_
|
|
2101
2292
|
|
|
2102
2293
|
:param uid: A unique identifier for the user profile.
|
|
2103
2294
|
:param data: A comma-separated list of filters for the `data` field of the profile
|
|
@@ -2159,31 +2350,37 @@ class SecurityClient(NamespacedClient):
|
|
|
2159
2350
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
2160
2351
|
) -> ObjectApiResponse[t.Any]:
|
|
2161
2352
|
"""
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2353
|
+
.. raw:: html
|
|
2354
|
+
|
|
2355
|
+
<p>Grant an API key.</p>
|
|
2356
|
+
<p>Create an API key on behalf of another user.
|
|
2357
|
+
This API is similar to the create API keys API, however it creates the API key for a user that is different than the user that runs the API.
|
|
2358
|
+
The caller must have authentication credentials for the user on whose behalf the API key will be created.
|
|
2359
|
+
It is not possible to use this API to create an API key without that user's credentials.
|
|
2360
|
+
The supported user authentication credential types are:</p>
|
|
2361
|
+
<ul>
|
|
2362
|
+
<li>username and password</li>
|
|
2363
|
+
<li>Elasticsearch access tokens</li>
|
|
2364
|
+
<li>JWTs</li>
|
|
2365
|
+
</ul>
|
|
2366
|
+
<p>The user, for whom the authentication credentials is provided, can optionally "run as" (impersonate) another user.
|
|
2367
|
+
In this case, the API key will be created on behalf of the impersonated user.</p>
|
|
2368
|
+
<p>This API is intended be used by applications that need to create and manage API keys for end users, but cannot guarantee that those users have permission to create API keys on their own behalf.
|
|
2369
|
+
The API keys are created by the Elasticsearch API key service, which is automatically enabled.</p>
|
|
2370
|
+
<p>A successful grant API key API call returns a JSON structure that contains the API key, its unique id, and its name.
|
|
2371
|
+
If applicable, it also returns expiration information for the API key in milliseconds.</p>
|
|
2372
|
+
<p>By default, API keys never expire. You can specify expiration information when you create the API keys.</p>
|
|
2373
|
+
|
|
2374
|
+
|
|
2375
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-security-grant-api-key>`_
|
|
2376
|
+
|
|
2377
|
+
:param api_key: The API key.
|
|
2181
2378
|
:param grant_type: The type of grant. Supported grant types are: `access_token`,
|
|
2182
2379
|
`password`.
|
|
2183
|
-
:param access_token: The user
|
|
2380
|
+
:param access_token: The user's access token. If you specify the `access_token`
|
|
2184
2381
|
grant type, this parameter is required. It is not valid with other grant
|
|
2185
2382
|
types.
|
|
2186
|
-
:param password: The user
|
|
2383
|
+
:param password: The user's password. If you specify the `password` grant type,
|
|
2187
2384
|
this parameter is required. It is not valid with other grant types.
|
|
2188
2385
|
:param run_as: The name of the user to be impersonated.
|
|
2189
2386
|
:param username: The user name that identifies the user. If you specify the `password`
|
|
@@ -2314,10 +2511,15 @@ class SecurityClient(NamespacedClient):
|
|
|
2314
2511
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
2315
2512
|
) -> ObjectApiResponse[t.Any]:
|
|
2316
2513
|
"""
|
|
2317
|
-
|
|
2318
|
-
|
|
2514
|
+
.. raw:: html
|
|
2515
|
+
|
|
2516
|
+
<p>Check user privileges.</p>
|
|
2517
|
+
<p>Determine whether the specified user has a specified list of privileges.
|
|
2518
|
+
All users can use this API, but only to determine their own privileges.
|
|
2519
|
+
To check the privileges of other users, you must use the run as feature.</p>
|
|
2520
|
+
|
|
2319
2521
|
|
|
2320
|
-
`<https://www.elastic.co/
|
|
2522
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-security-has-privileges>`_
|
|
2321
2523
|
|
|
2322
2524
|
:param user: Username
|
|
2323
2525
|
:param application:
|
|
@@ -2374,14 +2576,15 @@ class SecurityClient(NamespacedClient):
|
|
|
2374
2576
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
2375
2577
|
) -> ObjectApiResponse[t.Any]:
|
|
2376
2578
|
"""
|
|
2377
|
-
|
|
2378
|
-
specified user profile IDs have all the requested privileges. NOTE: The user
|
|
2379
|
-
profile feature is designed only for use by Kibana and Elastic's Observability,
|
|
2380
|
-
Enterprise Search, and Elastic Security solutions. Individual users and external
|
|
2381
|
-
applications should not call this API directly. Elastic reserves the right to
|
|
2382
|
-
change or remove this feature in future releases without prior notice.
|
|
2579
|
+
.. raw:: html
|
|
2383
2580
|
|
|
2384
|
-
|
|
2581
|
+
<p>Check user profile privileges.</p>
|
|
2582
|
+
<p>Determine whether the users associated with the specified user profile IDs have all the requested privileges.</p>
|
|
2583
|
+
<p>NOTE: The user profile feature is designed only for use by Kibana and Elastic's Observability, Enterprise Search, and Elastic Security solutions. Individual users and external applications should not call this API directly.
|
|
2584
|
+
Elastic reserves the right to change or remove this feature in future releases without prior notice.</p>
|
|
2585
|
+
|
|
2586
|
+
|
|
2587
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-security-has-privileges-user-profile>`_
|
|
2385
2588
|
|
|
2386
2589
|
:param privileges: An object containing all the privileges to be checked.
|
|
2387
2590
|
:param uids: A list of profile IDs. The privileges are checked for associated
|
|
@@ -2438,33 +2641,39 @@ class SecurityClient(NamespacedClient):
|
|
|
2438
2641
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
2439
2642
|
) -> ObjectApiResponse[t.Any]:
|
|
2440
2643
|
"""
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2644
|
+
.. raw:: html
|
|
2645
|
+
|
|
2646
|
+
<p>Invalidate API keys.</p>
|
|
2647
|
+
<p>This API invalidates API keys created by the create API key or grant API key APIs.
|
|
2648
|
+
Invalidated API keys fail authentication, but they can still be viewed using the get API key information and query API key information APIs, for at least the configured retention period, until they are automatically deleted.</p>
|
|
2649
|
+
<p>To use this API, you must have at least the <code>manage_security</code>, <code>manage_api_key</code>, or <code>manage_own_api_key</code> cluster privileges.
|
|
2650
|
+
The <code>manage_security</code> privilege allows deleting any API key, including both REST and cross cluster API keys.
|
|
2651
|
+
The <code>manage_api_key</code> privilege allows deleting any REST API key, but not cross cluster API keys.
|
|
2652
|
+
The <code>manage_own_api_key</code> only allows deleting REST API keys that are owned by the user.
|
|
2653
|
+
In addition, with the <code>manage_own_api_key</code> privilege, an invalidation request must be issued in one of the three formats:</p>
|
|
2654
|
+
<ul>
|
|
2655
|
+
<li>Set the parameter <code>owner=true</code>.</li>
|
|
2656
|
+
<li>Or, set both <code>username</code> and <code>realm_name</code> to match the user's identity.</li>
|
|
2657
|
+
<li>Or, if the request is issued by an API key, that is to say an API key invalidates itself, specify its ID in the <code>ids</code> field.</li>
|
|
2658
|
+
</ul>
|
|
2452
2659
|
|
|
2453
|
-
|
|
2660
|
+
|
|
2661
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-security-invalidate-api-key>`_
|
|
2454
2662
|
|
|
2455
2663
|
:param id:
|
|
2456
2664
|
:param ids: A list of API key ids. This parameter cannot be used with any of
|
|
2457
2665
|
`name`, `realm_name`, or `username`.
|
|
2458
2666
|
:param name: An API key name. This parameter cannot be used with any of `ids`,
|
|
2459
2667
|
`realm_name` or `username`.
|
|
2460
|
-
:param owner:
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2668
|
+
:param owner: Query API keys owned by the currently authenticated user. The `realm_name`
|
|
2669
|
+
or `username` parameters cannot be specified when this parameter is set to
|
|
2670
|
+
`true` as they are assumed to be the currently authenticated ones. NOTE:
|
|
2671
|
+
At least one of `ids`, `name`, `username`, and `realm_name` must be specified
|
|
2672
|
+
if `owner` is `false`.
|
|
2464
2673
|
:param realm_name: The name of an authentication realm. This parameter cannot
|
|
2465
2674
|
be used with either `ids` or `name`, or when `owner` flag is set to `true`.
|
|
2466
2675
|
:param username: The username of a user. This parameter cannot be used with either
|
|
2467
|
-
`ids` or `name
|
|
2676
|
+
`ids` or `name` or when `owner` flag is set to `true`.
|
|
2468
2677
|
"""
|
|
2469
2678
|
__path_parts: t.Dict[str, str] = {}
|
|
2470
2679
|
__path = "/_security/api_key"
|
|
@@ -2519,19 +2728,30 @@ class SecurityClient(NamespacedClient):
|
|
|
2519
2728
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
2520
2729
|
) -> ObjectApiResponse[t.Any]:
|
|
2521
2730
|
"""
|
|
2522
|
-
|
|
2523
|
-
period of time for which they are valid. After that time period, they can no
|
|
2524
|
-
longer be used. The time period is defined by the `xpack.security.authc.token.timeout`
|
|
2525
|
-
setting. The refresh tokens returned by the get token API are only valid for
|
|
2526
|
-
24 hours. They can also be used exactly once. If you want to invalidate one or
|
|
2527
|
-
more access or refresh tokens immediately, use this invalidate token API.
|
|
2731
|
+
.. raw:: html
|
|
2528
2732
|
|
|
2529
|
-
|
|
2733
|
+
<p>Invalidate a token.</p>
|
|
2734
|
+
<p>The access tokens returned by the get token API have a finite period of time for which they are valid.
|
|
2735
|
+
After that time period, they can no longer be used.
|
|
2736
|
+
The time period is defined by the <code>xpack.security.authc.token.timeout</code> setting.</p>
|
|
2737
|
+
<p>The refresh tokens returned by the get token API are only valid for 24 hours.
|
|
2738
|
+
They can also be used exactly once.
|
|
2739
|
+
If you want to invalidate one or more access or refresh tokens immediately, use this invalidate token API.</p>
|
|
2740
|
+
<p>NOTE: While all parameters are optional, at least one of them is required.
|
|
2741
|
+
More specifically, either one of <code>token</code> or <code>refresh_token</code> parameters is required.
|
|
2742
|
+
If none of these two are specified, then <code>realm_name</code> and/or <code>username</code> need to be specified.</p>
|
|
2530
2743
|
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
:param
|
|
2744
|
+
|
|
2745
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-security-invalidate-token>`_
|
|
2746
|
+
|
|
2747
|
+
:param realm_name: The name of an authentication realm. This parameter cannot
|
|
2748
|
+
be used with either `refresh_token` or `token`.
|
|
2749
|
+
:param refresh_token: A refresh token. This parameter cannot be used if any of
|
|
2750
|
+
`refresh_token`, `realm_name`, or `username` are used.
|
|
2751
|
+
:param token: An access token. This parameter cannot be used if any of `refresh_token`,
|
|
2752
|
+
`realm_name`, or `username` are used.
|
|
2753
|
+
:param username: The username of a user. This parameter cannot be used with either
|
|
2754
|
+
`refresh_token` or `token`.
|
|
2535
2755
|
"""
|
|
2536
2756
|
__path_parts: t.Dict[str, str] = {}
|
|
2537
2757
|
__path = "/_security/oauth2/token"
|
|
@@ -2582,14 +2802,15 @@ class SecurityClient(NamespacedClient):
|
|
|
2582
2802
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
2583
2803
|
) -> ObjectApiResponse[t.Any]:
|
|
2584
2804
|
"""
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2805
|
+
.. raw:: html
|
|
2806
|
+
|
|
2807
|
+
<p>Authenticate OpenID Connect.</p>
|
|
2808
|
+
<p>Exchange an OpenID Connect authentication response message for an Elasticsearch internal access token and refresh token that can be subsequently used for authentication.</p>
|
|
2809
|
+
<p>Elasticsearch exposes all the necessary OpenID Connect related functionality with the OpenID Connect APIs.
|
|
2810
|
+
These APIs are used internally by Kibana in order to provide OpenID Connect based authentication, but can also be used by other, custom web applications or other clients.</p>
|
|
2811
|
+
|
|
2591
2812
|
|
|
2592
|
-
`<https://www.elastic.co/
|
|
2813
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-security-oidc-authenticate>`_
|
|
2593
2814
|
|
|
2594
2815
|
:param nonce: Associate a client session with an ID token and mitigate replay
|
|
2595
2816
|
attacks. This value needs to be the same as the one that was provided to
|
|
@@ -2646,12 +2867,12 @@ class SecurityClient(NamespacedClient):
|
|
|
2646
2867
|
)
|
|
2647
2868
|
|
|
2648
2869
|
@_rewrite_parameters(
|
|
2649
|
-
body_fields=("
|
|
2870
|
+
body_fields=("token", "refresh_token"),
|
|
2650
2871
|
)
|
|
2651
2872
|
def oidc_logout(
|
|
2652
2873
|
self,
|
|
2653
2874
|
*,
|
|
2654
|
-
|
|
2875
|
+
token: t.Optional[str] = None,
|
|
2655
2876
|
error_trace: t.Optional[bool] = None,
|
|
2656
2877
|
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
2657
2878
|
human: t.Optional[bool] = None,
|
|
@@ -2660,23 +2881,22 @@ class SecurityClient(NamespacedClient):
|
|
|
2660
2881
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
2661
2882
|
) -> ObjectApiResponse[t.Any]:
|
|
2662
2883
|
"""
|
|
2663
|
-
|
|
2664
|
-
were generated as a response to the `/_security/oidc/authenticate` API. If the
|
|
2665
|
-
OpenID Connect authentication realm in Elasticsearch is accordingly configured,
|
|
2666
|
-
the response to this call will contain a URI pointing to the end session endpoint
|
|
2667
|
-
of the OpenID Connect Provider in order to perform single logout. Elasticsearch
|
|
2668
|
-
exposes all the necessary OpenID Connect related functionality with the OpenID
|
|
2669
|
-
Connect APIs. These APIs are used internally by Kibana in order to provide OpenID
|
|
2670
|
-
Connect based authentication, but can also be used by other, custom web applications
|
|
2671
|
-
or other clients.
|
|
2884
|
+
.. raw:: html
|
|
2672
2885
|
|
|
2673
|
-
|
|
2886
|
+
<p>Logout of OpenID Connect.</p>
|
|
2887
|
+
<p>Invalidate an access token and a refresh token that were generated as a response to the <code>/_security/oidc/authenticate</code> API.</p>
|
|
2888
|
+
<p>If the OpenID Connect authentication realm in Elasticsearch is accordingly configured, the response to this call will contain a URI pointing to the end session endpoint of the OpenID Connect Provider in order to perform single logout.</p>
|
|
2889
|
+
<p>Elasticsearch exposes all the necessary OpenID Connect related functionality with the OpenID Connect APIs.
|
|
2890
|
+
These APIs are used internally by Kibana in order to provide OpenID Connect based authentication, but can also be used by other, custom web applications or other clients.</p>
|
|
2674
2891
|
|
|
2675
|
-
|
|
2892
|
+
|
|
2893
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-security-oidc-logout>`_
|
|
2894
|
+
|
|
2895
|
+
:param token: The access token to be invalidated.
|
|
2676
2896
|
:param refresh_token: The refresh token to be invalidated.
|
|
2677
2897
|
"""
|
|
2678
|
-
if
|
|
2679
|
-
raise ValueError("Empty value passed for parameter '
|
|
2898
|
+
if token is None and body is None:
|
|
2899
|
+
raise ValueError("Empty value passed for parameter 'token'")
|
|
2680
2900
|
__path_parts: t.Dict[str, str] = {}
|
|
2681
2901
|
__path = "/_security/oidc/logout"
|
|
2682
2902
|
__query: t.Dict[str, t.Any] = {}
|
|
@@ -2690,8 +2910,8 @@ class SecurityClient(NamespacedClient):
|
|
|
2690
2910
|
if pretty is not None:
|
|
2691
2911
|
__query["pretty"] = pretty
|
|
2692
2912
|
if not __body:
|
|
2693
|
-
if
|
|
2694
|
-
__body["
|
|
2913
|
+
if token is not None:
|
|
2914
|
+
__body["token"] = token
|
|
2695
2915
|
if refresh_token is not None:
|
|
2696
2916
|
__body["refresh_token"] = refresh_token
|
|
2697
2917
|
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
@@ -2723,17 +2943,16 @@ class SecurityClient(NamespacedClient):
|
|
|
2723
2943
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
2724
2944
|
) -> ObjectApiResponse[t.Any]:
|
|
2725
2945
|
"""
|
|
2726
|
-
|
|
2727
|
-
as a URL string based on the configuration of the OpenID Connect authentication
|
|
2728
|
-
realm in Elasticsearch. The response of this API is a URL pointing to the Authorization
|
|
2729
|
-
Endpoint of the configured OpenID Connect Provider, which can be used to redirect
|
|
2730
|
-
the browser of the user in order to continue the authentication process. Elasticsearch
|
|
2731
|
-
exposes all the necessary OpenID Connect related functionality with the OpenID
|
|
2732
|
-
Connect APIs. These APIs are used internally by Kibana in order to provide OpenID
|
|
2733
|
-
Connect based authentication, but can also be used by other, custom web applications
|
|
2734
|
-
or other clients.
|
|
2946
|
+
.. raw:: html
|
|
2735
2947
|
|
|
2736
|
-
|
|
2948
|
+
<p>Prepare OpenID connect authentication.</p>
|
|
2949
|
+
<p>Create an oAuth 2.0 authentication request as a URL string based on the configuration of the OpenID Connect authentication realm in Elasticsearch.</p>
|
|
2950
|
+
<p>The response of this API is a URL pointing to the Authorization Endpoint of the configured OpenID Connect Provider, which can be used to redirect the browser of the user in order to continue the authentication process.</p>
|
|
2951
|
+
<p>Elasticsearch exposes all the necessary OpenID Connect related functionality with the OpenID Connect APIs.
|
|
2952
|
+
These APIs are used internally by Kibana in order to provide OpenID Connect based authentication, but can also be used by other, custom web applications or other clients.</p>
|
|
2953
|
+
|
|
2954
|
+
|
|
2955
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-security-oidc-prepare-authentication>`_
|
|
2737
2956
|
|
|
2738
2957
|
:param iss: In the case of a third party initiated single sign on, this is the
|
|
2739
2958
|
issuer identifier for the OP that the RP is to send the authentication request
|
|
@@ -2808,9 +3027,28 @@ class SecurityClient(NamespacedClient):
|
|
|
2808
3027
|
] = None,
|
|
2809
3028
|
) -> ObjectApiResponse[t.Any]:
|
|
2810
3029
|
"""
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
3030
|
+
.. raw:: html
|
|
3031
|
+
|
|
3032
|
+
<p>Create or update application privileges.</p>
|
|
3033
|
+
<p>To use this API, you must have one of the following privileges:</p>
|
|
3034
|
+
<ul>
|
|
3035
|
+
<li>The <code>manage_security</code> cluster privilege (or a greater privilege such as <code>all</code>).</li>
|
|
3036
|
+
<li>The "Manage Application Privileges" global privilege for the application being referenced in the request.</li>
|
|
3037
|
+
</ul>
|
|
3038
|
+
<p>Application names are formed from a prefix, with an optional suffix that conform to the following rules:</p>
|
|
3039
|
+
<ul>
|
|
3040
|
+
<li>The prefix must begin with a lowercase ASCII letter.</li>
|
|
3041
|
+
<li>The prefix must contain only ASCII letters or digits.</li>
|
|
3042
|
+
<li>The prefix must be at least 3 characters long.</li>
|
|
3043
|
+
<li>If the suffix exists, it must begin with either a dash <code>-</code> or <code>_</code>.</li>
|
|
3044
|
+
<li>The suffix cannot contain any of the following characters: <code>\\</code>, <code>/</code>, <code>*</code>, <code>?</code>, <code>"</code>, <code><</code>, <code>></code>, <code>|</code>, <code>,</code>, <code>*</code>.</li>
|
|
3045
|
+
<li>No part of the name can contain whitespace.</li>
|
|
3046
|
+
</ul>
|
|
3047
|
+
<p>Privilege names must begin with a lowercase ASCII letter and must contain only ASCII letters and digits along with the characters <code>_</code>, <code>-</code>, and <code>.</code>.</p>
|
|
3048
|
+
<p>Action names can contain any number of printable ASCII characters and must contain at least one of the following characters: <code>/</code>, <code>*</code>, <code>:</code>.</p>
|
|
3049
|
+
|
|
3050
|
+
|
|
3051
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-security-put-privileges>`_
|
|
2814
3052
|
|
|
2815
3053
|
:param privileges:
|
|
2816
3054
|
:param refresh: If `true` (the default) then refresh the affected shards to make
|
|
@@ -2954,14 +3192,20 @@ class SecurityClient(NamespacedClient):
|
|
|
2954
3192
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
2955
3193
|
) -> ObjectApiResponse[t.Any]:
|
|
2956
3194
|
"""
|
|
2957
|
-
|
|
2958
|
-
way to manage roles in the native realm, rather than using file-based role management.
|
|
2959
|
-
The create or update roles API cannot update roles that are defined in roles
|
|
2960
|
-
files. File-based role management is not available in Elastic Serverless.
|
|
3195
|
+
.. raw:: html
|
|
2961
3196
|
|
|
2962
|
-
|
|
3197
|
+
<p>Create or update roles.</p>
|
|
3198
|
+
<p>The role management APIs are generally the preferred way to manage roles in the native realm, rather than using file-based role management.
|
|
3199
|
+
The create or update roles API cannot update roles that are defined in roles files.
|
|
3200
|
+
File-based role management is not available in Elastic Serverless.</p>
|
|
2963
3201
|
|
|
2964
|
-
|
|
3202
|
+
|
|
3203
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-security-put-role>`_
|
|
3204
|
+
|
|
3205
|
+
:param name: The name of the role that is being created or updated. On Elasticsearch
|
|
3206
|
+
Serverless, the role name must begin with a letter or digit and can only
|
|
3207
|
+
contain letters, digits and the characters '_', '-', and '.'. Each role must
|
|
3208
|
+
have a unique name, as this will serve as the identifier for that role.
|
|
2965
3209
|
:param applications: A list of application privilege entries.
|
|
2966
3210
|
:param cluster: A list of cluster privileges. These privileges define the cluster-level
|
|
2967
3211
|
actions for users with this role.
|
|
@@ -2976,7 +3220,10 @@ class SecurityClient(NamespacedClient):
|
|
|
2976
3220
|
this operation visible to search, if `wait_for` then wait for a refresh to
|
|
2977
3221
|
make this operation visible to search, if `false` then do nothing with refreshes.
|
|
2978
3222
|
:param remote_cluster: A list of remote cluster permissions entries.
|
|
2979
|
-
:param remote_indices: A list of remote indices permissions entries.
|
|
3223
|
+
:param remote_indices: A list of remote indices permissions entries. NOTE: Remote
|
|
3224
|
+
indices are effective for remote clusters configured with the API key based
|
|
3225
|
+
model. They have no effect for remote clusters configured with the certificate
|
|
3226
|
+
based model.
|
|
2980
3227
|
:param run_as: A list of users that the owners of this role can impersonate.
|
|
2981
3228
|
*Note*: in Serverless, the run-as feature is disabled. For API compatibility,
|
|
2982
3229
|
you can still specify an empty `run_as` field, but a non-empty list will
|
|
@@ -3066,26 +3313,48 @@ class SecurityClient(NamespacedClient):
|
|
|
3066
3313
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
3067
3314
|
) -> ObjectApiResponse[t.Any]:
|
|
3068
3315
|
"""
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
|
|
3076
|
-
|
|
3316
|
+
.. raw:: html
|
|
3317
|
+
|
|
3318
|
+
<p>Create or update role mappings.</p>
|
|
3319
|
+
<p>Role mappings define which roles are assigned to each user.
|
|
3320
|
+
Each mapping has rules that identify users and a list of roles that are granted to those users.
|
|
3321
|
+
The role mapping APIs are generally the preferred way to manage role mappings rather than using role mapping files. The create or update role mappings API cannot update role mappings that are defined in role mapping files.</p>
|
|
3322
|
+
<p>NOTE: This API does not create roles. Rather, it maps users to existing roles.
|
|
3323
|
+
Roles can be created by using the create or update roles API or roles files.</p>
|
|
3324
|
+
<p><strong>Role templates</strong></p>
|
|
3325
|
+
<p>The most common use for role mappings is to create a mapping from a known value on the user to a fixed role name.
|
|
3326
|
+
For example, all users in the <code>cn=admin,dc=example,dc=com</code> LDAP group should be given the superuser role in Elasticsearch.
|
|
3327
|
+
The <code>roles</code> field is used for this purpose.</p>
|
|
3328
|
+
<p>For more complex needs, it is possible to use Mustache templates to dynamically determine the names of the roles that should be granted to the user.
|
|
3329
|
+
The <code>role_templates</code> field is used for this purpose.</p>
|
|
3330
|
+
<p>NOTE: To use role templates successfully, the relevant scripting feature must be enabled.
|
|
3331
|
+
Otherwise, all attempts to create a role mapping with role templates fail.</p>
|
|
3332
|
+
<p>All of the user fields that are available in the role mapping rules are also available in the role templates.
|
|
3333
|
+
Thus it is possible to assign a user to a role that reflects their username, their groups, or the name of the realm to which they authenticated.</p>
|
|
3334
|
+
<p>By default a template is evaluated to produce a single string that is the name of the role which should be assigned to the user.
|
|
3335
|
+
If the format of the template is set to "json" then the template is expected to produce a JSON string or an array of JSON strings for the role names.</p>
|
|
3336
|
+
|
|
3337
|
+
|
|
3338
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-security-put-role-mapping>`_
|
|
3077
3339
|
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
:param enabled:
|
|
3082
|
-
|
|
3340
|
+
:param name: The distinct name that identifies the role mapping. The name is
|
|
3341
|
+
used solely as an identifier to facilitate interaction via the API; it does
|
|
3342
|
+
not affect the behavior of the mapping in any way.
|
|
3343
|
+
:param enabled: Mappings that have `enabled` set to `false` are ignored when
|
|
3344
|
+
role mapping is performed.
|
|
3345
|
+
:param metadata: Additional metadata that helps define which roles are assigned
|
|
3346
|
+
to each user. Within the metadata object, keys beginning with `_` are reserved
|
|
3347
|
+
for system usage.
|
|
3083
3348
|
:param refresh: If `true` (the default) then refresh the affected shards to make
|
|
3084
3349
|
this operation visible to search, if `wait_for` then wait for a refresh to
|
|
3085
3350
|
make this operation visible to search, if `false` then do nothing with refreshes.
|
|
3086
|
-
:param role_templates:
|
|
3087
|
-
|
|
3088
|
-
|
|
3351
|
+
:param role_templates: A list of Mustache templates that will be evaluated to
|
|
3352
|
+
determine the roles names that should granted to the users that match the
|
|
3353
|
+
role mapping rules. Exactly one of `roles` or `role_templates` must be specified.
|
|
3354
|
+
:param roles: A list of role names that are granted to the users that match the
|
|
3355
|
+
role mapping rules. Exactly one of `roles` or `role_templates` must be specified.
|
|
3356
|
+
:param rules: The rules that determine which users should be matched by the mapping.
|
|
3357
|
+
A rule is a logical condition that is expressed by using a JSON DSL.
|
|
3089
3358
|
:param run_as:
|
|
3090
3359
|
"""
|
|
3091
3360
|
if name in SKIP_IN_PATH:
|
|
@@ -3160,23 +3429,41 @@ class SecurityClient(NamespacedClient):
|
|
|
3160
3429
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
3161
3430
|
) -> ObjectApiResponse[t.Any]:
|
|
3162
3431
|
"""
|
|
3163
|
-
|
|
3164
|
-
|
|
3165
|
-
|
|
3166
|
-
|
|
3167
|
-
|
|
3168
|
-
|
|
3169
|
-
|
|
3170
|
-
|
|
3171
|
-
|
|
3172
|
-
|
|
3173
|
-
:param
|
|
3174
|
-
|
|
3175
|
-
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
:param
|
|
3432
|
+
.. raw:: html
|
|
3433
|
+
|
|
3434
|
+
<p>Create or update users.</p>
|
|
3435
|
+
<p>Add and update users in the native realm.
|
|
3436
|
+
A password is required for adding a new user but is optional when updating an existing user.
|
|
3437
|
+
To change a user's password without updating any other fields, use the change password API.</p>
|
|
3438
|
+
|
|
3439
|
+
|
|
3440
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-security-put-user>`_
|
|
3441
|
+
|
|
3442
|
+
:param username: An identifier for the user. NOTE: Usernames must be at least
|
|
3443
|
+
1 and no more than 507 characters. They can contain alphanumeric characters
|
|
3444
|
+
(a-z, A-Z, 0-9), spaces, punctuation, and printable symbols in the Basic
|
|
3445
|
+
Latin (ASCII) block. Leading or trailing whitespace is not allowed.
|
|
3446
|
+
:param email: The email of the user.
|
|
3447
|
+
:param enabled: Specifies whether the user is enabled.
|
|
3448
|
+
:param full_name: The full name of the user.
|
|
3449
|
+
:param metadata: Arbitrary metadata that you want to associate with the user.
|
|
3450
|
+
:param password: The user's password. Passwords must be at least 6 characters
|
|
3451
|
+
long. When adding a user, one of `password` or `password_hash` is required.
|
|
3452
|
+
When updating an existing user, the password is optional, so that other fields
|
|
3453
|
+
on the user (such as their roles) may be updated without modifying the user's
|
|
3454
|
+
password
|
|
3455
|
+
:param password_hash: A hash of the user's password. This must be produced using
|
|
3456
|
+
the same hashing algorithm as has been configured for password storage. For
|
|
3457
|
+
more details, see the explanation of the `xpack.security.authc.password_hashing.algorithm`
|
|
3458
|
+
setting in the user cache and password hash algorithm documentation. Using
|
|
3459
|
+
this parameter allows the client to pre-hash the password for performance
|
|
3460
|
+
and/or confidentiality reasons. The `password` parameter and the `password_hash`
|
|
3461
|
+
parameter cannot be used in the same request.
|
|
3462
|
+
:param refresh: Valid values are `true`, `false`, and `wait_for`. These values
|
|
3463
|
+
have the same meaning as in the index API, but the default value for this
|
|
3464
|
+
API is true.
|
|
3465
|
+
:param roles: A set of roles the user has. The roles determine the user's access
|
|
3466
|
+
permissions. To create a user without any roles, specify an empty list (`[]`).
|
|
3180
3467
|
"""
|
|
3181
3468
|
if username in SKIP_IN_PATH:
|
|
3182
3469
|
raise ValueError("Empty value passed for parameter 'username'")
|
|
@@ -3244,7 +3531,7 @@ class SecurityClient(NamespacedClient):
|
|
|
3244
3531
|
pretty: t.Optional[bool] = None,
|
|
3245
3532
|
query: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
3246
3533
|
search_after: t.Optional[
|
|
3247
|
-
t.Sequence[t.Union[None, bool, float, int, str
|
|
3534
|
+
t.Sequence[t.Union[None, bool, float, int, str]]
|
|
3248
3535
|
] = None,
|
|
3249
3536
|
size: t.Optional[int] = None,
|
|
3250
3537
|
sort: t.Optional[
|
|
@@ -3259,10 +3546,17 @@ class SecurityClient(NamespacedClient):
|
|
|
3259
3546
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
3260
3547
|
) -> ObjectApiResponse[t.Any]:
|
|
3261
3548
|
"""
|
|
3262
|
-
|
|
3263
|
-
You can optionally filter the results with a query.
|
|
3549
|
+
.. raw:: html
|
|
3264
3550
|
|
|
3265
|
-
|
|
3551
|
+
<p>Find API keys with a query.</p>
|
|
3552
|
+
<p>Get a paginated list of API keys and their information.
|
|
3553
|
+
You can optionally filter the results with a query.</p>
|
|
3554
|
+
<p>To use this API, you must have at least the <code>manage_own_api_key</code> or the <code>read_security</code> cluster privileges.
|
|
3555
|
+
If you have only the <code>manage_own_api_key</code> privilege, this API returns only the API keys that you own.
|
|
3556
|
+
If you have the <code>read_security</code>, <code>manage_api_key</code>, or greater privileges (including <code>manage_security</code>), this API returns all API keys regardless of ownership.</p>
|
|
3557
|
+
|
|
3558
|
+
|
|
3559
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-security-query-api-keys>`_
|
|
3266
3560
|
|
|
3267
3561
|
:param aggregations: Any aggregations to run over the corpus of returned API
|
|
3268
3562
|
keys. Aggregations and queries work together. Aggregations are computed only
|
|
@@ -3276,30 +3570,39 @@ class SecurityClient(NamespacedClient):
|
|
|
3276
3570
|
`terms`, `range`, `date_range`, `missing`, `cardinality`, `value_count`,
|
|
3277
3571
|
`composite`, `filter`, and `filters`. Additionally, aggregations only run
|
|
3278
3572
|
over the same subset of fields that query works with.
|
|
3279
|
-
:param from_:
|
|
3280
|
-
than 10,000 hits using the from and size
|
|
3281
|
-
hits, use the `search_after` parameter.
|
|
3573
|
+
:param from_: The starting document offset. It must not be negative. By default,
|
|
3574
|
+
you cannot page through more than 10,000 hits using the `from` and `size`
|
|
3575
|
+
parameters. To page through more hits, use the `search_after` parameter.
|
|
3282
3576
|
:param query: A query to filter which API keys to return. If the query parameter
|
|
3283
3577
|
is missing, it is equivalent to a `match_all` query. The query supports a
|
|
3284
3578
|
subset of query types, including `match_all`, `bool`, `term`, `terms`, `match`,
|
|
3285
3579
|
`ids`, `prefix`, `wildcard`, `exists`, `range`, and `simple_query_string`.
|
|
3286
3580
|
You can query the following public information associated with an API key:
|
|
3287
3581
|
`id`, `type`, `name`, `creation`, `expiration`, `invalidated`, `invalidation`,
|
|
3288
|
-
`username`, `realm`, and `metadata`.
|
|
3289
|
-
|
|
3290
|
-
|
|
3291
|
-
|
|
3292
|
-
|
|
3293
|
-
:param
|
|
3294
|
-
|
|
3295
|
-
|
|
3582
|
+
`username`, `realm`, and `metadata`. NOTE: The queryable string values associated
|
|
3583
|
+
with API keys are internally mapped as keywords. Consequently, if no `analyzer`
|
|
3584
|
+
parameter is specified for a `match` query, then the provided match query
|
|
3585
|
+
string is interpreted as a single keyword value. Such a match query is hence
|
|
3586
|
+
equivalent to a `term` query.
|
|
3587
|
+
:param search_after: The search after definition.
|
|
3588
|
+
:param size: The number of hits to return. It must not be negative. The `size`
|
|
3589
|
+
parameter can be set to `0`, in which case no API key matches are returned,
|
|
3590
|
+
only the aggregation results. By default, you cannot page through more than
|
|
3591
|
+
10,000 hits using the `from` and `size` parameters. To page through more
|
|
3592
|
+
hits, use the `search_after` parameter.
|
|
3593
|
+
:param sort: The sort definition. Other than `id`, all public fields of an API
|
|
3594
|
+
key are eligible for sorting. In addition, sort can also be applied to the
|
|
3595
|
+
`_doc` field to sort by index order.
|
|
3296
3596
|
:param typed_keys: Determines whether aggregation names are prefixed by their
|
|
3297
3597
|
respective types in the response.
|
|
3298
3598
|
:param with_limited_by: Return the snapshot of the owner user's role descriptors
|
|
3299
3599
|
associated with the API key. An API key's actual permission is the intersection
|
|
3300
|
-
of its assigned role descriptors and the owner user's role descriptors
|
|
3301
|
-
|
|
3302
|
-
|
|
3600
|
+
of its assigned role descriptors and the owner user's role descriptors (effectively
|
|
3601
|
+
limited by it). An API key cannot retrieve any API key’s limited-by role
|
|
3602
|
+
descriptors (including itself) unless it has `manage_api_key` or higher privileges.
|
|
3603
|
+
:param with_profile_uid: Determines whether to also retrieve the profile UID
|
|
3604
|
+
for the API key owner principal. If it exists, the profile UID is returned
|
|
3605
|
+
under the `profile_uid` response field for each API key.
|
|
3303
3606
|
"""
|
|
3304
3607
|
__path_parts: t.Dict[str, str] = {}
|
|
3305
3608
|
__path = "/_security/_query/api_key"
|
|
@@ -3374,7 +3677,7 @@ class SecurityClient(NamespacedClient):
|
|
|
3374
3677
|
pretty: t.Optional[bool] = None,
|
|
3375
3678
|
query: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
3376
3679
|
search_after: t.Optional[
|
|
3377
|
-
t.Sequence[t.Union[None, bool, float, int, str
|
|
3680
|
+
t.Sequence[t.Union[None, bool, float, int, str]]
|
|
3378
3681
|
] = None,
|
|
3379
3682
|
size: t.Optional[int] = None,
|
|
3380
3683
|
sort: t.Optional[
|
|
@@ -3386,26 +3689,34 @@ class SecurityClient(NamespacedClient):
|
|
|
3386
3689
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
3387
3690
|
) -> ObjectApiResponse[t.Any]:
|
|
3388
3691
|
"""
|
|
3389
|
-
|
|
3390
|
-
filter the results with a query.
|
|
3692
|
+
.. raw:: html
|
|
3391
3693
|
|
|
3392
|
-
|
|
3694
|
+
<p>Find roles with a query.</p>
|
|
3695
|
+
<p>Get roles in a paginated manner.
|
|
3696
|
+
The role management APIs are generally the preferred way to manage roles, rather than using file-based role management.
|
|
3697
|
+
The query roles API does not retrieve roles that are defined in roles files, nor built-in ones.
|
|
3698
|
+
You can optionally filter the results with a query.
|
|
3699
|
+
Also, the results can be paginated and sorted.</p>
|
|
3393
3700
|
|
|
3394
|
-
|
|
3395
|
-
|
|
3396
|
-
|
|
3701
|
+
|
|
3702
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-security-query-role>`_
|
|
3703
|
+
|
|
3704
|
+
:param from_: The starting document offset. It must not be negative. By default,
|
|
3705
|
+
you cannot page through more than 10,000 hits using the `from` and `size`
|
|
3706
|
+
parameters. To page through more hits, use the `search_after` parameter.
|
|
3397
3707
|
:param query: A query to filter which roles to return. If the query parameter
|
|
3398
3708
|
is missing, it is equivalent to a `match_all` query. The query supports a
|
|
3399
3709
|
subset of query types, including `match_all`, `bool`, `term`, `terms`, `match`,
|
|
3400
3710
|
`ids`, `prefix`, `wildcard`, `exists`, `range`, and `simple_query_string`.
|
|
3401
3711
|
You can query the following information associated with roles: `name`, `description`,
|
|
3402
|
-
`metadata`, `applications.application`, `applications.privileges`, `applications.resources`.
|
|
3403
|
-
:param search_after:
|
|
3404
|
-
:param size: The number of hits to return.
|
|
3405
|
-
more than 10,000 hits using the `from` and `size`
|
|
3406
|
-
more hits, use the `search_after` parameter.
|
|
3407
|
-
:param sort:
|
|
3408
|
-
sort can also be applied to the `_doc` field to sort by index
|
|
3712
|
+
`metadata`, `applications.application`, `applications.privileges`, and `applications.resources`.
|
|
3713
|
+
:param search_after: The search after definition.
|
|
3714
|
+
:param size: The number of hits to return. It must not be negative. By default,
|
|
3715
|
+
you cannot page through more than 10,000 hits using the `from` and `size`
|
|
3716
|
+
parameters. To page through more hits, use the `search_after` parameter.
|
|
3717
|
+
:param sort: The sort definition. You can sort on `username`, `roles`, or `enabled`.
|
|
3718
|
+
In addition, sort can also be applied to the `_doc` field to sort by index
|
|
3719
|
+
order.
|
|
3409
3720
|
"""
|
|
3410
3721
|
__path_parts: t.Dict[str, str] = {}
|
|
3411
3722
|
__path = "/_security/_query/role"
|
|
@@ -3459,7 +3770,7 @@ class SecurityClient(NamespacedClient):
|
|
|
3459
3770
|
pretty: t.Optional[bool] = None,
|
|
3460
3771
|
query: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
3461
3772
|
search_after: t.Optional[
|
|
3462
|
-
t.Sequence[t.Union[None, bool, float, int, str
|
|
3773
|
+
t.Sequence[t.Union[None, bool, float, int, str]]
|
|
3463
3774
|
] = None,
|
|
3464
3775
|
size: t.Optional[int] = None,
|
|
3465
3776
|
sort: t.Optional[
|
|
@@ -3472,28 +3783,35 @@ class SecurityClient(NamespacedClient):
|
|
|
3472
3783
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
3473
3784
|
) -> ObjectApiResponse[t.Any]:
|
|
3474
3785
|
"""
|
|
3475
|
-
|
|
3476
|
-
can optionally filter the results with a query.
|
|
3786
|
+
.. raw:: html
|
|
3477
3787
|
|
|
3478
|
-
|
|
3788
|
+
<p>Find users with a query.</p>
|
|
3789
|
+
<p>Get information for users in a paginated manner.
|
|
3790
|
+
You can optionally filter the results with a query.</p>
|
|
3791
|
+
<p>NOTE: As opposed to the get user API, built-in users are excluded from the result.
|
|
3792
|
+
This API is only for native users.</p>
|
|
3479
3793
|
|
|
3480
|
-
|
|
3481
|
-
|
|
3482
|
-
|
|
3794
|
+
|
|
3795
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-security-query-user>`_
|
|
3796
|
+
|
|
3797
|
+
:param from_: The starting document offset. It must not be negative. By default,
|
|
3798
|
+
you cannot page through more than 10,000 hits using the `from` and `size`
|
|
3799
|
+
parameters. To page through more hits, use the `search_after` parameter.
|
|
3483
3800
|
:param query: A query to filter which users to return. If the query parameter
|
|
3484
3801
|
is missing, it is equivalent to a `match_all` query. The query supports a
|
|
3485
3802
|
subset of query types, including `match_all`, `bool`, `term`, `terms`, `match`,
|
|
3486
3803
|
`ids`, `prefix`, `wildcard`, `exists`, `range`, and `simple_query_string`.
|
|
3487
3804
|
You can query the following information associated with user: `username`,
|
|
3488
|
-
`roles`, `enabled`
|
|
3489
|
-
:param search_after:
|
|
3490
|
-
:param size: The number of hits to return.
|
|
3491
|
-
more than 10,000 hits using the `from` and `size`
|
|
3492
|
-
more hits, use the `search_after` parameter.
|
|
3493
|
-
:param sort: Fields eligible for sorting are: username
|
|
3494
|
-
sort can also be applied to the `_doc` field
|
|
3495
|
-
|
|
3496
|
-
|
|
3805
|
+
`roles`, `enabled`, `full_name`, and `email`.
|
|
3806
|
+
:param search_after: The search after definition
|
|
3807
|
+
:param size: The number of hits to return. It must not be negative. By default,
|
|
3808
|
+
you cannot page through more than 10,000 hits using the `from` and `size`
|
|
3809
|
+
parameters. To page through more hits, use the `search_after` parameter.
|
|
3810
|
+
:param sort: The sort definition. Fields eligible for sorting are: `username`,
|
|
3811
|
+
`roles`, `enabled`. In addition, sort can also be applied to the `_doc` field
|
|
3812
|
+
to sort by index order.
|
|
3813
|
+
:param with_profile_uid: Determines whether to retrieve the user profile UID,
|
|
3814
|
+
if it exists, for the users.
|
|
3497
3815
|
"""
|
|
3498
3816
|
__path_parts: t.Dict[str, str] = {}
|
|
3499
3817
|
__path = "/_security/_query/user"
|
|
@@ -3551,21 +3869,23 @@ class SecurityClient(NamespacedClient):
|
|
|
3551
3869
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
3552
3870
|
) -> ObjectApiResponse[t.Any]:
|
|
3553
3871
|
"""
|
|
3554
|
-
|
|
3555
|
-
|
|
3556
|
-
|
|
3557
|
-
|
|
3558
|
-
|
|
3559
|
-
|
|
3560
|
-
|
|
3561
|
-
|
|
3562
|
-
|
|
3563
|
-
|
|
3564
|
-
|
|
3565
|
-
|
|
3566
|
-
|
|
3567
|
-
|
|
3568
|
-
|
|
3872
|
+
.. raw:: html
|
|
3873
|
+
|
|
3874
|
+
<p>Authenticate SAML.</p>
|
|
3875
|
+
<p>Submit a SAML response message to Elasticsearch for consumption.</p>
|
|
3876
|
+
<p>NOTE: This API is intended for use by custom web applications other than Kibana.
|
|
3877
|
+
If you are using Kibana, refer to the documentation for configuring SAML single-sign-on on the Elastic Stack.</p>
|
|
3878
|
+
<p>The SAML message that is submitted can be:</p>
|
|
3879
|
+
<ul>
|
|
3880
|
+
<li>A response to a SAML authentication request that was previously created using the SAML prepare authentication API.</li>
|
|
3881
|
+
<li>An unsolicited SAML message in the case of an IdP-initiated single sign-on (SSO) flow.</li>
|
|
3882
|
+
</ul>
|
|
3883
|
+
<p>In either case, the SAML message needs to be a base64 encoded XML document with a root element of <code><Response></code>.</p>
|
|
3884
|
+
<p>After successful validation, Elasticsearch responds with an Elasticsearch internal access token and refresh token that can be subsequently used for authentication.
|
|
3885
|
+
This API endpoint essentially exchanges SAML responses that indicate successful authentication in the IdP for Elasticsearch access and refresh tokens, which can be used for authentication against Elasticsearch.</p>
|
|
3886
|
+
|
|
3887
|
+
|
|
3888
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-security-saml-authenticate>`_
|
|
3569
3889
|
|
|
3570
3890
|
:param content: The SAML response as it was sent by the user's browser, usually
|
|
3571
3891
|
a Base64 encoded XML document.
|
|
@@ -3625,18 +3945,20 @@ class SecurityClient(NamespacedClient):
|
|
|
3625
3945
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
3626
3946
|
) -> ObjectApiResponse[t.Any]:
|
|
3627
3947
|
"""
|
|
3628
|
-
|
|
3629
|
-
|
|
3630
|
-
|
|
3631
|
-
|
|
3632
|
-
|
|
3633
|
-
|
|
3634
|
-
|
|
3635
|
-
|
|
3636
|
-
|
|
3637
|
-
|
|
3948
|
+
.. raw:: html
|
|
3949
|
+
|
|
3950
|
+
<p>Logout of SAML completely.</p>
|
|
3951
|
+
<p>Verifies the logout response sent from the SAML IdP.</p>
|
|
3952
|
+
<p>NOTE: This API is intended for use by custom web applications other than Kibana.
|
|
3953
|
+
If you are using Kibana, refer to the documentation for configuring SAML single-sign-on on the Elastic Stack.</p>
|
|
3954
|
+
<p>The SAML IdP may send a logout response back to the SP after handling the SP-initiated SAML Single Logout.
|
|
3955
|
+
This API verifies the response by ensuring the content is relevant and validating its signature.
|
|
3956
|
+
An empty response is returned if the verification process is successful.
|
|
3957
|
+
The response can be sent by the IdP with either the HTTP-Redirect or the HTTP-Post binding.
|
|
3958
|
+
The caller of this API must prepare the request accordingly so that this API can handle either of them.</p>
|
|
3638
3959
|
|
|
3639
|
-
|
|
3960
|
+
|
|
3961
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-security-saml-complete-logout>`_
|
|
3640
3962
|
|
|
3641
3963
|
:param ids: A JSON array with all the valid SAML Request Ids that the caller
|
|
3642
3964
|
of the API has for the current user.
|
|
@@ -3700,17 +4022,19 @@ class SecurityClient(NamespacedClient):
|
|
|
3700
4022
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
3701
4023
|
) -> ObjectApiResponse[t.Any]:
|
|
3702
4024
|
"""
|
|
3703
|
-
|
|
3704
|
-
|
|
3705
|
-
|
|
3706
|
-
|
|
3707
|
-
|
|
3708
|
-
|
|
3709
|
-
|
|
3710
|
-
|
|
3711
|
-
|
|
4025
|
+
.. raw:: html
|
|
4026
|
+
|
|
4027
|
+
<p>Invalidate SAML.</p>
|
|
4028
|
+
<p>Submit a SAML LogoutRequest message to Elasticsearch for consumption.</p>
|
|
4029
|
+
<p>NOTE: This API is intended for use by custom web applications other than Kibana.
|
|
4030
|
+
If you are using Kibana, refer to the documentation for configuring SAML single-sign-on on the Elastic Stack.</p>
|
|
4031
|
+
<p>The logout request comes from the SAML IdP during an IdP initiated Single Logout.
|
|
4032
|
+
The custom web application can use this API to have Elasticsearch process the <code>LogoutRequest</code>.
|
|
4033
|
+
After successful validation of the request, Elasticsearch invalidates the access token and refresh token that corresponds to that specific SAML principal and provides a URL that contains a SAML LogoutResponse message.
|
|
4034
|
+
Thus the user can be redirected back to their IdP.</p>
|
|
3712
4035
|
|
|
3713
|
-
|
|
4036
|
+
|
|
4037
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-security-saml-invalidate>`_
|
|
3714
4038
|
|
|
3715
4039
|
:param query_string: The query part of the URL that the user was redirected to
|
|
3716
4040
|
by the SAML IdP to initiate the Single Logout. This query should include
|
|
@@ -3775,16 +4099,17 @@ class SecurityClient(NamespacedClient):
|
|
|
3775
4099
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
3776
4100
|
) -> ObjectApiResponse[t.Any]:
|
|
3777
4101
|
"""
|
|
3778
|
-
|
|
3779
|
-
|
|
3780
|
-
|
|
3781
|
-
|
|
3782
|
-
|
|
3783
|
-
|
|
3784
|
-
|
|
3785
|
-
|
|
4102
|
+
.. raw:: html
|
|
4103
|
+
|
|
4104
|
+
<p>Logout of SAML.</p>
|
|
4105
|
+
<p>Submits a request to invalidate an access token and refresh token.</p>
|
|
4106
|
+
<p>NOTE: This API is intended for use by custom web applications other than Kibana.
|
|
4107
|
+
If you are using Kibana, refer to the documentation for configuring SAML single-sign-on on the Elastic Stack.</p>
|
|
4108
|
+
<p>This API invalidates the tokens that were generated for a user by the SAML authenticate API.
|
|
4109
|
+
If the SAML realm in Elasticsearch is configured accordingly and the SAML IdP supports this, the Elasticsearch response contains a URL to redirect the user to the IdP that contains a SAML logout request (starting an SP-initiated SAML Single Logout).</p>
|
|
4110
|
+
|
|
3786
4111
|
|
|
3787
|
-
`<https://www.elastic.co/
|
|
4112
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-security-saml-logout>`_
|
|
3788
4113
|
|
|
3789
4114
|
:param token: The access token that was returned as a response to calling the
|
|
3790
4115
|
SAML authenticate API. Alternatively, the most recent token that was received
|
|
@@ -3839,22 +4164,22 @@ class SecurityClient(NamespacedClient):
|
|
|
3839
4164
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
3840
4165
|
) -> ObjectApiResponse[t.Any]:
|
|
3841
4166
|
"""
|
|
3842
|
-
|
|
3843
|
-
|
|
3844
|
-
|
|
3845
|
-
|
|
3846
|
-
|
|
3847
|
-
|
|
3848
|
-
|
|
3849
|
-
|
|
3850
|
-
|
|
3851
|
-
|
|
3852
|
-
|
|
3853
|
-
|
|
3854
|
-
|
|
3855
|
-
|
|
3856
|
-
|
|
3857
|
-
`<https://www.elastic.co/
|
|
4167
|
+
.. raw:: html
|
|
4168
|
+
|
|
4169
|
+
<p>Prepare SAML authentication.</p>
|
|
4170
|
+
<p>Create a SAML authentication request (<code><AuthnRequest></code>) as a URL string based on the configuration of the respective SAML realm in Elasticsearch.</p>
|
|
4171
|
+
<p>NOTE: This API is intended for use by custom web applications other than Kibana.
|
|
4172
|
+
If you are using Kibana, refer to the documentation for configuring SAML single-sign-on on the Elastic Stack.</p>
|
|
4173
|
+
<p>This API returns a URL pointing to the SAML Identity Provider.
|
|
4174
|
+
You can use the URL to redirect the browser of the user in order to continue the authentication process.
|
|
4175
|
+
The URL includes a single parameter named <code>SAMLRequest</code>, which contains a SAML Authentication request that is deflated and Base64 encoded.
|
|
4176
|
+
If the configuration dictates that SAML authentication requests should be signed, the URL has two extra parameters named <code>SigAlg</code> and <code>Signature</code>.
|
|
4177
|
+
These parameters contain the algorithm used for the signature and the signature value itself.
|
|
4178
|
+
It also returns a random string that uniquely identifies this SAML Authentication request.
|
|
4179
|
+
The caller of this API needs to store this identifier as it needs to be used in a following step of the authentication process.</p>
|
|
4180
|
+
|
|
4181
|
+
|
|
4182
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-security-saml-prepare-authentication>`_
|
|
3858
4183
|
|
|
3859
4184
|
:param acs: The Assertion Consumer Service URL that matches the one of the SAML
|
|
3860
4185
|
realms in Elasticsearch. The realm is used to generate the authentication
|
|
@@ -3907,13 +4232,15 @@ class SecurityClient(NamespacedClient):
|
|
|
3907
4232
|
pretty: t.Optional[bool] = None,
|
|
3908
4233
|
) -> ObjectApiResponse[t.Any]:
|
|
3909
4234
|
"""
|
|
3910
|
-
|
|
3911
|
-
Service Provider. The SAML 2.0 specification provides a mechanism for Service
|
|
3912
|
-
Providers to describe their capabilities and configuration using a metadata file.
|
|
3913
|
-
This API generates Service Provider metadata based on the configuration of a
|
|
3914
|
-
SAML realm in Elasticsearch.
|
|
4235
|
+
.. raw:: html
|
|
3915
4236
|
|
|
3916
|
-
|
|
4237
|
+
<p>Create SAML service provider metadata.</p>
|
|
4238
|
+
<p>Generate SAML metadata for a SAML 2.0 Service Provider.</p>
|
|
4239
|
+
<p>The SAML 2.0 specification provides a mechanism for Service Providers to describe their capabilities and configuration using a metadata file.
|
|
4240
|
+
This API generates Service Provider metadata based on the configuration of a SAML realm in Elasticsearch.</p>
|
|
4241
|
+
|
|
4242
|
+
|
|
4243
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-security-saml-service-provider-metadata>`_
|
|
3917
4244
|
|
|
3918
4245
|
:param realm_name: The name of the SAML realm in Elasticsearch.
|
|
3919
4246
|
"""
|
|
@@ -3957,14 +4284,16 @@ class SecurityClient(NamespacedClient):
|
|
|
3957
4284
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
3958
4285
|
) -> ObjectApiResponse[t.Any]:
|
|
3959
4286
|
"""
|
|
3960
|
-
|
|
3961
|
-
|
|
3962
|
-
|
|
3963
|
-
|
|
3964
|
-
|
|
3965
|
-
|
|
4287
|
+
.. raw:: html
|
|
4288
|
+
|
|
4289
|
+
<p>Suggest a user profile.</p>
|
|
4290
|
+
<p>Get suggestions for user profiles that match specified search criteria.</p>
|
|
4291
|
+
<p>NOTE: The user profile feature is designed only for use by Kibana and Elastic's Observability, Enterprise Search, and Elastic Security solutions.
|
|
4292
|
+
Individual users and external applications should not call this API directly.
|
|
4293
|
+
Elastic reserves the right to change or remove this feature in future releases without prior notice.</p>
|
|
3966
4294
|
|
|
3967
|
-
|
|
4295
|
+
|
|
4296
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-security-suggest-user-profiles>`_
|
|
3968
4297
|
|
|
3969
4298
|
:param data: A comma-separated list of filters for the `data` field of the profile
|
|
3970
4299
|
document. To return all content use `data=*`. To return a subset of content,
|
|
@@ -4033,38 +4362,43 @@ class SecurityClient(NamespacedClient):
|
|
|
4033
4362
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
4034
4363
|
) -> ObjectApiResponse[t.Any]:
|
|
4035
4364
|
"""
|
|
4036
|
-
|
|
4037
|
-
|
|
4038
|
-
|
|
4039
|
-
|
|
4040
|
-
|
|
4041
|
-
|
|
4042
|
-
|
|
4043
|
-
|
|
4044
|
-
|
|
4045
|
-
|
|
4046
|
-
|
|
4047
|
-
|
|
4048
|
-
|
|
4049
|
-
|
|
4050
|
-
|
|
4051
|
-
|
|
4052
|
-
|
|
4053
|
-
|
|
4365
|
+
.. raw:: html
|
|
4366
|
+
|
|
4367
|
+
<p>Update an API key.</p>
|
|
4368
|
+
<p>Update attributes of an existing API key.
|
|
4369
|
+
This API supports updates to an API key's access scope, expiration, and metadata.</p>
|
|
4370
|
+
<p>To use this API, you must have at least the <code>manage_own_api_key</code> cluster privilege.
|
|
4371
|
+
Users can only update API keys that they created or that were granted to them.
|
|
4372
|
+
To update another user’s API key, use the <code>run_as</code> feature to submit a request on behalf of another user.</p>
|
|
4373
|
+
<p>IMPORTANT: It's not possible to use an API key as the authentication credential for this API. The owner user’s credentials are required.</p>
|
|
4374
|
+
<p>Use this API to update API keys created by the create API key or grant API Key APIs.
|
|
4375
|
+
If you need to apply the same update to many API keys, you can use the bulk update API keys API to reduce overhead.
|
|
4376
|
+
It's not possible to update expired API keys or API keys that have been invalidated by the invalidate API key API.</p>
|
|
4377
|
+
<p>The access scope of an API key is derived from the <code>role_descriptors</code> you specify in the request and a snapshot of the owner user's permissions at the time of the request.
|
|
4378
|
+
The snapshot of the owner's permissions is updated automatically on every call.</p>
|
|
4379
|
+
<p>IMPORTANT: If you don't specify <code>role_descriptors</code> in the request, a call to this API might still change the API key's access scope.
|
|
4380
|
+
This change can occur if the owner user's permissions have changed since the API key was created or last modified.</p>
|
|
4381
|
+
|
|
4382
|
+
|
|
4383
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-security-update-api-key>`_
|
|
4054
4384
|
|
|
4055
4385
|
:param id: The ID of the API key to update.
|
|
4056
|
-
:param expiration:
|
|
4386
|
+
:param expiration: The expiration time for the API key. By default, API keys
|
|
4387
|
+
never expire. This property can be omitted to leave the expiration unchanged.
|
|
4057
4388
|
:param metadata: Arbitrary metadata that you want to associate with the API key.
|
|
4058
|
-
It supports nested data structure. Within the metadata object, keys beginning
|
|
4059
|
-
with _ are reserved for system usage.
|
|
4060
|
-
|
|
4061
|
-
|
|
4062
|
-
|
|
4063
|
-
|
|
4064
|
-
|
|
4065
|
-
|
|
4066
|
-
|
|
4067
|
-
|
|
4389
|
+
It supports a nested data structure. Within the metadata object, keys beginning
|
|
4390
|
+
with `_` are reserved for system usage. When specified, this value fully
|
|
4391
|
+
replaces the metadata previously associated with the API key.
|
|
4392
|
+
:param role_descriptors: The role descriptors to assign to this API key. The
|
|
4393
|
+
API key's effective permissions are an intersection of its assigned privileges
|
|
4394
|
+
and the point in time snapshot of permissions of the owner user. You can
|
|
4395
|
+
assign new privileges by specifying them in this parameter. To remove assigned
|
|
4396
|
+
privileges, you can supply an empty `role_descriptors` parameter, that is
|
|
4397
|
+
to say, an empty object `{}`. If an API key has no assigned privileges, it
|
|
4398
|
+
inherits the owner user's full permissions. The snapshot of the owner's permissions
|
|
4399
|
+
is always updated, whether you supply the `role_descriptors` parameter or
|
|
4400
|
+
not. The structure of a role descriptor is the same as the request for the
|
|
4401
|
+
create API keys API.
|
|
4068
4402
|
"""
|
|
4069
4403
|
if id in SKIP_IN_PATH:
|
|
4070
4404
|
raise ValueError("Empty value passed for parameter 'id'")
|
|
@@ -4119,21 +4453,22 @@ class SecurityClient(NamespacedClient):
|
|
|
4119
4453
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
4120
4454
|
) -> ObjectApiResponse[t.Any]:
|
|
4121
4455
|
"""
|
|
4122
|
-
|
|
4123
|
-
|
|
4124
|
-
|
|
4125
|
-
|
|
4126
|
-
|
|
4127
|
-
|
|
4128
|
-
|
|
4129
|
-
|
|
4130
|
-
|
|
4131
|
-
|
|
4132
|
-
|
|
4133
|
-
|
|
4134
|
-
|
|
4135
|
-
|
|
4136
|
-
|
|
4456
|
+
.. raw:: html
|
|
4457
|
+
|
|
4458
|
+
<p>Update a cross-cluster API key.</p>
|
|
4459
|
+
<p>Update the attributes of an existing cross-cluster API key, which is used for API key based remote cluster access.</p>
|
|
4460
|
+
<p>To use this API, you must have at least the <code>manage_security</code> cluster privilege.
|
|
4461
|
+
Users can only update API keys that they created.
|
|
4462
|
+
To update another user's API key, use the <code>run_as</code> feature to submit a request on behalf of another user.</p>
|
|
4463
|
+
<p>IMPORTANT: It's not possible to use an API key as the authentication credential for this API.
|
|
4464
|
+
To update an API key, the owner user's credentials are required.</p>
|
|
4465
|
+
<p>It's not possible to update expired API keys, or API keys that have been invalidated by the invalidate API key API.</p>
|
|
4466
|
+
<p>This API supports updates to an API key's access scope, metadata, and expiration.
|
|
4467
|
+
The owner user's information, such as the <code>username</code> and <code>realm</code>, is also updated automatically on every call.</p>
|
|
4468
|
+
<p>NOTE: This API cannot update REST API keys, which should be updated by either the update API key or bulk update API keys API.</p>
|
|
4469
|
+
|
|
4470
|
+
|
|
4471
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-security-update-cross-cluster-api-key>`_
|
|
4137
4472
|
|
|
4138
4473
|
:param id: The ID of the cross-cluster API key to update.
|
|
4139
4474
|
:param access: The access to be granted to this API key. The access is composed
|
|
@@ -4203,14 +4538,16 @@ class SecurityClient(NamespacedClient):
|
|
|
4203
4538
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
4204
4539
|
) -> ObjectApiResponse[t.Any]:
|
|
4205
4540
|
"""
|
|
4206
|
-
|
|
4207
|
-
|
|
4208
|
-
|
|
4209
|
-
|
|
4210
|
-
|
|
4211
|
-
|
|
4541
|
+
.. raw:: html
|
|
4542
|
+
|
|
4543
|
+
<p>Update security index settings.</p>
|
|
4544
|
+
<p>Update the user-configurable settings for the security internal index (<code>.security</code> and associated indices). Only a subset of settings are allowed to be modified. This includes <code>index.auto_expand_replicas</code> and <code>index.number_of_replicas</code>.</p>
|
|
4545
|
+
<p>NOTE: If <code>index.auto_expand_replicas</code> is set, <code>index.number_of_replicas</code> will be ignored during updates.</p>
|
|
4546
|
+
<p>If a specific index is not in use on the system and settings are provided for it, the request will be rejected.
|
|
4547
|
+
This API does not yet support configuring the settings for indices before they are in use.</p>
|
|
4548
|
+
|
|
4212
4549
|
|
|
4213
|
-
`<https://www.elastic.co/
|
|
4550
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-security-update-settings>`_
|
|
4214
4551
|
|
|
4215
4552
|
:param master_timeout: The period to wait for a connection to the master node.
|
|
4216
4553
|
If no response is received before the timeout expires, the request fails
|
|
@@ -4277,21 +4614,25 @@ class SecurityClient(NamespacedClient):
|
|
|
4277
4614
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
4278
4615
|
) -> ObjectApiResponse[t.Any]:
|
|
4279
4616
|
"""
|
|
4280
|
-
|
|
4281
|
-
|
|
4282
|
-
|
|
4283
|
-
|
|
4284
|
-
|
|
4285
|
-
|
|
4286
|
-
|
|
4287
|
-
|
|
4288
|
-
|
|
4289
|
-
|
|
4290
|
-
|
|
4291
|
-
|
|
4292
|
-
|
|
4293
|
-
|
|
4294
|
-
|
|
4617
|
+
.. raw:: html
|
|
4618
|
+
|
|
4619
|
+
<p>Update user profile data.</p>
|
|
4620
|
+
<p>Update specific data for the user profile that is associated with a unique ID.</p>
|
|
4621
|
+
<p>NOTE: The user profile feature is designed only for use by Kibana and Elastic's Observability, Enterprise Search, and Elastic Security solutions.
|
|
4622
|
+
Individual users and external applications should not call this API directly.
|
|
4623
|
+
Elastic reserves the right to change or remove this feature in future releases without prior notice.</p>
|
|
4624
|
+
<p>To use this API, you must have one of the following privileges:</p>
|
|
4625
|
+
<ul>
|
|
4626
|
+
<li>The <code>manage_user_profile</code> cluster privilege.</li>
|
|
4627
|
+
<li>The <code>update_profile_data</code> global privilege for the namespaces that are referenced in the request.</li>
|
|
4628
|
+
</ul>
|
|
4629
|
+
<p>This API updates the <code>labels</code> and <code>data</code> fields of an existing user profile document with JSON objects.
|
|
4630
|
+
New keys and their values are added to the profile document and conflicting keys are replaced by data that's included in the request.</p>
|
|
4631
|
+
<p>For both labels and data, content is namespaced by the top-level fields.
|
|
4632
|
+
The <code>update_profile_data</code> global privilege grants privileges for updating only the allowed namespaces.</p>
|
|
4633
|
+
|
|
4634
|
+
|
|
4635
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-security-update-user-profile-data>`_
|
|
4295
4636
|
|
|
4296
4637
|
:param uid: A unique identifier for the user profile.
|
|
4297
4638
|
:param data: Non-searchable data that you want to associate with the user profile.
|