12.7.2. ディレクトリーエントリーのターゲット
識別名 (DN) およびその下のエントリーに基づいてアクセスを制御するには、アクセス制御手順 (ACI) の target キーワードを使用します。target キーワードを使用するターゲットルールは、DN を式として取ります。
(target comparison_operator "ldap:///distinguished_name")
対象となる DN またはその上位 DN に、target キーワードで ACI を設定する必要があります。たとえば、ou=People,dc=example,dc=com をターゲットにする場合、ACI を ou=People,dc=example,dc=com または dc=example,dc=com のいずれかに設定する必要があります。
例12.1 target キーワードの使用
ou=People,dc=example,dc=com エントリーに保存されているユーザーを有効にして、独自のエントリー内の全属性を検索および表示するには、以下を実行します。
# ldapmodify -D "cn=Directory Manager" -W -H ldap://server.example.com -x
dn: ou=People,dc=example,dc=com
changetype: modify
add: aci
aci: (target = "ldap:///ou=People,dc=example,dc=com") (version 3.0;
acl "Allow users to read and search attributes of own entry"; allow (search, read)
(userdn = "ldap:///self");)
target キーワードでのワイルドカードの使用
* ワイルドカード文字ターゲットに複数のエントリーを使用できます。
以下のターゲットルールの例は、uid 属性が文字 a で始まる値に設定される ou=People,dc=example,dc=com のすべてのエントリーと一致します。
(target = "ldap:///uid=a*,ou=People,dc=example,dc=com")
ワイルドカードの位置に応じて、ルールは属性値だけでなく、完全な DN にも適用されます。そのため、ワイルドカードを DN の一部の代わりに使用できます。
例12.2 ワイルドカードを使用したディレクトリーエントリーのターゲット
次のルールは、dc=example,dc=com ツリー内のすべてのエントリーを対象とし、uid 属性が一致するもので、dc=example,dc=com エントリー自体に格納されているエントリーだけではありません。
(target = "ldap:///uid=user_name*,dc=example,dc=com")
以前のターゲットルールは、以下のような複数のエントリーと一致します。
-
uid=user_name,dc=example,dc=com -
uid=user_name,ou=People,dc=example,dc=com -
uid=user_name2,dc=example,dc=com
Directory Server は、DN の接尾辞部分でのワイルドカードをサポートしません。たとえば、ディレクトリーの接尾辞が dc=example,dc=com の場合は、(target = "ldap:///dc=*.com") などのように、この接尾辞でワイルドカード付きのターゲットは使用できません。