你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

为Microsoft Sentinel创建无代码连接器

无代码连接器框架 (CCF) 使合作伙伴、高级用户和开发人员能够创建自定义连接器,以便将数据引入Microsoft Sentinel。

使用 CCF 创建的连接器完全是 SaaS,无需安装服务。 它们还包括运行状况监视和来自 Microsoft Sentinel 的完全支持。

使用以下步骤创建 CCF 连接器并将数据源连接到Microsoft Sentinel

  • 生成数据连接器
  • 创建 ARM 模板
  • 部署连接器
  • 将Microsoft Sentinel连接到数据源并开始引入数据

本文将介绍如何完成每个步骤,并提供一个 示例无代码连接器 ,以便在此过程中进行生成。

如果你是软件开发合作伙伴,并且需要支持来构建 CCF 数据连接器,请联系 Microsoft Sentinel 合作伙伴获取AzureSentinelPartner@microsoft.com帮助。

此 CCF 与以前的版本有何不同?

CCF 的初始版本于 2022 年 1 月 公布 。 此后,我们对平台进行了改进,不再建议 使用旧版本 。 此新版本的 CCF 具有以下关键改进:

  1. 更好地支持各种身份验证和分页类型。

  2. 支持 (DCR) 的标准数据收集规则。

  3. 现在,无代码连接器的用户界面和连接配置部分是独立的。 这允许创建具有以前无法实现的多个连接的连接器。

先决条件

在生成连接器之前,请先了解数据源以及Microsoft Sentinel需要如何连接。

  1. 数据收集终结点 (DCE)

    DCE 是 DCR 的要求。 每个 Log Analytics 工作区 DCR 部署仅创建一个 DCE。 为Microsoft Sentinel工作区部署的每个 DCR 都使用相同的 DCE。 有关如何创建一个或是否需要新终结点的详细信息,请参阅 Azure Monitor 中的数据收集终结点

  2. 输出表的架构 () 。

    请务必了解数据流的形状以及要包含在输出表中的字段。 参考数据源文档或分析足够的输出示例。

数据连接器 API 参考中研究以下组件并验证它们的支持:

  1. 数据源的 HTTP 请求和响应结构

  2. 数据源所需的身份验证。
    例如,如果数据源需要使用证书签名的令牌,则数据连接器 API 参考指定不支持证书身份验证。

  3. 数据源的分页选项

测试 API

建议使用 API 测试工具测试组件,如下所示:

警告

对于具有敏感数据(如凭据、机密、访问令牌、API 密钥和其他类似信息)的情况,请确保使用一种工具,该工具通过必要的安全功能保护数据、脱机工作或在本地工作、不会将数据同步到云,也不需要登录到联机帐户。 这样,就可以降低向公众公开敏感数据的风险。

生成数据连接器

提示

如果你是独立软件供应商 (ISV) ,在使用Microsoft Sentinel无代码连接器框架构建Microsoft Sentinel集成时需要支持,Microsoft应用保证团队可能会提供帮助。 若要与应用保证团队联系,请向 azuresentinelpartner@microsoft.com发送电子邮件。

生成 CCF 数据连接器需要四个组件。

  1. 输出表定义
  2. 数据收集规则 (DCR)
  3. 数据连接器用户界面
  4. 数据连接器连接规则

每个组件都有一个部分,详细说明创建和验证过程。 从每个组件获取 JSON,以便对 ARM 模板进行最终打包。

输出表定义

提示

如果数据仅引入到标准 Log Analytics 表,请跳过此步骤。 标准表的示例包括 CommonSecurityLogASimDnsActivityLogs。 有关受支持的标准数据类型的完整列表的详细信息,请参阅 自定义数据连接器的数据转换支持

如果数据源不符合标准表的架构,则有两个选项:

  • 为所有数据创建自定义表
  • 为某些数据创建自定义表,并将符合的数据拆分为标准表

使用 Log Analytics UI 直接方法创建自定义表和 DCR。 如果使用 表 API 或其他编程方法创建自定义表,请手动将 _CL 后缀添加到表名称。 有关详细信息,请参阅 创建自定义表

有关将数据拆分为多个表的详细信息,请参阅 示例数据和 为该数据创建 的示例自定义表

数据收集规则

数据收集规则 (DCR) Azure Monitor 中定义数据收集过程。 DCR 指定应收集哪些数据、如何转换数据以及将数据发送到何处。

  • 每个数据连接器仅部署一个 DCR。
  • DCR 必须在同一区域中具有相应的 DCE。
  • 部署 CCF 数据连接器时,如果 DCR 尚不存在,则会创建该连接器。

在以下文章中参考有关 DCR 的最新信息:

有关演示如何创建 DCE(包括使用示例数据创建自定义表和 DCR)的教程,请参阅教程:将数据发送到Azure使用日志引入 API (Azure 门户) 监视日志。 使用本教程中的过程验证是否已使用 DCR 将数据正确引入表。

若要了解如何创建具有多个数据流的复杂 DCR,请参阅 DCR 示例部分

数据连接器用户界面

此组件在Microsoft Sentinel数据连接器库中呈现数据连接器的 UI。 每个数据连接器只能有一个 UI 定义。

使用数据连接器定义 API 生成数据连接器用户界面。 使用 数据连接器定义参考 作为补充来更详细地解释 API 元素。

注意:

  1. kind API 轮询连接器的 属性应始终为 Customizable
  2. 由于这是一种 API 轮询连接器,因此请将类型 connectivityCriteria 设置为 hasDataConnectors
  3. 该示例 instructionSteps 包括 类型 ConnectionToggleButton为 的按钮。 此按钮有助于根据指定的连接参数触发数据连接器规则的部署。

使用 API 测试工具 调用数据连接器定义 API 来创建数据连接器 UI,以便在数据连接器库中对其进行验证。

若要从示例中学习,请参阅 数据连接器定义参考示例部分

数据连接规则

目前有三种类型的数据连接规则可用于定义 CCF 数据连接器。

使用 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资源管理 (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 门户创建和部署 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"
        }
]

此响应包含 eventTypeAlertFile。 文件事件将引入规范化标准表 AsimFileEventLogs,而警报事件将引入自定义表。

自定义表示例

有关此表的结构的详细信息,请参阅 表 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 ,并将输出转换为两个表。

  1. 第一个数据流将 eventType = 警报 定向到自定义 ExampleConnectorAlerts_CL 表。
  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 数据连接器所需的 4 个 JSON 组件部分:

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

将各个部分与 JSON 感知编辑器(如 Visual Code)拼凑在一起,以最大程度地减少语法错误(如逗号、右括号和括号)。

为了指导模板生成过程,注释会显示在 元数据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 模板 - 资源

此模板指南中有 5 个 ARM 部署资源,其中包含 4 个 CCF 数据连接器构建组件。

  1. contentTemplates (父资源)
  2. dataConnectorDefinitions - 有关详细信息,请参阅 数据连接器用户界面
  3. metadata
  4. contentTemplates
  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!
    ]
}

有关详细信息,请参阅