このガイドは、コードレス コネクタ フレームワーク (CCF) プッシュ (プレビュー) を使用して、Microsoft Sentinel 用のプッシュベースのコードレス コネクタを理解し、ビルドし、デプロイするのに役立ちます。
CCF プッシュとは何ですか?
CCF プッシュ コネクタを使用すると、アプリケーションはセキュリティ イベントをリアルタイムで Microsoft Sentinel に直接送信できます。 API から定期的にデータをフェッチする従来のポーリング ベースのコネクタとは異なり、プッシュ コネクタを使用すると、システムでイベントが発生したときに Sentinel にデータをプッシュできます。
CCF プッシュには、いくつかの重要な利点があります。
- アプリケーション制御データ フロー: アプリケーションは、データを送信するタイミングと方法を制御し、インテリジェントなバッチ処理戦略と最適化されたネットワーク使用を可能にします。
- リアルタイム インジェスト: ポーリング間隔を待たずに、イベントが発生するとすぐにデータを送信します。
- 簡略化されたアーキテクチャ: Sentinel がポーリングするために API エンドポイントを維持する必要はありません。
- テンプレート ベースのプロビジョニング: 展開では、DCR、カスタム テーブル、Entra アプリケーション登録、クライアント シークレット用の ARM テンプレートが作成されます。送信アプリケーションで構成する接続の詳細を受け取ります。
- セキュリティで保護された認証: セキュリティで保護されたデータの送信に OAuth 2.0 で Microsoft Entra アプリケーションを使用します。
前提条件
- 開始する前に、パッケージ化ツール用の Azure-Sentinel GitHub リポジトリにアクセスできる必要があります。
- Microsoft Entra のアクセス許可:
- Microsoft Entra ID でアプリ登録を作成するためのアクセス許可。 通常、ENTRA ID アプリケーション開発者ロール以上が必要です。
- シークレットを含むアプリケーションを作成するためのアクセス許可。 このアクセス許可を付与しない場合、セキュリティ上の理由によりコネクタが失敗します。
- 発行元には、Microsoft Entra アプリケーションからトークンを取得するための適切なロールが必要です。 これらのトークンは、データ収集エンドポイント (DCE) への要求を認証するために必要です。これは、コネクタが最終的にそのデータをプッシュするエンドポイントです。 プロバイダーがトークンを取得できない場合、データを DCE に送信することはできません。
- Microsoft Azure のアクセス許可:
- データ収集ルール (DCR) に対して Monitoring Metrics Publisher ロールを割り当てる許可。 通常、Azure RBAC の所有者ロールまたはユーザー アクセス管理者ロールが必要です。
CCF プッシュのしくみ
プッシュ モデルとプル モデル
プッシュ データ インジェスト モデルとプル データ インジェスト モデルの違いを理解することは、シナリオに適したコネクタの種類を選択するのに役立ちます。
ポーリングベースのCCFプルコネクタ:
プル モデルでは、Microsoft Sentinel によって API が定期的にポーリングされ、データが取得されます。
- Microsoft Sentinel は、構成されたスケジュールでデータ ソース API への接続を開始します。
- データは、5 分ごとなど、定期的なポーリング間隔で到着します。
- パブリックにアクセス可能な API エンドポイントを維持する必要があります。
- Sentinel のポーリング インフラストラクチャは、データ収集プロセスを管理します。
CCF プッシュ コネクタ - イベント駆動型:
プッシュ モデルでは、アプリケーションはデータを Microsoft Sentinel に直接送信します。
- アプリケーションは、イベントが発生したときにデータの送信を開始します。
- イベントが生成されると、ほぼリアルタイムでデータが到着します。
- API エンドポイントを維持する必要はありません。
- アプリケーションは、バッチ処理、タイミング、データ フローの最適化を制御します。
プッシュ データ フロー
CCF プッシュ データ フローは、次の 5 つの主要な手順で構成されます。
Microsoft Sentinel でコネクタをデプロイします。
Azure では、次のリソースが自動的に作成されます。
- 資格情報を使用した Microsoft Entra アプリケーション
- データ収集規則 (DCR) - データの処理方法を定義します
- データ収集エンドポイント (DCE) - データを送信する URL
- カスタム ログ テーブル - データが格納されている場所
- ロールの割り当て - Entra アプリのアクセス許可
次の接続の詳細を受け取ります。
- テナント ID
- アプリケーション (クライアント) ID
- クライアント シークレット
- DCE URI (エンドポイント URL)
- DCR 不変 ID
- ストリーム名
アプリケーションは、次のデータを送信します。
- CCF によって生成された Entra アプリの資格情報を使用して OAuth 2.0 トークンを取得します。 詳細については、「OAuth 2.0 クライアント資格情報フロー」を参照してください。
- イベントをテーブル スキーマに一致する JSON として書式設定する
- DCE エンドポイントにデータをPOSTする
Azure はデータを処理して格納します。
- DCR がデータを変換する (オプションの KQL 変換)
- Log Analytics のカスタム テーブルにデータが書き込まれる
- データは、Sentinel のクエリ、分析、およびアラートで使用できます
CCF プッシュ成果物
CCF プッシュ コネクタ ソリューションは、次の 4 つの主要コンポーネントで構成されます。
- カスタム テーブル定義
- データ収集規則 (DCR)
- コネクタ定義 (UI)
- プッシュ コネクタの構成
カスタム テーブル定義
それは何ですか: Log Analytics でデータの構造を定義するスキーマ。
主要な要件:
- テーブル名は、
_CL(カスタム ログ サフィックス) で終わる必要があります。 -
TimeGenerated列 (datetime 型) を含める必要があります。 - 列の型: string、int、long、real、bool、datetime、dynamic、guid。
- API バージョン
2025-07-01以降を使用します。 - 詳細については、「 Azure Monitor ログでカスタム テーブルを作成する」を参照してください。
Example:
{
"name": "ContosoSecurityAlerts_CL",
"type": "Microsoft.OperationalInsights/workspaces/tables",
"apiVersion": "2025-07-01",
"properties": {
"schema": {
"name": "ContosoSecurityAlerts_CL",
"columns": [
{
"name": "TimeGenerated",
"type": "datetime"
},
{
"name": "EventSeverity",
"type": "string"
},
{
"name": "EventType",
"type": "string"
},
{
"name": "UserName",
"type": "string"
},
{
"name": "SourceIP",
"type": "string"
},
{
"name": "DeviceId",
"type": "string"
},
{
"name": "AlertMessage",
"type": "string"
}
]
}
}
}
データ収集規則 (DCR)
それは何ですか: Azure Monitor がデータを取り込んで処理する方法を定義します。 詳細については、「Azure Monitor のデータ収集ルール」を参照してください。
実行内容:
- 入力ストリーム名を指定します (アプリがデータを送信するときに使用するもの)
- データを整形および強化するためのオプションの KQL 変換を定義します
- 宛先テーブルにデータをルーティングする
- データ収集エンドポイント (DCE) へのリンク
主なコンポーネント:
-
streamDeclarations: 受信データの構造を定義します (アプリが送信するデータと一致する必要があります) -
destinations: データの行き先 (Log Analytics ワークスペース) -
dataFlows: 入力ストリームから出力テーブルへの変換パイプライン -
dataCollectionEndpointId: データ インジェスト用の DCE へのリンク
Example:
{
"name": "ContosoSecurityAlertsPushDCR",
"apiVersion": "2021-09-01-preview",
"type": "Microsoft.Insights/dataCollectionRules",
"location": "[parameters('workspace-location')]",
"properties": {
"streamDeclarations": {
"Custom-ContosoSecurityAlerts": {
"columns": [
{
"name": "EventSeverity",
"type": "string"
},
{
"name": "EventType",
"type": "string"
},
{
"name": "UserName",
"type": "string"
},
{
"name": "SourceIP",
"type": "string"
},
{
"name": "DeviceId",
"type": "string"
},
{
"name": "AlertMessage",
"type": "string"
}
]
}
},
"destinations": {
"logAnalytics": [
{
"workspaceResourceId": "[variables('workspaceResourceId')]",
"name": "clv2ws1"
}
]
},
"dataFlows": [
{
"streams": [
"Custom-ContosoSecurityAlerts"
],
"destinations": [
"clv2ws1"
],
"transformKql": "source | extend TimeGenerated = now()",
"outputStream": "Custom-ContosoSecurityAlerts_CL"
}
],
"dataCollectionEndpointId": "[concat('/subscriptions/',parameters('subscription'),'/resourceGroups/',parameters('resourceGroupName'),'/providers/Microsoft.Insights/dataCollectionEndpoints/',parameters('workspace'))]"
}
}
Important
- ストリーム名は
Custom-プレフィックスで始まる必要があります。 -
transformKqlは、パススルー用に単に"source"することも、データ変換用の KQL ロジックを含めることもできます。 -
outputStreamは、Custom-プレフィックスと_CLサフィックスを持つテーブル名と一致する必要があります。
コネクタ定義 (UI)
コネクタ定義は、Microsoft Sentinel データ コネクタ ギャラリーでのコネクタの表示方法を制御します。 詳細については、「 データ コネクタ定義 API リファレンス」を参照してください。
コネクタ定義には次のものが含まれます。
- コネクタのタイトル、説明、およびブランド化
- ワークスペースへのアクセスや Entra のアクセス許可など、必須の前提条件とアクセス許可
- デプロイのための手順
- ユーザーに接続の詳細を表示するための UI コントロール
主要な UI 要素:
-
DeployPushConnectorButton: リソースの自動デプロイをトリガーします -
CopyableLabel: デプロイ後に接続の詳細を表示します (fillWithパラメーターを使用) -
Markdown: 書式設定された命令とコンテキストを提供します -
IsConnectedQuery: 最近のデータに基づいてコネクタの接続を検証します
構造体の例 (わかりやすくするために省略されています):
{
"name": "ContosoSecurityAlertsPush",
"apiVersion": "2022-09-01-preview",
"type": "Microsoft.SecurityInsights/dataConnectorDefinitions",
"location": "[parameters('workspace-location')]",
"kind": "Customizable",
"properties": {
"connectorUiConfig": {
"id": "ContosoSecurityAlertsPush",
"title": "Contoso Security Alerts (Push)",
"publisher": "Contoso Corporation",
"descriptionMarkdown": "The [Contoso Security Alerts](https://www.contoso.com/) connector provides the capability to push real-time security alerts from your Contoso application directly into Microsoft Sentinel using the Codeless Connector Framework (CCF) Push pattern. This connector ingests alert severity, event types, user information, and network details into a custom Log Analytics table for analysis, alerting, and visualization.",
"graphQueries": [
{
"metricName": "Security Alerts",
"legend": "ContosoSecurityAlerts_CL",
"baseQuery": "ContosoSecurityAlerts_CL"
}
],
"sampleQueries": [
{
"description": "All security alerts",
"query": "ContosoSecurityAlerts_CL\n | sort by TimeGenerated desc"
},
{
"description": "Critical and High severity alerts",
"query": "ContosoSecurityAlerts_CL\n | where EventSeverity in ('Critical', 'High')\n | sort by TimeGenerated desc"
}
],
"dataTypes": [
{
"name": "ContosoSecurityAlerts_CL",
"lastDataReceivedQuery": "ContosoSecurityAlerts_CL\n| summarize Time = max(TimeGenerated)\n| where isnotempty(Time)"
}
],
"connectivityCriteria": [
{
"type": "IsConnectedQuery",
"value": [
"ContosoSecurityAlerts_CL\n| summarize LastLogReceived = max(TimeGenerated)\n| project IsConnected = LastLogReceived > ago(7d)"
]
}
],
"availability": {
"status": 1
},
"permissions": {
"resourceProvider": [
{
"provider": "Microsoft.OperationalInsights/workspaces",
"permissionsDisplayText": "read and write permissions are required.",
"providerDisplayName": "Workspace",
"scope": "Workspace",
"requiredPermissions": {
"write": true,
"read": true,
"delete": true
}
}
],
"customs": [
{
"name": "Microsoft Entra",
"description": "Permission to create an app registration in Microsoft Entra ID. Typically requires Entra ID Application Developer role or higher."
},
{
"name": "Microsoft Azure",
"description": "Permission to assign Monitoring Metrics Publisher role on data collection rule (DCR). Typically requires Azure RBAC Owner or User Access Administrator role."
}
]
},
"instructionSteps": [
{
"title": "1. Create ARM Resources and Provide the Required Permissions",
"description": "This connector enables your Contoso application to push security alerts directly to Microsoft Sentinel via the Azure Monitor Ingestion API.",
"instructions": [
{
"type": "Markdown",
"parameters": {
"content": "#### Automated Configuration and Secure Data Ingestion with Entra Application \nClicking on \"Deploy\" will trigger the creation of a Log Analytics table and a Data Collection Rule (DCR). \nIt will then create an Entra application, link the DCR to it, and set the entered secret in the application. This setup enables data to be sent securely to the DCR using an Entra token."
}
},
{
"type": "DeployPushConnectorButton",
"parameters": {
"label": "Deploy Contoso Push connector resources",
"applicationDisplayName": "Contoso Security Alerts Push Connector Application"
}
}
]
},
{
"title": "2. Configure Your Contoso Application",
"description": "Use the following parameters to configure your Contoso application to push security alerts to the workspace.",
"instructions": [
{
"type": "CopyableLabel",
"parameters": {
"label": "Tenant ID (Directory ID)",
"fillWith": [
"TenantId"
]
}
},
{
"type": "CopyableLabel",
"parameters": {
"label": "Entra App Registration Application ID",
"fillWith": [
"ApplicationId"
],
"placeholder": "Deploy push connector to get the App Registration Application ID"
}
},
{
"type": "CopyableLabel",
"parameters": {
"label": "Entra App Registration Secret",
"fillWith": [
"ApplicationSecret"
],
"placeholder": "Deploy push connector to get the App Registration Secret"
}
},
{
"type": "CopyableLabel",
"parameters": {
"label": "Data Collection Endpoint Uri",
"fillWith": [
"DataCollectionEndpoint"
],
"placeholder": "Deploy push connector to get the Data Collection Endpoint Uri"
}
},
{
"type": "CopyableLabel",
"parameters": {
"label": "Data Collection Rule Immutable ID",
"fillWith": [
"DataCollectionRuleId"
],
"placeholder": "Deploy push connector to get the Data Collection Rule Immutable ID"
}
},
{
"type": "CopyableLabel",
"parameters": {
"label": "Stream Name",
"value": "Custom-ContosoSecurityAlerts"
}
},
{
"type": "Markdown",
"parameters": {
"content": "#### Configure Contoso Application\nUpdate your Contoso application configuration with the above credentials to enable security alert push to Microsoft Sentinel.\n\nExample configuration:\njson\n{\n \"azure\": {\n \"tenant_id\": \"<Tenant ID>\",\n \"client_id\": \"<Application ID>\",\n \"client_secret\": \"<Application Secret>\",\n \"dce_endpoint\": \"<Data Collection Endpoint Uri>\",\n \"dcr_immutable_id\": \"<Data Collection Rule Immutable ID>\",\n \"stream_name\": \"Custom-ContosoSecurityAlerts\"\n }\n}\n"
}
}
]
}
]
}
}
}
Important
-
id内のconnectorUiConfigは一意であり、データ コネクタ構成の参照と一致している必要があります。 - 運用コネクタに
IsConnectedQueryを使用する (最近のデータを検証する)、またはhasDataConnectorsを使用して簡単な検証を行います。 -
fillWithのCopyableLabelパラメーターは、デプロイ後に自動的に設定されます。 - ストリーム名などの固定値では、
valueの代わりにfillWithパラメーターを使用します。
プッシュ コネクタの構成
プッシュ コネクタの構成は、コネクタ定義をデプロイされたリソースにリンクするデータ コネクタ インスタンスです。
プッシュ コネクタの構成
- コネクタ定義 (UI) を、デプロイされた DCR および Entra アプリにリンクします。
- 認証の詳細 (アプリ ID、サービス プリンシパル ID) を格納します
- DCR 構成 (エンドポイント、変更できない ID、ストリーム名) を記録します
- UI で接続の詳細を取得してユーザーに表示できるようにします。
主なプロパティ:
-
connectorDefinitionName: コネクタ定義のidと一致する必要があります -
dcrConfig: DCR エンドポイント、ルール ID、およびストリーム名が含まれています -
auth: Entra アプリケーション ID とサービス プリンシパル ID が含まれています -
kind: プッシュ コネクタの場合は "Push" にする必要があります
例:
{
"name": "ContosoSecurityAlertsPushDCR",
"apiVersion": "2021-09-01-preview",
"type": "Microsoft.Insights/dataCollectionRules",
"location": "[parameters('workspace-location')]",
"properties": {
"streamDeclarations": {
"Custom-ContosoSecurityAlerts": {
"columns": [
{
"name": "EventSeverity",
"type": "string"
},
{
"name": "EventType",
"type": "string"
},
{
"name": "UserName",
"type": "string"
},
{
"name": "SourceIP",
"type": "string"
},
{
"name": "DeviceId",
"type": "string"
},
{
"name": "AlertMessage",
"type": "string"
}
]
}
},
"destinations": {
"logAnalytics": [
{
"workspaceResourceId": "[variables('workspaceResourceId')]",
"name": "clv2ws1"
}
]
},
"dataFlows": [
{
"streams": [
"Custom-ContosoSecurityAlerts"
],
"destinations": [
"clv2ws1"
],
"transformKql": "source | extend TimeGenerated = now()",
"outputStream": "Custom-ContosoSecurityAlerts_CL"
}
],
"dataCollectionEndpointId": "[concat('/subscriptions/',parameters('subscription'),'/resourceGroups/',parameters('resourceGroupName'),'/providers/Microsoft.Insights/dataCollectionEndpoints/',parameters('workspace'))]"
}
}
Important
-
connectorDefinitionNameは、コネクタ定義のidと完全に一致する必要があります。 -
streamNameは、DCR で宣言されているストリームと一致する必要があります。 - ユーザーが DeployPushConnector ボタンを選択すると、デプロイ中にこのリソースが自動的に作成されます。
初めてのプッシュ コネクタの構築
この例では、アプリケーションから Sentinel にセキュリティ アラートを送信する単純なプッシュ コネクタを構築します。
目標: アプリケーションから Sentinel にリアルタイムでセキュリティ アラートを送信する
アプリケーションからイベント構造が送信されます。
{
"TimeGenerated": "2025-11-21T10:30:00Z",
"EventSeverity": "Medium",
"EventType": "LoginAlert",
"UserName": "alice@contoso.com",
"SourceIP": "192.168.1.100",
"DeviceId": "device-12345",
"AlertMessage": "Multiple failed login attempts detected"
}
プッシュ コネクタを作成するためのステップ バイ ステップ ガイド
Azure-Sentinel リポジトリを複製する
公式の Azure-Sentinel リポジトリをフォークして、ローカル コンピューターにクローンします。 このリポジトリにはパッケージ化ツールが含まれており、標準のソリューション構造が提供されます。
リポジトリの複製
git clone https://github.com/<YOUR_FORK>/Azure-Sentinel.gitソリューション ディレクトリに移動します。
cd Azure-Sentinel/Solutions
リポジトリ構造には次のものが含まれます。
- ツール/Create-Azure-Sentinel-Solution/V3/
- createSolutionV3.ps1 パッケージ スクリプトが含まれています
- ソリューション/ コネクタ ソリューションを作成する場所
ソリューション フォルダー構造の作成 標準の名前付け規則に従って、ソリューション/ フォルダー内に新しいソリューション ディレクトリを作成します。 ソリューション ディレクトリの作成 (Azure-Sentinel/Solutions/から)
mkdir ContosoSecurityAlerts cd ContosoSecurityAlerts mkdir Data mkdir "Data Connectors" mkdir "Data Connectors/ContosoSecurityAlerts_ccf"フォルダー構造は次のようになります。
Azure-Sentinel/
└── ソリューション/
└── ContosoSecurityAlerts/
├── データ/
└── データ コネクタ/
└── ContosoSecurityAlerts_ccf/テーブルを定義する
ContosoSecurityAlerts_ccf フォルダーで、カスタム テーブル定義を使用して table.json という名前のファイルを作成します。
{ "name": "ContosoSecurityAlerts_CL", "type": "Microsoft.OperationalInsights/workspaces/tables", "apiVersion": "2025-07-01", "properties": { "schema": { "name": "ContosoSecurityAlerts_CL", "columns": [ { "name": "TimeGenerated", "type": "datetime" }, { "name": "EventSeverity", "type": "string" }, { "name": "EventType", "type": "string" }, { "name": "UserName", "type": "string" }, { "name": "SourceIP", "type": "string" }, { "name": "DeviceId", "type": "string" }, { "name": "AlertMessage", "type": "string" } ] } } }DCR を作成する
ContosoSecurityAlerts_ccf フォルダーに、入力ストリームを定義し、データをテーブルにルーティングする DCR.json という名前のファイルを作成します。
{ "name": "ContosoSecurityAlertsPushDCR", "apiVersion": "2021-09-01-preview", "type": "Microsoft.Insights/dataCollectionRules", "location": "[parameters('workspace-location')]", "properties": { "streamDeclarations": { "Custom-ContosoSecurityAlerts": { "columns": [ { "name": "EventSeverity", "type": "string" }, { "name": "EventType", "type": "string" }, { "name": "UserName", "type": "string" }, { "name": "SourceIP", "type": "string" }, { "name": "DeviceId", "type": "string" }, { "name": "AlertMessage", "type": "string" } ] } }, "destinations": { "logAnalytics": [ { "workspaceResourceId": "[variables('workspaceResourceId')]", "name": "clv2ws1" } ] }, "dataFlows": [ { "streams": [ "Custom-ContosoSecurityAlerts" ], "destinations": [ "clv2ws1" ], "transformKql": "source | extend TimeGenerated = now()", "outputStream": "Custom-ContosoSecurityAlerts_CL" } ], "dataCollectionEndpointId": "[concat('/subscriptions/',parameters('subscription'),'/resourceGroups/',parameters('resourceGroupName'),'/providers/Microsoft.Insights/ dataCollectionEndpoints/',parameters('workspace'))]" } }コネクタ定義を作成する
ContosoSecurityAlerts_ccf フォルダーに、ユーザーが Sentinel でコネクタを操作する方法を定義する connectorDefinition.json という名前のファイルを作成します。
{ "name": "ContosoSecurityAlertsPush", "apiVersion": "2022-09-01-preview", "type": "Microsoft.SecurityInsights/dataConnectorDefinitions", "location": "[parameters('workspace-location')]", "kind": "Customizable", "properties": { "connectorUiConfig": { "id": "ContosoSecurityAlertsPush", "title": "Contoso Security Alerts (Push)", "publisher": "Contoso Corporation", "descriptionMarkdown": "The [Contoso Security Alerts](https://www.contoso.com/) connector provides the capability to push real-time security alerts from your Contoso application directly into Microsoft Sentinel using the Codeless Connector Framework (CCF) Push pattern. This connector ingests alert severity, event types, user information, and network details into a custom Log Analytics table for analysis, alerting, and visualization.", "graphQueries": [ { "metricName": "Security Alerts", "legend": "ContosoSecurityAlerts_CL", "baseQuery": "ContosoSecurityAlerts_CL" } ], "sampleQueries": [ { "description": "All security alerts", "query": "ContosoSecurityAlerts_CL\n | sort by TimeGenerated desc" }, { "description": "Critical and High severity alerts", "query": "ContosoSecurityAlerts_CL\n | where EventSeverity in ('Critical', 'High')\n | sort by TimeGenerated desc" } ], "dataTypes": [ { "name": "ContosoSecurityAlerts_CL", "lastDataReceivedQuery": "ContosoSecurityAlerts_CL\n| summarize Time = max(TimeGenerated)\n| where isnotempty(Time)" } ], "connectivityCriteria": [ { "type": "IsConnectedQuery", "value": [ "ContosoSecurityAlerts_CL\n| summarize LastLogReceived = max(TimeGenerated)\n| project IsConnected = LastLogReceived > ago(7d)" ] } ], "availability": { "status": 1 }, "permissions": { "resourceProvider": [ { "provider": "Microsoft.OperationalInsights/workspaces", "permissionsDisplayText": "read and write permissions are required.", "providerDisplayName": "Workspace", "scope": "Workspace", "requiredPermissions": { "write": true, "read": true, "delete": true } } ], "customs": [ { "name": "Microsoft Entra", "description": "Permission to create an app registration in Microsoft Entra ID. Typically requires Entra ID Application Developer role or higher." }, { "name": "Microsoft Azure", "description": "Permission to assign Monitoring Metrics Publisher role on data collection rule (DCR). Typically requires Azure RBAC Owner or User Access Administrator role." } ] }, "instructionSteps": [ { "title": "1. Create ARM Resources and Provide the Required Permissions", "description": "This connector enables your Contoso application to push security alerts directly to Microsoft Sentinel via the Azure Monitor Ingestion API.", "instructions": [ { "type": "Markdown", "parameters": { "content": "#### Automated Configuration and Secure Data Ingestion with Entra Application \nClicking on \"Deploy\" will trigger the creation of a Log Analytics table and a Data Collection Rule (DCR). \nIt will then create an Entra application, link the DCR to it, and set the entered secret in the application. This setup enables data to be sent securely to the DCR using an Entra token." } }, { "type": "DeployPushConnectorButton", "parameters": { "label": "Deploy Contoso Push connector resources", "applicationDisplayName": "Contoso Security Alerts Push Connector Application" } } ] }, { "title": "2. Configure Your Contoso Application", "description": "Use the following parameters to configure your Contoso application to push security alerts to the workspace.", "instructions": [ { "type": "CopyableLabel", "parameters": { "label": "Tenant ID (Directory ID)", "fillWith": [ "TenantId" ] } }, { "type": "CopyableLabel", "parameters": { "label": "Entra App Registration Application ID", "fillWith": [ "ApplicationId" ], "placeholder": "Deploy push connector to get the App Registration Application ID" } }, { "type": "CopyableLabel", "parameters": { "label": "Entra App Registration Secret", "fillWith": [ "ApplicationSecret" ], "placeholder": "Deploy push connector to get the App Registration Secret" } }, { "type": "CopyableLabel", "parameters": { "label": "Data Collection Endpoint Uri", "fillWith": [ "DataCollectionEndpoint" ], "placeholder": "Deploy push connector to get the Data Collection Endpoint Uri" } }, { "type": "CopyableLabel", "parameters": { "label": "Data Collection Rule Immutable ID", "fillWith": [ "DataCollectionRuleId" ], "placeholder": "Deploy push connector to get the Data Collection Rule Immutable ID" } }, { "type": "CopyableLabel", "parameters": { "label": "Stream Name", "value": "Custom-ContosoSecurityAlerts" } }, { "type": "Markdown", "parameters": { "content": "#### Configure Contoso Application\nUpdate your Contoso application configuration with the above credentials to enable security alert push to Microsoft Sentinel.\n\nExample configuration:\njson\n{\n \"azure\": {\n \"tenant_id\": \"<Tenant ID>\",\n \"client_id\": \"<Application ID>\",\n \"client_secret\": \"<Application Secret>\",\n \"dce_endpoint\": \"<Data Collection Endpoint Uri>\",\n \"dcr_immutable_id\": \"<Data Collection Rule Immutable ID>\",\n \"stream_name\": \"Custom-ContosoSecurityAlerts\"\n }\n}\n" } } ] } ] } } }Data Connector 構成を作成する
ContosoSecurityAlerts_ccf フォルダーに、コネクタ定義をデプロイされたリソースにリンクする dataConnector.json という名前のファイルを作成します。
{ "name": "ContosoSecurityAlertsPushConnectorPolling", "apiVersion": "2024-09-01", "type": "Microsoft.SecurityInsights/dataConnectors", "kind": "Push", "properties": { "connectorDefinitionName": "ContosoSecurityAlertsPush", "dcrConfig": { "streamName": "Custom-ContosoSecurityAlerts", "dataCollectionEndpoint": "[[parameters('dcrConfig').dataCollectionEndpoint]", "dataCollectionRuleImmutableId": "[[parameters('dcrConfig').dataCollectionRuleImmutableId]" }, "auth": { "type": "Push", "AppId": "[[parameters('auth').appId]", "ServicePrincipalId": "[[parameters('auth').servicePrincipalId]" }, "request": { "RetryCount": 1 }, "response": { "eventsJsonPaths": [ "$" ] } } }ソリューション メタデータ ファイルを作成する
Solution_ContosoSecurityAlerts.json データ フォルダーに、ソリューションの詳細を含む
Solution_ContosoSecurityAlerts.jsonを作成します。{ "Name": "ContosoSecurityAlerts", "Author": "Contoso Corporation - support@contoso.com", "Logo": "<svg width=\"75px\" height=\"75px\" viewBox=\"0 0 75 75\" xmlns=\"http://www.w3.org/2000/svg\"><rect width=\"75\" height=\"75\" fill=\"#FF6B35\"/><text x=\"37. 5\" y=\"45\" font-family=\"Arial\" font-size=\"18\" fill=\"white\" text-anchor=\"middle\" font-weight=\"bold\">CONTOSO</text></svg>", "Description": "The Contoso Security Alerts solution provides real-time security alert ingestion from your Contoso application into Microsoft Sentinel using the Codeless Connector Framework (CCF) Push pattern. Your application pushes alert severity, event types, user information, and network details directly to Azure Monitor for analysis, alerting, and visualization.", "Data Connectors": [ "Data Connectors/ContosoSecurityAlerts_ccf/connectorDefinition.json" ], "BasePath": "C:\\GitHub\\Azure-Sentinel\\Solutions\\ContosoSecurityAlerts", "Version": "1.0.0", "Metadata": "SolutionMetadata.json", "TemplateSpec": true, "Is1PConnector": false }Important
重要なフィールド要件:
-
BasePath: Azure-Sentinel リポジトリへの実際のローカル パスに更新します -
Metadata:SolutionMetadata.jsonを参照する必要があります (手順 6B で作成) -
Version: セマンティック バージョン管理 (例:3.0.0 -
TemplateSpec: コンテンツ ハブ ソリューションでは常にtrue -
Is1Pconnector: パートナー/カスタム コネクタのfalseに設定します
-
ソリューション ルートに SolutionMetadata.json を作成する
ContosoSecurityAlerts フォルダーで、ソリューションのルート ディレクトリ (データ フォルダーと同じレベル) に SolutionMetadata.json を作成します。
{ "publisherId": "contoso", "offerId": "contoso-security-alerts", "firstPublishDate": "2025-01-01", "lastPublishDate": "2025-01-01", "providers": [ "Contoso" ], "categories": { "domains": [ "Security - Threat Protection", "Security - Cloud Security" ] }, "support": { "name": "Contoso Corporation", "tier": "Partner", "link": "https://www.contoso.com/support" } }コンテンツ ハブのパッケージ化には、SolutionMetadata.json ファイルが必要です。
- パッケージ 化ツールでは、ソリューション ルートにこのファイルが必要です
- コンテンツ ハブ配布用の Marketplace メタデータが含まれています
ソリューション ルートに ReleaseNotes.md を作成する
Version 変更日 (DD-MM-YYYY) 変更履歴 3.0.0 DD-MM-YYYY ソリューションの例
検証チェックリスト
次の手順に進む前に、次のことを確認します。
- フォルダー名にスペースがありません (例:
ContosoSecurityAlerts -
NameSolution_ContosoSecurityAlerts.json のフィールドがフォルダー名と正確に一致する -
SolutionMetadata.jsonソリューション ルートに存在する (データ フォルダーに存在しない) -
BasePathは、実際のローカル Azure-Sentinel リポジトリ パスを指します -
Metadataフィールドは "SolutionMetadata.json" を参照しています -
publisherIdとofferIdの両方のファイルが一致している
ソリューション構造を確認する
フォルダー構造が必要なレイアウトとすべてのファイルが一致することを確認します。
Azure-Sentinel/ └── Solutions/ └── ContosoSecurityAlerts/ Folder name (no spaces) ├── Data/ │ └── Solution_ContosoSecurityAlerts.json From Step 7A ├── SolutionMetadata.json From Step 7B (at root) ├── ReleaseNotes.md From Step 7C └── Data Connectors/ └── ContosoSecurityAlerts_ccf/ ├── table.json From Step 3 ├── DCR.json From Step 4 ├── connectorDefinition.json From Step 5 └── dataConnector.json From Step 6ソリューションをパッケージ化する
createSolutionV3.ps1 パッケージ 化ツールを使用して、ARM デプロイ テンプレートを生成します。
# Navigate to the packaging tools directory (from Azure-Sentinel repository root) cd Tools/Create-Azure-Sentinel-Solution/V3 # Run the packaging tool # When prompted for "Enter solution data folder path:", provide: # <REPO_ROOT>Solutions/ContosoSecurityAlerts/Data (Note! This path is absolute) .\createSolutionV3.ps1スクリプトは自動的に次の操作を行います。
- データ/フォルダー構造を検証します
- コネクタアーティファクトを処理する
想定される出力:
パッケージ 化スクリプトは、arm-ttk (Azure Resource Manager Template Toolkit) の検証に失敗したことを示しています。 CCF プッシュ コネクタでは、このエラーが予想され、正常です。
Failed arm-ttk (Test-AzTemplate): Package Failed arm-ttk (Test-AzTemplate) on solutions: Package ************Validating if Package Json files are valid or not*************** File Solutions\ContosoSecurityAlerts\Package\createUiDefinition.json is a valid Json file! File Solutions\ContosoSecurityAlerts\Package\mainTemplate.json is a valid Json file! File Solutions\ContosoSecurityAlerts\Package\testParameters.json is a valid Json file!有効なファイルを確認する 3 つの JSON 検証メッセージが表示された場合、パッケージ化は成功しました。 CCF プッシュ コネクタの
arm-ttkエラーは無視できます。ソリューション パッケージをデプロイする
生成された ARM テンプレート (パッケージ/mainTemplate.json) を Azure サブスクリプションにデプロイします。
- Azure portal で、[カスタム テンプレートのデプロイ] を検索します
- エディターで [独自のテンプレートを作成する] を選択する
- [ ファイルの読み込み ] を選択し、出力フォルダーから
Package/mainTemplate.jsonを選択します - [保存] を選びます。
- デプロイ パラメーターを入力します。
- サブスクリプション: Azure サブスクリプション
- リソース グループ: Sentinel ワークスペースを含むリソース グループ
- 地域: Sentinel ワークスペースと同じリージョン
- ワークスペース: Log Analytics ワークスペース名
- [ 確認と作成] を選択し、[作成] を 選択します。
このデプロイにより、Microsoft Sentinel データ コネクタ ギャラリーでコネクタを使用できるようになります。
詳細な手順については、[クイック スタート: Azure portal を使用した ARM テンプレートの作成とデプロイ](/azure/azure-resource-manager/templates/quickstart-create-templates-use-the-portal) を参照してください。
データ コネクタを有効にする
ソリューション パッケージをデプロイした後、コネクタでリソースをプロビジョニングし、資格情報を生成できるようにします。
- Azure portal で、Microsoft Sentinel ワークスペースに移動します
- 構成>データコネクタにアクセスする
- Contoso セキュリティ アラート (プッシュ) を検索して選択する
- [ コネクタ ページを開く] を選択します
- [Deploy Contoso Security Alerts connector]\(Contoso Security Alerts コネクタのデプロイ\) ボタンを選択します
- デプロイが完了するまで待機します (資格情報を使用してカスタム テーブル、DCR、DCE、Entra アプリケーションを作成します)
- 表示される接続の詳細をコピーします。
- テナント ID
- アプリケーション (クライアント) ID
- クライアント シークレット
- データ収集エンドポイント URI
- データ収集規則の変更できない ID
- ストリーム名:
Custom-ContosoSecurityAlerts
アプリケーションを構成する
手順 10 の資格情報とリソースの詳細を使用して、アプリケーション コードを更新します。 このコードでは、OAuth 2.0 クライアント資格情報フローを使用して Azure Monitor で認証します。
Caution
資格情報を保護する: 資格情報 (テナント ID、アプリケーション ID、クライアント シークレット) をアプリケーション コードに直接ハードコーディングしたり、ソース管理にコミットしたりしないでください。 次のようなセキュリティで保護された資格情報ストレージ ソリューションを使用します。
- 運用アプリケーション用の Azure Key Vault
- 環境変数または構成ファイル (ソース管理から除外)
- マネージド ID (該当する場合)
- 保管中の資格情報を暗号化するシークレット管理ツール
Python アプリケーション コードの例:
次の例では、 <Your-Tenant-ID> などのプレースホルダー値を使用します。 これらの値を、実際の資格情報への安全な参照に置き換えます。
import requests import json from datetime import datetime, timezone # Connection details from Step 11 tenant_id = "<Your-Tenant-ID>" app_id = "<Your-Application-ID>" app_secret = "<Your-Client-Secret>" dce_uri = "<Your-DCE-URI>" dcr_immutable_id = "<Your-DCR-Immutable-ID>" stream_name = "Custom-ContosoSecurityAlerts" **Get OAuth token** token_url = f"https://login.microsoftonline.com/{tenant_id}/oauth2/v2.0/token" token_data = { "client_id": app_id, "scope": "https://monitor.azure.com//.default", "client_secret": app_secret, "grant_type": "client_credentials" } token_response = requests.post(token_url, data=token_data) access_token = token_response.json()["access_token"] # Create event matching your table schema event = [{ "TimeGenerated": datetime.now(timezone.utc).isoformat(), "EventSeverity": "Medium", "EventType": "LoginAlert", "UserName": "alice@contoso.com", "SourceIP": "192.168.1.100", "DeviceId": "device-12345", "AlertMessage": "Multiple failed login attempts detected" }] # Send to Sentinel headers = { "Authorization": f"Bearer {access_token}", "Content-Type": "application/json" } upload_url = f"{dce_uri}/dataCollectionRules/{dcr_immutable_id}/streams/{stream_name}?api-version=2023-01-01" response = requests.post(upload_url, headers=headers, json=event) print(f"Status: {response.status_code}") print("Security alert sent to Sentinel!")データのクエリを実行する
アラートを送信した後、Sentinel でクエリを実行します。 最初のインジェストには 5 ~ 10 分かかります。
// View all recent alerts ContosoSecurityAlerts_CL | where TimeGenerated > ago(1h) | order by TimeGenerated desc // High severity alerts ContosoSecurityAlerts_CL | where EventSeverity == "High" | project TimeGenerated, EventType, UserName, SourceIP, AlertMessage // Alert summary by severity ContosoSecurityAlerts_CL | where TimeGenerated > ago(7d) | summarize Count=count() by EventSeverity
関連するコンテンツ
CCF プッシュ コネクタについて理解したら、次の手順を実行します。
- データ スキーマを設計する - 送信するイベントとそのフィールドを特定します。
- コネクタ成果物の作成 - 4 つの JSON ファイル (テーブル、DCR、コネクタ定義、データ コネクタ) を構築します。
- ソリューション構造を整理 する - 適切な名前付けでデータ コネクタ/データ コネクタ/フォルダーを設定します。
-
ソリューションをパッケージ化 する -
createSolutionV3.ps1を使用してデプロイ テンプレートを生成します。 - デプロイとテスト - Sentinel ワークスペースにデプロイし、データ フローを検証します。
- アプリケーションと統合 する - リアルタイムでイベントを送信するコードを追加します。
- アラートとワークブックを作成する - セキュリティ監視にデータを使用します。
その他のリソース
CCF ドキュメント
- コードレス コネクタ (CCF プル) を作成 する - ポーリング ベースのコネクタ。
- Data Connector Definitions API リファレンス - UI 構成ガイド。
- データ コネクタ接続規則リファレンス - ポーリング コネクタの接続規則。
Azure Monitor とデータ収集
- Azure Monitor ログ インジェスト API - データを送信するためのコア API。
- Azure Monitor のデータ収集規則 - DCR について。
- データ収集規則の構造 - DCR 構造体の詳細。
- Azure Monitor のデータ収集エンドポイント - DCE 構成。
- チュートリアル: ログ インジェスト API を使用して Azure Monitor ログにデータを送信 する - 詳細なチュートリアル。
- カスタム テーブルの作成 - カスタム テーブル作成ガイド。
認証とセキュリティ
- OAuth 2.0 クライアント資格情報フロー - アプリ間認証のしくみ。
- Microsoft ID プラットフォーム アクセス トークン - OAuth トークンについて。
- アプリケーションを Microsoft Entra ID に登録する - Microsoft Entra ID にアプリケーションを登録する方法。
- Azure AD アプリケーション登録のベスト プラクティス - Entra アプリのセキュリティ。
- Azure Resource Manager (ARM) テンプレートを使用して Azure ロールを 割り当てる - テンプレートを使用してロールを割り当てます。
- ARM テンプレートのセキュリティに関する推奨事項 - デプロイ テンプレートのセキュリティ保護。
- Azure Monitor サービスの制限 - レート制限とクォータ。
Microsoft Sentinel
- Microsoft Sentinel ソリューションについて - コネクタをソリューションとしてパッケージ化する。
- データ コネクタの正常性を監視する - 正常性の監視。
- データ コネクタの ARM テンプレート リファレンス - 完全な API リファレンス。
ヘルプを取得する
- 統合を構築するISVパートナー向けのお問い合わせ先は次のとおりです。 azuresentinelpartner@microsoft.com
- 技術的な質問については、"azure-sentinel" というタグで Microsoft Q&A を使用してください。