Update Security index settings
Updates the settings of the security internal indices.
Prerequisites
- To use this API, you must have at least the
manage_securitycluster privilege.
Request body
-
security - (Optional, object) Settings to be used for the index used for most security configuration, including Native realm users and roles configured via the API.
-
security-tokens - (Optional, object) Settings to be used for the index used to store tokens.
-
security-profile - (Optional, object) Settings to be used for the index used to store profile information.
Description
This API allows a user to modify the settings for the Security internal indices (.security and associated indices). Only a subset of settings are allowed to be modified. This includes:
-
index.auto_expand_replicas -
index.number_of_replicas
If index.auto_expand_replicas is set, index.number_of_replicas will be ignored during updates.
Examples
An example of modifying the Security settings:
resp = client.perform_request(
"PUT",
"/_security/settings",
headers={"Content-Type": "application/json"},
body={
"security": {
"index.auto_expand_replicas": "0-all"
},
"security-tokens": {
"index.auto_expand_replicas": "0-all"
},
"security-profile": {
"index.auto_expand_replicas": "0-all"
}
},
)
print(resp) const response = await client.transport.request({
method: "PUT",
path: "/_security/settings",
body: {
security: {
"index.auto_expand_replicas": "0-all",
},
"security-tokens": {
"index.auto_expand_replicas": "0-all",
},
"security-profile": {
"index.auto_expand_replicas": "0-all",
},
},
});
console.log(response); PUT /_security/settings
{
"security": {
"index.auto_expand_replicas": "0-all"
},
"security-tokens": {
"index.auto_expand_replicas": "0-all"
},
"security-profile": {
"index.auto_expand_replicas": "0-all"
}
} The configured settings can be retrieved using the Get Security index settings API. If a given index is not in use on the system, but settings are provided for it, the request will be rejected - this API does not yet support configuring the settings for these indices before they are in use.
© 2023-2025 Elasticsearch
As of September 2024, Elasticsearch is available under a choice of three licenses: the Server Side Public License (SSPL), the Elastic License, or the AGPLv3 (OSI approved).
Elasticsearch and the Elasticsearch logo are trademarks of Elasticsearch B.V., registered in the U.S. and in other countries.
https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-update-settings.html