付録A 認証の無効化

本付録では、ユーザーが特定のサービスに対し認証を無効にする方法を紹介します。
以下のセクションで指定されるパスはすべて jboss-as ディレクトリを起点とした相対パスとなっています。
JXM Console の認証の無効化:

JMX コンソールの認証を無効にするには、次のファイルを編集し、security-constraint (セキュリティ制約) の部分をコメントアウトします。

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>
Web Console 認証の無効化:

Web コンソールの認証を無効にするには、次のファイルにある<security-constraint> の部分をコメントアウトし編集します。

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>
HTTP Invoker 認証の無効化:

HTTP invoker の認証を無効にするには、次のファイルのセキュリティレルムより JNDIFactoryEJBInvokerServletJMXInvokerServlet を削除する必要があります。

server/$PROFILE/deploy/httpha-invoker.sar/invoker.war/WEB-INF/web.xml
例えば、security-constraint 要素は次のようになるはずです。
<security-constraint>
  <web-resource-collection>
    <web-resource-name>HttpInvokers</web-resource-name>
    <description>An example security config that only allows users with the role HttpInvoker to access the HTTP invoker servlets
    </description>
    <url-pattern>/restricted/*</url-pattern>
  </web-resource-collection>
  <auth-constraint>
  <role-name>HttpInvoker</role-name>
  </auth-constraint>
</security-constraint>
JMX Invoker 認証の無効化:

JMX invoker の認証を無効にするには、次のファイルを編集し、セキュリティインターセプタのパススルーをコメントアウトします。

server/$PROFILE/deploy/jmx-invoker-service.xml
org.jboss.jmx.connector.invoker.InvokerAdaptorService クラスを持つ MBean 部分を探します。 その部分の認証ユーザーに関する行をコメントアウトします。
AuthenticationInterceptor モジュールを指定する<interceptor>の部分をコメントアウトします。
<descriptors>
  <interceptors>
    <!--Uncomment to require authenticated users-->
    <interceptor code="org.jboss.jmx.connector.invoker.AuthenticationInterceptor"
        securityDomain="java:/jaas/jmx-console"/>
    <!--Interceptor that deals with non-serializable results-->
    <interceptor code="org.jboss.jmx.connector.invoker.SerializableInterceptor"
        policyClass="StripModelMBeanInfoPolicy"/>
  </interceptors>
</descriptors>
ProfileService 認証の無効化:

ProfileService の認証を無効にするには、次のファイルを編集し、serverProxyInterceptors 一覧の内容をコメントアウトします。

deploy/profileservice-jboss-beans.xml
以下の<bean> 部分をコメントアウトします。
<bean class="org.jboss.aspects.security.AuthenticationInterceptor">
  <constructor>
    <parameter>
      <value-factory bean="JNDIBasedSecurityManagement" method="getAuthenticationManager" parameter="jmx-console"/>
    </parameter>
  </constructor>
</bean>
<bean class="org.jboss.aspects.security.RoleBasedAuthorizationInterceptor">
  <constructor>
    <parameter>
      <value-factory bean="JNDIBasedSecurityManagement" method="getAuthenticationManager" parameter="jmx-console"/>
    </parameter>
    <parameter>
      <value-factory bean="JNDIBasedSecurityManagement" method="getAuthenticationManager" parameter="jmx-console"/>
    </parameter>
  </constructor>
</bean>
JBossWS 認証の無効化:

JBossWS の認証を無効にするには、次のファイルを編集し、<security-constraint> をコメントアウトします。

deploy/jbossws.sar/jbossws-management.war/WEB-INF/web.xml
以下の<security-constraint> 部分をコメントアウトします。
<security-constraint>
  <web-resource-collection>
    <web-resource-name>ContextServlet</web-resource-name>
    <description>An example security config that only allows users with the role 'friend' to access the JBossWS console web application
    </description>
    <url-pattern>/*</url-pattern>
  </web-resource-collection>
  <auth-constraint>
      <role-name>friend</role-name>
  </auth-constraint>
</security-constraint>