Microsoft Sentinel用のコードレス コネクタを作成する

Codeless Connector Framework (CCF) は、パートナー、上級ユーザー、開発者に、データをMicrosoft Sentinelに取り込むためのカスタム コネクタを作成する機能を提供します。

CCF を使用して作成されたコネクタは完全に SaaS であり、サービスインストールの要件はありません。 また、正常性の監視とMicrosoft Sentinelからの完全なサポートも含まれます。

次の手順を使用して CCF コネクタを作成し、データ ソースを Microsoft Sentinel に接続します

  • データ コネクタを構築する
  • ARM テンプレートを作成する
  • コネクターをデプロイする
  • Microsoft Sentinelをデータ ソースに接続し、データの取り込みを開始する

この記事では、各手順を完了し、途中でビルドする コードレス コネクタの例 を提供する方法について説明します。

ソフトウェア開発パートナーであり、CCF データ コネクタを構築するためのサポートが必要な場合は、AzureSentinelPartner@microsoft.comMicrosoft Sentinelパートナーにお問い合わせください。

この CCF は以前のバージョンとどのように異なりますか?

CCF の初期バージョンは、2022 年 1 月に 発表されました 。 その後、プラットフォームが改善され、 レガシ リリース は推奨されなくなりました。 この新しいバージョンの CCF には、次の重要な機能強化があります。

  1. さまざまな認証と改ページの種類のサポートが向上しました。

  2. 標準データ収集規則 (DCR) をサポートします。

  3. これで、コードレス コネクタのユーザー インターフェイスと接続構成部分が分離されました。 これにより、以前は不可能だった複数の接続を持つコネクタを作成できます。

前提条件

コネクタを構築する前に、データ ソースと、Microsoft Sentinel接続する必要がある方法を理解してください。

  1. データ収集エンドポイント (DCE)

    DCE は DCR の要件です。 ログ分析ワークスペース DCR デプロイごとに作成される DCE は 1 つだけです。 Microsoft Sentinel ワークスペースにデプロイされたすべての DCR は、同じ DCE を使用します。 新しいエンドポイントを作成する方法や、新しいエンドポイントが必要かどうかの詳細については、「Azure Monitor のデータ収集エンドポイント」を参照してください。

  2. 出力テーブルのスキーマ。

    データ ストリームの形状と、出力テーブルに含めるフィールドを理解することが重要です。 データ ソースのドキュメントを参照するか、十分な出力例を分析します。

Data Connector API リファレンスで、次のコンポーネントを調査し、それらのサポートを確認します。

  1. データ ソースへの HTTP 要求と応答の構造

  2. データ ソースで必要な認証。
    たとえば、データ ソースで証明書で署名されたトークンが必要な場合、データ コネクタ API リファレンスでは証明書認証がサポートされていないことを指定します。

  3. データ ソースへの改ページオプション

API のテスト

次のいずれかの API テスト ツールを使用してコンポーネントをテストすることをお勧めします。

注意

資格情報、シークレット、アクセス トークン、API キーなどの機密データがあるシナリオでは、必要なセキュリティ機能でデータを保護し、オフラインまたはローカルで動作し、データをクラウドに同期せず、オンライン アカウントにサインインする必要がないツールを使用してください。 これにより、機密データを一般に公開するリスクを軽減できます。

データ コネクタを構築する

ヒント

独立系ソフトウェア ベンダー (ISV) であり、Microsoft Sentinel コードレス コネクタ フレームワークを使用してMicrosoft Sentinel統合を構築するときにサポートが必要な場合は、Microsoft App Assure チームが支援できる場合があります。 App Assure チームと連携するには、 azuresentinelpartner@microsoft.comにメールを送信します。

CCF データ コネクタを構築するには、4 つのコンポーネントが必要です。

  1. 出力テーブル定義
  2. データ収集規則 (DCR)
  3. データ コネクタのユーザー インターフェイス
  4. データ コネクタ接続規則

各コンポーネントには、作成および検証するプロセスの詳細を示すセクションがあります。 ARM テンプレートの最終的なパッケージ化のために、各コンポーネントから JSON を取得します。

出力テーブル定義

ヒント

データが標準の Log Analytics テーブルにのみ取り込まれる場合は、この手順をスキップします。 標準テーブルの例としては、 CommonSecurityLogASimDnsActivityLogs などがあります。 サポートされている標準データ型の完全な一覧の詳細については、「 カスタム データ コネクタのデータ変換のサポート」を参照してください。

データ ソースが標準テーブルのスキーマに準拠していない場合は、次の 2 つのオプションがあります。

  • すべてのデータのカスタム テーブルを作成する
  • 一部のデータのカスタム テーブルを作成し、準拠データを標準テーブルに分割する

簡単な方法で Log Analytics UI を使用して、DCR と共にカスタム テーブルを作成します。 Tables API または別のプログラムメソッドを使用してカスタム テーブルを作成する場合は、テーブル名に_CLサフィックスを手動で追加します。 詳細については、「 カスタム テーブルの作成」を参照してください。

データを複数のテーブルに分割する方法の詳細については、 データの例とそのデータ 用に作成された カスタム テーブルの例 を参照してください。

データ収集ルール

データ収集規則 (DCR) は、Azure Monitor でデータ収集プロセスを定義します。 DCR は、収集するデータ、そのデータを変換する方法、およびそのデータを送信する場所を指定します。

  • データ コネクタごとにデプロイされる DCR は 1 つだけです。
  • DCR には、同じリージョンに対応する DCE が必要です。
  • CCF データ コネクタがデプロイされると、DCR がまだ存在しない場合は作成されます。

これらの記事の DCR に関する最新情報を参照してください。

サンプル データを使用してカスタム テーブルと DCR を作成するなど、DCE の作成を示すチュートリアルについては、「チュートリアル: ログ インジェスト API を使用してログを監視Azureにデータを送信する (Azure portal)」を参照してください。 DCR を使用してデータがテーブルに正しく取り込まれるかどうかを確認するには、このチュートリアルのプロセスを使用します。

複数のデータ フローを含む複雑な DCR を作成する方法については、 DCR の例に関するセクションを参照してください。

データ コネクタのユーザー インターフェイス

このコンポーネントは、Microsoft Sentinel データ コネクタ ギャラリーのデータ コネクタの UI をレンダリングします。 各データ コネクタの UI 定義は 1 つだけです。

データ コネクタ定義 API を使用して、データ コネクタ のユーザー インターフェイスを構築します。 API 要素について詳しく説明するには、 データ コネクタ定義リファレンス を補足として使用します。

注:

  1. API ポーリング コネクタの kind プロパティは、常に Customizableする必要があります。
  2. これは API ポーリング コネクタの一種であるため、 connectivityCriteria の種類を に設定します hasDataConnectors
  3. この例では、ConnectionToggleButton型のボタンを含instructionSteps。 このボタンは、指定された接続パラメーターに基づいてデータ コネクタ ルールのデプロイをトリガーするのに役立ちます。

データ コネクタの定義 API を呼び出す API テスト ツール を使用して、データ コネクタ ギャラリーで検証するためにデータ コネクタ UI を作成します。

例から学習するには、「 データ コネクタ定義のリファレンス例」セクションを参照してください。

データ接続規則

現在、CCF データ コネクタを定義するためのデータ接続規則は 3 種類あります。

API テスト ツールを使用して、データ コネクタ API を呼び出して、接続規則と以前のコンポーネントを組み合わせたデータ コネクタを作成します。 コネクタが UI に接続されていることを確認します。

機密入力をセキュリティで保護する

CCF データ コネクタで使用される認証に関係なく、機密情報がセキュリティで保護されるようにするには、次の手順を実行します。 目標は、ARM テンプレートから CCF に資格情報を渡すことです。読み取り可能な機密オブジェクトはデプロイ履歴に残しません。

ラベルを作成する

データ コネクタ定義は、セキュリティ資格情報の入力を求める UI 要素を作成します。 たとえば、データ コネクタが OAuth を使用してログ ソースに対して認証を行う場合、データ コネクタ定義セクションには手順に OAuthForm の種類が含まれます。 これにより、資格情報の入力を求める ARM テンプレートが設定されます。

"instructions": [
    {
        "type": "OAuthForm",
        "parameters": {
        "UsernameLabel": "Username",
        "PasswordLabel": "Password",
        "connectButtonLabel": "Connect",
        "disconnectButtonLabel": "Disconnect"
        }
    }
],

機密入力を格納する

ARM デプロイ テンプレートのセクションには、管理者がデータ コネクタをデプロイしてパスワードを入力する場所が用意されています。 securestringを使用して、展開後に読み取り不可能なオブジェクトで機密情報をセキュリティで保護します。 詳細については、「 パラメーターのセキュリティに関する推奨事項」を参照してください。

"mainTemplate": {
    "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
    "contentVersion": "[variables('dataConnectorCCPVersion')]",
    "parameters": {
        "Username": {
            "type": "securestring",
            "minLength": 1,
            "metadata": {
                "description": "Enter the username to connect to your data source."
        },
        "Password": {
            "type": "securestring",
            "minLength": 1,
            "metadata": {
                "description": "Enter the API key, client secret or password required to connect."
            }
        },
    // more deployment template information
    }
}

securestring オブジェクトを使用する

最後に、CCF はデータ コネクタ セクションの資格情報オブジェクトを利用します。

"auth": {
    "type": "OAuth2",
    "ClientSecret": "[[parameters('Password')]",
    "ClientId": "[[parameters('Username')]",
    "GrantType": "client_credentials",
    "TokenEndpoint": "https://api.contoso.com/oauth/token",
    "TokenEndpointHeaders": {
        "Content-Type": "application/x-www-form-urlencoded"
    },
    "TokenEndpointQueryParameters": {
        "grant_type": "client_credentials"
    }
},

注:

資格情報オブジェクトの奇妙な構文は、 "ClientSecret": "[[parameters('Password')]", 入力ミスではありません。 パラメーターも使用するデプロイ テンプレートを作成するには、そのセクションのパラメーターを余分な開始[でエスケープする必要があります。 これにより、パラメーターは、コネクタとのユーザー操作に基づいて値を割り当てることができます。

詳細については、「 テンプレート式のエスケープ文字」を参照してください。

デプロイ テンプレートを作成する

サンプル テンプレート コード サンプルをガイドとして使用して、Azure Resource Management (ARM) テンプレートを手動でパッケージ化します。 これらのコード サンプルは、一緒にスプライスする必要がある ARM テンプレート セクションで分割されています。

Google Cloud Platform (GCP) CCF データ コネクタを作成する場合は、 GCP CCF テンプレートの例を使用してデプロイ テンプレートをパッケージ化します。 GCP CCF テンプレートに入力する方法については、「 GCP データ コネクタ接続規則リファレンス」を参照してください

テンプレートの例に加えて、Microsoft Sentinel コンテンツ ハブで使用できる発行済みソリューションでは、データ コネクタに CCF が使用されます。 コンポーネントを ARM テンプレートにステッチする方法の例として、次のソリューションを確認します。

RestApiPoller CCF データ コネクタの例

GCP CCF データ コネクタの例

コネクターをデプロイする

コードレス コネクタをカスタム テンプレートとしてデプロイします。

ヒント

前の手順で作成したリソースを削除します。 DCR とカスタム テーブルは、デプロイと共に作成されます。 デプロイする前にこれらのリソースを削除しない場合は、テンプレートを確認する方が難しくなります。

  1. ARM デプロイ テンプレートの内容をコピーします。
  2. 「クイック スタート: Azure portalを使用して ARM テンプレートを作成してデプロイする」の記事のテンプレートの編集とデプロイの手順に従います。

ログソースのネットワーク分離を維持する

ログ ソースでネットワーク分離が必要な場合は、CCF で使用されるパブリック IP アドレスの許可リストを構成します。

Azure仮想ネットワークでは、サービス タグを使用してネットワーク アクセス制御を定義します。 CCF の場合、そのサービス タグは スキューバです。

スキューバ サービス タグに関連付けられている現在の IP 範囲を見つけるには、「サービス タグ検出 API を使用する」を参照してください。

コードレス コネクタを確認する

データ コネクタ ギャラリーでコードレス コネクタを表示します。 データ コネクタを開き、接続に必要なすべての認証パラメーターを完了します。 正常に接続されると、DCR テーブルとカスタム テーブルが作成されます。 リソース グループ内の DCR リソースと、ログ分析ワークスペースから任意のカスタム テーブルを表示します。

注:

データの取り込み開始を確認するには、最大で 30 分かかる場合があります。

コードレス コネクタを構築する各手順は、次の例のセクションで表されます。

複数のテーブルへのインジェストを含む複雑なデータ ソースを示すために、この例では、出力テーブル スキーマと複数の出力ストリームを持つ DCR を備えています。 DCR の例では、これらを KQL 変換と共に配置します。 データ コネクタ UI の定義と接続規則の例は、この同じ例のデータ ソースから続きます。 最後に、ソリューション テンプレートでは、これらすべてのサンプル コンポーネントを使用して、CCF データ コネクタの例を作成する方法をエンド ツー エンドで示します。

データの例

データ ソースは、エンドポイントに接続するときに次の JSON を返します。

[
        {
        "ts": "3/6/2023 8:15:15 AM",
        "eventType": "Alert",
        "deviceMac": "bc:27:c6:21:1c:70",
        "clientMac": "",
        "srcIp": "10.12.11.106",
        "destIp": "121.93.178.13",
        "protocol": "tcp/ip",
        "priority": "0",
        "message": "This is an alert message"
        },
        {
        "ts": "3/6/2023 8:14:54 AM",
        "eventType": "File",
        "srcIp": "178.175.128.249",
        "destIp": "234.113.125.105",
        "fileType": "MS_EXE",
        "fileSizeBytes": 193688,
        "disposition": "Malicious"
        }
]

この応答には、アラートファイルeventTypeが含まれています。 ファイル イベントは正規化された標準テーブル AsimFileEventLogs に取り込まれますが、アラート イベントはカスタム テーブルに取り込まれます。

カスタム テーブルの例

このテーブルの構造の詳細については、「 Tables API」を参照してください。 カスタム ログ テーブル名には、 _CL サフィックスが必要です。

{
"properties": {
    "schema": {
        "name": "ExampleConnectorAlerts_CL",
        "columns": [
        {
          "name": "TimeGenerated",
          "type": "datetime"
        },
        {
          "name": "SourceIP",
          "type": "string"
        },
        {
          "name": "DestIP",
          "type": "string"
        },
        {
          "name": "Message",
          "type": "string"
        },
        {
          "name": "Priority",
          "type": "int"
        }
        ]
      }
    }
}

データ収集ルールの例

次の DCR では、サンプル データ ソースを使用して単一のストリーム Custom-ExampleConnectorInput を定義し、出力を 2 つのテーブルに変換します。

  1. 最初のデータフローは、 eventType = Alert をカスタム ExampleConnectorAlerts_CL テーブルに転送します。
  2. 2 番目のデータフローでは、 eventType = File が正規化された標準テーブル、ASimFileEventLogsに転送されます。

この例の構造の詳細については、「 データ収集規則の構造」を参照してください。

テスト環境でこの DCR を作成するには、 データ収集規則 API に従います。 {{double curly braces}}の例の要素は、API テスト ツールで使いやすくするために値を必要とする変数を示しています。 ARM テンプレートでこのリソースを作成すると、ここで表される変数がパラメーターと交換されます。

{
  "location": "{{location}}",
  "properties": {
    "dataCollectionEndpointId": "/subscriptions/{{subscriptionId}}/resourceGroups/{{resourceGroupName}}/providers/Microsoft.Insights/dataCollectionEndpoints/{{dataCollectionEndpointName}}",
    "streamDeclarations": {
      "Custom-ExampleConnectorInput": {
        "columns": [
          {
            "name": "ts",
            "type": "datetime"
          },
          {
            "name": "eventType",
            "type": "string"
          },
          {
            "name": "deviceMac",
            "type": "string"
          },
          {
            "name": "clientMac",
            "type": "string"
          },
          {
            "name": "srcIp",
            "type": "string"
          },
          {
            "name": "destIp",
            "type": "string"
          },
          {
            "name": "protocol",
            "type": "string"
          },
          {
            "name": "priority",
            "type": "string"
          },
          {
            "name": "message",
            "type": "string"
          },
          {
            "name": "fileType",
            "type": "string"
          },
          {
            "name": "fileSizeBytes",
            "type": "int"
          },
          {
            "name": "disposition",
            "type": "string"
          }
        ]
      }
    },
    "destinations": {
      "logAnalytics": [
        {
          "workspaceResourceId": "/subscriptions/{{subscriptionId}}/resourcegroups/{{resourceGroupName}}/providers/microsoft.operationalinsights/workspaces/{{workspaceName}}",
          "name": "{{uniqueFriendlyDestinationName}}"
        }
      ]
    },
    "dataFlows": [
      {
        "streams": [
          "Custom-ExampleConnectorInput"
        ],
        "destinations": [
          "{{uniqueFriendlyDestinationName}}"
        ],
        "transformKql": "source | where eventType == \"Alert\" | project TimeGenerated = ts, SourceIP = srcIp, DestIP = destIp, Message = message, Priority = priority \n",
        "outputStream": "Custom-ExampleConnectorAlerts_CL"
      },
      {
        "streams": [
          "Custom-ExampleConnectorInput"
        ],
        "destinations": [
          "{{uniqueFriendlyDestinationName}}"
        ],
        "transformKql": "source | where eventType == \"File\" | project-rename TimeGenerated = ts, EventOriginalType = eventType, SrcIpAddr = srcIp, DstIpAddr = destIp, FileContentType = fileType, FileSize = fileSizeBytes, EventOriginalSeverity = disposition \n",
        "outputStream": "Microsoft-ASimFileEventLogs"
      }
    ]
  }
}

データ コネクタ UI 定義の例

この例は、 データ コネクタ定義リファレンスにあります

データ コネクタ接続規則の例

この例は、 データ コネクタリファレンスにあります。

ARM テンプレートの例

次の構造で ARM デプロイ テンプレートをビルドします。これには、CCF データ コネクタの構築に必要な JSON コンポーネントの 4 つのセクションが含まれています。

{
    "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
    "contentVersion": "1.0.0.0",
    "parameters": {},
    "variables": {},
    "resources": [],
}

セクションを Visual Code などの JSON 対応エディターと組み合わせて、コンマや閉じかっこ、かっこなどの構文エラーを最小限に抑えます。

テンプレートの作成プロセスをガイドするために、コメントはメタデータに表示されるかdescriptionコメント表記//インラインで表示されます。 詳細については、「 ARM テンプレートのベスト プラクティス - コメント」を参照してください。

ARM テンプレート テスト ツールキット (arm-ttk) を使用して、ビルドするテンプレートを検証することを検討してください。 詳細については、「 arm-ttk」を参照してください。

ARM テンプレートの例 - パラメーター

詳細については、「 ARM テンプレートのパラメーター」を参照してください。

警告

リソースのデプロイ後に読み取り可能なオブジェクト内のすべてのパスワードとシークレットには、 securestring を使用します。 詳細については、「 機密入力のセキュリティ保護 」と 「パラメーターのセキュリティに関する推奨事項」を参照してください。

{
    "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
    "contentVersion": "1.0.0.0",
    "parameters": {
        "location": {
            "type": "string",
            "minLength": 1,
            "defaultValue": "[resourceGroup().location]",
            "metadata": {
                "description": "Not used, but needed to pass the arm-ttk test, 'Location-Should-Not-Be-Hardcoded'. Instead the `workspace-location` derived from the log analytics workspace is used."
            }
        },
        "workspace-location": {
            "type": "string",
            "defaultValue": "",
            "metadata": {
                "description": "[concat('Region to deploy solution resources -- separate from location selection',parameters('location'))]"
            }
        },
        "subscription": {
            "defaultValue": "[last(split(subscription().id, '/'))]",
            "type": "string",
            "metadata": {
                "description": "subscription id where Microsoft Sentinel is configured"
            }
        },
        "resourceGroupName": {
            "defaultValue": "[resourceGroup().name]",
            "type": "string",
            "metadata": {
                "description": "resource group name where Microsoft Sentinel is configured"
            }
        },
        "workspace": {
            "defaultValue": "",
            "type": "string",
            "metadata": {
                "description": "the log analytics workspace enabled for Microsoft Sentinel"
            }
        }
    },
    // Next is the variables section here
}

ARM テンプレートの例 - 変数

これらの推奨変数は、テンプレートを簡略化するのに役立ちます。 必要に応じて、多かれ少なかれ使用してください。 詳細については、「 ARM テンプレートの変数」を参照してください。

    "variables": {
        "workspaceResourceId": "[resourceId('microsoft.OperationalInsights/Workspaces', parameters('workspace'))]",
        "_solutionName": "Solution name", // Enter your solution name 
        "_solutionVersion": "3.0.0", // must be 3.0.0 or above
        "_solutionAuthor": "Contoso", // Enter the name of the author
        "_packageIcon": "<img src=\"{LogoLink}\" width=\"75px\" height=\"75px\">", // Enter the http link for the logo. NOTE: This field is only recommended for Azure Global Cloud.
        "_solutionId": "azuresentinel.azure-sentinel-solution-azuresentinel.azure-sentinel-MySolution", // Enter a name for your solution with this format but exchange the 'MySolution' portion
        "dataConnectorVersionConnectorDefinition": "1.0.0",
        "dataConnectorVersionConnections": "1.0.0",
        "_solutionTier": "Community", // This designates the appropriate support - all custom data connectors are "Community"
        "_dataConnectorContentIdConnectorDefinition": "MySolutionTemplateConnectorDefinition", // Enter a name for the connector
        "dataConnectorTemplateNameConnectorDefinition": "[concat(parameters('workspace'),'-dc-',uniquestring(variables('_dataConnectorContentIdConnectorDefinition')))]",
        "_dataConnectorContentIdConnections": "MySolutionTemplateConnections", // Enter a name for the connections this connector makes
        "dataConnectorTemplateNameConnections": "[concat(parameters('workspace'),'-dc-',uniquestring(variables('_dataConnectorContentIdConnections')))]",
        "_logAnalyticsTableId1": "ExampleConnectorAlerts_CL" // Enter the custom table name - not needed if you are ingesting data into standard tables
		// Enter more variables as needed "":""
    },
    // Next is the resources sections here

ARM テンプレートの例 - リソース

このテンプレート ガイドには、4 つの CCF データ コネクタ構築コンポーネントを格納する 5 つの ARM デプロイ リソースがあります。

  1. contentTemplates (親リソース)
  2. dataConnectorDefinitions - 詳細については、「 データ コネクタのユーザー インターフェイス」を参照してください。
  3. metadata
  4. contentTemplates
    • metadata
    • RestApiPoller - 詳細については、「 データ接続規則」を参照してください。
  5. contentPackages
    "resources": [
        // resource section 1 - contentTemplates
        {
            "type": "Microsoft.OperationalInsights/workspaces/providers/contentTemplates",
            "apiVersion": "2023-04-01-preview",
            "name": "[concat(parameters('workspace'),'/Microsoft.SecurityInsights/', variables('dataConnectorTemplateNameConnectorDefinition'), variables('dataConnectorVersionConnectorDefinition'))]",
            "location": "[parameters('workspace-location')]",
            "dependsOn": [
                "[extensionResourceId(resourceId('Microsoft.OperationalInsights/workspaces', parameters('workspace')), 'Microsoft.SecurityInsights/contentPackages', variables('_solutionId'))]"
            ],
            "properties": {
                "contentId": "[variables('_dataConnectorContentIdConnectorDefinition')]",
                "displayName": "[concat(variables('_solutionName'), variables('dataConnectorTemplateNameConnectorDefinition'))]",
                "contentKind": "DataConnector",
                "mainTemplate": {
                    "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
                    "contentVersion": "[variables('dataConnectorVersionConnectorDefinition')]",
                    "parameters": {},
                    "variables": {},
                    "resources": [
                        {
                            "name": "[concat(parameters('workspace'),'/Microsoft.SecurityInsights/',concat('DataConnector-', variables('_dataConnectorContentIdConnectorDefinition')))]",
                            "apiVersion": "2022-01-01-preview",
                            "type": "Microsoft.OperationalInsights/workspaces/providers/metadata",
                            "properties": {
                                "parentId": "[extensionResourceId(resourceId('Microsoft.OperationalInsights/workspaces', parameters('workspace')), 'Microsoft.SecurityInsights/dataConnectorDefinitions', variables('_dataConnectorContentIdConnectorDefinition'))]",
                                "contentId": "[variables('_dataConnectorContentIdConnectorDefinition')]",
                                "kind": "DataConnector",
                                "version": "[variables('dataConnectorVersionConnectorDefinition')]",
                                "source": {
                                    "sourceId": "[variables('_solutionId')]",
                                    "name": "[variables('_solutionName')]",
                                    "kind": "Solution"
                                },
                                "author": {
                                    "name": "[variables('_solutionAuthor')]"
                                },
                                "support": {
                                    "name": "[variables('_solutionAuthor')]",
                                    "tier": "[variables('_solutionTier')]"
                                },
                                "dependencies": {
                                    "criteria": [
                                        {
                                            "version": "[variables('dataConnectorVersionConnections')]",
                                            "contentId": "[variables('_dataConnectorContentIdConnections')]",
                                            "kind": "ResourcesDataConnector"
                                        }
                                    ]
                                }
                            }
                        },
                        {
                            "name": "MyDCRV1", // Enter your DCR name
                            "apiVersion": "2021-09-01-preview",
                            "type": "Microsoft.Insights/dataCollectionRules",
                            "location": "[parameters('workspace-location')]",
                            "kind": null,
                            "properties": 
							{ 
                                // Enter your DCR properties here.
                                //  Consider using these variables:
                                //  "dataCollectionEndpointId": "[concat('/subscriptions/',parameters('subscription'),'/resourceGroups/',parameters('resourceGroupName'),'/providers/Microsoft.Insights/dataCollectionEndpoints/',parameters('workspace'))]",
                                //  "workspaceResourceId": "[variables('workspaceResourceId')]",
							}
                        },
                        {
                            "name": "[variables('_logAnalyticsTableId1')]",
                            "apiVersion": "2022-10-01",
                            "type": "Microsoft.OperationalInsights/workspaces/tables",
                            "location": "[parameters('workspace-location')]",
                            "kind": null,
                            "properties": 
							{
								// Enter your log analytics table schema here. 
                                //  Consider using this variable for the name property:
                                //  "name": "[variables('_logAnalyticsTableId1')]",
							}			
                        }
						// Enter more tables if needed.
                    ]
                },
                "packageKind": "Solution",
                "packageVersion": "[variables('_solutionVersion')]",
                "packageName": "[variables('_solutionName')]",
                "contentProductId": "[concat(substring(variables('_solutionId'), 0, 50),'-','dc','-', uniqueString(concat(variables('_solutionId'),'-','DataConnector','-',variables('_dataConnectorContentIdConnectorDefinition'),'-', variables('dataConnectorVersionConnectorDefinition'))))]",
                "packageId": "[variables('_solutionId')]",
                "contentSchemaVersion": "3.0.0",
                "version": "[variables('_solutionVersion')]"
            }
        },
        // resource 2 section here
        // resource section 2 - dataConnectorDefinitions
        {
            "name": "[concat(parameters('workspace'),'/Microsoft.SecurityInsights/',variables('_dataConnectorContentIdConnectorDefinition'))]",
            "apiVersion": "2022-09-01-preview",
            "type": "Microsoft.OperationalInsights/workspaces/providers/dataConnectorDefinitions",
            "location": "[parameters('workspace-location')]",
            "kind": "Customizable",
            "properties": 
			{
				//Enter your data connector definition properties here
				//"connectorUiConfig": {
				//	"graphQueriesTableName": "[variables('_logAnalyticsTableId1')]",
                //}, 
			}
        },
        // resource 3 section here
        // resource section 3 - metadata
        {
            "name": "[concat(parameters('workspace'),'/Microsoft.SecurityInsights/',concat('DataConnector-', variables('_dataConnectorContentIdConnectorDefinition')))]",
            "apiVersion": "2022-01-01-preview",
            "type": "Microsoft.OperationalInsights/workspaces/providers/metadata",
            "properties": {
                "parentId": "[extensionResourceId(resourceId('Microsoft.OperationalInsights/workspaces', parameters('workspace')), 'Microsoft.SecurityInsights/dataConnectorDefinitions', variables('_dataConnectorContentIdConnectorDefinition'))]",
                "contentId": "[variables('_dataConnectorContentIdConnectorDefinition')]",
                "kind": "DataConnector",
                "version": "[variables('dataConnectorVersionConnectorDefinition')]",
                "source": {
                    "sourceId": "[variables('_solutionId')]",
                    "name": "[variables('_solutionName')]",
                    "kind": "Solution"
                },
                "author": {
                    "name": "[variables('_solutionAuthor')]"
                },
                "support": {
                    "name": "[variables('_solutionAuthor')]",
                    "tier": "[variables('_solutionTier')]"
                },
                "dependencies": {
                    "criteria": [
                        {
                            "version": "[variables('dataConnectorVersionConnections')]",
                            "contentId": "[variables('_dataConnectorContentIdConnections')]",
                            "kind": "ResourcesDataConnector"
                        }
                    ]
                }
            }
        },
        // resource 4 section here
        // resource section 4 - contentTemplates
        {
            "type": "Microsoft.OperationalInsights/workspaces/providers/contentTemplates",
            "apiVersion": "2023-04-01-preview",
            "name": "[concat(parameters('workspace'),'/Microsoft.SecurityInsights/', variables('dataConnectorTemplateNameConnections'), variables('dataConnectorVersionConnections'))]",
            "location": "[parameters('workspace-location')]",
            "dependsOn": [
                "[extensionResourceId(resourceId('Microsoft.OperationalInsights/workspaces', parameters('workspace')), 'Microsoft.SecurityInsights/contentPackages', variables('_solutionId'))]"
            ],
            "properties": {
                "contentId": "[variables('_dataConnectorContentIdConnections')]",
                "displayName": "[concat(variables('_solutionName'), variables('dataConnectorTemplateNameConnections'))]",
                "contentKind": "ResourcesDataConnector",
                "mainTemplate": {
                    "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
                    "contentVersion": "[variables('dataConnectorVersionConnections')]",
                    "parameters":
                    // These parameters are used by the data connector primarily as properties for the administrator to enter in the UI when configuring the connector
					{
                        "connectorDefinitionName": {
                            "defaultValue": "connectorDefinitionName",
                            "type": "string",
                            "minLength": 1
                        },
                        "workspace": {
                            "defaultValue": "[parameters('workspace')]",
                            "type": "string"
                        },
                        "dcrConfig": {
                            "defaultValue": {
                                "dataCollectionEndpoint": "data collection Endpoint",
                                "dataCollectionRuleImmutableId": "data collection rule immutableId"
                            },
                            "type": "object"
                        }
						// Enter additional parameters, for example:
						//"domainname": {
                        //    "defaultValue": "domain name",
                        //    "type": "string",
                        //    "minLength": 1
                        //},
                        //"apikey": {
                        //    "defaultValue": "",
                        //    "type": "securestring",
                        //    "minLength": 1
                        //}
                    },
                    "variables": {
                        "_dataConnectorContentIdConnections": "[variables('_dataConnectorContentIdConnections')]"
                    },
                    "resources": [
                        {
                            "name": "[concat(parameters('workspace'),'/Microsoft.SecurityInsights/',concat('DataConnector-', variables('_dataConnectorContentIdConnections')))]",
                            "apiVersion": "2022-01-01-preview",
                            "type": "Microsoft.OperationalInsights/workspaces/providers/metadata",
                            "properties": {
                                "parentId": "[extensionResourceId(resourceId('Microsoft.OperationalInsights/workspaces', parameters('workspace')), 'Microsoft.SecurityInsights/dataConnectors', variables('_dataConnectorContentIdConnections'))]",
                                "contentId": "[variables('_dataConnectorContentIdConnections')]",
                                "kind": "ResourcesDataConnector",
                                "version": "[variables('dataConnectorVersionConnections')]",
                                "source": {
                                    "sourceId": "[variables('_solutionId')]",
                                    "name": "[variables('_solutionName')]",
                                    "kind": "Solution"
                                },
                                "author": {
                                    "name": "[variables('_solutionAuthor')]"
                                },
                                "support": {
                                    "name": "[variables('_solutionAuthor')]",
                                    "tier": "[variables('_solutionTier')]"
                                }
                            }
                        },
                        {
                            "name": "[concat(parameters('workspace'),'/Microsoft.SecurityInsights/', 'MyDataConnector')]", // Replace the last part of the name with your data connector name
                            //  To create several connections using this template, make the name dynamic. For example, use the 'concat' function to add the connector name with a GUID using the 'guid' function.
                            "apiVersion": "2022-12-01-preview",
                            "type": "Microsoft.OperationalInsights/workspaces/providers/dataConnectors",
                            "location": "[parameters('workspace-location')]",
                            "kind": "RestApiPoller",
                            "properties": 
							{
								// Enter your data connector properties here. If you want to use UI parameters remember to escape the parameter like this: "[[parameters('paramName')]"
								//  Use parameters as needed. For example:	
                                // "dataType": "My product security event API",
                                // "response": {
                                //   "eventsJsonPaths": [
                                //        "$"
                                //    ],
                                //    "format": "json"
                                // },
                                // "paging": {
                                //    "pagingType": "LinkHeader"
                                // },
                                // "connectorDefinitionName": "[[parameters('connectorDefinitionName')]",
                                // "auth": {
                                //   "apiKeyName": "Authorization",
                                //    "ApiKey": "[[parameters('apikey')]",
                                //    "apiKeyIdentifier": "SSWS",
                                //    "type": "APIKey"
                                //} ,
                                // "request": {
                                //   "apiEndpoint": "[[concat('https://',parameters('domainname'),'/api/v1/logs')]",
                                //    "rateLimitQPS": 10,
                                //   "queryWindowInMin": 5,
                                //   "httpMethod": "GET",
                                //    "retryCount": 3,
                                //    "timeoutInSeconds": 60,
                                //    "headers": {
                                //        "Accept": "application/json",
                                //        "User-Agent": "My-Data-Source"
                                //    },
                                //    "startTimeAttributeName": "since",
								//    "endTimeAttributeName": "until"		     
                                // },
                                // "dcrConfig": {
                                //    "dataCollectionEndpoint": "[[parameters('dcrConfig').dataCollectionEndpoint]",
                                //    "dataCollectionRuleImmutableId": "[[parameters('dcrConfig').dataCollectionRuleImmutableId]",
                                //    "streamName": "Custom-ExampleConnectorAlerts_CL" //This input stream should be the same as the inputStream property configured for the DataCollectionRule 
                                // },
                                // "isActive": true
                            }
                        }
                    ]
                },
                "packageKind": "Solution",
                "packageVersion": "[variables('_solutionVersion')]",
                "packageName": "[variables('_solutionName')]",
                "contentProductId": "[concat(substring(variables('_solutionId'), 0, 50),'-','rdc','-', uniqueString(concat(variables('_solutionId'),'-','ResourcesDataConnector','-',variables('_dataConnectorContentIdConnections'),'-', variables('dataConnectorVersionConnections'))))]",
                "packageId": "[variables('_solutionId')]",
                "contentSchemaVersion": "3.0.0",
                "version": "[variables('_solutionVersion')]"
            }
        },
        // resource 5 section here
        // resource section 5 - contentPackages
        {
            "type": "Microsoft.OperationalInsights/workspaces/providers/contentPackages",
            "name": "[concat(parameters('workspace'),'/Microsoft.SecurityInsights/', variables('_solutionId'))]",
            "location": "[parameters('workspace-location')]",
            "apiVersion": "2023-04-01-preview",
            "properties": {
                "version": "[variables('_solutionVersion')]",
                "kind": "Solution",
                "contentSchemaVersion": "3.0.0",
                "contentId": "[variables('_solutionId')]",
                "source": {
                    "kind": "Solution",
                    "name": "[variables('_solutionName')]",
                    "sourceId": "[variables('_solutionId')]"
                },
                "author": {
                    "name": "[variables('_solutionAuthor')]"
                },
                "support": {
                    "name": "[variables('_solutionAuthor')]"
                },
                "dependencies": {
                    "operator": "AND",
                    "criteria": [
                        {
                            "kind": "DataConnector",
                            "contentId": "[variables('dataConnectorVersionConnectorDefinition')]",
                            "version": "[variables('_dataConnectorContentIdConnectorDefinition')]"
                        }
                    ]
                },
                "firstPublishDate": "2023-12-05",
                "providers": [
                    "[variables('_solutionAuthor')]"
                ],
                "contentKind": "Solution",
                "packageId": "[variables('_solutionId')]",
                "contentProductId": "[concat(substring(variables('_solutionId'), 0, 50),'-','sl','-', uniqueString(concat(variables('_solutionId'),'-','Solution','-',variables('_solutionId'),'-', variables('_solutionVersion'))))]",
                "displayName": "[variables('_solutionName')]",
                "publisherDisplayName": "[variables('_solutionId')]",
                "descriptionHtml": "test",
                "icon": "[variables('_packageIcon')]"
            }
        }
        // that's the end!
    ]
}

トピック