2.4. カスケード連鎖の設定
データベースリンクは、別のデータベースリンクに指定するように設定でき、カスケード連鎖操作を作成します。ディレクトリーツリー内の全データにアクセスするのに、複数のホップが必要になるとカスケード連鎖がいつでも発生します。
2.4.1. カスケード連鎖の概要
ディレクトリーがクライアントアプリケーションの要求を処理するために必要なホップが複数使用されると、カスケード連鎖が発生します。

クライアントアプリケーションは変更要求を Server 1 に送信します。Server 1 には、別のデータベースリンクが含まれる Server 2 に操作を転送するデータベースリンクが含まれています。Server 2 のデータベースリンクは、クライアントがデータベースに変更するデータが含まれる Server 3 に転送します。クライアントが変更するデータの一部にアクセスするには、2 つのホップが必要になります。
通常の操作要求時に、クライアントはサーバーにバインドし、そのクライアントに適用された ACI が評価されます。カスケード連鎖では、クライアントバインド要求は Server 1 で評価されますが、上の例の Server 2 クライアントに適用される ACI は、要求が宛先サーバーへチェーンされた後にのみ評価されます。
たとえば、サーバー A では、ディレクトリーツリーが分割されます。

ルート接尾辞 dc=example,dc=com ならびに ou=people および ou=groups のサブ接尾辞は、サーバー A に保存されます。ou=europe,dc=example,dc=com および ou=groups の接尾辞は、サーバー B に保存され、ou=europe,dc=example,dc=com 接尾辞の ou=people ブランチはサーバー C に保存されます。
サーバー A、B、および C に設定されたカスケードでは、以下のように ou=people,ou=europe,dc=example,dc=com エントリーでターゲットとなるクライアント要求が以下のようにルーティングされます。

まず、クライアントは、Database Link 1 を使用して Server A にバインドし、Server B に連鎖します。その後、Server B は、Database Link 2 を使用して ou=people,ou=europe,dc=example,dc=com ブランチのデータにアクセスする Server C のターゲットデータベースに連鎖されます。ディレクトリーがクライアント要求を処理するには少なくとも 2 つのホップが必要であるため、これはカスケード連鎖とみなされます。
2.4.2. コマンドラインを使用したカスケード連鎖の設定
本セクションでは、以下の図に示すように、3 つのサーバーを使用してカスケード連鎖を設定する方法を説明します。

Server 1 の設定手順
- 接尾辞 c=africa,ou=people,dc=example,dc=com を作成します。
# dsconf -D "cn=Directory Manager" ldap://server1.example.com backend create --parent-suffix="ou=people,dc=example,dc=com" --suffix="c=africa,ou=people,dc=example,dc=com"
- DBLink1 データベースリンクを作成します。
# dsconf -D "cn=Directory Manager" ldap://server1.example.com chaining link-create --suffix="c=africa,ou=people,dc=example,dc=com" --server-url="ldap://africa.example.com:389/" --bind-mech="" --bind-dn="cn=server1 proxy admin,cn=config" --bind-pw="password" --check-aci="off" "DBLink1"
- ループ検出を有効にします。
# dsconf -D "cn=Directory Manager" ldap://server1.example.com chaining config-set --add-control="1.3.6.1.4.1.1466.29539.12"
Server 2 上の設定手順
- Server 1 をプロキシー承認に使用するプロキシー管理ユーザーを Server 2 に作成します。
# ldapadd -D "cn=Directory Manager" -W -p 389 -h server2.example.com -x dn: cn=server1 proxy admin,cn=config objectclass: person objectclass: organizationalPerson objectclass: inetOrgPerson cn: server1 proxy admin sn: server1 proxy admin userPassword: password description: Entry for use by database links
重要セキュリティー上の理由から、cn=Directory Manager
アカウントは使用しないでください。 - 接尾辞 ou=Zanzibar,c=africa,ou=people,dc=example,dc=com を作成します。
# dsconf -D "cn=Directory Manager" ldap://server2.example.com backend create --parent-suffix="c=africaou=people,dc=example,dc=com" --suffix="ou=Zanzibar,c=africa,ou=people,dc=example,dc=com"
- DBLink2 データベースリンクを作成します。
# dsconf -D "cn=Directory Manager" ldap://server2.example.com chaining link-create --suffix="ou=Zanzibar,c=africa,ou=people,dc=example,dc=com" --server-url="ldap://zanz.africa.example.com:389/" --bind-mech="" --bind-dn="server2 proxy admin,cn=config" --bind-pw="password" --check-aci="on "DBLink2"
DBLink2
リンクはカスケード連鎖設定の中間データベースリンクであるため、ACL チェックを有効にして、クライアントとプロキシーの管理ユーザーによるデータベースリンクへのアクセスを許可するかどうかをサーバーが確認できるようにします。 - ループ検出を有効にします。
# dsconf -D "cn=Directory Manager" ldap://server2.example.com chaining config-set --add-control="1.3.6.1.4.1.1466.29539.12"
- プロキシー認証制御を有効にします。
# dsconf -D "cn=Directory Manager" ldap://server2.example.com chaining config-set --add-control="2.16.840.1.113730.3.4.12"
- ローカルプロキシー認証 ACI を追加します。
# ldapmodify -D "cn=Directory Manager" -W -p 389 -h server2.example.com -x dn: c=africa,ou=people,dc=example,dc=com changetype: modify add: aci aci:(targetattr="*")(target="lou=Zanzibar,c=africa,ou=people,dc=example,dc=com") (version 3.0; acl "Proxied authorization for database links"; allow (proxy) userdn = "ldap:///cn=server1 proxy admin,cn=config";)
- Server 1 の c=us,ou=people,dc=example,dc=com にいる
uid
属性セットを持つユーザーが、Server 3 の ou=Zanzibar,c=africa,ou=people,dc=example,dc=com の接尾辞ツリーに対して、任意のタイプの操作を実行できるようにする ACI を追加します。# ldapmodify -D "cn=Directory Manager" -W -p 389 -h server2.example.com -x dn: c=africa,ou=people,dc=example,dc=com changetype: modify add: aci aci:(targetattr="*")(target="ou=Zanzibar,c=africa,ou=people,dc=example,dc=com") (version 3.0; acl "Client authorization for database links"; allow (all) userdn = "ldap:///uid=*,c=us,ou=people,dc=example,dc=com";)
Server 3 に、Server 3 で追加の権限を必要とする別の接尾辞のユーザーが存在する場合は、Server 2 にさらにクライアント ACI を追加する必要があります。
Server 3 の設定手順
- Server 3 でプロキシー管理ユーザーを作成し、Server 2 をプロキシー承認に使用するプロキシー管理ユーザーを作成します。
# ldapadd -D "cn=Directory Manager" -W -p 389 -h server3.example.com -x dn: cn=server2 proxy admin,cn=config objectclass: person objectclass: organizationalPerson objectclass: inetOrgPerson cn: server2 proxy admin sn: server2 proxy admin userPassword: password description: Entry for use by database links
重要セキュリティー上の理由から、cn=Directory Manager
アカウントは使用しないでください。 - ローカルプロキシー認証 ACI を追加します。
# ldapmodify -D "cn=Directory Manager" -W -p 389 -h server3.example.com -x dn: ou=Zanzibar,ou=people,dc=example,dc=com changetype: modify add: aci aci: (targetattr = "*")(version 3.0; acl "Proxied authorization for database links"; allow (proxy) userdn = "ldap:///cn=server2 proxy admin,cn=config";)
- Server 1 の c=us,ou=people,dc=example,dc=com にいる
uid
属性セットを持つユーザーが、Server 3 の ou=Zanzibar,c=africa,ou=people,dc=example,dc=com の接尾辞ツリーに対して、任意のタイプの操作を実行できるようにする ACI を追加します。# ldapmodify -D "cn=Directory Manager" -W -p 389 -h server3.example.com -x dn: ou=Zanzibar,ou=people,dc=example,dc=com changetype: modify add: aci aci: (targetattr ="*")(target="ou=Zanzibar,c=africa,ou=people,dc=example,dc=com") (version 3.0; acl "Client authentication for database link users"; allow (all) userdn = "ldap:///uid=*,c=us,ou=people,dc=example,dc=com";)
Server 3 に、Server 3 で追加の権限を必要とする別の接尾辞のユーザーが存在する場合は、Server 2 にさらにクライアント ACI を追加する必要があります。
これで、カスケード連鎖は設定されました。このカスケード設定により、ユーザーは Server 1 にバインドし、Server 3 の ou=Zanzibar,c=africa,ou=people,dc=example,dc=com ブランチの情報を変更できます。セキュリティーのニーズに応じて、アクセス制御をより詳細に提供する必要があります。
2.4.3. ループの検出
Directory Server に含まれる LDAP 制御により、ループが回避されます。サーバーは、最初にチェーンを試行するときに、このコントロールを、使用できる最大ホップ数または連鎖接続に設定します。後続の各サーバーでカウントが減ります。サーバーが 0 の数を受信すると、ループが検出されたと判断し、クライアントアプリケーションに通知します。
コントロールを使用するには、1.3.6.1.4.1.1466.29539.12 OID を追加します。LDAP コントロールの追加に関する詳細は、「LDAP 制御チェーン」を参照してください。各データベースリンクの設定ファイルに制御がない場合、ループ検出は実装されません。
許可されるホップ数は、
nsHopLimit
パラメーターを使用して定義されます。デフォルトでは、パラメーターは 10 に設定されます。たとえば、example
チェーンのホップ制限を 5 に設定するには、以下のコマンドを実行します。
# dsconf -D "cn=Directory Manager" ldap://server.example.com chaining link-set --hop-limit 5 example