User can view reports created by other users

Hi,

I've noticed that I can only view the reports I've created. Is there a way to access reports created by other users in Kibana?

In self-managed and Cloud hosted deployments, reports are stored in Elasticsearch.

To check who created the reports you can use the following API call.

GET .reporting-*/_search
{
  "size": 0,
  "aggs": {
    "NAME": {
      "terms": {
        "field": "created_by"
      }
    }
  }
}

Each user can access their own reports. It's controlled by created_by field value in the reporting.* indices. Because reporting.* are the system indices you can't edit them by default users and roles.

You can create a role to access system indices, but this is definitely not recommended. If you still want to use it, I am sharing the method below.

#create user to access system indices
PUT _security/role/super_duper_user
{
  "indices": [
    {
      "names": ["*"],
      "privileges": ["all"],
      "allow_restricted_indices": true
    }
  ]
}

PUT _security/user/musab
{
  "password": "REDACTED",
  "roles": ["superuser", "super_duper_user"]
}
#create an ingest pipeline to update created_by value.
PUT _ingest/pipeline/add_user_to_created_by
{
  "description": "Add musab to created_by field using a script",
  "processors": [
    {
      "script": {
        "source": """
          if (ctx.created_by == null) {
            ctx.created_by = ['musab'];
          } else if (ctx.created_by instanceof String) {
            ctx.created_by = [ctx.created_by, 'musab'];
          } else if (!ctx.created_by.contains('musab')) {
            ctx.created_by.add('musab');
          }
        """
      }
    }
  ]
}

#login with musab user and run the below command. Make sure that `"updated": X` has some value except 0.
POST .reporting-*/_update_by_query?pipeline=add_user_to_created_by

After run the update_by_query command the musab user can access any reports.