Can't create API role for Gitlab Advanced Search

Hi all,

As a part of enabling Gitlab Advanced Search using Elastic as a backend, I need to create a role in Elastic.

Elastic API returns this error message when doing GET or POST actions:

GET _security/role
{
  "error" : "Incorrect HTTP method for uri [/_security/role?pretty=true] and method [GET], allowed: [POST]",
  "status" : 405
}
POST _security/role/gitlab-role
{
  "cluster": ["mm-elk"],
  "indices": [
    {
      "names": ["gitlab-*"],
      "privileges": [
        "create_index",
        "delete_index",
        "view_index_metadata",
        "read",
        "manage",
        "write"
      ]
    }
  ]
}

This returns:

{
  "error" : "no handler found for uri [/_security/role/gitlab-role?pretty=true] and method [POST]"
}

Version is 8.1.2.

Any ideas on what might I be missing?

Thanks!

It looks like security is disabled on your cluster.

Check for xpack.security.enabled in your elasticsearch.yml

Thanks Tim,

Indeed, right now xpack.security is disabled. Do I also need to enable anonymous access for this gitlab advanced search?

And add the gitlab_role there?

Best regards,
Oscar

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