【发布时间】:2015-07-20 06:16:21
【问题描述】:
是否可以在 Kibana 中启用身份验证以限制对仪表板的访问仅限特定用户访问?
【问题讨论】:
是否可以在 Kibana 中启用身份验证以限制对仪表板的访问仅限特定用户访问?
【问题讨论】:
Kibana 本身不支持身份验证或限制对仪表板的访问。
您可以在 Kibana 前面使用 nginx 作为代理 限制对 Kibana 4 的访问,如下所述:https://serverfault.com/a/345244。只需将 proxy_pass 设置为端口 5601 并在防火墙上为其他人禁用此端口。这将完全启用或禁用 Kibana。
Elastic 还有一个名为 Shield 的工具,可让您管理 elasticsearch 的安全性。例如,使用 Shield,您可以允许某人以只读权限分析特定索引中的数据。 https://www.elastic.co/products/shield
编辑:Elastic 在 github 上有一个 issue,他们建议使用 Shield。
Remember Shield 仅提供索引级访问控制。这意味着用户 A 将能够看到所有仪表板,但其中一些是空的(因为他无权访问所有索引)。
【讨论】:
shield 是订阅,因此可以试用 30 天,但需要持续付费。
检查这个名为elasticsearch-readonlyrest 的插件。 它允许通过身份验证或 ip/网络、x-forwarded-for 标头轻松控制访问,并允许在 kibana 中设置读写或只读访问,并限制每个用户的索引访问。它设置简单,应该为大多数人提供足够的控制。
如果需要更多控制,您可以使用search-guard,这是一个免费的屏蔽替代品。
【讨论】:
Kibana4 目前不支持这个。
【讨论】:
我已经通过安装haproxy实现了身份验证。
$sudo nano /etc/kibana/kibana.yml
server.host: "localhost"
2.在安装了kibana的同一台机器上安装haproxy
$ sudo apt update && sudo apt install haproxy
$ sudo nano /etc/haproxy/haproxy.cfg
global
log /dev/log local0
log /dev/log local1 notice
chroot /var/lib/haproxy
stats socket /run/haproxy/admin.sock mode 660 level admin
stats timeout 30s
user haproxy
group haproxy
daemon
# Default SSL material locations
ca-base /etc/ssl/certs
crt-base /etc/ssl/private
# Default ciphers to use on SSL-enabled listening sockets.
# For more information, see ciphers(1SSL). This list is from:
# https://hynek.me/articles/hardening-your-web-servers-ssl-ciphers/
ssl-default-bind-ciphers ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!MD5:!DSS
ssl-default-bind-options no-sslv3
defaults
log global
mode http
option httplog
option dontlognull
timeout connect 10m
timeout client 10m
timeout server 10m
errorfile 400 /etc/haproxy/errors/400.http
errorfile 403 /etc/haproxy/errors/403.http
errorfile 408 /etc/haproxy/errors/408.http
errorfile 500 /etc/haproxy/errors/500.http
errorfile 502 /etc/haproxy/errors/502.http
errorfile 503 /etc/haproxy/errors/503.http
errorfile 504 /etc/haproxy/errors/504.http
userlist UsersFor_Kibana
user kibana insecure-password myPASSWORD
frontend localnodes
bind *:80
mode http
default_backend nodes
backend nodes
acl AuthOkay_Kibana http_auth(UsersFor_Kibana)
http-request auth realm Kibana if !AuthOkay_Kibana
mode http
balance roundrobin
option forwardfor
http-request set-header X-Forwarded-Port %[dst_port]
http-request add-header X-Forwarded-Proto https if { ssl_fc }
option httpchk HEAD / HTTP/1.1\r\nHost:localhost
server server1 127.0.0.1:5601 check
用户名:-“kibana” 密码:-“我的密码”
当您浏览http://IP:80 时,会弹出一个用于身份验证的窗口。
【讨论】:
老问题,但我想补充一点,aws 有一个开源版本的 elk。您也许可以使用 elastic.co 版本中的插件。 https://github.com/opendistro-for-elasticsearch/security
【讨论】: