Red Hat Training

A Red Hat training course is available for Red Hat JBoss Enterprise Application Platform

18.4.4.4. リモーティングサブシステムを設定する

概要

JBoss Remoting には、3 つのトップレベルの設定可能な要素があります。ワーカースレッドプール、1 つ以上のコネクター、および一連のローカルおよびリモート接続 URI です。このトピックでは、設定可能な各項目の説明、各項目を設定する方法の CLI コマンドの例、および完全に設定されたサブシステムの XML の例を示します。この設定はサーバーにのみ適用されます。独自のアプリケーションにカスタムコネクターを使用する場合を除き、Remoting のサブシステムの設定は必要でないことがほとんどです。EJB などの、リモーティングクライアントとして動作するアプリケーションには特定のコネクターに接続するための別の設定が必要になります。

注記
Remoting サブシステムの設定は、Web ベースの管理コンソールには公開されませんが、コマンドラインベースの管理 CLI から完全に設定できます。XML を手動で編集することはお勧めしません。

CLI コマンドの適応

CLI コマンドは、デフォルト のプロファイルを設定するときに、管理対象ドメイン用に作成されます。別のプロファイルを設定するには、その名前に置き換えます。スタンドアロンサーバーの場合、コマンドの /profile=default 部分を省略します。

リモーティングサブシステム外の設定

リモーティング サブシステムの外部にあるいくつかの設定の側面があります。

ネットワークインターフェース
リモーティング サブシステムで使用されるネットワークインターフェイスは、domain/configuration/domain.xml または standalone/configuration/standalone.xml で定義されている パブリック インターフェイスです。
<interfaces>
   <interface name="management"/>
   <interface name="public"/>
   <interface name="unsecure"/>
</interfaces>        

パブリック インターフェイスのホストごとの定義は、domain.xml または standalone.xml と同じディレクトリーの host.xml で定義されます。このインターフェイスは、他のいくつかのサブシステムでも使用されます。変更するときは注意してください。
<interfaces>
   <interface name="management">
      <inet-address value="${jboss.bind.address.management:127.0.0.1}"/>
   </interface>
   <interface name="public">
      <inet-address value="${jboss.bind.address:127.0.0.1}"/>
   </interface>
   <interface name="unsecure">
      <!-- Used for IIOP sockets in the standard configuration.
         To secure JacORB you need to setup SSL -->
      <inet-address value="${jboss.bind.address.unsecure:127.0.0.1}"/>
   </interface>
</interfaces>             

socket-binding
remoting サブシステムによって使用されるデフォルトのソケットバインディングは TCP ポート 4447 にバインドされます。これを変更する必要がある場合の詳細は、ソケットバインディングとソケットバインディンググループに関するドキュメントを参照してください。
ソケットバインディングおよびソケットバインディンググループに関する情報は、JBoss EAP の 『管理および設定ガイド』 の 『ソケットバインディンググループ』 の章にあります。 https://access.redhat.com/documentation/ja-jp/red_hat_jboss_enterprise_application_platform/?version=6.4
EJB の リモーティングコネクター参照
EJB サブシステムにはリモートメソッド呼び出しに対するリモーティングコネクターへの参照が含まれています。デフォルト設定は次のとおりです。
<remote connector-ref="remoting-connector" thread-pool-name="default"/>            

セキュアなトランスポート設定
リモーティングトランスポートはクライアントの要求があれば StartTLS を使用してセキュアな接続 (HTTPS、Secure Servlet など) を使用します。セキュアな接続とセキュアでない接続の両方で同じソケットバインディング (ネットワークポート) が使用されるため、サーバー側に追加の設定をする必要はありません。クライアントは必要に応じてセキュアなトランスポートまたはセキュアでないトランスポートを要求します。EJB、ORB、JMS プロバイダーなどのリモーティングを使用する JBoss EAP 6 のコンポーネントはデフォルトでセキュアなインターフェイスを使用します。
警告:StartTLS のセキュリティーに関する考慮事項
StartTLS はクライアントの要求があればセキュアな接続を有効にしますが、セキュアでない接続がデフォルトになります。本質的に、StartTLS は攻撃者がクライアントの要求を妨害し、要求を編集してセキュアでない接続を要求する中間者 攻撃の対象になりやすい欠点があります。セキュアでない接続が適切なフォールバックである場合を除き、実際にはクライアントがセキュアな接続を取得できなかったときに適切に失敗するよう記述する必要があります。

ワーカースレッドプール

ワーカースレッドプールは、Remoting コネクターを介して入ってくる作業を処理するために使用できるスレッドのグループです。これは単一の要素 <worker-thread-pool> であり、いくつかの属性を取ります。ネットワークタイムアウトが発生した場合、スレッドが不足した場合、またはメモリー使用量を制限する必要がある場合は、これらの属性を調整してください。具体的な推奨事項は、特定の状況によって異なります。詳細は Red Hat グローバルサポートサービスまでお問い合わせください。

表18.2 ワーカースレッドプールの属性

属性 説明 CLI コマンド
読み取りスレッド
リモーティングワーカーに対して作成する読み取りスレッドの数。デフォルトは1です。
/profile=default/subsystem=remoting/:write-attribute(name=worker-read-threads,value=1)
write-threads
リモーティングワーカーに作成する書き込みスレッドの数。デフォルトは1です。
/profile=default/subsystem=remoting/:write-attribute(name=worker-write-threads,value=1)
task-keepalive
コアでないリモーティングワーカーのタスクスレッドにキープアライブを使用する期間 (ミリ秒単位)。デフォルトは 60 です。
/profile=default/subsystem=remoting/:write-attribute(name=worker-task-keepalive,value=60)
task-max-threads
リモーティングワーカーのタスクスレッドプールに対するスレッドの最大数。デフォルトは 16 です。
/profile=default/subsystem=remoting/:write-attribute(name=worker-task-max-threads,value=16)
task-core-threads
リモーティングワーカーのタスクスレッドプールに対するコアスレッドの数。デフォルトは 4 です。
/profile=default/subsystem=remoting/:write-attribute(name=worker-task-core-threads,value=4)
task-limit
許可するリモーティングワーカータスクの最大数。 この数を超えるリモーティングワーカータスクは拒否されます。デフォルトは 16384 です。
/profile=default/subsystem=remoting/:write-attribute(name=worker-task-limit,value=16384)

コネクター

コネクターは主な Remoting 設定要素です。複数のコネクターを設定できます。それぞれは、いくつかのサブ要素といくつかの可能な属性を持つ要素 <connector> 要素で設定されています。デフォルトのコネクターは複数の JBoss EAP 6 サブシステムによって使用されます。カスタムコネクターの要素や属性の設定はアプリケーションによって異なるため、詳細は Red Hat グローバルサポートサービスまでご連絡ください。

表18.3 コネクターの属性

属性 説明 CLI コマンド
socket-binding このコネクターに使用するソケットバインディングの名前。
/profile = default/subsystem = remoteing/connectedor = remoteing-connector/:write-attribute (name = socket-binding、value = remoteing)
authentication-provider
このコネクターで使用するコンテナー用 Java 認証サービスプロバイダーインターフェイス (JASPIC) モジュール。モジュールはクラスパスに含まれている必要があります。
/profile = default/subsystem = remoteing/connectedor = remoteing-connector/:write-attribute (name = authentication-provider、value = myProvider)
security-realm
任意。アプリケーションのユーザー、パスワード、およびロールを含むセキュリティーレルム。EJB または Web アプリケーションは、セキュリティーレルムに対して認証できます。ApplicationRealm は、デフォルトの JBoss EAP 6 インストールで使用できます。
/profile = default/subsystem = remoteing/connectedor = remoteing-connector/:write-attribute (name = security-realm、value = ApplicationRealm)

表18.4 コネクター要素

属性 説明 CLI コマンド
sasl
Simple Authentication and Security Layer (SASL) 認証メカニズムの囲み要素
該当なし
properties
1 つ以上の <property> 要素が含まれ、それぞれに name 属性とオプションの value 属性があります。
/profile = default/subsystem = remoteing/connectedor = remoteing-connector/property = myProp/:add (value = myPropValue)

送信接続

3 つのタイプのアウトバウンド接続を指定することができます。

  • STF へのアウトバウンド接続
  • ソケットなどのローカルリソースに接続するローカルアウトバウンド接続
  • リモートリソースに接続し、セキュリティーレルムを使用して認証を行うリモートアウトバウンド接続
すべてのアウトバウンド接続は、<outbound-connections> 要素で囲まれています。これらの各接続タイプは、outbound-socket-binding-ref 属性を取ります。アウトバウンド接続は uri 属性を取ります。リモートアウトバウンド接続は、オプションの ユーザー名セキュリティーレルム 属性を使用して承認に使用します。

表18.5 アウトバウンド接続要素

属性 説明 CLI コマンド
outbound-connection 一般的なアウトバウンド接続。
/profile = default/subsystem = remoting/outbound-connection = my-connection/:add (uri = http://my-connection)
local-outbound-connection 暗黙の local://URI スキームを使用したアウトバウンド接続。
/profile = default/subsystem = remoteing/local-outbound-connection = my-connection/:add (outbound-socket-binding-ref = remoteing2)
remote-outbound-connection
セキュリティーレルムで基本/ダイジェスト認証を使用する、remote://URI スキームのアウトバウンド接続。
/profile = default/subsystem = remoteing/remote-outbound-connection = my-connection/:add (outbound-socket-binding-ref = remoteing、username = myUser、security-realm = ApplicationRealm)

SASL 要素

SASL 子要素を定義する前に、最初の SASL 要素を作成する必要があります。以下のコマンドを使用します。

/profile=default/subsystem=remoting/connector=remoting-connector/security=sasl:add
SASL 要素の子要素について、次の表で説明します。

表18.6 SASL 子要素

属性 説明 CLI コマンド
include-mechanisms
SASL メカニズムのリストである value 属性が含まれています。
/profile=default/subsystem=remoting/connector=remoting-connector/security=sasl:write-attribute(name=include-mechanisms,value=["DIGEST","PLAIN","GSSAPI"])
qop
優先度の高い順に、SASL の保護品質値のリストである value 属性が含まれています。
/profile=default/subsystem=remoting/connector=remoting-connector/security=sasl:write-attribute(name=qop,value=["auth"])
strength
優先度の高い順に、SASL 暗号強度値のリストである value 属性が含まれています。
/profile=default/subsystem=remoting/connector=remoting-connector/security=sasl:write-attribute(name=strength,value=["medium"])
reuse-session
ブール値である value 属性が含まれています。true の場合、セッションの再利用を試みます。
/profile=default/subsystem=remoting/connector=remoting-connector/security=sasl:write-attribute(name=reuse-session,value=false)
server-auth
ブール値である value 属性が含まれています。true の場合、サーバーはクライアントに対して認証を行います。
/profile=default/subsystem=remoting/connector=remoting-connector/security=sasl:write-attribute(name=server-auth,value=false)
policy
以下の要素を 0 個以上含む囲み要素。それぞれが単一の を取ります。
  • Forward-Secrecy – Forward Secrecy を実装するためにメカニズムが必要かどうか (1 つのセッションに割り込むと、将来のセッションに割り込むための情報が自動的に提供されません)
  • 非アクティブ–非辞書攻撃の影響を受けやすいメカニズムが許可されているかどうか。false の値は許可し、true は拒否します。
  • no-anonymous –匿名ログインを受け入れるメカニズムが許可されているかどうか。false の値は許可し、true は拒否します。
  • 辞書なし–パッシブ辞書攻撃の影響を受けやすいメカニズムが許可されているかどうか。false の値は許可し、true は拒否します。
  • no-plain-text –単純なプレーンパッシブ攻撃の影響を受けやすいメカニズムが許可されているかどうか。false の値は許可し、true は拒否します。
  • pass-credentials –クライアントの資格情報を渡すメカニズムが許可されているかどうか。
/profile=default/subsystem=remoting/connector=remoting-connector/security=sasl/sasl-policy=policy:add
/profile=default/subsystem=remoting/connector=remoting-connector/security=sasl/sasl-policy=policy:write-attribute(name=forward-secrecy,value=true)
/profile=default/subsystem=remoting/connector=remoting-connector/security=sasl/sasl-policy=policy:write-attribute(name=no-active,value=false)
/profile=default/subsystem=remoting/connector=remoting-connector/security=sasl/sasl-policy=policy:write-attribute(name=no-anonymous,value=false)
/profile=default/subsystem=remoting/connector=remoting-connector/security=sasl/sasl-policy=policy:write-attribute(name=no-dictionary,value=true)
/profile=default/subsystem=remoting/connector=remoting-connector/security=sasl/sasl-policy=policy:write-attribute(name=no-plain-text,value=false)
/profile=default/subsystem=remoting/connector=remoting-connector/security=sasl/sasl-policy=policy:write-attribute(name=pass-credentials,value=true)
properties
1 つ以上の <property> 要素が含まれ、それぞれに name 属性とオプションの value 属性があります。
/profile=default/subsystem=remoting/connector=remoting-connector/security=sasl/property=myprop:add(value=1)
/profile=default/subsystem=remoting/connector=remoting-connector/security=sasl/property=myprop2:add(value=2)

例18.38 設定例

この例は、JBoss EAP 6 に同梱されているデフォルトのリモーティングサブシステムを示しています。
<subsystem xmlns="urn:jboss:domain:remoting:1.1">
    <connector name="remoting-connector" socket-binding="remoting" security-realm="ApplicationRealm"/>
</subsystem>    

この例には多くの仮想値が含まれており、前に説明した要素と属性をコンテキストに入れるために提示されています。
<subsystem xmlns="urn:jboss:domain:remoting:1.1">
    <worker-thread-pool read-threads="1" task-keepalive="60" task-max-threads="16" task-core-thread="4" task-limit="16384" write-threads="1" />
    <connector name="remoting-connector" socket-binding="remoting" security-realm="ApplicationRealm">
        <sasl>
            <include-mechanisms value="GSSAPI PLAIN DIGEST-MD5" />
            <qop value="auth" />
            <strength value="medium" />
            <reuse-session value="false" />
            <server-auth value="false" />
            <policy>
                <forward-secrecy value="true" />
                <no-active value="false" />
                <no-anonymous value="false" />
                <no-dictionary value="true" />
                <no-plain-text value="false" />
                <pass-credentials value="true" />
            </policy>
            <properties>
                <property name="myprop1" value="1" />
                <property name="myprop2" value="2" />
            </properties>
        </sasl>
        <authentication-provider name="myprovider" />
        <properties>
            <property name="myprop3" value="propValue" />
        </properties>
    </connector>
    <outbound-connections>
        <outbound-connection name="my-outbound-connection" uri="http://myhost:7777/"/>
        <remote-outbound-connection name="my-remote-connection" outbound-socket-binding-ref="my-remote-socket" username="myUser" security-realm="ApplicationRealm"/>
        <local-outbound-connection name="myLocalConnection" outbound-socket-binding-ref="my-outbound-socket"/>
    </outbound-connections>
</subsystem>    

まだ文書化されていない設定の側面

  • JNDI およびマルチキャスト自動検出