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

如何设置Kibana SSO(通过OAuth)?,oauth,single-sign-on,kibana,Oauth,Single Sign On,Kibana,我的公司非常努力地为所有第三方服务保留SSO。我想让Kibana与我们的谷歌应用程序帐户一起工作。可能吗?如何实现?Kibana让您自行实现安全性。我相信Elastic的产品支持安全即插即用(security-as-a-plugin),但我还没有浏览订阅模式,也没有深入研究过它 我处理这个问题的方法是使用一个和使用nginx将代理反向到Kibana server { listen 80; server_name kibana.example.org; # redirec

我的公司非常努力地为所有第三方服务保留SSO。我想让Kibana与我们的谷歌应用程序帐户一起工作。可能吗?如何实现?

Kibana让您自行实现安全性。我相信Elastic的产品支持安全即插即用(security-as-a-plugin),但我还没有浏览订阅模式,也没有深入研究过它

我处理这个问题的方法是使用一个和使用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资源并重定向到服务器本地主机上的侦听Kibana实例。它是安全的,因为无法直接连接到Kibana。

从Elasticsearch,Kibana 5.0,shield插件(安全插件)嵌入在(付费服务)中。因此,通过Kibana 5.0,您可以:

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;
    }
}
  • 使用
  • 使用
这两个插件都可以与基本身份验证一起使用,因此您可以应用类似Oauth2的代理。一个额外的代理将转发带有右
Authorization
标题和摘要
base64(用户名:密码)

有关该步骤的说明,请参见适用于x-pack的。因此,您将有:

我已经在中设置了docker compose配置,以便在Kibana/Elasticsearch 6.1.1中使用searchguard或x-pack:


X-Pack并不意味着付费,只是一个不同的许可证(更严格的限制,例如,只要您自己使用它,您就可以使用它,而不是为其他人(如AWS)托管它)