wtakase / kibana-own-home

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

Own Home with Read only rest #110

Open Harish346 opened 6 years ago

Harish346 commented 6 years ago

Hi @wtakase , I am trying to use ownhome with Readonly rest.But I am getting the following Error

error [09:09:19.367] TypeError: Cannot read property 'updated_at' of undefined at C:\Users\Harish\Desktop\Kibana with own_Home\kibana-6.2.4-windows-x86_64\src\server\saved_objects\client\saved_objects_client.js:442:41 at next (native) at step (C:\Users\Harish\Desktop\Kibana with own_Home\kibana-6.2.4-windows-x86_64\src\server\saved_objects\client\saved_objects_client.js:20:191) at C:\Users\Harish\Desktop\Kibana with own_Home\kibana-6.2.4-windows-x86_64\src\server\saved_objects\client\saved_objects_client.js:20:361

My nginx.conf as follows: events { worker_connections 1024; }

http { upstream elasticsearch { server 127.0.0.1:9200; keepalive 15; }

upstream kibana { server 127.0.0.1:5601; keepalive 15; }

server { listen 8881;

location / {
  auth_basic           "Protected Elasticsearch";
  auth_basic_user_file C:/nginx-1.5.4/conf/htpasswd;

  proxy_pass http://elasticsearch;
  proxy_redirect off;
  proxy_buffering off;

  proxy_http_version 1.1;
  proxy_set_header Connection "Keep-Alive";
  proxy_set_header Proxy-Connection "Keep-Alive";
}

}

server { listen 8885;

location / {

  auth_basic           "Protected Kibana";
  auth_basic_user_file C:/nginx-1.5.4/conf/htpasswd;

  proxy_pass http://kibana;

  proxy_buffering off;
  proxy_set_header x-forwarded-user $remote_user;

  proxy_http_version 1.1;
  proxy_set_header Connection "Keep-Alive";
  proxy_set_header Proxy-Connection "Keep-Alive";
}

}

} readonlyrest.yml as follows: readonlyrest: enable: true # optional, defaults=true if at least 1 "access_control_rules" block
response_if_req_forbidden: Sorry, your request is forbidden. access_control_rules:

kibana.yml as follows:

elasticsearch.ssl.verificationMode: none own_home.proxy_user_header: x-forwarded-user own_home.session.secretkey: "mysecretkeymysecretkeymysecretkeymysecretkeymysecretkey" own_home.session.isSecure: false own_home.local.enabled: true own_home.elasticsearch.url: http://localhost:9200 elasticsearch.url: "http://localhost:19200" elasticsearch.username: "kibana" elasticsearch.password: "kibana" elasticsearch.requestHeadersWhitelist: [x-forwarded-user,cookie ] own_home.local.groups: [ public ]

Howard-Chang commented 6 years ago

Hi @Harish346, can below readonlyrest.yml work in your own home +ROR?

readonlyrest:
  enable: true
  access_control_rules:
    - name: nginx
      type: allow
      indices: ["*"]
      actions: ["*"]

btw the "," need delete

name: Accept requests from users in group team1 on index1
groups: ["group1"]
type: allow
indices: ["demo*",]    // here

you can also check the elasticsearch log to find the problem.