[V9.0.2 2017 年 5 月]

System Authorization Facility インターフェースの構成

System Authorization Facility (SAF) インターフェースにより、mqweb サーバーは外部セキュリティー・マネージャーを認証および許可検査のために呼び出すことができます。

始める前に

以下のことを確認します。
  • 始めに 」で説明されているように、機能する IBM® MQ Console および REST API
  • SAF への許可インターフェースを使用するために実行される WebSphere® Application Server Liberty エンジェル・プロセス。 詳しくは、 z/OS 許可サービスを Liberty for z/OS を参照してください。

本タスクについて

SAF インターフェースにより、 mqweb サーバーは、 IBM MQ ConsoleREST APIの両方の認証および許可検査のために外部セキュリティー・マネージャーを呼び出すことができます。

このタスクの一部のステップを実行するには、 特権ユーザー である必要があることに注意してください。

手順

  1. z/OS 許可サービスを Liberty for z/OS の手順に従って、 z/OS® 許可サービスを使用するためのアクセス権限を mqweb Liberty サーバーに付与します。
    エンジェル・プロセスを開始するためのサンプル JCL は、 USS_ROOT/web/templates/zos/procs/bbgzangl.jclにあります。ここで、USS_ROOT は、 IBM MQ for z/OS USS コンポーネントがインストールされている Unix システム・サービス内のパスです。

    bbgzangl.jclで、 USS_ROOT/webを指すように SET ROOT ステートメントを変更します (例: /usr/lpp/mqm/V9R0M0/web)。

    angel プロセスの停止および開始についての詳細は、「z/OS での Liberty の管理」 を参照してください。

  2. Liberty: System Authorization Facility (SAF) 非認証ユーザーのセットアップ 」のステップに従って、Liberty に必要な非認証ユーザーを作成します。
  3. zos_saf_registry.xml ファイルを使用します。
    [V9.0.5 2018 年 3 月]

    IBM MQ 9.0.5から、パス PathPrefix /web/mq/samp/configuration から zos_saf_registry.xml ファイルをコピーします。ここで、 PathPrefixIBM MQ Unix System Services Components のインストール・パスです。

    IBM MQ 9.0.4 以前の場合は、以下のファイルを使用します。

    <?xml version="1.0" encoding="UTF-8"?>
    <server>
        <!-- ****************************************************************** -->
        <!--                                                                    -->
        <!--  IBM MQ security configuration for MQ Console and REST API.        -->
        <!--                                                                    -->
        <!--  Name: zos_saf_registry.xml                                        -->
        <!--                                                                    -->
        <!--  Description: SAF based registry for z/OS                          -->
        <!--                                                                    -->
        <!-- ****************************************************************** -->
        <!-- <copyright                                                         -->
        <!--     notice='lm-source-program'                                     -->
        <!--     pids='5724-H72'                                                -->
        <!--     years='2017'                                                   -->
        <!--     crc='0' >                                                      -->
        <!--                                                                    -->
        <!--     Licensed Materials - Property of IBM                           -->
        <!--                                                                    -->
        <!--     5724-H72                                                       -->
        <!--                                                                    -->
        <!--     (C) Copyright IBM Corp. 2017, 2024. All Rights Reserved.       -->
        <!--                                                                    -->
        <!--     US Government Users Restricted Rights - Use, duplication or    -->
        <!--     disclosure restricted by GSA ADP Schedule Contract with        -->
        <!--     IBM Corp.                                                      -->
        <!-- </copyright>                                                       -->
    
        <!--
        Role mappings are granted by giving users and groups READ access to the 
        following profiles in the EJBROLE class:
        
        1) MQWEB.com.ibm.mq.console.MQWebAdmin 
        
        MQWebAdmin role access for the MQ Console. All MQ commands issued by the
        MQ Console use the security context of the operating system user running
        the application server.
        
        2) MQWEB.com.ibm.mq.console.MQWebAdminRO
        
        MQWebAdminRO role access for the MQ Console. The security context of
        the operating system user running the application server is used for
        all read-only MQ commands, such as DISPLAY CHANNEL, QUEUE, etc,
        issued by the MQ Console.
             
        3) MQWEB.com.ibm.mq.console.MQWebUser
    
        MQWebUser role access for the MQ Console. All MQ commands issued by
        the MQ Console use the security context of the principal and so the
        user must be known to the queue manager and authorized to issue the
        command.
        
        4) MQWEB.com.ibm.mq.rest.MQWebAdmin
        
        MQWebAdmin role access for the MQ REST API. All MQ commands issued by the
        REST API use the security context of the operating system user running
        the application server.
        
        5) MQWEB.com.ibm.mq.rest.MQWebAdminRO
        
        MQWebAdminRO role access for the MQ REST API. The security context of
        the operating system user running the application server is used for
        all read-only MQ commands, such as DISPLAY CHANNEL, QUEUE, etc,
        issued by the REST API.
        
        6) MQWEB.com.ibm.mq.rest.MQWebUser
        
        MQWebUser role access for the MQ REST API. All MQ commands issued by
        the REST API use the security context of the principal and so the
        user must be known to the queue manager and authorized to issue the
        command.
     
        In addition the sample enables HTTP Basic Authentication.
        -->
        
        <!-- 
        Enable features 
        -->
        <featureManager>
            <feature>appSecurity-2.0</feature>
            <feature>zosSecurity-1.0</feature>
            <feature>basicAuthenticationMQ-1.0</feature>
        </featureManager>
    
        <!-- 
        The MQ Console 
        -->
        <enterpriseApplication id="com.ibm.mq.console"/>
    
        <!-- 
        The MQ REST API 
        -->
        <enterpriseApplication id="com.ibm.mq.rest"/>
    
        <safRegistry id="saf"/>
        <safAuthorization id="saf"/>
        <safCredentials unauthenticatedUser="WSGUEST" profilePrefix="MQWEB"/>    
        
        <!-- 
        Enable HTTP by uncommenting the line below. 
        -->
        <!--
        <variable name="httpPort" value="9080"/>
        -->
        
        <!-- 
        By default the server listens for HTTP/HTTPS requests on localhost only. To 
        listen on all available network interfaces uncomment the line below. To listen
        on a specific IP address or hostname replace the * with an appropriate value.
        -->
        <!--
        <variable name="httpHost" value="*"/>
        -->
                
        <!--       
        Default MQ SSL configuration allows TLS v1.2 ONLY, refer to the 
        IBM Documentation section on "IBM MQ Console and REST API security" 
        for details of how to configure security.
        -->             
        <sslDefault sslRef="mqDefaultSSLConfig"/>
                        
        <!-- 
        Enable client certificate authentication by uncommenting the
        block below and creating a trust.jks store. Basic registry
        maps the common name (CN=) issued by a trusted CA to
        users names in the registry. For example a certificate with 
        a distinguished name of 'CN=mqadmin,O=IBM,C=GB' will be granted 
        a MQWebAdmin role under the 'mqadmin' user.
               
        The default, auto-generated certificate held in key.jks is
        intended for developer convenience only, it is not intended for
        production use.
    
        Passwords for both defaultKeyStore and defaultTrustStore should
        be changed and encoded using the securityUtility tool, refer
        to the following IBM Developer article for further information;
    
        https://developer.ibm.com/wasdev/docs/configuring-ssl-liberty/
        -->
        <!--
        <keyStore id="defaultKeyStore" location="key.jks" type="JKS" password="password"/>
        <keyStore id="defaultTrustStore" location="trust.jks" type="JKS" password="password"/>
        <ssl id="thisSSLConfig" clientAuthenticationSupported="true" keyStoreRef="defaultKeyStore"
             trustStoreRef="defaultTrustStore" sslProtocol="TLSv1.2" serverKeyAlias="default"/>
        <sslDefault sslRef="thisSSLConfig"/>    
        -->    
        
        <!--
        Uncomment the following two variables, and adjust them, to change 
        the default CORS settings.
        -->
        <!--
        <variable name="mqRestCorsAllowedOrigins" value="https://localhost:9883"/>
        <variable name="mqRestCorsMaxAgeInSeconds" value="120"/>
        -->    
    </server>
  4. サンプル・ファイルを WLP_user_directory/servers/mqweb ディレクトリーに配置します。ここで、 WLP_user_directory は、 mqweb サーバー定義を作成するために crtmqweb.sh スクリプトを実行したときに指定したディレクトリーです。
  5. オプション: 以前に mqwebuser.xmlで構成設定を変更した場合は、それらをサンプル・ファイルにコピーします。
  6. 既存の mqwebuser.xml ファイルを削除し、サンプル・ファイルの名前を mqwebuser.xmlに変更します。
  7. mqwebuser.xmlsafCredentials エレメントをカスタマイズします。
    1. profilePrefix を Liberty サーバーで固有の名前に設定します。 単一のシステムで複数の mqweb サーバーが稼働している場合は、サーバーごとに異なる名前 (例えば、MQWEB903 と MQWEB904) を選択する必要があります。
    2. unauthenticatedUser を、ステップ 2で作成した非認証ユーザーの名前に設定します。
  8. mqweb サーバーの APPLID を RACFに定義します。
    APPLID リソース名は、ステップ 7profilePrefix 属性に指定した値です。 RACF で mqweb サーバーの APPLID を定義する例を以下に示します。
    RDEFINE APPL profilePrefix UACC(NONE)
  9. 認証されるすべてのユーザーまたはグループに、APPL クラスの mqweb サーバー APPLID への MQ Console または REST API READ アクセス権限を付与します。
    これは、ステップ 2で定義した非認証ユーザーに対しても行う必要があります。 RACF で mqweb サーバーの APPLID に対する READ アクセス権限をユーザーに付与する例を以下に示します。
    PERMIT profilePrefix CLASS(APPL) ACCESS(READ) ID(userID)
  10. MQ Console および REST APIのロールへのアクセス権限をユーザーに付与するために必要な EJBROLE クラスのプロファイルを定義します。
    以下の例では、 RACFのプロファイルを定義しています。ここで、 profilePrefix は、ステップ 7profilePrefix 属性に指定した値です。
    
    RDEFINE EJBROLE profilePrefix.com.ibm.mq.console.MQWebAdmin UACC(NONE)
    RDEFINE EJBROLE profilePrefix.com.ibm.mq.console.MQWebAdminRO UACC(NONE)
    RDEFINE EJBROLE profilePrefix.com.ibm.mq.console.MQWebUser UACC(NONE)
    RDEFINE EJBROLE profilePrefix.com.ibm.mq.rest.MQWebAdmin UACC(NONE)
    RDEFINE EJBROLE profilePrefix.com.ibm.mq.rest.MQWebAdminRO UACC(NONE)
    RDEFINE EJBROLE profilePrefix.com.ibm.mq.rest.MQWebUser UACC(NONE)
    RDEFINE EJBROLE profilePrefix.com.ibm.mq.rest.MFTWebAdmin UACC(NONE)
    RDEFINE EJBROLE profilePrefix.com.ibm.mq.rest.MFTWebAdminRO UACC(NONE)
    
    IBM MQ 9.0.4 以前の場合:
    
    RDEFINE EJBROLE profilePrefix.com.ibm.mq.console.MQWebAdmin UACC(NONE)
    RDEFINE EJBROLE profilePrefix.com.ibm.mq.console.MQWebAdminRO UACC(NONE)
    RDEFINE EJBROLE profilePrefix.com.ibm.mq.console.MQWebUser UACC(NONE)
    RDEFINE EJBROLE profilePrefix.com.ibm.mq.rest.MQWebAdmin UACC(NONE)
    RDEFINE EJBROLE profilePrefix.com.ibm.mq.rest.MQWebAdminRO UACC(NONE)
    RDEFINE EJBROLE profilePrefix.com.ibm.mq.rest.MQWebUser UACC(NONE)
    
  11. MQ Console および REST APIの役割に対するアクセス権限をユーザーに付与します。
    これを行うには、ステップ 10で作成した EBJROLE クラスの 1 つ以上のプロファイルに対する READ アクセス権限をユーザーまたはグループに付与します。
    以下の例では、 RACFの REST API に対する MQWebAdmin 役割に対するアクセス権限をユーザーに付与します。ここで、 profilePrefix は、ステップ 7profilePrefix 属性に指定した値です。
    
    PERMIT profilePrefix.com.ibm.mq.rest.MQWebAdmin CLASS(EJBROLE) ACCESS(READ) ID(userID)

結果

IBM MQ Console および REST APIの SAF 認証をセットアップしました。