0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

InstanaのOpenLDAP認証設定(簡易)

0
Posted at

はじめに

Instana Self-hostedを構築する際に、ユーザー作成をしようとしたら

こちらの記事を参考に、Instana self-hosted on k8sで、k8sの環境にLDAPサーバーを立てることで簡単にユーザーを追加する方法を

on K8s)

全体概要

Instana Self-hosted(Kubernetes 環境)に OpenLDAP を用いた LDAP 認証を追加する。
OpenLDAPを K8s クラスタ内の専用 Namespace(openldap)にデプロイし、Instana の認証バックエンドとして設定する。

┌──────────────────────────────────────────────────────┐
│  Kubernetes Cluster                                   │
│                                                      │
│  ┌─────────────────┐      ┌──────────────────────┐  │
│  │  Namespace:     │      │  Namespace: instana   │  │
│  │  openldap       │      │                      │  │
│  │                 │      │  Instana Core        │  │
│  │  OpenLDAP Pod   │◄─────│  (LDAP auth config)  │  │
│  │  (port 389/636) │      │                      │  │
│  └─────────────────┘      └──────────────────────┘  │
└──────────────────────────────────────────────────────┘

Instana GUIでの設定項目
項目
LDAP ドメイン instana.local
ベース DN dc=instana,dc=local
組織名 Instana Demo
TLS 無効(false
イメージ osixia/openldap:1.5.0
サービスタイプ ClusterIP
LDAP ポート 389
LDAPS ポート 636

前提条件

  • Kubernetes クラスタへの kubectl アクセスが可能であること
  • Instana Self-hosted がすでに動作していること
  • Instana の管理者権限を持つアカウントがあること

手順

Step 1. マニフェストの適用

openldap.yaml を apply する。マニフェストには以下のリソースが含まれる。

リソース種別 名前 内容
Namespace openldap OpenLDAP 用の専用 Namespace
Secret openldap-secret admin / config パスワードを格納
ConfigMap openldap-bootstrap ユーザー・グループ定義 LDIF
Deployment openldap OpenLDAP Pod(レプリカ数: 1)
Service openldap ClusterIP、ポート 389 / 636
kubectl apply -f openldap.yaml

Step 2. Pod の起動確認

kubectl get pods -n openldap

Running 状態になるまで待つ。

NAME                        READY   STATUS    RESTARTS   AGE
openldap-xxxxxxxxxxxx-xxxx  1/1     Running   0          30s

Step 3. LDAP 接続確認(疎通テスト)

Pod 内から ldapsearch を実行して、ユーザーが正しく登録されているか確認する。

kubectl exec -n openldap deploy/openldap -- \
  ldapsearch -x \
    -H ldap://localhost:389 \
    -D "cn=admin,dc=instana,dc=local" \
    -w admin123 \
    -b "dc=instana,dc=local"

Step 4. Instana の LDAP 設定

Instana 管理画面 Settings > Authentication で以下の値を入力する。

UI フィールド 入力値 備考
URL ldap://openldap.openldap.svc.cluster.local:389
Trust any certificate authorities whilst using ldaps ✅ チェックあり 自己署名証明書・未信頼 CA を使う場合に有効化
LDAP read-only user cn=admin,dc=instana,dc=local Bind DN
Password admin123
Base dc=instana,dc=local
LDAP Group Query (cn=instana-users) 括弧あり
LDAP Group member map uniqueMember
User query (uid=%s) 括弧あり
Email map mail

Note: LDAP URL のホスト名は Kubernetes の DNS 形式
<service-name>.<namespace>.svc.cluster.local を使用する。


テストユーザー

openldap.yaml 内の ConfigMap(50-instana-users.ldif)で定義している。

uid cn mail userPassword グループ
hinano Hinano Test hinano@example.com hinano123 instana-users
masaru Masaru Test masaru@example.com masaru123 instana-users

LDAP ディレクトリ構造

dc=instana,dc=local
├── ou=people
│   ├── uid=hinano
│   └── uid=masaru
└── ou=groups
    └── cn=instana-users
        ├── uniqueMember: uid=hinano,ou=people,dc=instana,dc=local
        └── uniqueMember: uid=masaru,ou=people,dc=instana,dc=local

注意事項

  • 本設定は検証用途向けであり、パスワードがプレーンテキストで記載されている。
    本番環境では Kubernetes Secret を使用し、パスワードを安全に管理すること。
  • TLS は無効化しているため、本番環境では LDAP_TLS: "true" に設定し、証明書を適切に管理すること。
  • osixia/openldap:1.5.0 イメージは非公式イメージのため、本番採用時はセキュリティスキャンを実施すること。

関連ファイル

ファイル 内容
openldap.yaml K8s マニフェスト(Namespace / Secret / ConfigMap / Deployment / Service)
input_form.md Instana UI 入力値一覧
openldap-auth-on-k8s-instana.md 元手順書
0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?