如何设置Kibana SSO(通过OAuth)?

时间:2015-04-13 12:02:54

标签: oauth single-sign-on kibana

我公司非常努力为所有第三方服务保留SSO。我想让Kibana使用我们的Google Apps帐户。那可能吗?怎么样?

2 个答案:

答案 0 :(得分:2)

Kibana让您实现安全。我相信Elastic的Shield产品支持安全即插即用,但我还没有浏览订阅模型,也没有深入了解它。

我处理这个问题的方法是使用oauth2 proxy application并使用nginx将代理转发给Kibana。

server {
    listen 80;
    server_name kibana.example.org;

    # redirect http->https while we're at it
    rewrite ^ https://$server_name$request_uri? permanent;
}

server {
    # listen for traffic destined for kibana.example.org:443
    listen 443 default ssl;

    server_name  kibana.example.org;
    ssl_certificate /etc/nginx/ssl/cert.crt;
    ssl_certificate_key /etc/nginx/ssl/cert.key.pem;
    add_header Strict-Transport-Security max-age=1209600;

    # for https://kibana.example.org/, send to our oauth2 proxy app
    location / {

        # the oauth2 proxy application i use listens on port :4180
        proxy_pass http://127.0.0.1:4180;
        # preserve our host and ip from the request in case we want to
        # dispatch the request to a named nginx directive
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Scheme $scheme;
        proxy_connect_timeout 15;
        proxy_send_timeout 30;
        proxy_read_timeout 30;
    }
}

请求进入,触发一个nginx指令,该指令将请求发送到ouath应用程序,后者又处理SSO资源并重定向到服务器的localhost上的侦听Kibana实例。这是安全的,因为无法直接与Kibana建立联系。

答案 1 :(得分:0)

从Elasticsearch,Kibana 5.0,屏蔽插件(安全插件)嵌入x-pack(付费服务)。所以从Kibana 5.0你可以:

这两个插件都可以与基本身份验证一起使用,因此您可以应用像this one这样的Oauth2代理。一个附加代理会使用带有摘要Authorization的正确base64(username:password)标头转发请求

x-pack的this article中描述了该过程。所以你将拥有:

enter image description here

我在this repo中设置了一个docker-compose配置,用于将searchguard或x-pack与Kibana / Elasticsearch 6.1.1一起使用: