第4章 Elytron サブシステムの例
4.1. 初期状態
JBoss EAP はデフォルトで以下の事前設定されたコンポーネントを提供します。
- ApplicationDomain
-
ApplicationDomain
セキュリティードメインは認証にApplicationRealm
およびgroups-to-roles
を使用します。また、ログインパーミッションの割り当てにdefault-permission-mapper
も使用します。 - ApplicationRealm
-
ApplicationRealm
セキュリティーレルムは、application-users.properties
を使用してプリンシパルを認証し、application-roles.properties
を使用してロールを割り当てるセキュリティーレルムです。これらのファイルは、デフォルトでEAP_HOME/standalone/configuration
にマップするjboss.server.config.dir
の下にあります。これらのファイルは、レガシーのデフォルトセキュリティー設定で使用されるファイルと同じです。 - application-http-authentication
-
application-http-authentication
http-authentication-factory は HTTP 上の認証に使用できます。これは、global
provider-http-server-mechanism-factory を使用して認証方法をフィルターし、認証するプリンシパルにApplicationDomain
を使用します。BASIC
およびFORM
認証を許可し、BASIC
をApplication Realm
としてアプリケーションに公開します。 - application-sasl-authentication
-
application-sasl-authentication
sasl-authentication-factory は SASL を使用した認証に使用できます。これはconfigured
sasl-server-factory を使用して認証方法をフィルターし、またglobal
provider-sasl-server-factory を使用してプロバイダー名をフィルターします。management-sasl-authentication
は、プリンシパルの認証にManagementDomain
セキュリティードメインを使用します。 - configured (configurable-sasl-server-factory)
-
これは、メカニズム名を基に使用される
sasl-authentication-factory
をフィルターするために使用されます。この場合、configured
はJBOSS-LOCAL-USER
およびDIGEST-MD5
で一致します。また、wildfly.sasl.local-user.default-user
を$local
に設定します。 - default-permission-mapper
default-permission-mapper
は、default-permissions
パーミッションセットを使用して、サーバー上のサービスへアクセスするのにアイデンティティーが必要とする完全セットのパーミッションを割り当てする、簡単なパーミッションマッパーです。たとえば、
default-permission-mapper
はdefault-permissions
パーミッションセットによって指定されるorg.wildfly.extension.batch.jberet.deployment.BatchPermission
を使用してバッチジョブのパーミッションを割り当てます。バッチパーミッションは起動、停止、再起動、破棄、および読み取りで、javax.batch.operations.JobOperator
と一致します。また、
default-permission-mapper
はlogin-permission
パーミッションセットによって指定されたorg.wildfly.security.auth.permission.LoginPermission
を使用してログインパーミッションを割り当てます。- elytron (mechanism-provider-filtering-sasl-server-factor)
-
これは、プロバイダーを基に使用される
sasl-authentication-factory
をフィルターするために使用されます。この場合、elytron
はWildFlyElytron
プロバイダー名で一致します。 - global (provider-http-server-mechanism-factory)
- HTTP 認証ファクトリーの作成時にサポートされる認証方法をリストするために使用される HTTP サーバーファクトリーのメカニズム定義です。
- global (provider-sasl-server-factory)
- これは、SASL 認証ファクトリーを作成するために使用される SASL サーバーファクトリー定義です。
- groups-to-roles
-
groups-to-roles
マッパーは、プリンシパルのgroups
情報をデコードし、role
情報に使用する簡単なロールデコーダーです。 - local (マッパー)
-
local
マッパーは、local
セキュリティーレルムにマップする定数ロールマッパーです。認証をlocal
セキュリティーレルムにマップするのに使用されます。 - local (セキュリティーレルム)
-
local
セキュリティーレルムは認証を行わず、プリンシパルのアイデンティティーを$local
に設定します。 - ManagementDomain
-
ManagementDomain
セキュリティードメインは認証に以下の 2 つのセキュリティーレルムを使用します。groups-to-roles
によるManagementRealm
、super-user-mapper
によるlocal
。また、ログインパーミッションの割り当てにdefault-permission-mapper
も使用します。 - ManagementRealm
-
ManagementRealm
セキュリティーレルムは、mgmt-users.properties
を使用してプリンシパルを認証し、mgmt-roles.properties
を使用してロールを割り当てるセキュリティーレルムです。これらのファイルは、デフォルトでEAP_HOME/standalone/configuration
にマップするjboss.server.config.dir
の下にあります。これらのファイルは、レガシーのデフォルトセキュリティー設定で使用されるファイルと同じです。 - management-http-authentication
-
management-http-authentication
http-authentication-factory は、HTTP 上の認証に使用できます。これはglobal
provider-http-server-mechanism-factory を使用して認証方法をフィルターし、ManagementDomain
を認証するプリンシパルに使用します。DIGEST
認証を許可し、ManagementRealm
としてアプリケーションに公開します。 - management-sasl-authentication
-
management-sasl-authentication
sasl-authentication-factory は SASL を使用した認証に使用できます。これはconfigured
sasl-server-factory を使用して認証方法をフィルターし、またglobal
provider-sasl-server-factory を使用してプロバイダー名をフィルターします。management-sasl-authentication
は、プリンシパルの認証にManagementDomain
セキュリティードメインを使用します。また、local
レルムマッパーを使用してJBOSS-LOCAL-USER
を使った認証をマップし、DIGEST-MD5
を使った認証をManagementRealm
にマップします。 - super-user-mapper
-
super-user-mapper
マッパーはSuperUser
ロールをプリンシパルにマップする定数ロールマッパーです。
4.1.1. セキュリティー
アプリケーションをセキュアにするため、JBoss EAP には事前設定された HTTP 用の application-http-authentication
と SASL 用の application-sasl-authentication
が同梱されています。application-http-authentication
http-authentication-factory は、認証に ApplicationRealm
と groups-to-roles
を使用する ApplicationDomain
を使用します。ApplicationRealm
は、ユーザー名、パスワード、およびロール情報に対して application-users.properties
および application-roles.properties
が関係する properties-realm です。
管理インターフェイスをセキュアにするため、JBoss EAP には事前設定された HTTP 用の management-http-authentication
と SASL 用の management-sasl-authentication
が同梱されています。management-http-authentication
http-authentication-factory は、認証に ManagementRealm
と groups-to-roles
を使用する ManagementDomain
を使用します。ManagementRealm
は、ユーザー名、パスワード、およびロール情報に対して mgmt-users.properties
および mgmt-roles.properties
が関係する properties-realm です。management-sasl-authentication
sasl-authentication-factory は JBOSS-LOCAL-USER
認証に local
を使用し、DIGEST-MD5
認証に ManagementRealm
を使用する ManagementDomain
を使用します。
4.1.2. 仕組み
デフォルトでは JBoss EAP のユーザーは存在しませんが、この例の目的で以下のユーザーが追加されています。
表4.1 ユーザー
ユーザー名 | パスワード | ロール | セキュリティーレルム |
---|---|---|---|
Susan | Testing123! | ManagementRealm | |
Sarah | Testing123! | sample | ApplicationRealm |
Frank | Testing123! | ApplicationRealm |
JBoss EAP インスタンスは起動時に、4 つの認証ファクトリーとそれらに関連するセキュリティードメイン、セキュリティーレルム、およびその他設定済みのコンポーネントをロードします。
JBOSS-LOCAL-USER
を使用して管理 CLI で管理インターフェイスにアクセスしようとするユーザーがいる場合 (JBoss EAP インスタンスと同じホストから管理 CLI を実行している)、そのユーザーは local
セキュリティーレルムを使用して ManagementDomain
でユーザーを認証しようとする management-sasl-authentication
sasl-authentication-factory に転送されます。
Susan が異なるホストから管理 CLI を使用して管理インターフェイスにアクセスしようとする場合、SASL で DIGEST-MD5
認証を使用します。Susan は、 ManagementRealm
セキュリティーレルムを使用して ManagementDomain
でユーザーを認証しようとする management-sasl-authentication
sasl-authentication-factory に転送されます。
Susan が web ベースの管理コンソールを使用して管理インターフェイスにアクセスしようとする場合、HTTP で DIGEST
認証を使用することになります。Susan は、ManagementRealm
セキュリティーレルムを使用して ManagementDomain
でユーザーを認証しようとする management-http-authentication
http-authentication-factory に転送されます。
アプリケーション sampleApp1.war
には /hello.html
と /secure/hello.html
の 2 つの HTML ファイルがあり、BASIC
HTTP 認証を使用してパス /secure/*
をセキュアにします。Application Realm
を使用し、sample
ロールが必要です。ユーザーが sampleApp1.war
にアクセスしようとすると、application-http-authentication
http-authentication-factory に転送されます。ApplicationRealm
セキュリティーレルムを使用して ApplicationDomain
でユーザーを認証しようとします。
Sarah が /hello.html
を要求すると、認証なしでページを閲覧できます。Sarah が /secure/hello.html
を要求すると、ユーザー名とパスワードの入力が求められます。ログインに成功した後、Sarah は /secure/hello.html
を閲覧できます。Frank や Susan を含むすべてのユーザーが /hello.html
にアクセスできますが、Frank と Susan は /secure/hello.html
にはアクセスできません。Frank は sample
ロールを持たず、Susan は ApplicationRealm
セキュリティーレルムに存在しません。