wtakase / kibana-own-home

Multi-tenancy for Kibana
Other
249 stars 79 forks source link

Error on Kibana when using Ownhome with SearchGuard and SearchGuard-Kibana plugin #86

Open waveter opened 6 years ago

waveter commented 6 years ago

I config ownhome to use with searchguard plugin. My config for searchguard as below: sg_roles_mapping.yml

sg_role1:
  users:
    - user1
sg_role2:
  users:
    - user2

sg_roles.yml:

sg_role1:
  indices:
    '?kibana*':
      '*':
        - ALL
sg_role2:
  indices:
    '?kibana*':
      '*':
        - ALL

This configuration work ok, however, you can see, each user can access dashboard of other user. When I change the configure file sg_roles.yml as below:

sg_role1:
  indices:
    '?kibana_user1':
      '*':
        - ALL
sg_role2:
  indices:
    '?kibana_user2':
      '*':
        - ALL

The error below occur on Kibana:

error  [08:56:55.806]  TypeError: Cannot read property 'updated_at' of undefined
    at /usr/share/kibana/src/server/saved_objects/client/saved_objects_client.js:442:41
    at next (native)
    at step (/usr/share/kibana/src/server/saved_objects/client/saved_objects_client.js:20:191)
    at /usr/share/kibana/src/server/saved_objects/client/saved_objects_client.js:20:361

Do you have any idea where the error come from and how to fix it? Could you please help me @wtakase? Thank you very much

waveter commented 6 years ago

If I modify file sg_roles.yml as below:

sg_role1:
  indices:
    '?kibana':
      '*':
        - ALL
    '?kibana_user1':
      '*':
        - ALL

sg_role2:
  indices:
    '?kibana':
      '*':
        - ALL
    '?kibana_user2':
      '*':
        - ALL

I can login by user1 normally, then I logout, and login by user2, the same error occurs:

 error  [10:06:31.443]  TypeError: Cannot read property 'updated_at' of undefined
    at /usr/share/kibana/src/server/saved_objects/client/saved_objects_client.js:442:41
    at next (native)
    at step (/usr/share/kibana/src/server/saved_objects/client/saved_objects_client.js:20:191)
    at /usr/share/kibana/src/server/saved_objects/client/saved_objects_client.js:20:361

It is so strange, because we can only use 1 user with a browser, or we have to clear everything before using other user