5.3.2.3. LDAP グループ情報の RBAC ロールへのマッピング

LDAP サーバーへの接続が作成され、グループ検索が適切に設定されたら、LDAP グループと RBAC ロール間のマッピングを作成する必要があります。このマッピングは包括的かつ排他的で可能で、ユーザーはグループメンバーシップに基づいて自動的にロールを割り当てることができます。

警告

RBAC が設定されていない場合は、注意が必要です。、特に新規に作成された LDAP 対応レルムに切り替える場合は十分に注意してください。ユーザーとロールを適切に設定せずに RBAC を有効にすると、管理者が JBoss EAP 管理インターフェースにログインできなくなることがあります。

注記

ここで使用する管理 CLI コマンドは、JBoss EAP スタンドアロンサーバーを実行していることを仮定しています。JBoss EAP 管理対象ドメインの管理 CLI を使用する場合の詳細は『管理 CLI ガイド』を参照してください。

RBAC が有効になっており、設定されていることの確認

LDAP と RBAC ロール間のマッピングを使用するには、RBAC を有効化し、初期設定する必要があります。

/core-service=management/access=authorization:read-attribute(name=provider)

以下の結果が出されます。

{ "outcome" => "success", "result" => "rbac" }

RBAC の有効化および設定の詳細は、JBoss EAP『サーバーセキュリティーの設定方法』の「ロールベースアクセス制御の有効化」を参照してください。

既存のロール一覧の確認

read-children-names 操作を使用して、設定されたロールの完全なリストを取得します。

/core-service=management/access=authorization:read-children-names(child-type=role-mapping)

ロールの一覧を作成するもの

{
  "outcome" => "success",
  "result" =>
    [ "Administrator", "Deployer", "Maintainer", "Monitor", "Operator", "SuperUser" ]
}

また、ロールの既存のすべてのマッピングを確認できます。

/core-service=management/access=authorization/role-mapping=Administrator:read-resource(recursive=true)
{
  "outcome" => "success",
  "result" =>
  {
    "include-all" => false,
    "exclude" => undefined,
    "include" => {
      "user-theboss" => {
        "name" => "theboss",
        "realm" => undefined,
        "type" => "USER"
      },
      "user-harold" => {
        "name" => "harold",
        "realm" => undefined,
        "type" => "USER"
      },
      "group-SysOps" => {
        "name" => "SysOps",
        "realm" => undefined,
        "type" => "GROUP"
      }
    }
  }
}

Role-Mapping エントリーの設定

ロールに Role-Mapping エントリーがない場合は、これを作成する必要があります。例:

/core-service=management/access=authorization/role-mapping=Auditor:read-resource()
{
  "outcome" => "failed",
  "failure-description" => "WFLYCTL0216: Management resource '[ (\"core-service\" => \"management\"), (\"access\" => \"authorization\"), (\"role-mapping\" => \"Auditor\") ]' not found"
}

ロールマッピングを追加する:

/core-service=management/access=authorization/role-mapping=Auditor:add()
{
  "outcome" => "success"
}

検証する:

/core-service=management/access=authorization/role-mapping=Auditor:read-resource()
{
  "outcome" => "success",
  "result" => {
    "include-all" => false,
    "exclude" => undefined,
    "include" => undefined
  }
}

除外および除外のロールへのグループの追加

ロールに含める、またはロールから除外するためにグループを追加できます。

注記

除外マッピングが優先されるか、または包含マッピングが優先されます。

包含にグループを追加:

/core-service=management/access=authorization/role-mapping=Auditor/include=group-GroupToInclude:add(name=GroupToInclude, type=GROUP)

除外するグループを追加:

/core-service=management/access=authorization/role-mapping=Auditor/exclude=group-GroupToExclude:add(name=GroupToExclude, type=GROUP)

結果の確認:

/core-service=management/access=authorization/role-mapping=Auditor:read-resource(recursive=true)
{
  "outcome" => "success",
  "result" => {
    "include-all" => false,
    "exclude" => {
      "group-GroupToExclude" => {
        "name" => "GroupToExclude",
        "realm" => undefined,
        "type" => "GROUP"
      }
    },
    "include" => {
      "group-GroupToInclude" => {
        "name" => "GroupToInclude",
        "realm" => undefined,
        "type" => "GROUP"
      }
    }
  }
}

RBAC ロールグループの除外または包含からのグループの削除

グループを追加から削除するには、以下を使用します。

/core-service=management/access=authorization/role-mapping=Auditor/include=group-GroupToInclude:remove

除外からグループを削除するには、以下を使用します。

/core-service=management/access=authorization/role-mapping=Auditor/exclude=group-GroupToExclude:remove