Kibana Create Role API returns 404

Hello,

I know this is technically a duplicate of this discussion right here, but I'm not satisfied with the outcome of it.

I'm attempting to use Kibana's create/update role API to create a user role. I'm following the documentation here, but when I make this call I get a 404 not found error.

This is the CURL command I'm using:

curl -X PUT "http://elastic:changeme@localhost:5601/api/security/role/new_role" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d '{<role information>}'

If I try this command with a role that already exists, such as 'kibana_user' I get that role's info, so I know that my user has the 'manage security' cluster privilege.

I've tried sending this request with '-X GET' as the user in the previously linked discussion did, but that didn't work.

I'm running out of ideas. Am I missing something here? I'm using Kibana 7.16.2 if that matters at all.

*edit - added Kibana version

Welp, it seems I was able to fix this by creating a role with the same name through the Elasticsearch role API. This is probably why I was getting a 404, the role didn't exist on Elasticsearch.

@Larry_Gregory whenever you get a chance - can you throw some light on this ? Thanks

1 Like

Perhaps take a look at this post talks a about the difference of creating roles through Kibana and Elasticsearch APIs

Perhaps that will help a bit... Or not i.e they are related but not the same.

Think of role API through Kibana as a higher level abstraction of the lower level elasticsearch API

Hope that makes a little sense.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.