ユーザー管理および認証

Red Hat Directory Server 12

ユーザー、グループ、ロール、および認証関連の設定の管理

Red Hat Customer Content Services

概要

ユーザーのアクセス権限、リソース制限、ユーザーグループ、ユーザーロールを管理する方法を説明します。パスワードとアカウントのロックアウトポリシーを設定し、ユーザーグループのアクセスを拒否し、バインド識別名 (バインド DN) に応じてシステムリソースを制限できます。

Red Hat ドキュメントへのフィードバック (英語のみ)

Red Hat ドキュメントに対するご意見をお聞かせください。ドキュメントの改善点があればお知らせください。これを行うには、以下を行います。

  • Jira からのフィードバック送信 (アカウントが必要)

    1. Jira の Web サイトにログインします。
    2. 上部のナビゲーションバーで Create をクリックします。
    3. Summary フィールドにわかりやすいタイトルを入力します。
    4. Description フィールドに、ドキュメントの改善に関するご意見を記入してください。ドキュメントの該当部分へのリンクも追加してください。
    5. ダイアログの下部にある Create をクリックします。
  • Bugzilla からのフィードバック送信 (アカウントが必要)

    1. Bugzilla の Web サイトに移動します。
    2. Component として Documentation を使用します。
    3. Description フィールドに、ドキュメントの改善に向けたご提案を記入してください。ドキュメントの該当部分へのリンクも追加してください。
    4. Submit Bug をクリックします。

第1章 Directory Manager のパスワードの変更

Directory Manager は特権データベース管理者であり、Linux オペレーティングシステムの root ユーザーに相当します。Directory Manager のエントリーと、対応するパスワードは、インスタンスのインストール時に設定されます。管理者は、Directory Manager のパスワードを変更して別のパスワードを使用できます。

1.1. コマンドラインを使用した Directory Manager のパスワードの変更

ディレクトリーマネージャーの新しいパスワードは、dsconf コマンドラインユーティリティーを使用するか、nsslapd-rootpw パラメーターを手動で指定することで設定できます。

重要

必ず暗号化された接続を使用してパスワードを設定してください。暗号化されていない接続を使用すると、パスワードがネットワークに公開される可能性があります。サーバーが暗号化された接続に対応していない場合は、Web コンソールを使用して Directory Manager のパスワードを更新してください。

手順

  • 次のいずれかのオプションを使用して、Directory Manager のパスワードを設定します。

    • パスワードを自動的に暗号化するには:

      # dsconf -D "cn=Directory Manager" ldaps://server.example.com config replace nsslapd-rootpw=password

      Directory Server は、nsslapd-rootpw パラメーターで設定したプレーンテキスト値を自動的に暗号化します。

      警告

      パスワードに中括弧 {} を使用しないでください。Directory Server は、パスワードを {password-storage-scheme}hashed_password 形式で保存します。サーバーは、中括弧内の文字をパスワードストレージスキームとして解釈します。文字列が無効なストレージスキームである場合、またはパスワードが正しくハッシュ化されない場合、Directory Manager はサーバーに接続できません。

    • パスワードを手動で暗号化するには:

      1. 新しいパスワードハッシュを生成します。以下に例を示します。

        # pwdhash -D /etc/dirsrv/slapd-instance_name password
        {PBKDF2_SHA256}AAAgAMwPYIhEkQozTagoX6RGG5E7d6/6oOJ8TVty...

        パスワードは、Directory Server インスタンス設定の nsslapd-rootpwstoragescheme 属性で設定されたパスワードストレージスキームを使用して暗号化されます。

      2. STARTTLS 接続を使用して、nsslapd-rootpw 属性を、前のステップで表示された値に設定します。

        # dsconf -D "cn=Directory Manager" ldaps://server.example.com config replace nsslapd-rootpw="{PBKDF2_SHA256}AAAgAMwPYIhEkQozTagoX6RGG5E7d6/6oOJ8TVty..."

1.2. Web コンソールを使用した Directory Manager のパスワードの変更

Web コンソールを使用して、Directory Manager の新しいパスワードを設定できます。

前提条件

  • Web コンソールでインスタンスにログインしている。

手順

  1. ServerServer SettingsDirectory Manager メニューを開きます。
  2. Directory Manager Password フィールドおよび Confirm Password フィールドに新規パスワードを入力します。
  3. オプション: 別のパスワードストレージスキームを設定します。
  4. Save をクリックします。

第2章 Directory Manager のパスワードのリセット

Directory Manager は特権データベース管理者であり、Linux オペレーティングシステムの root ユーザーに相当します。Directory Manager のパスワードは、インスタンスのインストール時に設定されます。パスワードを紛失した場合は、パスワードをリセットして、ディレクトリーへの特権アクセスを取り戻すことができます。

2.1. コマンドラインを使用した Directory Manager のパスワードのリセット

Directory Server インスタンスへの root アクセス権がある場合は、Directory Manager のパスワードをリセットできます。

手順

  1. 新しいパスワードハッシュを生成します。以下に例を示します。

    # pwdhash -D /etc/dirsrv/slapd-instance_name new_password
    {PBKDF2_SHA256}AAAgABU0bKhyjY53NcxY33ueoPjOUWtl4iyYN5uW...

    Directory Server インスタンス設定へのパスを指定したため、pwdhash ジェネレーターは自動的に nsslapd-rootpwstoragescheme 属性で設定されたパスワードストレージスキームを使用して、新しいパスワードを暗号化します。

  2. Directory Server インスタンスを停止します。

    # dsctl instance_name stop
  3. /etc/dirsrv/slapd-instance_name/dse.ldif ファイルを編集し、nsslapd-rootpw 属性を、最初のステップで表示された値に設定します。

    nsslapd-rootpw: {PBKDF2_SHA256}AAAgABU0bKhyjY53NcxY33ueoPjOUWtl4iyYN5uW...
  4. Directory Server インスタンスを起動します。

    # dsctl instance_name start

第3章 パスワードポリシーの設定

パスワードポリシーは、一定レベルのセキュリティーを適用することで、パスワードの使用に関連するリスクを最小限に抑えます。たとえば、パスワードポリシーを定義すると、次のことを実現できます。

  • スケジュールに基づくパスワードの変更をユーザーに要求する。
  • 複雑なパスワードの指定をユーザーに要求する。
  • 特定の複雑な要件を満たすパスワード構文の使用を必須にする。

3.1. パスワードポリシーの仕組み

Directory Server は、逆ピラミッド型のきめ細かいパスワードポリシーをサポートしており、一般的なポリシーから個別的なポリシーまで対応しています。グローバルパスワードポリシーよりも、サブツリーレベルのパスワードポリシーが優先され、サブツリーレベルのパスワードポリシーよりもユーザーレベルのパスワードポリシーが優先されます。

以下を定義できます。

  • ディレクトリー全体に適用されるグローバルパスワードポリシー
  • ローカルパスワードポリシー

    • 特定のサブツリーに適用されるサブツリーレベルのポリシー
    • 特定のユーザーに適用されるユーザーレベルのポリシー

パスワードポリシーは付加的ではありません。1 つのエントリーに適用されるパスワードポリシーは 1 つだけです。たとえば、グローバルまたはサブツリーレベルのパスワードポリシーで特定の属性を設定しても、ユーザーレベルのパスワードポリシーでその属性を設定しなかった場合、その属性はユーザーに適用されません。この場合、ユーザーがログインを試みると、ユーザーレベルのポリシーのみがアクティブになります。

警告

パスワード管理者アカウントまたは Directory Manager (ルート DN) を使用してパスワードを設定すると、パスワードポリシーがバイパスされます。これらのアカウントは、通常のユーザーパスワードの管理には使用しないでください。これらは、事前にハッシュされたパスワードの追加や、リセット後に一時パスワードを設定するために現在のパスワード制約を意図的に上書きするなど、パスワードポリシーをバイパスする必要があるパスワード管理タスクを実行する場合にのみ使用してください。

ユーザーアカウントに適用される完全なパスワードポリシーは、次の要素で構成されます。

  • パスワードポリシーチェックのタイプまたはレベル。この情報は、サーバーがグローバルパスワードポリシーとローカルパスワードポリシーのどちらをチェックして実行する必要があるかを示します。
  • パスワードの追加および変更の情報。パスワード情報には、パスワードの構文およびパスワード履歴の詳細が含まれます。
  • バインド情報。バインド情報には、許可される猶予ログインの回数、パスワードエージング属性、およびバインド失敗の追跡が含まれます。
注記

パスワードポリシーを確立したら、アカウントロックアウトポリシーを設定することで、ユーザーのパスワードを潜在的な脅威から保護できます。アカウントロックアウトは、ユーザーのパスワードを繰り返し推測してディレクトリーに侵入しようとする攻撃から保護します。

3.2. コマンドラインを使用したグローバルパスワードポリシーの設定

デフォルトでは、グローバルパスワードポリシー設定は無効になっています。dsconf コマンドラインユーティリティーを使用して、グローバルパスワードポリシーを設定できます。

手順

  1. 現在の設定を表示します。

    # dsconf -D "cn=Directory Manager" ldap://server.example.com pwpolicy get
    Global Password Policy: cn=config
    ------------------------------------
    passwordstoragescheme: PBKDF2_SHA256
    passwordChange: on
    passwordMustChange: off
    passwordHistory: off
    passwordInHistory: 6
    ...
  2. パスワードポリシー設定を調整します。使用可能な設定の完全なリストを表示するには、次のように入力します。

    # dsconf -D "cn=Directory Manager" ldap://server.example.com pwpolicy set --help

    たとえば、パスワード構文の確認を有効にしてパスワードの最小の長さを 12 文字に設定するには、次のコマンドを実行します。

    # dsconf -D "cn=Directory Manager" ldap://server.example.com pwpolicy set --pwdchecksyntax on --pwdmintokenlen 12
  3. パスワードポリシーのアカウントロックアウト機能を有効にします。

    # dsconf -D "cn=Directory Manager" ldap://server.example.com pwpolicy set --pwdlockout on

3.3. Web コンソールを使用したグローバルパスワードポリシーの設定

デフォルトでは、グローバルパスワードポリシー設定は無効になっています。Web コンソールを使用して、グローバルパスワードポリシーを設定できます。

前提条件

  • Web コンソールでインスタンスにログインしている。

手順

  1. DatabasePassword PoliciesGlobal Policy メニューを開きます。
  2. グローバルパスワードポリシーを設定します。次のカテゴリーのパラメーターを設定できます。

    • 一般的な設定 (パスワードストレージスキームなど)
    • パスワードの有効期限設定 (パスワードが失効するまでの期間など)
    • アカウントのロックアウト設定 (何回ログインに失敗したらアカウントをロックするかなど)
    • パスワード構文の設定 (パスワードの最小長など)

      ツールヒントとパラメーターの cn=config エントリーで対応する属性名を表示するには、設定の上にマウスのカーソルを合わせます。

  3. Save をクリックします。

3.4. ローカルパスワードポリシーエントリー

dsconf localpwp addsubtree または dsconf localpwp adduser コマンドを使用すると、Directory Server がローカルパスワードポリシー属性を格納するためのエントリーを自動的に作成します。

サブツリーの場合、次のエントリーが追加されます。

表3.1 サブツリーのローカルパスワードポリシーエントリー

エントリー名説明内容

nsPwPolicyContainer

サブツリーレベルのコンテナーエントリー

サブツリーとそのすべての子のさまざまなパスワードポリシー関連のエントリー

nsPwPolicyEntry

実際のパスワードポリシー仕様エントリー

サブツリーに固有のすべてのパスワードポリシー属性

nsPwTemplateEntry

CoS テンプレートエントリー

nsPwPolicyEntry エントリーを参照する pwdpolicysubentry

<CoS definition entry DN>

サブツリーレベルの CoS 定義エントリー

CoS 定義エントリー

例3.1 サブツリー ou=people,dc=example,dc=com の nsPwPolicyContainer エントリー

dn: cn=nsPwPolicyContainer,ou=people,dc=example,dc=com
objectClass: top
objectClass: nsContainer
cn: nsPwPolicyContainer

例3.2 サブツリー ou=people,dc=example,dc=com の nsPwPolicyEntry エントリー

dn: cn="cn=nsPwPolicyEntry,ou=people,dc=example,dc=com",
 cn=nsPwPolicyContainer,ou=people,dc=example,dc=com
objectclass: top
objectclass: extensibleObject
objectclass: ldapsubentry
objectclass: passwordpolicy

例3.3 サブツリー ou=people,dc=example,dc=com の nsPwTemplateEntry エントリー

dn: cn="cn=nsPwTemplateEntry,ou=people,dc=example,dc=com",
 cn=nsPwPolicyContainer,ou=people,dc=example,dc=com
objectclass: top
objectclass: extensibleObject
objectclass: costemplate
objectclass: ldapsubentry
cosPriority: 1
pwdpolicysubentry: cn="cn=nsPwPolicyEntry,ou=people,dc=example,dc=com",
     cn=nsPwPolicyContainer,ou=people,dc=example,dc=com

例3.4 サブツリー ou=people,dc=example,dc=com の CoS 仕様エントリー

dn: cn=newpwdpolicy_cos,ou=people,dc=example,dc=com
objectclass: top
objectclass: LDAPsubentry
objectclass: cosSuperDefinition
objectclass: cosPointerDefinition
cosTemplateDn: cn=cn=nsPwTemplateEntry\,ou=people\,dc=example,dc=com,
 cn=nsPwPolicyContainer,ou=people,dc=example,dc=com
cosAttribute: pwdpolicysubentry default operational

ユーザーの場合、次のエントリーが追加されます。

表3.2 ユーザーのローカルパスワードポリシーエントリー

エントリー名説明内容

nsPwPolicyContainer

親レベルのコンテナーエントリー

ユーザーとそのすべての子のさまざまなパスワードポリシー関連のエントリー

nsPwPolicyEntry

実際のパスワードポリシー仕様エントリー

ユーザーに固有のすべてのパスワードポリシー属性

例3.5 ユーザーの nsPwPolicyContainer エントリー uid=user_name,ou=people,dc=example,dc=com

dn: cn=nsPwPolicyContainer,ou=people,dc=example,dc=com
objectClass: top
objectClass: nsContainer
cn: nsPwPolicyContainer

例3.6 ユーザーの nsPwPolicyEntry エントリー uid=user_name,ou=people,dc=example,dc=com

dn: cn="cn=nsPwPolicyEntry,uid=user_name,ou=people,dc=example,dc=com",
 cn=nsPwPolicyContainer,ou=people,dc=example,dc=com
objectclass: top
objectclass: extensibleObject
objectclass: ldapsubentry
objectclass: passwordpolicy

3.5. コマンドラインを使用したローカルパスワードポリシーの設定

ローカルパスワードポリシーは、ディレクトリー全体の設定を定義するグローバルパスワードポリシーとは対照的に、特定のユーザーまたはサブツリーに対するポリシーです。現在、ローカルパスワードポリシーを設定するには、コマンドラインを使用する必要があります。

前提条件

  • ポリシーを作成する対象のユーザーまたはサブツリーエントリーがディレクトリーにすでに存在している。

手順

  1. サブツリーまたはユーザーエントリーにローカルパスワードポリシーがすでに存在しているかどうかを確認します。以下に例を示します。

    # dsconf -D "cn=Directory Manager" ldap://server.example.com localpwp get "ou=People,dc=example,dc=com"
    Enter password for cn=Directory Manager on ldap://server.example.com:
    Error: No password policy was found for this entry

    ローカルポリシーが存在しない場合は、これを作成します。

    • subtree パスワードポリシーを作成するには、以下を実行します。

      # dsconf -D "cn=Directory Manager" ldap://server.example.com localpwp addsubtree "ou=People,dc=example,dc=com"
    • user パスワードポリシーを作成するには、以下を実行します。

      # dsconf -D "cn=Directory Manager" ldap://server.example.com localpwp adduser "uid=user_name,ou=People,dc=example,dc=com"
  2. ローカルポリシー属性を設定します。使用可能な設定の完全なリストを表示するには、次のように入力します。

    # dsconf -D "cn=Directory Manager" ldap://server.example.com localpwp set --help

    たとえば、パスワードの有効期限を有効にし、パスワードの最大有効期間を 14 日 (1209600 秒) に設定するには、以下を実行します。

    • subtree パスワードポリシー:

      # dsconf -D "cn=Directory Manager" ldap://server.example.com localpwp set --pwdexpire on --pwdmaxage 1209600 "ou=People,dc=example,dc=com"
    • user パスワードポリシー:

      # dsconf -D "cn=Directory Manager" ldap://server.example.com localpwp set --pwdexpire on --pwdmaxage 1209600 "uid=user_name,ou=People,dc=example,dc=com"

3.6. コマンドラインを使用したローカルパスワードポリシーの無効化

新しいローカルポリシーを作成すると、cn=config エントリーの nsslapd-pwpolicy-local パラメーターが自動的に on に設定されます。ローカルパスワードポリシーを有効にしない場合は、コマンドラインを使用して手動で無効にすることができます。

手順

  • すべてのローカルポリシーを無効にするか、特定のローカルポリシーを削除します。

    • すべてのローカルパスワードポリシーを無効にするには:

      # dsconf -D "cn=Directory Manager" ldap://server.example.com pwpolicy set --pwdlocal off
    • 単一の既存の サブツリー パスワードポリシーを削除するには:

      # dsconf -D "cn=Directory Manager" ldap://server.example.com localpwp remove "ou=People,dc=example,dc=com"
    • 単一の既存の ユーザー パスワードポリシーを削除するには:

      # dsconf -D "cn=Directory Manager" ldap://server.example.com localpwp remove "uid=user_name,ou=People,dc=example,dc=com"

第4章 一時パスワードルールの設定

Directory Server のパスワードポリシーは、ユーザーアカウントの一時パスワードの設定をサポートしています。ユーザーに一時パスワードを割り当てると、Directory Server は、ユーザーがパスワードを変更するまで、パスワード変更以外の操作を拒否します。

一時パスワードの機能は次のとおりです。

  • cn=Directory Manager アカウントのみが一時パスワードを割り当てることができます。
  • Directory Server は、攻撃者によるパスワードの調査を防ぐために、認証の試行を一定の回数だけ許可します。
  • Directory Server は、設定直後に一時パスワードを使用できないように、指定された遅延時間後に認証の試行を許可します。
  • Directory Server は、ユーザーが一時パスワードを使用またはリセットしなかった場合に一時パスワードが期限切れになるように、指定された期間のみ認証の試行を許可します。
  • 認証が成功した場合、Directory Server は他の操作を実行する前に、ユーザーによるパスワードのリセットを要求します。

デフォルトでは、一時パスワードルールは無効になります。一時パスワードルールは、グローバルまたはローカルパスワードポリシーで設定できます。

4.1. グローバルパスワードポリシーでの一時的なパスワードルールの有効化

Directory Server インスタンス全体に対して一時パスワード機能を有効にするには、次の手順を実行します。

  1. 管理者がパスワードをリセットした場合にユーザーによるパスワードの変更を必須にします。
  2. グローバルパスワードポリシーで一時パスワード機能を設定します。

管理者がユーザーの userPassword 属性を更新し、passwordMustChange 属性を on に設定すると、Directory Server は一時パスワードルールを適用します。

手順

  1. 管理者によるパスワードリセット後のユーザーによるパスワード変更を必須に設定します。

    # dsconf -D "cn=Directory Manager" ldap://server.example.com  pwpolicy set --pwdmustchange on
  2. グローバルパスワードポリシーで一時パスワードルールを設定します。

    # dsconf -D "cn=Directory Manager" ldap://server.example.com pwpolicy set --pwptprmaxuse 5 --pwptprdelayexpireat 3600 --pwptprdelayvalidfrom 60

    この例では、以下のように設定されています。

    • --pwptprmaxuse オプションで、ユーザーが一時パスワードを使用できる最大試行回数を 5 に設定しています。
    • --pwptprdelayexpireat オプションで、一時パスワードの有効期限が切れるまでの時間を 3600 秒 (1 時間) に設定しています。
    • --pwptprdelayvalidfrom オプションで、管理者がユーザーのパスワードをリセットしてから 60 秒後に、--pwptprdelayexpireat で設定した時間が開始するように設定しています。

検証

  • 一時パスワードルールを保存する属性を表示します。

    # dsconf -D "cn=Directory Manager" ldap://server.example.com pwpolicy get | grep -i TPR
    passwordTPRMaxUse: 5
    passwordTPRDelayExpireAt: 3600
    passwordTPRDelayValidFrom: 60

4.2. ローカルパスワードポリシーでの一時的なパスワードルールの有効化

特定のユーザーまたはサブツリーの一時パスワード機能を有効にするには、管理者によるパスワードリセット時のユーザーによるパスワード変更を必須にして、ローカルパスワードポリシーで機能を設定します。

管理者がユーザーの userPassword 属性を更新し、passwordMustChange 属性を on に設定すると、Directory Server が次の条件に該当するユーザーに一時パスワードルールを適用します。

  • ローカルパスワードポリシーが有効になっている
  • ローカルパスワードポリシーが有効になっているサブツリーに保存されている

手順

  1. 管理者によるパスワードリセット後のユーザーによるパスワード変更を必須に設定します。

    # dsconf -D "cn=Directory Manager" ldap://server.example.com  pwpolicy set --pwdmustchange on
  2. 一時パスワードルール設定を設定します。

    • 既存のサブツリーの場合:

      # dsconf -D "cn=Directory Manager" ldap://server.example.com localpwp addsubtree --pwptprmaxuse 5 --pwptprdelayexpireat 3600 --pwptprdelayvalidfrom 60 ou=People,dc=example,dc=com
    • 既存のユーザーの場合:

      # dsconf -D "cn=Directory Manager" ldap://server.example.com localpwp adduser --pwptprmaxuse 5 --pwptprdelayexpireat 3600 --pwptprdelayvalidfrom 60 uid=example,ou=People,dc=example,dc=com

    この例では、以下のようになります。

    • --pwptprmaxuse オプションで、ユーザーが一時パスワードを使用できる最大試行回数を 5 に設定しています。
    • --pwptprdelayexpireat オプションで、一時パスワードの有効期限が切れるまでの時間を 3600 秒 (1 時間) に設定しています。
    • --pwptprdelayvalidfrom オプションで、管理者がユーザーのパスワードをリセットしてから 60 秒後に、--pwptprdelayexpireat で設定した時間が開始するように設定しています。

検証

  • 識別名 (DN) のローカルパスワードポリシーを表示します。

    # dsconf -D "cn=Directory Manager" ldap://server.example.com localpwp get <DN> | grep -i TPR
    passwordTPRMaxUse: 5
    passwordTPRDelayExpireAt: 3600
    passwordTPRDelayValidFrom: 60

第5章 パスワード管理者権限の割り当て

Directory Manager は、パスワード管理者 ロールをユーザーまたはグループに割り当てることができます。パスワード管理者は適切なパーミッションを持つアクセス制御命令 (ACI) を必要とするため、単一の ACI セットですべてのパスワード管理者を管理できるようにグループを設定することを推奨します。

パスワード管理者ロールを使用すると、次のシナリオで役立ちます。

  • 次回のログイン時にパスワードの変更をユーザーに強制する属性を設定する
  • ユーザーのパスワードを、パスワードポリシーで定義されている別のストレージスキームに変更する
重要

パスワード管理者は、すべてのユーザーパスワード操作を実行できます。パスワード管理者アカウントまたは Directory Manager (root DN) を使用してパスワードを設定すると、パスワードポリシーは回避され、検証されません。これらのアカウントは、通常のユーザーパスワードの管理には使用しないでください。Red Hat は、userPassword 属性のみを更新する権限を持つデータベース内の既存のロールで通常のパスワード更新を実行することを推奨します。

注記

新しい passwordAdminSkipInfoUpdate: on/off 設定を cn=config エントリーに追加すると、パスワード管理者が実行するパスワード更新をきめ細かく制御できます。この設定を有効にすると、パスワードの更新では、passwordHistorypasswordExpirationTimepasswordRetryCountpwdReset、および passwdExpWarned などの特定の属性は更新されません。

5.1. グローバルポリシーでのパスワード管理者権限の割り当て

グローバルポリシーでは、パスワード管理者ロールをユーザーまたはユーザーグループに割り当てることができます。Red Hat では、単一のアクセス制御命令 (ACI) セットですべてのパスワード管理者を管理できるようにグループを設定することを推奨します。

前提条件

  • パスワード管理者ロールを割り当てるすべてのユーザーを含む、password_admins という名前のグループを作成した。

手順

  1. パスワード管理者ロールの権限を定義する ACI を作成します。

    ldapmodify -D "cn=Directory Manager" -W -p 389 -h server.example.com -x dn: ou=people,dc=example,dc=com changetype: modify add: aci aci: (targetattr="userPassword || nsAccountLock || userCertificate || nsSshPublicKey") (targetfilter="(objectClass=nsAccount)")(version 3.0; acl "Enable user password reset"; allow (write, read)(groupdn="ldap:///cn=password_admins,ou=groups,dc=example,dc=com");)
  2. パスワード管理者ロールをグループに割り当てます。

    # dsconf -D "cn=Directory Manager" ldap://server.example.com pwpolicy set --pwdadmin "cn=password_admins,ou=groups,dc=example,dc=com"

5.2. ローカルポリシーでのパスワード管理者権限の割り当て

ローカルポリシーでは、パスワード管理者ロールをユーザーまたはユーザーグループに割り当てることができます。Red Hat では、単一のアクセス制御命令 (ACI) セットですべてのパスワード管理者を管理できるようにグループを設定することを推奨します。

前提条件

  • パスワード管理者ロールを割り当てるすべてのユーザーを含む、password_admins という名前のグループを作成した。

手順

  1. パスワード管理者ロールの権限を定義する ACI を作成します。

    ldapmodify -D "cn=Directory Manager" -W -p 389 -h server.example.com -x dn: ou=people,dc=example,dc=com changetype: modify add: aci aci: (targetattr="userPassword || nsAccountLock || userCertificate || nsSshPublicKey") (targetfilter="(objectClass=nsAccount)")(version 3.0; acl "Enable user password reset"; allow (write, read)(groupdn="ldap:///cn=password_admins,ou=groups,dc=example,dc=com");)
  2. パスワード管理者ロールをグループに割り当てます。

    # dsconf -D "cn=Directory Manager" ldap://server.example.com localpwp set ou=people,dc=example,dc=com --pwdadmin "cn=password_admins,ou=groups,dc=example,dc=com"

5.3. 関連情報

第6章 匿名バインドの無効化

ユーザーが認証情報を指定せずに Directory Server への接続を試みた場合、この操作は anonymous bind (匿名バインド) と呼ばれます。匿名バインドは、ユーザーに最初の認証を要求しないため、ディレクトリー内の電話番号の検索など、検索と読み取り操作が簡素化されます。ただし、アカウントのないユーザーがデータにアクセスできるため、匿名バインドはセキュリティーリスクとなる可能性もあります。

警告

デフォルトでは、匿名バインドは Directory Server で検索および読み取り操作に対して有効になります。これにより、ユーザーエントリーだけでなく、ルート Directory Server エントリー (DSE) などの設定エントリーへの不正アクセスが可能になります。

6.1. コマンドラインでの匿名バインドの無効化

セキュリティーを強化するには、匿名バインドを無効にします。

手順

  • nsslapd-allow-anonymous-access 設定パラメーターを off に設定します。

    # dsconf -D "cn=Directory Manager" ldap://server.example.com config replace nsslapd-allow-anonymous-access=off

検証

  • ユーザーアカウントを指定せずに検索を実行します。

    # ldapsearch -H ldap://server.example.com -b "dc=example,dc=com" -x
    ldap_bind: Inappropriate authentication (48)
    	additional info: Anonymous access is not allowed

6.2. Web コンソールでの匿名バインドの無効化

セキュリティーを強化するには、匿名バインドを無効にします。

前提条件

  • Web コンソールでインスタンスにログインしている。

手順

  1. ServerServer SettingsAdvanced Settings に移動します。
  2. Allow Anonymous Access パラメーターを off に設定します。
  3. Save をクリックします。

検証

  • ユーザーアカウントを指定せずに検索を実行します。

    # ldapsearch -H ldap://server.example.com -b "dc=example,dc=com" -x
    ldap_bind: Inappropriate authentication (48)
            additional info: Anonymous access is not allowed

第7章 ユーザーとロールの手動による非アクティブ化

Directory Server では、単一のユーザーアカウントまたは一連のアカウントを一時的に非アクティブ化できます。アカウントが非アクティブになると、ユーザーがディレクトリーにバインドできなくなります。認証操作は失敗します。

7.1. コマンドラインを使用したユーザーとロールの非アクティブ化とアクティブ化

コマンドラインまたは操作属性を使用して、ユーザーとロールを手動で非アクティブ化できます。

ロールは、静的グループと動的グループの両方として動作します。グループを使用すると、エントリーはメンバーとしてグループエントリーに追加されます。ロールを使用すると、role 属性がエントリーに追加され、その属性はロールエントリー内のメンバーを自動的に識別するために使用されます。

ユーザーとロールは、同じ手順で非アクティブ化します。ただし、ロールを非アクティブにした場合、ロールエントリー自体ではなくロールのメンバーが非アクティブになります。

ユーザーとロールを非アクティブ化するには、コマンドラインで次のコマンドを実行します。

  • ユーザーアカウントを非アクティブ化する場合:

    # dsidm -D "cn=Directory Manager" ldap://server.example.com -b "dc=example,dc=com" account lock "uid=user_name,ou=People,dc=example,dc=com"
  • ロールを非アクティブ化する場合:

    # dsidm -D "cn=Directory Manager" ldap://server.example.com -b "dc=example,dc=com" role lock "cn=Marketing,ou=People,dc=example,dc=com"

ユーザーとロールをアクティブ化するには、コマンドラインで次のコマンドを実行します。

  • ユーザーアカウントをアクティブ化する場合:

    # dsidm -D "cn=Directory Manager" ldap://server.example.com -b "dc=example,dc=com" account unlock "uid=user_name,ou=People,dc=example,dc=com"
  • ロールをアクティブ化する場合:

    # dsidm -D "cn=Directory Manager" ldap://server.example.com -b "dc=example,dc=com" role unlock "cn=Marketing,ou=People,dc=example,dc=com"

必要に応じて、コマンドを使用する代わりに、操作属性 nsAccountLock をエントリーに追加できます。エントリーに値が truensAccountLock 属性が含まれている場合、サーバーはバインドを拒否します。

7.2. アカウントまたはロールのステータスを表示するためのコマンド

Directory Server のアカウントまたはロールのステータスは、対応するコマンドをコマンドラインで使用すると表示できます。

ステータスを表示するためのコマンド

  • アカウントのステータスを表示します。

    # dsidm -D "cn=Directory Manager" ldap://server.example.com -b "dc=example,dc=com" account entry-status "uid=user_name,ou=People,dc=example,dc=com"
    Entry DN: uid=user_name,ou=People,dc=example,dc=com
    Entry Creation Date: 20210813085535Z (2021-08-13 08:55:35)
    Entry Modification Date: 20210813085535Z (2021-08-13 08:55:35)
    Entry State: activated

    オプション: -V オプションは追加の詳細を表示します。

    例7.1 アクティブなアカウントの詳細な出力

    # dsidm -D "cn=Directory Manager" ldap://server.example.com -b "dc=example,dc=com" account entry-status "uid=user_name,ou=People,dc=example,dc=com" -V
    Entry DN: uid=user_name,ou=People,dc=example,dc=com
    Entry Creation Date: 20210824160645Z (2021-08-24 16:06:45)
    Entry Modification Date: 20210824160645Z (2021-08-24 16:06:45)
    Entry Last Login Date: 20210824160645Z (2021-08-24 16:06:45)
    Entry Time Until Inactive: 2 seconds (2021-08-24 16:07:45)
    Entry State: activated

    例7.2 非アクティブなアカウントの詳細な出力

    # dsidm -D "cn=Directory Manager" ldap://server.example.com -b "dc=example,dc=com" account entry-status "uid=user_name,ou=People,dc=example,dc=com" -V
    Entry DN: uid=user_name,ou=People,dc=example,dc=com
    Entry Creation Date: 20210824160645Z (2021-08-24 16:06:45)
    Entry Modification Date: 20210824160645Z (2021-08-24 16:06:45)
    Entry Last Login Date: 20210824160645Z (2021-08-24 16:06:45)
    Entry Time Since Inactive: 3 seconds (2021-08-24 16:07:45)
    Entry State: inactivity limit exceeded
  • ロールのステータスを表示します。

    # dsidm -D "cn=Directory Manager" ldap://server.example.com -b "dc=example,dc=com" role entry-status "cn=Marketing,ou=People,dc=example,dc=com"
    Entry DN: cn=Marketing,ou=people,dc=example,dc=com
    Entry State: activated
  • サブツリーのステータスを表示します。

    # dsidm -D "cn=Directory Manager" ldap://server.example.com -b "dc=example,dc=com" account subtree-status "ou=People,dc=example,dc=com" -f "(uid=*)" -V -o "2021-08-25T14:30:30"

    次のオプションを使用して、サブツリーでの検索結果をフィルタリングできます。

    • 検索フィルターを設定する -f オプション
    • 検索範囲を設定する -s オプション
    • 非アクティブなアカウントのみを返す -i オプション
    • 指定された日付 YYYY-MM-DDTHH:MM:SS より前に非アクティブになるアカウントのみを返す -o オプション

第8章 レプリケーション環境内のすべてのサーバー間でアカウントロックアウト属性を同期する

Directory Server は、アカウントのロックアウト属性をローカルで保存します。複数のサーバーがある環境では、攻撃者がアカウントのロックアウト数に達するまで 1 台のサーバーへのログインを試み、その後さらに他のサーバーにログインを試みることを防ぐために、この属性のレプリケーションを設定してください。

8.1. レプリケーション環境で Directory Server がパスワードおよびアカウントのロックアウトポリシーを処理する方法

Directory Server は、パスワードおよびアカウントのロックアウトポリシーを次のように適用します。

  • パスワードポリシーは、データプロバイダーに適用されます。
  • アカウントロックアウトポリシーは、レプリケーショントポロジー内のすべてのサーバーに適用されます。

Directory Server は次パスワードポリシー属性をレプリケートします。

  • passwordMinAge
  • passwordMaxAge
  • passwordExp
  • passwordWarning

ただし、デフォルトでは、Directory Server は以下に示す一般的なアカウントロックアウト属性をレプリケートしません。

  • passwordRetryCount
  • retryCountResetTime
  • accountUnlockTime

攻撃者がアカウントのロックアウト数に達するまで 1 台のサーバーへのログインを試み、その後さらに他のサーバーにログインを試みることを防ぐには、これらのアカウントロックアウト属性をレプリケートします。

8.2. アカウントロックアウト属性をレプリケートするための Directory Server の設定

passwordRetryCountretryCountResetTime、または accountUnlockTime 属性を更新するアカウントロックアウトポリシーまたはパスワードポリシーを使用する場合は、これらの属性の値がすべてのサーバーで同じになるように Directory Server を設定してこれらの属性をレプリケートします。

この手順は、レプリケーショントポロジー内のすべてのサプライヤーで実行してください。

前提条件

  • 前述の属性を 1 つ以上更新するアカウントロックアウトポリシーまたはパスワードポリシーを設定している。
  • Directory Server をレプリケーション環境で使用している。

手順

  1. パスワードポリシー属性のレプリケーションを有効にします。

    # dsconf -D "cn=Directory Manager" ldap://server.example.com pwpolicy set --pwdisglobal="on"
  2. 一部レプリケーションを使用する場合は、レプリケーションから除外される属性のリストを表示します。

    # dsconf -D "cn=Directory Manager" ldap://server.example.com repl-agmt get --suffix "dc=example,dc=com" example-agreement | grep "nsDS5ReplicatedAttributeList"

    デフォルト設定を使用すると、出力は表示されず、Directory Server はアカウントロックアウト属性をレプリケートします。ただし、次の例のように、除外される属性のリストが返された場合は、属性リストを確認してください。

    nsDS5ReplicatedAttributeList: (objectclass=*) $ EXCLUDE accountUnlockTime passwordRetryCount retryCountResetTime example1 example2

    この例では、accountUnlockTimepasswordRetryCount、および retryCountResetTime ロックアウトポリシー属性が、その他の 2 つの属性とともにレプリケーションから除外されます。

  3. 直前のコマンドの出力にアカウントロックアウト属性が表示された場合は、ロックアウトポリシー属性以外の属性のみを含めるように一部レプリケーション設定を更新します。

    # dsconf -D "cn=Directory Manager" ldap://server.example.com repl-agmt set --suffix "dc=example,dc=com" --frac-list "example1 example2" example-agreement

検証

  1. 無効なパスワードを使用して、ユーザーとして検索の実行を試みます。

    # ldapsearch -H ldap://server.example.com -D "uid=example,ou=People,dc=example,dc=com" -w "invalid-password" -b "dc=example,dc=com" -x
    ldap_bind: Invalid credentials (49)
  2. ユーザーの passwordRetryCount 属性を表示します。

    # ldapsearch -H ldap://server.example.com -D "cn=Directory Manager" -W -b "uid=example,ou=People,dc=example,dc=com" -x passwordRetryCount
    ...
    dn: uid=example,ou=People,dc=example,dc=com
    passwordRetryCount: 1
  3. レプリケーショントポロジー内の別のサーバーで直前のコマンドを実行します。passwordRetryCount 属性の値が同じである場合、Directory Server は属性をレプリケートします。

第9章 参照整合性を使用したエントリー間の関係の維持

Referential Integrity は、Directory Server が関連するエントリー間の関係を維持するためのデータベースメカニズムです。この機能を使用すると、ディレクトリー内の 1 つのエントリーへの更新を、更新されたエントリーを参照する他のエントリーに正しく反映できます。

たとえば、ディレクトリーからユーザーを削除し、Referential Integrity プラグインが有効になっている場合、サーバーは、そのユーザーがメンバーとなっているグループからもそのユーザーを削除します。プラグインが有効になっていない場合、ユーザーは管理者が手動で削除するまでグループのメンバーのままになります。

Referential Integrity は、ユーザーおよびグループの管理に Directory Server を利用する他の製品と Directory Server を統合する場合に重要な機能です。

9.1. Referential Integrity プラグインの仕組み

Referential Integrity プラグインを有効にすると、デフォルトでは、操作直後に memberuniqueMemberowner、および seeAlso 属性の整合性更新が実行されます。

たとえば、管理者がディレクトリー内のグループまたはユーザーを削除、更新、名前変更、または移動した場合、Directory Server はその操作を Referential Integrity のログファイルに記録します。Directory Server はこのログファイルから識別名 (DN) を使用し、プラグインの設定で指定された属性に一致するエントリーを検索し、一致するエントリーを更新します。たとえば、cn=demo,dc=example,dc=com エントリーを削除すると、プラグインは cn=demo,dc=example,dc=com に設定された member 属性でエントリーを検索し、これらの member 属性を削除します。その後、プラグインは uniqueMemberowner、および seeAlso 属性に対して同じことを実行します。

デフォルトでは、Directory Server は元の操作と同じトランザクションで検索および更新を行います。検索および更新操作には時間がかかる場合があるため、これらの操作は、元の操作の完了後に遅延させることができます。dsconf plugin referential-integrity set コマンドの --update-lay オプションを使用すると、元の操作を整合性の更新から分離できます。

変更および削除操作のパフォーマンスの低下を回避するには、Referential Integrity プラグインの設定で指定した属性をインデックス化します。

9.2. コマンドラインを使用した Referential Integrity プラグインの設定

コマンドラインを使用して Referential Integrity プラグインを設定できます。

この手順は、レプリケーショントポロジー内のすべてのサプライヤーで実行してください。

手順

  1. Referential Integrity プラグインを有効にします。

    # dsconf -D "cn=Directory Manager" ldap://server.example.com plugin referential-integrity enable
  2. プラグインがユーザーエントリーの削除または名前変更操作を検索するサブツリーを設定します。

    # dsconf -D "cn=Directory Manager" ldap://server.example.com plugin referential-integrity set --entry-scope "ou=People,dc=example,dc=com"
  3. オプション: エントリースコープでサブツリーを除外します。

    # dsconf -D "cn=Directory Manager" ldap://server.example.com plugin referential-integrity set --exclude-entry-scope "ou=Special Users,ou=People,dc=example,dc=com"

    このコマンドは、ou=Special Users,ou=People,dc=example,dc=com サブツリーで実行される削除または名前変更操作を無視するようにプラグインを設定します。

  4. プラグインがグループエントリーを更新するサブツリーを設定します。

    # dsconf -D "cn=Directory Manager" ldap://server.example.com plugin referential-integrity set --container-scope "ou=Groups,dc=example,dc=com"
  5. デフォルトでは、プラグインは memberuniqueMemberowner、および seeAlso 属性の整合性更新を実行します。他の属性を指定するには、次のように入力します。

    # dsconf -D "cn=Directory Manager" ldap://server.example.com plugin referential-integrity set --membership-attr attribute_1 attribute_2

    このコマンドは、プラグインの設定内の属性のリストをオーバーライドすることに注意してください。属性を追加する場合は、現在の属性リストと追加の属性リストを --membership-attr オプションに渡します。

  6. オプション: デフォルトでは、Directory Server は参照整合性チェックを即座に実行します。遅延を設定する場合は、次のように入力します。

    # dsconf -D "cn=Directory Manager" ldap://server.example.com plugin referential-integrity set --update-delay=5

    このコマンドは、参照整合性チェックを 5 秒遅延させます。複数のサプライヤーで Referential Integrity を有効にした場合、遅延を設定するとレプリケーションループやディレクトリーの不整合が発生する可能性があることに注意してください。このような問題を回避するには、トポロジー内の 1 つのサプライヤーでのみプラグインを有効にします。

  7. インスタンスを再起動します。

    # dsctl instance_name restart

検証

  1. Referential Integrity プラグインの設定を表示します。

    # dsconf -D "cn=Directory Manager" ldap://server.example.com plugin referential-integrity show
    ...
    nsslapd-plugincontainerscope: ou=Groups,dc=example,dc=com
    nsslapd-pluginentryscope: ou=People,dc=example,dc=com
    ...
    referint-membership-attr: member
    referint-membership-attr: uniquemember
    referint-membership-attr: owner
    referint-membership-attr: seeAlso
    referint-update-delay: 0
    ...
  2. グループの member 属性を表示して、グループのメンバーをリストします。

    # ldapsearch -D "cn=Directory Manager" -W -H ldap://server.example.com -b "cn=demoGroup,ou=Groups,dc=example,dc=com" member
    ...
    member: uid=demoUser,ou=People,dc=example,dc=com
  3. uid=demoUser,ou=People,dc=example,dc=com ユーザーを削除します。

    # dsidm -D "cn=Directory manager" ldap://server.example.com -b "dc=example,dc=com" user delete "uid=demoUser,ou=People,dc=example,dc=com"
  4. グループのメンバーを再度表示します。

    # ldapsearch -D "cn=Directory Manager" -W -H ldap://server.example.com -b "cn=demoGroup,ou=People,dc=example,dc=com" member

    uid=demoUser,ou=People,dc=example,dc=com が グループのメンバーとしてリストされなければ、Referential Integrity プラグインは機能しています。

9.3. Web コンソールを使用した Referential Integrity プラグインの設定

Directory Server Web コンソールを使用して Referential Integrity プラグインを設定できます。

この手順は、レプリケーショントポロジー内のすべてのサプライヤーで実行してください。

前提条件

  • Web コンソールでインスタンスにログインしている。

手順

  1. PluginsReferential Integrity に移動します。
  2. プラグインを有効にします。
  3. ActionsRestart Instance をクリックします。
  4. PluginsReferential Integrity を再度移動します。
  5. デフォルトでは、プラグインは memberuniqueMemberowner、および seeAlso 属性の整合性更新を実行します。他の属性を指定するには、Membership Attribute フィールドのリストを更新します。
  6. Entry Scope フィールドを、プラグインがユーザーエントリーの削除または名前変更の操作を検索するサブツリーの DN に設定します。
  7. オプション: エントリースコープの下にあるサブツリーを除外するには、Exclude Entry Scope フィールドにサブツリーの DN を入力します。
  8. Container Scope フィールドを、プラグインがグループエントリーを更新するサブツリーの DN に設定します。
  9. オプション: Referential Integrity のログファイルへのパスを更新します。Directory Server はこのファイルを使用してディレクトリー内の変更を追跡します。dirsrv ユーザーには、この場所への書き込み権限が必要であることに注意してください。
  10. オプション: デフォルトでは、Directory Server は参照整合性チェックを即座に実行します。遅延を設定する場合は、Update Delay フィールドで設定します。

    複数のサプライヤーで Referential Integrity を有効にした場合、遅延を設定するとレプリケーションループやディレクトリーの不整合が発生する可能性があることに注意してください。このような問題を回避するには、トポロジー内の 1 つのサプライヤーでのみプラグインを有効にします。

  11. Save Config をクリックします。

検証

  1. グループの member 属性を表示して、グループのメンバーをリストします。

    # ldapsearch -D "cn=Directory Manager" -W -H ldap://server.example.com -b "cn=demoGroup,ou=Groups,dc=example,dc=com" member
    ...
    member: uid=demoUser,ou=People,dc=example,dc=com
  2. uid=demoUser,ou=People,dc=example,dc=com ユーザーを削除します。

    # dsidm -D "cn=Directory manager" ldap://server.example.com -b "dc=example,dc=com" user delete "uid=demoUser,ou=People,dc=example,dc=com"
  3. グループのメンバーを再度表示します。

    # ldapsearch -D "cn=Directory Manager" -W -H ldap://server.example.com -b "cn=demoGroup,ou=People,dc=example,dc=com" member

    uid=demoUser,ou=People,dc=example,dc=com が グループのメンバーとしてリストされなければ、Referential Integrity プラグインは機能しています。

第10章 Directory Server でのロールの使用

ロールを使用して Directory Server エントリーをグループ化できます。ロールは、静的グループと動的グループの両方として動作します。ロールはグループよりも柔軟に実装できるため、簡単に使用できます。たとえば、アプリケーションはグループを選択し、複数のグループのメンバーリストを参照するのではなく、エントリー自体をクエリーしてエントリーが属するロールのリストを取得できます。

コマンドライン または Web コンソール を使用してロールを管理できます。

10.1. Directory Server のロール

ロールは、ハイブリッドグループと同様に、静的グループと動的グループの両方として動作します。

  • グループを使用すると、Directory Server はエントリーをグループエントリーにメンバーとして追加します。
  • ロールを使用すると、Directory Server はロール属性をエントリーに追加し、この属性を使用してロールエントリー内のメンバーを自動的に識別します。

ロールメンバーは、ロールを持つエントリーです。ロールのメンバーは、ロールタイプに応じて明示的にまたは動的に指定できます。Directory Server は、以下のタイプのロールをサポートします。

  • 管理ロール

    管理ロールにはメンバーの明示的なリストがあります。管理ロールを使用すると、静的グループで実行するのと同じタスクを実行できます。

  • フィルター設定ロール

    動的グループによるフィルタリングと同様に、フィルター設定ロールを使用してロールメンバーをフィルタリングできます。Directory Server は、エントリーがロールで定義された特定の属性を持っているかどうかに応じて、フィルター設定ロールにエントリーを割り当てます。

  • ネストされたロール

    ネストされたロールは、管理ロールとフィルター設定ロールを含むことができます。

ロールを作成するときは、ユーザーがロールに対して自分自身を追加または削除できるかどうかを決定します。詳細は、「Directory Server でのロールのセキュアな使用」 を参照してください。

注記

サーバーがクライアントアプリケーションに対して機能するため、Directory Server ではロールの評価がグループを評価するよりもリソース集約されます。ロールを使用すると、クライアントアプリケーションは nsRole 属性を検索してロールのメンバーシップを確認することができます。nsRole 属性は、エントリーがどのロールに属しているかを識別する計算属性です。Directory Server は nsRole 属性を保存しません。クライアントアプリケーションの観点からは、メンバーシップを確認する方法は統一されており、サーバー側で実行されます。

ロールの使用に関する考慮事項については、「ディレクトリーサービスの計画と設計」 ドキュメントの「グループとロールのいずれを使用するかの決定」を参照してください。

10.2. Directory Server でのロールのセキュアな使用

新しいロールを作成するときは、ユーザーがロールに対して自身を簡単に追加または削除できるかどうかを考慮してください。たとえば、Mountain Biking グループロールのユーザーが、自身を簡単に同ロールに追加または削除できるようにすることは可能です。ただし、Marketing ロールが割り当てられているユーザーに、同ロールへの自身の追加または削除を許可することはできません。

潜在的なセキュリティーリスクの 1 つは、ロールを非アクティブ化してユーザーアカウントを非アクティブ化することです。非アクティブなロールには、接尾辞に特別なアクセス制御手順 (ACI) が定義されます。管理者によって、ユーザーがロールに自身を自由に追加および削除することが許可されている場合、これらのユーザーは非アクティブなロールから自身を削除して、アカウントのロックを解除できます。

たとえば、管理ロールがユーザーに割り当てられるとします。Directory Server がアカウントの非アクティブ化を使用してこの管理ロールをロックすると、Directory Server はそのユーザーの nsAccountLock 属性を true として計算するため、ユーザーはサーバーにバインドできなくなります。ただし、ユーザーがすでに Directory Server にバインドされており、管理ロールによってロックされている場合、制限的な ACI が指定されていなければ、ユーザーはエントリーから nsRoleDN 属性を削除して自身のロックを解除できます。

ユーザーが nsRoleDN 属性を削除できないようにするには、ロールのタイプに応じて次の ACI を使用します。

  • 管理ロール。管理ロールのメンバーであるエントリーの場合は、次の ACI を使用します。

    aci: (targetattr="nsRoleDN")
    (targattrfilters= add=nsRoleDN:(!(nsRoleDN=cn=AdministratorRole,dc=example,dc=com)), del=nsRoleDN:(!(nsRoleDN=cn=nsManagedDisabledRole,dc=example,dc=com)))
    (version3.0;acl "allow mod of nsRoleDN by self but not to critical values"; allow(write) userdn=ldap:///self;)
  • フィルター設定ロール。フィルターの一部である属性 (nsRoleFilter) を保護します。フィルター設定ロールが使用する属性の追加、削除、または変更をユーザーに許可しないでください。Directory Server がフィルター属性の値を計算する場合は、このフィルター属性値を変更できるすべての属性を保護する必要があります。
  • ネストされたロール。ネストされたロールは、フィルター設定ロールと管理ロールを含むことができます。したがって、ネストされたロールに含まれるロールの属性ごとに、ACI での変更操作を制限する必要があります。

10.3. コマンドラインを使用した Directory Server でのロールの管理

コマンドラインを使用して、ロールを表示、作成、および削除できます。

10.3.1. Directory Server での管理ロールの作成

管理ロールは、明示的に列挙されたメンバーのリストを持つロールです。ldapmodify ユーティリティーを使用して、管理ロールを作成できます。次の例では、マーケティングチームの管理ロールを作成します。

前提条件

  • ou=people,dc=example,dc=com 親エントリーが Directory Server に存在する。
  • cn=Bob Jones,ou=people,dc=example,dc=com ユーザーエントリーが Directory Server に存在する。

手順

  1. -a オプションを指定した ldapmodify コマンドを使用して、cn=Marketing 管理ロールエントリーを作成します。

    # ldapmodify -a -D "cn=Directory Manager" -W -H ldap://server.example.com -x << EOF
    dn: cn=Marketing,ou=people,dc=example,dc=com
    objectclass: top
    objectclass: LDAPsubentry
    objectclass: nsRoleDefinition
    objectclass: nsSimpleRoleDefinition
    objectclass: nsManagedRoleDefinition
    cn: Marketing
    description: managed role for the marketing team
    EOF

    管理ロールエントリーには、次のオブジェクトクラスが含まれている必要があります。

    • LDAPsubentry
    • nsRoleDefinition
    • nsSimpleRoleDefinition
    • nsManagedRoleDefinition
  2. このユーザーエントリーに nsRoleDN 属性を追加して、cn=Marketing,ou=people,dc=example,dc=com 管理ロールを cn=Bob Jones,ou=people,dc=example,dc=com ユーザーエントリーに割り当てます。

    # ldapmodify -D "cn=Directory Manager" -W -H ldap://server.example.com -x << EOF
    dn: cn=Bob Jones,ou=people,dc=example,dc=com
    changetype: modify
    add: nsRoleDN
    nsRoleDN: cn=Marketing,ou=people,dc=example,dc=com
    EOF
    
    modifying entry "cn=Bob Jones,ou=people,dc=example,dc=com"
  3. オプション: インデックスのない検索を避けるために、userRoot データベースの nsRoleDN 属性の 等価 インデックスを設定します。

    #  dsconf -D "cn=Directory Manager" ldap://server.example.com backend index add --index-type eq --attr nsroleDN --reindex userRoot

検証

  • 現在 cn=Marketing,ou=people,dc=example,dc=com 管理ロールに属しているユーザーエントリーをリスト表示します。

    # ldapsearch -D "cn=Directory Manager" -W -H ldap://server.example.com -x -b "dc=example,dc=com" "(nsRole=cn=Marketing,ou=people,dc=example,dc=com)" dn 
    
    dn: cn=Bob Jones,ou=people,dc=example,dc=com
    
    dn: cn=Tom Devis,ou=people,dc=example,dc=com

10.3.2. Directory Server でのフィルター設定ロールの作成

Directory Server は、エントリーにロールで定義された特定の属性がある場合、フィルター設定ロールにエントリーを割り当てます。ロール定義では、nsRoleFilter LDAP フィルターを指定します。フィルターに一致するエントリーは、ロールのメンバーです。

ldapmodify ユーティリティーを使用して、フィルター設定ロールを作成できます。次の例では、営業部門のマネージャー用のフィルター設定ロールを作成します。

前提条件

  • ou=people,dc=example,dc=com 親エントリーが Directory Server に存在する。

手順

  1. -a オプションを指定した ldapmodify コマンドを使用して、cn=SalesManagerFilter のフィルター設定ロールエントリーを作成します。

    # ldapmodify -a -D "cn=Directory Manager" -W -H ldap://server.example.com -x << EOF
    dn: cn=SalesManagerFilter,ou=people,dc=example,dc=com
    changetype: add
    objectclass: top
    objectclass: LDAPsubentry
    objectclass: nsRoleDefinition
    objectclass: nsComplexRoleDefinition
    objectclass: nsFilteredRoleDefinition
    cn: SalesManagerFilter
    nsRoleFilter: o=sales managers
    Description: filtered role for sales managers
    EOF

    cn=SalesManagerFilter のフィルター設定ロールエントリーには、ロール用の o=sales manager フィルターがあります。sales managers の値を持つ o 属性を有するすべてのユーザーエントリーは、フィルター設定ロールのメンバーです。

    フィルター設定ロールのメンバーになったユーザーエントリーの例:

    dn: cn=Pat Smith,ou=people,dc=example,dc=com
    objectclass: person
    cn: Pat
    sn: Smith
    userPassword: password
    o: sales managers

    フィルター設定ロールエントリーには、次のオブジェクトクラスが必要です。

    • LDAPsubentry
    • nsRoleDefinition
    • nsComplexRoleDefinition
    • nsFilteredRoleDefinition
  2. オプション: インデックスのない検索を避けるために、nsRoleFilter ロールフィルターで使用する属性の 等価 インデックスを設定します。この例では、ロールは o=sales manager をフィルターとして使用します。したがって、o 属性にインデックスを付けて、検索パフォーマンスを向上します。

    #  dsconf -D "cn=Directory Manager" ldap://server.example.com backend index add --index-type eq --attr o --reindex userRoot

検証

  • 現在 cn=SalesManagerFilter,ou=people,dc=example,dc=com フィルター設定ロールに属しているユーザーエントリーをリスト表示します。

    # ldapsearch -D "cn=Directory Manager" -W -H ldap://server.example.com -x -b "dc=example,dc=com" "(nsRole=cn=SalesManagerFilter,ou=people,dc=example,dc=com)" dn 
    
    dn: cn=Jess Mor,ou=people,dc=example,dc=com
    
    dn: cn=Pat Smith,ou=people,dc=example,dc=com

10.3.3. Directory Server でのネストされたロールの作成

ネストされたロールは、管理ロールとフィルター設定ロールを含むことができます。ネストされたロールエントリーには、ネストするロールを識別するための nsRoleDN 属性が必要です。

ldapmodify ユーティリティーを使用して、ネストされたロールを作成できます。次の例では、Directory Server での管理ロールの作成Directory Server でのフィルター設定ロールの作成 で作成した管理ロールとフィルター設定ロールを含むネストされたロールを作成します。

前提条件

  • ou=people,dc=example,dc=com 親エントリーが Directory Server に存在する。

手順

  1. -a オプションを指定した ldapmodify コマンドを使用して、cn=SalesManagerFilter フィルター設定ロールと cn=Marketing 管理ロールを含む cn=MarketingSales のネストされたロールエントリーを作成します。

    # ldapmodify -a -D "cn=Directory Manager" -W -H ldap://server.example.com -x << EOF
    dn: cn=MarketingSales,ou=people,dc=example,dc=com
    objectclass: top
    objectclass: LDAPsubentry
    objectclass: nsRoleDefinition
    objectclass: nsComplexRoleDefinition
    objectclass: nsNestedRoleDefinition
    cn: MarketingSales
    nsRoleDN: cn=SalesManagerFilter,ou=people,dc=example,dc=com
    nsRoleDN: cn=Marketing,ou=people,dc=example,dc=com
    EOF

    必要に応じて、ロールに description 属性を含めることができます。

    ネストされたロールエントリーには、次のオブジェクトクラスが必要です。

    • LDAPsubentry
    • nsRoleDefinition
    • nsComplexRoleDefinition
    • nsNestedRoleDefinition

検証

  • cn=MarketingSales のネストされたロールに現在属しているユーザーエントリーをリスト表示します。

    # ldapsearch -D "cn=Directory Manager" -W -H ldap://server.example.com -x -b "dc=example,dc=com" "(nsRole=cn=MarketingSales,ou=people,dc=example,dc=com)" dn 
    
    dn: cn=Bob Jones,ou=people,dc=example,dc=com
    dn: cn=Pat Smith,ou=people,dc=example,dc=com
    dn: cn=Jess Mor,ou=people,dc=example,dc=com
    dn: cn=Tom Devis,ou=people,dc=example,dc=com

10.3.4. エントリーのロールの表示

エントリーのロールを表示するには、nsRole 仮想属性を明示的に指定して ldapsearch コマンドを使用します。

前提条件

  • ロールエントリーが存在する。
  • uid=user_name ユーザーエントリーにロールを割り当てている。

手順

  • 指定した nsRole 仮想属性を持つ uid=user_name エントリーを検索します。

    # ldapsearch -D "cn=Directory Manager" -W -H ldap://server.example.com -b "dc=example,dc=com" -s sub -x "(uid=user_name)" nsRole
    
    dn: uid=user_name,ou=people,dc=example,dc=com
    ...
    nsRole: cn=Role for Managers,dc=example,dc=com
    nsRole: cn=Role for Accounting,dc=example,dc=com

    このコマンドは、uid=user_name ユーザーがメンバーとなっているすべてのロールを取得します。

10.3.5. Directory Server でのロールの削除

Directory Server のロールを削除するには、ldapmodify コマンドを使用します。

以下に、cn=Marketing 管理ロールを Directory Server から削除する例を示します。

手順

  • cn=Marketing 管理ロールエントリーを削除するには、次のように入力します。

    # ldapmodify -D "cn=Directory Manager" -W -H ldap://server.example.com -x << EOF
    dn: cn=Marketing,ou=People,dc=example,dc=com
    changetype: delete
    EOF
    
    deleting entry "cn=Marketing,ou=People,dc=example,dc=com"
    注記

    ロールを削除すると、Directory Server はロールエントリーのみを削除し、各ロールメンバーの nsRoleDN 属性は削除しません。各ロールメンバーの nsRoleDN 属性を削除するには、参照整合性プラグインを有効にし、nsRoleDN 属性を管理するようにこのプラグインを設定します。

    参照整合性プラグインの詳細は、参照整合性を使用したエントリー間の関係の維持 を参照してください。

関連情報

10.4. Web コンソールを使用した Directory Server のロールの管理

Web コンソールの LDAP browser を使用して、ロールを表示、作成、削除できます。

10.4.1. LDAP ブラウザーでのロールの作成

Web コンソールで LDAP Browser ウィザードを使用して、Red Hat Directory Server エントリーのロールを作成できます。

前提条件

  • Web コンソールへのアクセス。
  • 親エントリーが Directory Server に存在する。

手順

  1. Web コンソールにログインし、Red Hat Directory Server をクリックします。
  2. Web コンソールが Red Hat Directory Server インターフェイスをロードしたら、LDAP Browser を開きます。
  3. LDAP エントリーを選択し、Options メニューを開きます。
  4. ドロップダウンメニューから New を選択し、Create a new role をクリックします。
  5. ウィザードの手順に従い、各手順を完了したら Next ボタンをクリックします。
  6. ロールを作成するには、Create Role の手順でロールの設定を確認し、Create ボタンをクリックします。Back ボタンをクリックしてロールの設定を変更するか、Cancel ボタンをクリックしてロールの作成をキャンセルできます。
  7. ウィザードウィンドウを閉じるには、Finish ボタンをクリックします。

検証

  • LDAP エントリーを展開し、新しいロールがエントリーパラメーターに表示されることを確認します。

10.4.2. LDAP ブラウザーでのロールの削除

Web コンソールで LDAP Browser を使用して、Red Hat Directory Server エントリーからロールを削除できます。

前提条件

  • Web コンソールへのアクセス。
  • 親エントリーが Directory Server に存在する。

手順

  1. Web コンソールにログインし、Red Hat Directory Server をクリックします。
  2. Web コンソールが Red Hat Directory Server インターフェイスをロードしたら、LDAP browser をクリックします。
  3. LDAP エントリーを展開し、削除するロールを選択します。
  4. Options メニューを開き、Delete を選択します。
  5. 削除するロールに関するデータを確認し、Deletion の手順に到達するまで Next ボタンをクリックします。
  6. スイッチを Yes, I’m sure の位置に切り替え、Delete ボタンをクリックします。
  7. ウィザードウィンドウを閉じるには、Finish ボタンをクリックします。

検証

  • LDAP エントリーを展開し、ロールがエントリーのパラメーターに含まれていないことを確認します。

10.4.3. LDAP ブラウザーでのロールの変更

Web コンソールで LDAP Browser を使用して、Red Hat Directory Server エントリーのロールパラメーターを変更できます。

前提条件

  • Web コンソールへのアクセス。
  • 親エントリーが Red Hat Directory Server に存在する。

手順

  1. Web コンソールにログインし、Red Hat Directory Server をクリックします。
  2. Web コンソールが Red Hat Directory Server インターフェイスをロードしたら、LDAP browser をクリックします。
  3. LDAP エントリーを展開し、変更するロールを選択します。
  4. Options メニューをクリックし、Edit を選択してロールのパラメーターを変更するか、Rename を選択してロールの名前を変更します。
  5. ウィザードウィンドウで必要なパラメーターを変更し、LDIF Statements の手順が表示されるまで各手順を完了して Next をクリックします。
  6. 更新されたパラメーターを確認し、Modify Entry または Change Entry Name をクリックします。
  7. ウィザードウィンドウを閉じるには、Finish ボタンをクリックします。

検証

  • LDAP エントリーを展開し、更新されたパラメーターがロールにリストされていることを確認します。

法律上の通知

Copyright © 2024 Red Hat, Inc.
The text of and illustrations in this document are licensed by Red Hat under a Creative Commons Attribution–Share Alike 3.0 Unported license ("CC-BY-SA"). An explanation of CC-BY-SA is available at http://creativecommons.org/licenses/by-sa/3.0/. In accordance with CC-BY-SA, if you distribute this document or an adaptation of it, you must provide the URL for the original version.
Red Hat, as the licensor of this document, waives the right to enforce, and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent permitted by applicable law.
Red Hat, Red Hat Enterprise Linux, the Shadowman logo, the Red Hat logo, JBoss, OpenShift, Fedora, the Infinity logo, and RHCE are trademarks of Red Hat, Inc., registered in the United States and other countries.
Linux® is the registered trademark of Linus Torvalds in the United States and other countries.
Java® is a registered trademark of Oracle and/or its affiliates.
XFS® is a trademark of Silicon Graphics International Corp. or its subsidiaries in the United States and/or other countries.
MySQL® is a registered trademark of MySQL AB in the United States, the European Union and other countries.
Node.js® is an official trademark of Joyent. Red Hat is not formally related to or endorsed by the official Joyent Node.js open source or commercial project.
The OpenStack® Word Mark and OpenStack logo are either registered trademarks/service marks or trademarks/service marks of the OpenStack Foundation, in the United States and other countries and are used with the OpenStack Foundation's permission. We are not affiliated with, endorsed or sponsored by the OpenStack Foundation, or the OpenStack community.
All other trademarks are the property of their respective owners.