Search content of .opendistro_security index

Good day,

I am trying to search the content of the “.opendistro_security” index, in particular I am trying to search for specific roles that start with a prefix. Unfortunately the " GET _opendistro/_security/api/roles/" retrieve all the available roles.

Currently I have a requirement to synchronize opendistro elasticsearch with roles defined an external system (not LDAP). I will be basically replicating the external roles into opendistro elasticsearch. It will be usefully to search the content of “.opendistro_security” index such as roles and rolemappings.

Appreciate your help.

Thanks

@asfoorial I dont think there is any clean way of achieving this. Using The API will provide the full list of roles as you mentioned, which can then be used in a script to extract necessary roles. It is also possible to query security index . opendistro_security using curl with admin certs, however the source of the response will be base64 encoded. There might be a plugin available to decode this on the fly and query inside, but I’m not familiar with one.