405 error with PUT on /_searchguard/api/sg_config

7.7.1-42

I have enabled this setting in elasticsearch.yml
searchguard.unsupported.restapi.allow_sgconfig_modification: true

But when I try to PUT to /_searchguard/api/sg_config I get the following error:

{
  "error" : "Incorrect HTTP method for uri [/_searchguard/api/sg_config/?pretty=true] and method [PUT], allowed: [PATCH, GET]",
  "status" : 405
}

Is there another setting to enable this that I am missing?

Read the error message again. It says you use the HTTP PUT method. The PUT is not supported. The supported methods are PATCH and GET.

The documentation:

States that PUT / PATCH / GET are all supported. PUT / PATCH are disabled by default, but the config option below should enable both. However…it only enables PATCH and not PUT.

Since you can break the Search Guard authentication by uploading a faulty configuration, you need to explicitely enable the PUT endpoint by setting searchguard.unsupported.restapi.allow_sgconfig_modification: true in elasticsearch.yml

Then it is a bug either in docs or in the API endpoint. Did you try PATCH? Did it work?