CSP/RESTアプリケーションに接続できません。どのように調査すれば良いですか?

※Caché/Ensembleの「CSPゲートウェイ」は、IRISでは「Webゲートウェイ」と名称が変更されています。
 これに伴い、サービス名も、「%Service_CSP」 ⇒ 「%Service_WebGateway」となっています。
 以下は、IRISベースの名称で記載しておりますので、適宜読み替えてご参照ください。



CSP/RESTアプリケーションに接続できない場合は、次の手順で確認を行います。

1.  Webゲートウェイ管理ページでの確認
2.監査ログの確認
3.(ログイン失敗の原因にもとづき) 設定等の変更を行う  

以下、詳細の手順です。

1. Webゲートウェイ管理ページでの確認
 Webゲートウェイ管理ページは、下記URLで直接開きます。
 http://localhost/csp/bin/Systems/Module.cxw
 ※必要に応じてポート番号を指定してください。

 A. Webゲートウェイ管理ページを開ける場合
  [Test Server Connection]で、サーバへテスト接続を行います。
  テスト接続で「Server Availability Error」等のエラーが出てサーバに接続できない場合は、以下を確認します。
  ・Webサーバのログ
  ・イベントログ([View Event Log]メニューより確認)
    ※イベントログは、日付の古いログから並んでいますので、最新のログは末尾となります。
   接続エラー時のログに、下記のようなメッセージが出ていれば、WebゲートウェイからIRISサーバへの接続が失敗していることが分かります。 

 Failed to connect - Reason: 0 (Connection successfully made but server not responding)

  B. Webゲートウェイ管理ページを開けない場合
  この場合は、以下を確認します。
  ・Webサーバのログ
  ・ネットワークの確認
  ・CSP.log(管理ページで確認するイベントログと同じです。)
   <CSP.logの場所>
    ・IISの場合(デフォルト):C:\Inetpub\CSPGateway
            ・IRIS同梱のプライベートウェブサーバ(簡易Apache)の場合:<インストールdir>\CSP\bin
      ※実稼動インスタンスではプライベートウェブサーバを使用することは出来ません。詳細は下記をご確認下さい。
      https://jp.community.intersystems.com/node/507896

2.監査ログの確認
 監査ログを確認し、ログイン失敗の原因を調査します。
 ①監査が無効であれば有効にして
 ②ロギングが必要なイベントを構成。
 ③再度アクセスを試行して、
 ④監査ログを確認し、ログイン失敗の原因を調査します。
 ※もともと監査が有効になっていて必要なログが取得できていれば、③のみで確認できます。

 通常、監査関連の操作は管理ポータルから実行できますが、以下では、管理ポータルに接続できない場合を想定し、
 コマンドベースのユーティリティ^SECURITYを使用して、上記①~④を実行しています。
 (管理ポータルから実行する方法については、下記の開発者コミュニティの記事をご確認ください。
  いつも使用しているユーザで IRIS や Caché にアクセスできなくなった時の原因の探り方(監査の使い方)

①監査を有効にする

%SYS>do ^SECURITY

1) User setup
2) Role setup
3) Service setup
4) Resource setup
5) Application setup
6) Auditing setup         ←監査のセットアップ
8) SSL configuration setup
9) Mobile phone service provider setup
10) OpenAM Identity Services setup
11) Encryption key setup
12) System parameter setup
13) X509 User setup
14) KMIP server setup
15) Exit

Option? 6

1) Enable auditing
2) Disable auditing
3) View system audit database
4) Configure auditing events
5) Manage audit logs
6) Exit

Option? 1

Enable auditing? No => yes   ←監査を有効に
Freeze system on audit database error? No => No
Confirm changes? Yes => Yes
Auditing is enabled

②ログイン失敗イベントの監査ログへの記録を有効にします。

1) Enable auditing
2) Disable auditing
3) View system audit database
4) Configure auditing events   ←監査するイベントを構成
5) Manage audit logs
6) Exit

Option? 4

1) Create audit event
2) Edit audit event
3) List audit events
4) Delete audit events
5) Reset audit event counters
6) Export audit events
7) Import audit events

Option? 2
Enter event source, type, and name as source/type/name

Event to edit? ?                ( ? を入力して Enter を押すと選択可能な一覧を表示します)

 Num  EventName                           Enabled
  1)  %Ensemble/%Message/ViewContents     はい
  2)  %Ensemble/%Production/ModifyConfiguration  はい
  3)  %Ensemble/%Production/StartStop     はい
  4)  %Ensemble/%Schema/Modify            はい
  5)  %System/%DirectMode/DirectMode      いいえ
  6)  %System/%Login/JobEnd               いいえ
  7)  %System/%Login/JobStart             いいえ
  8)  %System/%Login/Login                いいえ
  9)  %System/%Login/LoginFailure         いいえ
 10)  %System/%Login/Logout               いいえ

(略)

Event to edit? 9 %System/%Login/LoginFailure   ←LoginFailureイベントを編集
                           ( 9 Enter で後ろにイベント名が表示されます)
Enable auditing for event? No => yes                     ( ここで yes としてイベントを記録するようにします)
Confirm changes to Event %System/%Login/LoginFailure? Yes => Yes
Event %System/%Login/LoginFailure updated
Enter event source, type, and name as source/type/name

Event to edit?

この状態で、③再度CSP/RESTアプリケーションへのアクセスを試みます。
④ログイン失敗の監査が記録されるので、それをターミナルで確認します。

1) Enable auditing
2) Disable auditing
3) View system audit database
4) Configure auditing events
5) Manage audit logs
6) Exit

Option? 3

1) Audit list
2) Audit list by event
3) Audit list by username
4) Audit list by pid
5) Exit

Option? 1
Users? * =>
Event Names? * =>
Event Types? * =>
Event Sources? * =>
System IDs? * =>
Pids? * =>
Groups? * =>
Beginning date and time? 2021-10-28 00:00:00 => 2021-10-22
Ending date and time? 2021-10-28 15:29:24 =>
Number of records to display? 20 =>
Num  Timestamp               Event Name                       Username
1    2021-10-22 11:46:56.589 %System/%Login/LoginFailure
Display detail of which record (0=End)?  => 1
 
Description:  %Service_WebGateway ログイン失敗
Timestamp:    2021-10-22 11:46:56.589   Username:
UTCTimestamp: 2021-10-22 02:46:56.589   Pid:          19020
Event Source: %System                   JobId/JobNum: 2818061/13
Event Type:   %Login                    Session ID:
Event:        LoginFailure              IPAddress:    127.0.0.1
System ID:    Server1:IRISHEALTH2021
                                        Executable:   CSPap.dll
Namespace:    %SYS                      Index:        1776
Roles:                                  Group:
User Info:    Start CSP                 O/S User:     CSP Gateway
Routine:
Authentication: 認証なし
Event Data:
エラーメッセージ:           エラー #951: サービス %Service_WebGateway では認証なしアクセスが無効に設定されています
サービス名:              %Service_WebGateway
$I:                 |TCP|1972|19020
$P:                 |TCP|1972|19020
 
Display detail of which record (0=End)?  =>

この例では、%Service_WebGatewayで、認証なし設定が無効とされているにもかかわらず、認証なしアクセスをした場合のエラーが出力されています。

3.(ログイン失敗の原因にもとづき) 設定等の変更を行う  
 2.のエラー内容にもとづき、%Service_WebGatewayで認証なしアクセスを許可するよう設定を変更する場合の例です。

%SYS>do ^SECURITY 
 
1) User setup
2) Role setup
3) Service setup
4) Resource setup
5) Application setup
6) Auditing setup
8) SSL configuration setup
9) Mobile phone service provider setup
10) OpenAM Identity Services setup
11) Encryption key setup
12) System parameter setup
13) X509 User setup
14) KMIP server setup
15) Exit
 
Option? 3
 
1) Edit service
2) List services
3) Detailed list services
4) Export services
5) Import services
6) Exit
 
Option? 1
 
Service to edit? %Service_WebGateway
Enabled? Yes => Yes
Allow 認証なし access? No => Yes   ←認証なしアクセスを有効にするよう設定変更
Allow パスワード authentication? Yes => Yes
Allow Kerberos authentication? No => No
Allow Kerberos パケット整合性 authentication? No => No
Allow Kerberos 暗号化 authentication? No => No
Edit list of Allowed Incoming Connections? No => No
Confirm changes to service %Service_WebGateway? Yes => Yes
Service %Service_WebGateway updated
Service to edit?

これで、エラー原因が解消されました。 
上記は一例ですが、監査ログで原因を調査⇒各種設定等を変更して解消、という流れで対応してみてください。


該当する製品: Caché, Ensemble, 旧HealthShare, IRIS Data Platform, IRIS for Health
関連トピック: コマンドベースでセキュリティ関連設定を変更する方法(^SECURITYユーティリティの使用)
添付ファイル:

アンケートにご協力をお願いします
このトピックは参考になりましたか?
このトピックに関するお問い合わせ

FAQトップに戻る