No permissions for "settings number of replicas : 0"

Hi,

When I am executing in Dev tool the following request,

PUT /*/_settings 
{
  "index": {
    "number_of_replicas":0,
    "auto_expand_replicas": false
  }
}

I get the following error.
I am logged in on admin account.

{
  "error" : {
    "root_cause" : [
      {
        "type" : "security_exception",
        "reason" : "no permissions for [] and User [name=admin, backend_roles=[admin], requestedTenant=null]"
      }
    ],
    "type" : "security_exception",
    "reason" : "no permissions for [] and User [name=admin, backend_roles=[admin], requestedTenant=null]"
  },
  "status" : 403
}

But, If a specific index is set, it is applied normally.

PUT /winlogbeat*/_settings
{
  "index": {
    "number_of_replicas":0,
    "auto_expand_replicas": false
  }
}

We are using docker container,
And our kibana.yml, internal_user.yml and docker-compose.yml files setting like that

kibana.yml
image

internal_user.yml
image

docker-compose.yml
image

How can I set the number of replicas?
Any suggestions?

Hi @jp.lee As far as I know the only index that is causing this permission error is is the security index (.opendistro_security). The rest of the indices should work without issue. Admin user doesn’t have the permission either and to the best of my knowledge the only way to manipulate that index is to use admin certificate with curl, as follows:

curl -XPUT "https://localhost:9200/.opendistro_security/_settings" -H 'Content-Type: application/json' -d'{  "index": {    "number_of_replicas":0,    "auto_expand_replicas": false  }}' -k --cert /usr/share/elasticsearch/config/kirk.pem --key /usr/share/elasticsearch/config/kirk-key.pem

change elasticsearch to opensearch on the certificate paths.

curl -XPUT "https://localhost:9200/_all/_settings" -H 'Content-Type: application/json' -d'{  "index": { "number_of_replicas":0,    "auto_expand_replicas": false  }}' -k --cert /usr/share/opensearch/config/kirk.pem --key /usr/share/opensearch/config/kirk-key.pem