Red Hat Training
A Red Hat training course is available for Red Hat JBoss Enterprise Application Platform
3.3.2.3. LDAP グループ情報の RBAC ロールへのマッピング
LDAP サーバーへの接続が作成され、グループ検索が適切に設定されたら、LDAP グループと RBAC ロール間のマッピングを作成する必要があります。このマッピングは包括的かつ排他的で可能で、ユーザーはグループメンバーシップ情報に基づいて自動的にロールを割り当てることができます。
RBAC が設定されていない場合は、注意が必要です。、特に新規に作成された LDAP 対応レルムに切り替える場合は十分に注意してください。ユーザーとロールを適切に設定せずに RBAC を有効にすると、管理者が管理インターフェースにログインできなくなることがあります。
以下の CLI コマンドは、JBoss EAP 6 のスタンドアロンインスタンスを想定して実行されました。JBoss EAP 6 ドメインでの CLI の使用の詳細は、Red Hat JBoss Enterprise Application Platform 6 Administration and Configuration Guide の The Management CLI セクションを参照してください。
RBAC が有効になっており、設定されていることの確認
LDAP と RBAC ロール間のマッピングを使用するには、RBAC を有効化し、初期設定する必要があります。
/core-service=management/access=authorization:read-attribute(name=provider)
以下の結果が出されます。
{
"outcome" => "success",
"result" => "rbac"
}RBAC の有効化と設定の詳細は、Red Hat JBoss Enterprise Application Platform 6 How to Configure Server Security guide の Enabling Role-Based Access Control セクションを参照してください。
既存のロール一覧の確認
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" => "JBAS014807: 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)
結果の確認:
[standalone@localhost:9999 /] /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"
}}
}
}ロールからのグループの削除
除外または含めるために追加されたグループも削除される場合があります
グループを追加から削除するには、以下を使用します。
/core-service=management/access=authorization/role-mapping=Auditor/include=group-GroupToInclude:remove
除外からグループを削除するには、以下を使用します。
/core-service=management/access=authorization/role-mapping=Auditor/exclude=group-GroupToExclude:remove