PUT request for add... several things

  • 6.2.4 Enterprise Trial

  • Win10

I have no problem with creating new internaluser, rolemapping and role via PUT command run from DevTool inside Kibana. Have also no problem with getting such kind of data from SG via CURL or direct requests sent from RESTED extension.

But when I’d like to create new internaluser via RESTED I’ve received error. My request is:

[PUT] https://localhost:9200/_searchguard/api/internalusers/worf

Headers: Content-Type application/json

BasicAuth: admin adminpass

Request body: Type JSON

parameter: internaluser { “password”: “worfpass”, “roles”: [“kibanauser”] }

Error is:

  {
"status": "error"  ,
"reason": "Invalid configuration"  ,
"invalid_keys"    : {
"keys": "internaluser"
  }
}

For me parameter name internaluser is incorrect, but I cannot find correct name. My forecast is that for rolemapping and role will have the same problem. What are correct parameter names for all 3 PUTs?

Another question: I think about using Rest API found on https://github.com/floragunncom/search-guard-rest-api. Found also “or Elasticsearch 6 this module comes already bundled with Search Guard 6. No need to download it separately.” but cannot find code itself? Where to find it? Or this Rest API is not under development? Last update 8 months ago…

Stupid me :slight_smile: Solved

Instead of 1 parameter have to be 2:

password worfpass

roles [“kibanauser”]

You are looking at the wrong repository: In SG5, we did not ship any enterprise module out of the box. If you wanted to use e.g. the REST API, you needed to download and install the module. This was leading to some confusion. In SG6 we decided to bundle and ship the enterprise modules with the regular SG plugin. You can find the combined repository here:

https://github.com/floragunncom/search-guard-enterprise-modules

···

On Tuesday, August 7, 2018 at 4:18:23 PM UTC+2, Lech Szczecinski wrote:

Stupid me :slight_smile: Solved

Instead of 1 parameter have to be 2:

password worfpass

roles [“kibanauser”]