第2章 Admin Console の設定

2.1. セキュリティ

Admin Console は、JAAS セキュリティドメインjmx-consoleを使いセキュリティーを確保しています。Enterprise Application Platformが zip アーカイブを使いインストールされた場合、このセキュリティドメインにはユーザーアカウントがありません。デフォルトのユーザー名/パスワードをもとにした攻撃の可能性をなくすためです。Enterprise Application Platformがグラフィックインストーラーを使いインストールされた場合、JAASセキュリティドメインおよびユーザーアカウントはインストールプロセスの一部として作成されます。JAASセキュリティドメイン名がインストール時に変更された場合でも、これらのユーザーは同じ場所に保存されます。

2.1.1. 認証

認証とは、ユーザーをシステムに認識させるプロセスのことです。Admin Console はjmx-console および jboss-web ドメイン経由でユーザーに割り当てられた権限やロールとユーザー名/パスワード認証を使います。

2.1.2. 認証の有効化

Enterprise Application Platformはデフォルトで有効になった状態のセキュリティドメイン上にて認証を提供しています。この認証が有効かを確認するには、すでに無効になっている認証を再度有効化するか、以下の手順に従ってください。Enterprise Application Platformのセキュリティドメインと認証に関する詳細情報は、『セキュリティガイド』を参照してください。

手順2.1 認証の有効化

  1. JMXコンソールで認証の有効化

    以下のweb.xml ファイル
    • JBOSS_HOME/server/PROFILE/deploy/jmx-console.war/WEB-INF/web.xmlにて
    以下の部分security-constraint がアンコメントされているよう確認してください。
    <security-constraint>
       <web-resource-collection>
          <web-resource-name>HtmlAdaptor</web-resource-name>
          <description>
             An example security config that only allows users with the role
             JBossAdmin to access the HTML JMX console web application
          </description>
          <url-pattern>/*</url-pattern>
      </web-resource-collection>
      <auth-constraint>
        <role-name>JBossAdmin</role-name>
      </auth-constraint>
    </security-constraint>
    
  2. JMXコンソールでセキュリティドメインを有効化

    以下のjboss-web.xml ファイル
    • JBOSS_HOME/server/PROFILE/deploy/jmx-console.war/WEB-INF/jboss-web.xmlにて
    以下の部分が含まれるようにしてください。
    <jboss-web>
      <!-- Uncomment the security-domain to enable security. You will
         need to edit the htmladaptor login configuration to setup the
         login modules used to authentication users.
      -->
      <security-domain>java:/jaas/jmx-console</security-domain>
    </jboss-web>
    
  3. Admin Console で認証を有効化

    以下のweb.xml ファイル
    • JBOSS_HOME/server/PROFILE/deploy/management/console-mgr.sar/web-console.war/WEB-INF/web.xml
    以下の部分security-constraint がアンコメントされているよう確認してください。
    <security-constraint>
       <web-resource-collection>
          <web-resource-name>HtmlAdaptor</web-resource-name>
          <description>
             An example security config that only allows users with the role
             JBossAdmin to access the HTML JMX console web application
          </description>
          <url-pattern>/*</url-pattern>
      </web-resource-collection>
      <auth-constraint>
        <role-name>JBossAdmin</role-name>
      </auth-constraint>
    </security-constraint>
    
  4. Admin Console でセキュリティドメインを有効化

    以下のjboss-web.xml ファイル
    • JBOSS_HOME/server/PROFILE/deploy/management/console-mgr.sar/web.console.war/WEB-INF/jboss-web.xml
    以下の部分が含まれるようにしてください。
    <jboss-web>
      <!-- Uncomment the security-domain to enable security. You will
         need to edit the htmladaptor login configuration to setup the
         login modules used to authentication users.
      -->
      <security-domain>java:/jaas/jmx-console</security-domain>
    </jboss-web>
    

2.1.3. 認証の無効化

セキュアな社内のマシンにインストールを行う開発環境で利用する場合は認証を無効にすることができます。

警告

外部との接触があるインストールにおいて認証を無効にしないでください。

手順2.2 認証の無効化

  1. JMXコンソールでのセキュリティ制限を無効する方法

    以下のweb.xml ファイル
    • JBOSS_HOME/server/PROFILE/deploy/jmx-console.war/WEB-INF/web.xmlにて
    security-constraint の部分をコメントアウトします。
    <security-constraint>
       <web-resource-collection>
          <web-resource-name>HtmlAdaptor</web-resource-name>
          <description>
             An example security config that only allows users with the role
             JBossAdmin to access the HTML JMX console web application
          </description>
          <url-pattern>/*</url-pattern>
      </web-resource-collection>
      <auth-constraint>
        <role-name>JBossAdmin</role-name>
      </auth-constraint>
    </security-constraint>
    
  2. JMXコンソールでセキュリティドメインを無効する方法

    以下のjboss-web.xml ファイル
    • JBOSS_HOME/server/PROFILE/deploy/jmx-console.war/WEB-INF/jboss-web.xmlにて
    以下の部分を削除してください。
    <jboss-web>
      <!-- Uncomment the security-domain to enable security. You will
         need to edit the htmladaptor login configuration to setup the
         login modules used to authentication users.
      -->
      <security-domain>java:/jaas/jmx-console</security-domain>
    </jboss-web>
    
  3. Admin Consoleでセキュリティ制限を無効にする方法

    以下のweb.xml ファイル
    • JBOSS_HOME/server/PROFILE/deploy/management/console-mgr.sar/web-console.war/WEB-INF/web.xml
    security-constraint の部分をコメントアウトします。
    <security-constraint>
       <web-resource-collection>
          <web-resource-name>HtmlAdaptor</web-resource-name>
          <description>
             An example security config that only allows users with the role
             JBossAdmin to access the HTML JMX console web application
          </description>
          <url-pattern>/*</url-pattern>
      </web-resource-collection>
      <auth-constraint>
        <role-name>JBossAdmin</role-name>
      </auth-constraint>
    </security-constraint>
    
  4. Admin Console 向けにセキュリティドメインを無効にする方法

    以下のjboss-web.xml ファイル
    • JBOSS_HOME/server/PROFILE/deploy/management/console-mgr.sar/web.console.war/WEB-INF/jboss-web.xml
    以下の部分を削除してください。
    <jboss-web>
      <!-- Uncomment the security-domain to enable security. You will
         need to edit the htmladaptor login configuration to setup the
         login modules used to authentication users.
      -->
      <security-domain>java:/jaas/jmx-console</security-domain>
    </jboss-web>
    

2.1.4. ユーザーとロール

Enterprise Application Platformはロールを使いAdmin Consoleへのアクセスを許可および制限します。特に、Admin Consoleのユーザーに割り当てられるロールは、この手順で説明されている通り、JBossAdminHttpInvokerロールです。

手順2.3 ユーザの作成

この手順で、ユーザーを作成してから、ユーザーにAdmin ConsoleやHTTP呼び出しへのアクセス権限を割り当てます。
  1. jmx-console JAAS セキュリティドメインでユーザーを作成する方法

    JBOSS_HOME/server/PROFILE/conf/props/ディレクトリのjmx-console-users.properties ファイルを編集します。
    1. ユーザ名とパスワードの作成

      username = passwordペアを作成します。

      重要

      コメント付きのadmin=admin (ユーザー名とパスワード) がユーザー名/パスワードの定義構文例です。ユーザーアカウントにはこれを使わないようにしてください。
  2. web-console JAAS セキュリティドメインでユーザーを作成する方法

    1. JBOSS_HOME/server/PROFILE/deploy/management/console-mgr.sar/web-console.war/WEB-INF/classes/ ディレクトリのweb-console-users.properties ファイルを編集します。
    2. ユーザ名とパスワードの追加

      username = passwordペアを追加します。

      重要

      コメント付きのadmin=admin (ユーザー名とパスワード) がユーザー名/パスワードの定義構文例です。ユーザーアカウントにはこれを使わないようにしてください。
  3. ユーザー権限の授与

    1. JBOSS_HOME/server/PROFILE/deploy/management/console-mgr.sar/web-console.war/WEB-INF/classes/ディレクトリのweb-console-roles.propertiesファイルを編集します。
    2. フォームのユーザーにエントリーを作成します。
      username=JBossAdmin,HttpInvoker
      
      JBossAdmin
      Web-Consoleへアクセスできるユーザー権限を割り当てます。
      HttpInvoker
      HTTP Invokerへアクセスできるユーザー権限を割り当てます。