2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

KibanaのSAML認証

Last updated at Posted at 2021-03-22

目的

この記事では、KibanaにてSAML認証(Okta経由)を有効化するための手順を纏めます。

前提

手順

1. Oktaの設定手順

①接続先のKibanaの情報をもとに以下情報を入力します。

image.png

/api/security/v1/samlは、固定っぽいので注意が必要です。

②group Attributeの値を設定する。

image.png

2. Elasticsearchの設定手順

以下を設定してElasticsearchを再起動します。

①メタデータを/etc/elasticsearch/samlに作成

idp-metadata.xml
# pwd
/etc/elasticsearch/saml
# ls -ll
total 4
-rw-r--r-- 1 root elasticsearch 2380 Mar 21 13:03 idp-metadata.xml

idp-metadata.xmlの中身は以下からGetできます。
[View Setup Instructions] -> [Provide the following IDP metadata to your SP provider.]
をコピーしてidp-metadata.xmlに貼り付けます。

image.png

②elasticsearch.ymlの設定値を以下の通り変更します。

elasticsearch.ymlの設定
# ----------------------------------- SAML Setting ------------------------------------
xpack.security.authc.token.enabled: true
xpack.security.authc.realms.saml:
         saml1:
           order: 2
           attributes.principal: "nameid"
           attributes.groups: "groups"
           idp.metadata.path: saml/idp-metadata.xml
           idp.entity_id: "https://sso.example.com/"
           sp.entity_id:  "https://kibana.example.com/"
           sp.acs: "https://kibana.example.com/api/security/v1/saml"
           sp.logout: "https://kibana.example.com/logout"
           sp.acs: "https://sso.example.com/api/security/v1/saml"
           sp.logout: "https://sso.example.com/logout"

3. Kibanaの設定手順

以下を設定してKibanaを再起動します。

kibana.ymlを以下の通り編集します。basic.basic1はBasic認証をのこすための設定です。
KibanaにSMAL経由でログインできなくなったときのリカバリーとして作成しました。
KibanaIP:Port/loginでBasic認証に切り替えられるそうです。

kibana.ymlの設定
xpack.security.authc.providers:
  saml.saml1:
    order: 0
    realm: "saml1"
  basic.basic1:
    order: 1

4. Oktaユーザーとグループの作成

グループ(OK_Kibana_Admin)を作成し、既存のOktaユーザーを所属させます。

image.png

5. OktaグループとKibanaのRollを紐づけ

既存のKibana Roll(superuser)とOktaのグループを紐づけるために、
KibanaのDevToolで以下コマンドを実行します。
version 7.12だとDev Toolではなく、GUI画面で編集するそうです。
https://www.elastic.co/guide/en/kibana/current/role-mappings.html

aaa
PUT /_security/role_mapping/saml-kibana-admins
{
   "enabled": true,
    "roles": [ "superuser" ],
    "rules": { "all" : [
        { "field": { "realm.name": "saml1" } },
        { "field": { "groups": "OK_Kibana_Admin" } }
    ]},
    "metadata": { "version": 1 }
}

以上です。

参考URL

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?