# Microsoft Sentinel向けAzure Monitor (GovCloud向け)

{% hint style="warning" %}
この連携機能はKeeper GovCloudをご利用の組織のみを対象しております。GovCloudをご利用でない場合は、[Microsoft Sentinel連携](/enterprise-guide/jp/event-reporting/microsoft-sentinel/microsoft-sentinel-with-azure-marketplace.md)ページをご参照ください。
{% endhint %}

## 概要

Azure MonitorとMicrosoft Sentinelは密接に関係しています。Sentinelはログ管理とデータ収集のためにAzure Monitorのインフラを活用しており、Azure Monitorは[Log Analytics](https://www.google.com/search?sca_esv=d16c61d435099b34\&cs=0\&sxsrf=AE3TifP9dkvGVVnv8tOTF6P2Ol5yFQq3vQ%3A1751561028999\&q=Log+Analytics\&sa=X\&ved=2ahUKEwjv6omnkaGOAxUkGDQIHRCEDVEQxccNegQIBBAB\&mstk=AUtExfA68v5flpho2dB-iI29UnLQx7lzHn8jIbGTgSHps2VjROE4JxqWE5lcjFQzraGh-tdcxH22KoGF2cf2a3zLj6ENedePt4YxBMAKPNi5VcqpXt-B8QrrWHkzrP2AuRrYTiqBKHxF7lwlqAcK2CQRZAiv0uulx7EZRtSVY7V-CRA_q9HEuernsG-4T5YcX_mO3VrV0aPmt0DzwLavqLKAmea2rEMqyXr08C7DQw8XM9F3QCnnOpPApskGLeeN8m6VQhjsMHXhHJQCMlS8itf9v4IVjoSxc9K2dqeumcrG2GOLWQ\&csui=3)や[Azure Monitor Agent](https://www.google.com/search?sca_esv=d16c61d435099b34\&cs=0\&sxsrf=AE3TifP9dkvGVVnv8tOTF6P2Ol5yFQq3vQ%3A1751561028999\&q=Azure+Monitor+Agent\&sa=X\&ved=2ahUKEwjv6omnkaGOAxUkGDQIHRCEDVEQxccNegQIBBAC\&mstk=AUtExfA68v5flpho2dB-iI29UnLQx7lzHn8jIbGTgSHps2VjROE4JxqWE5lcjFQzraGh-tdcxH22KoGF2cf2a3zLj6ENedePt4YxBMAKPNi5VcqpXt-B8QrrWHkzrP2AuRrYTiqBKHxF7lwlqAcK2CQRZAiv0uulx7EZRtSVY7V-CRA_q9HEuernsG-4T5YcX_mO3VrV0aPmt0DzwLavqLKAmea2rEMqyXr08C7DQw8XM9F3QCnnOpPApskGLeeN8m6VQhjsMHXhHJQCMlS8itf9v4IVjoSxc9K2dqeumcrG2GOLWQ\&csui=3)を含む基盤プラットフォームを提供しています。その上にSentinelが構築され、取得したデータをセキュリティ情報およびイベント管理 (SIEM) 機能に活用します。

Keeperは、Azure [Logs Ingestion API](https://learn.microsoft.com/en-us/azure/azure-monitor/logs/logs-ingestion-api-overview)を使用して、Azure MonitorのLog Analyticsワークスペーステーブルへイベントを直接ストリーミングすることに対応しています。2025年1月時点では、この方法とAPIがAzureログへのイベントデータ送信に推奨されています。

## セットアップ手順

[Azureポータル](https://portal.azure.com/)にアクセスします。

### 1. アプリケーション登録の作成

Azure App登録は、Logs Ingestion APIへのAPIリクエストを認証するために使用します。

* [**\[アプリの登録\]**](https://portal.azure.com/#view/Microsoft_AAD_RegisteredApps/ApplicationsListBlade) に移動し、**\[新規登録]** を選択します。

フォームに以下のように記入します。

* **名前:** `KeeperLogging`
* **サポートされているアカウントの種類:** デフォルトの **\[シングルテナント]** を選択
* **リダイレクト URI:** ここでは空欄のままにします。
* **\[登録]**&#x3092;クリックします。

#### 登録後の手順

* **管理**を展開します。
* **\[API の公開]** をクリックします。
* アプリケーションID URIの **\[追加]** をクリックします。
* 提案されるデフォルトのURI (例: `api://[client-id]`) をそのまま使用します。

### 2. クライアントシークレットの作成 <a href="#id-2-create-client-secret" id="id-2-create-client-secret"></a>

Azureの [**\[アプリの登録\]**](https://portal.azure.com/#view/Microsoft_AAD_RegisteredApps/ApplicationsListBlade) から、**\[管理]** > **\[証明書とシークレット]** に移動し、**\[新しいクライアント シークレット]** を作成します。

* **\[説明]** と **\[有効期限]** を設定します。
* 生成された値をコピーし、Keeperボルトに保存します。
* この値は最後の手順 (クライアントシークレットの値) で必要になるため、必ず保管してください。

**\[概要]** 画面で、ディレクトリ (テナント) IDと表示名も控えておきます。

{% hint style="info" %}
以下の情報を後で使用するために保存します。

* **アプリケーション (クライアント) ID**
* **クライアントシークレットID**
* **クライアントシークレットの値**
* **ディレクトリ (テナント) ID** (**\[アプリの登録]** ページに記載されています)
  {% endhint %}

### 3. Log Analyticsワークスペースの作成

Log Analyticsワークスペースは、Azure Monitorがログデータを収集・保存するための中心的なリソースです。すでにワークスペースを作成済みの場合は、この手順をスキップできます。

* Azureで [**\[Log Analytics ワークスペース\]**](https://portal.azure.com/#browse/Microsoft.OperationalInsights%2Fworkspaces) に移動します。
* **\[作成]** をクリックし、以下の項目を設定します。
  * **\[サブスクリプション]**: 使用するAzureサブスクリプションを選択
  * **\[リソース グループ]**: 新規作成または既存のリソースグループを選択
  * **\[名前]**: わかりやすい名前を設定 (例: `KeeperLogsWorkspace`)
  * **\[地域]**: 任意の地域を選択
  * **\[確認および作成]** をクリックして内容を確認後、**\[作成]** をクリックします。

### 4. 登録したアプリケーションにロールを割り当てる

対象のLog Analyticsワークスペースで、KeeperLoggingアプリケーションに「Log Analytics Contributor」ロールを割り当てます。

ワークスペースの画面で、以下の手順を行います。

* 手順3で作成したLog Analyticsワークスペースを開きます。
* **\[アクセス制御 (IAM)]** を選択します。
* **\[ロールの割り当て]** を選択します。
* **\[追加] > \[ロールの割り当ての追加]** をクリックします。
* 「**Log Analytics Contributor**」と入力し、該当するロールを選択します。
* **\[次へ]** をクリックします。
* **\[+ メンバーの選択]** をクリックし、一覧からKeeperLoggingアプリケーションを選択します。
* **\[選択]** をクリックします。
* **\[確認と割り当て]** を選択します。
* ロールの割り当てが正常に完了したことを確認します。

### 5. データ収集エンドポイント (DCE) を作成 <a href="#id-5-create-a-data-collection-endpoint-dce" id="id-5-create-a-data-collection-endpoint-dce"></a>

データ収集ルール (DCR) を作成する前に、データ収集エンドポイント (DCE) が必要です。

* Azure&#x3067;**「**[**データ収集エンドポイント**](https://portal.azure.com/#browse/microsoft.insights%2Fdatacollectionendpoints)**」 (DCE)** を開きます。
* 「**Data Collection Endpoints**」を検索し、**\[作成]** をクリックします。

以下の項目を設定します。

* **\[サブスクリプション]**: 使用するAzureサブスクリプションを選択
* **\[リソース グループ]**: DCRで使用するものと同じリソースグループを選択
* **\[地域]**: 任意のリージョンを選択
* **\[名前]**: わかりやすい名前を設定 (例: `KeeperLogsEndpoint`)

「Logs Ingestion URL」をメモしておきます (後の手順で使用)。

* 例: `keeperlogsendpoint-mcag.eastus-1.ingest.monitor.azure.com`

### 6. テーブルとデータ収集ルールを作成

Log Analyticsワークスペースを開き、**\[テーブル]** を選択して新しいテーブルを作成します。

```
[
  {
    "TimeGenerated": "2025-01-23T01:31:11.123Z",
    "audit_event": "some_event",
    "remote_address": "10.15.12.192",
    "category": "some_category_id",
    "client_version": "EMConsole.17.0.0",
    "username": "email@company.com",
    "enterprise_id": 1234,
    "timestamp": "2025-01-23T01:31:11.123Z",
    "data": {
      "node_id": "abc12345",
      "record_uid": "B881237126",
      "folder_uid": "BCASD12345",
      "some_flag": true
    }
  },
  {
    "TimeGenerated": "2025-01-23T01:31:11.124Z",
    "audit_event": "some_event",
    "remote_address": "10.15.12.192",
    "category": "some_category_id",
    "client_version": "EMConsole.17.0.0",
    "username": "email@company.com",
    "enterprise_id": 1234,
    "timestamp": "2025-01-23T01:31:11.123Z",
    "data": {
      "node_id": "abc12345",
      "record_uid": "B881237126",
      "folder_uid": "BCASD12345",
      "some_flag": true
    }
  },
  {
    "TimeGenerated": "2025-01-23T01:31:11.125Z",
    "audit_event": "some_event",
    "remote_address": "10.15.12.192",
    "category": "some_category_id",
    "client_version": "EMConsole.17.0.0",
    "username": "email@company.com",
    "enterprise_id": 1234,
    "timestamp": "2025-01-23T01:31:11.123Z",
    "data": {
      "node_id": "abc12345",
      "record_uid": "B881237126",
      "folder_uid": "BCASD12345",
      "some_flag": true
    }
  }
]
```

変更内容を確認し、問題がなければリクエストを送信してテーブルを作成します。

この例では、テーブルは **`KeeperLogs_CL`** として表示されます (Azureが自動で **`_CL`** を追加します)。

### 7. データ収集ルールにアプリの許可を割り当てる

Azureの[データ収集ルール](https://portal.azure.com/#browse/microsoft.insights%2Fdatacollectionrules) (DCR) の箇所から

* 対象のDCR (例: `KeeperDCR`) を選択します。
* **\[アクセス制御 (IAM)]** を選択します。
* **\[ロールの割り当て]** を選択します。
* **\[追加] > \[ロールの割り当ての追加]** をクリックします。
* 「**Monitoring Metrics Publisher**」と入力し、該当するロールを選択します。
* **\[次へ]** をクリックします。
* **\[+ メンバーの選択]** をクリックし、一覧からKeeperLoggingアプリケーションを選択します。
* KeeperLoggingアプリケーションにロールを割り当てます。

同じ手順を繰り返し、「Monitoring Contributor」と「Monitoring Reader」のロールも追加します。

### 8. データ収集エンドポイントにアプリの許可を割り当てる

Azureの[データ収集エンドポイント](https://portal.azure.com/#browse/microsoft.insights%2Fdatacollectionendpoints) (DCE) の箇所から

* 対象のDCE (例: `KeeperLogsEndpoint`) を選択します。
* **\[ロールの割り当て]** を選択します。
* **\[追加] > \[ロールの割り当ての追加]** をクリックします。
* 「**Monitoring Metrics Publisher**」と入力し、該当するロールを選択します。
* **\[+ メンバーの選択]** をクリックし、一覧からKeeperLoggingアプリケーションを選択します。
* KeeperLoggingアプリケーションにロールを割り当てます。

同じ手順を繰り返し、「Monitoring Contributor」ロールも追加します。

これでAzure側の設定は完了です。次に、管理コンソールの設定を行います。

### 9. 管理コンソールを更新 <a href="#id-9-update-admin-console" id="id-9-update-admin-console"></a>

#### Keeper管理コンソールでの設定手順

[**Keeper**管理コンソール](https://keepersecurity.com/console/)にKeeper管理者としてログインしてから、**\[レポート&アラート]** に移動し、**\[Azure Monitor Logs]** を選択します。

上記[手順2](#id-2-create-client-secret)から以下の情報を入力します。

* **AzureテナントID**: Azureの **\[サブスクリプション]** セクションで確認できます。
* **アプリケーション (クライアント) ID**: アプリ登録 (KeeperLogging) の **\[概要]** 画面から取得します。
* **クライアントシークレットの値**: アプリの登録のシークレットから取得したクライアントシークレットの値。
* **エンドポイントURL**: 以下の形式で作成されたURLです。
  * <mark style="color:red;">https\://\<collection\_url>/dataCollectionRules/\<dcr\_id>/streams/</mark>

    <mark style="color:red;">?api-version=2023-01-01</mark>

エンドポイントURLは、以下の値を組み合わせて作成します。

* **\<Collection URL>**: [手順5](#id-5-create-a-data-collection-endpoint-dce)で取得したURL
* **\<DCR\_ID>**: データ収集ルール (DCR) の **Immutable Id** の値 (例: `dcr-xxxxxxx`)
* **\<TABLE>**: Azureで作成したテーブル名 (例: `Custom-KeeperLogs_CL`)

```
https://<Collection_URL>/dataCollectionRules/<DCR_ID>/streams/<TABLE>?api-version=2023-01-01
```

### セットアップ完了

KeeperからAzure MonitorにSIEMログが送信されると、数分以内にCustom Logsテーブルにデータが表示され始めます。

***

## トラブルシューティング

テスト目的で、Bearerトークンを生成し、Azure Monitor API に対してAPIリクエストを送信することで、プロセスの仕組みを確認できます。

### Bearerトークンを取得する手順

以下の情報を置き換えて、リクエストを送信します。

* `<Tenant_ID>`: 手順9で取得したテナントID
* `<Application_ID>`: 手順9で取得したアプリケーション (クライアント) ID
* `<Client_Secret_Value>`: 手順9で取得したクライアントシークレットの値

これらを使って、Bearerトークンを取得するためのリクエストを行います。

```
curl -X POST 'https://login.microsoftonline.com/<Tenant_ID>/oauth2/v2.0/token' \
-H 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=client_credentials' \
--data-urlencode 'client_id=<Application_ID>' \
--data-urlencode 'client_secret=Client_Secret_Value' \
--data-urlencode 'scope=https://monitor.azure.com/.default'
```

{% hint style="info" %}
トークン取得時の `scope` には、利用するクラウドに応じて以下のベースURLを指定します。

* **Azureパブリッククラウド**: **<https://monitor.azure.com>**
* **Azure US Governmentクラウド**: **<https://monitor.azure.us>**
  {% endhint %}

#### Curlリクエストでトークンを取得する

curlを実行すると、応答JSONに `access_token` などが含まれます。例は以下のとおりです。

```json
{"token_type":"Bearer","expires_in":3599,"ext_expires_in":3599,"access_token":"xxxxx"}
```

返却された `access_token` を使い、以下の手順でKeeperイベントログ送信用のcurlリクエストを送信します。

### SIEMイベントを送信

以下のようにCurlリクエストを送信してください。

以下の各部分を置き換えてください。

* `<ENDPOINT_URL>`: 上記の[手順9](#id-9-update-admin-console)で作成したURL
* `<TOKEN>`: 上記で取得したBearerトークン

```
curl -X POST "<ENDPOINT_URL>" \
-H "Authorization: Bearer <TOKEN>" \
-H "Content-Type: application/json" \
-d '[
    {
      "TimeGenerated": "2025-01-23T01:31:11.123Z",
      "audit_event": "event_one",
      "remote_address": "10.15.12.192",
      "category": "msp",
      "client_version": "EMConsole.17.0.0",
      "username": "email@company.com",
      "enterprise_id": 1234,
      "timestamp": "2025-01-23T01:31:11.123Z",
      "data": {
        "node_id": "abc12345",
        "record_uid": "B881237126",
        "folder_uid": "BCASD12345",
        "some_flag": true
      }
    },
    {
      "TimeGenerated": "2025-01-23T01:31:11.124Z",
      "audit_event": "event_two",
      "remote_address": "10.15.12.192",
      "category": "general",
      "client_version": "EMConsole.17.0.0",
      "username": "email@company.com",
      "enterprise_id": 1234,
      "timestamp": "2025-01-23T01:31:11.123Z",
      "data": {
        "node_id": "abc12345",
        "record_uid": "B881237126",
        "folder_uid": "BCASD12345",
        "some_flag": true
      }
    },
    {
      "TimeGenerated": "2025-01-23T01:31:11.125Z",
      "audit_event": "event_three",
      "remote_address": "10.15.12.192",
      "category": "security",
      "client_version": "EMConsole.17.0.0",
      "username": "email@company.com",
      "enterprise_id": 1234,
      "timestamp": "2025-01-23T01:31:11.123Z",
      "data": {
        "node_id": "abc12345",
        "record_uid": "B881237126",
        "folder_uid": "BCASD12345",
        "some_flag": true
      }
    }
  ]'
```

Bearerトークンの有効期限は1時間です。

イベントは、Log Analyticsワークスペースに反映されるまで数分かかることがあります。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.keeper.io/enterprise-guide/jp/event-reporting/microsoft-sentinel/azure-monitor.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
