Membuat konektor tanpa kode untuk Microsoft Sentinel
Codeless Connector Platform (CCP) menyediakan kemampuan mitra, pengguna tingkat lanjut, dan pengembang untuk membuat konektor kustom untuk menyerap data ke Microsoft Azure Sentinel.
Konektor yang dibuat menggunakan CCP sepenuhnya SaaS, tanpa persyaratan untuk penginstalan layanan. Mereka juga mencakup pemantauan kesehatan dan dukungan penuh dari Microsoft Azure Sentinel.
Gunakan langkah-langkah berikut untuk membuat konektor CCP Anda dan menyambungkan sumber data Anda ke Microsoft Azure Sentinel
- Membangun konektor data
- Buat templat ARM
- Menyebarkan konektor
- Menyambungkan Microsoft Sentinel ke sumber data Anda dan memulai penyerapan data
Artikel ini akan menunjukkan kepada Anda cara menyelesaikan setiap langkah dan menyediakan contoh konektor tanpa kode untuk dibangun di sepanjang jalan.
Bagaimana CCP ini berbeda dari versi sebelumnya?
Versi awal PKT diumumkan pada Januari 2022. Sejak itu, kami telah meningkatkan platform dan rilis warisan tidak lagi direkomendasikan. Versi baru CCP ini memiliki peningkatan kunci berikut:
Dukungan yang lebih baik untuk berbagai jenis autentikasi dan penomoran halaman.
Mendukung aturan pengumpulan data standar (DCR).
Antarmuka pengguna dan bagian konfigurasi koneksi dari konektor tanpa kode sekarang terpisah. Ini memungkinkan pembuatan konektor dengan beberapa koneksi yang sebelumnya tidak dimungkinkan.
Prasyarat
Sebelum membangun konektor, pahami sumber data Anda dan bagaimana Microsoft Azure Sentinel perlu terhubung.
Titik Akhir Pengumpulan Data (DCE)
DCE adalah persyaratan untuk DCR. Hanya satu DCE yang dibuat per penyebaran DCR ruang kerja analitik log. Setiap DCR yang disebarkan untuk ruang kerja Microsoft Azure Sentinel menggunakan DCE yang sama. Untuk informasi selengkapnya tentang cara membuat atau apakah Anda memerlukan yang baru, lihat Titik akhir pengumpulan data di Azure Monitor.
Skema tabel output.
Penting untuk memahami bentuk aliran data Anda dan bidang yang ingin Anda sertakan dalam tabel output. Referensikan dokumentasi sumber data Anda atau analisis contoh output yang memadai.
Teliti komponen berikut dan verifikasi dukungan untuk komponen tersebut dalam referensi API Konektor Data:
Permintaan HTTP dan struktur respons ke sumber data
Autentikasi yang diperlukan oleh sumber data.
Misalnya, jika sumber data Anda memerlukan token yang ditandatangani dengan sertifikat, referensi API konektor data menentukan autentikasi sertifikasi tidak didukung.Opsi penomoran halaman ke sumber data
API Pengujian
Sebaiknya uji komponen Anda dengan alat pengujian API seperti salah satu hal berikut:
- Visual Studio Code dengan ekstensi dari Visual Studio Marketplace
- PowerShell Invoke-RestMethod
- Microsoft Edge - Alat Konsol Jaringan
- Bruno
- curl
Perhatian
Untuk skenario di mana Anda memiliki data sensitif, seperti kredensial, rahasia, token akses, kunci API, dan informasi serupa lainnya, pastikan untuk menggunakan alat yang melindungi data Anda dengan fitur keamanan yang diperlukan, berfungsi offline atau lokal, tidak menyinkronkan data Anda ke cloud, dan tidak mengharuskan Anda masuk ke akun online. Dengan cara ini, Anda mengurangi risiko sekeliling mengekspos data sensitif ke publik.
Membangun konektor data
Ada empat komponen yang diperlukan untuk membangun konektor data CCP.
- Definisi tabel output
- Aturan Pengumpulan Data (DCR)
- Antarmuka pengguna konektor data
- Aturan koneksi konektor data
Setiap komponen memiliki bagian yang merinci proses untuk membuat dan memvalidasi. Ambil JSON dari setiap komponen untuk kemasan akhir templat ARM.
Definisi tabel output
Tip
Lewati langkah ini jika data Anda hanya diserap ke tabel Analitik Log standar. Contoh tabel standar termasuk CommonSecurityLog dan ASimDnsActivityLogs. Untuk informasi selengkapnya tentang daftar lengkap jenis data standar yang didukung, lihat Dukungan transformasi data untuk konektor data kustom.
Jika sumber data Anda tidak sesuai dengan skema tabel standar, Anda memiliki dua opsi:
- Membuat tabel kustom untuk semua data
- Membuat tabel kustom untuk beberapa data dan memisahkan data sesuai dengan tabel standar
Gunakan UI Log Analytics untuk metode penerusan lurus untuk membuat tabel kustom bersama dengan DCR. Jika Anda membuat tabel kustom menggunakan Tables API atau metode terprogram lainnya, tambahkan _CL
akhiran secara manual ke nama tabel. Untuk informasi selengkapnya, lihat Membuat tabel kustom.
Untuk informasi selengkapnya tentang memisahkan data Anda ke lebih dari satu tabel, lihat contoh data dan contoh tabel kustom yang dibuat untuk data tersebut.
Aturan pengumpulan data
Aturan pengumpulan data (DCR) menentukan proses pengumpulan data di Azure Monitor. DCR menentukan data apa yang harus dikumpulkan, cara mengubah data tersebut, dan tujuan pengiriman data tersebut.
- Hanya ada satu DCR yang disebarkan per konektor data.
- DCR harus memiliki DCE yang sesuai di wilayah yang sama.
- Ketika konektor data CCP disebarkan, DCR dibuat jika belum ada.
Referensikan informasi terbaru tentang DCR dalam artikel ini:
Untuk tutorial yang menunjukkan pembuatan DCE, termasuk menggunakan data sampel untuk membuat tabel kustom dan DCR, lihat Tutorial: Mengirim data ke Log Azure Monitor dengan API penyerapan Log (portal Azure). Gunakan proses dalam tutorial ini untuk memverifikasi data diserap dengan benar ke tabel Anda dengan DCR Anda.
Untuk memahami cara membuat DCR kompleks dengan beberapa aliran data, lihat bagian contoh DCR.
Antarmuka pengguna konektor data
Komponen ini merender UI untuk konektor data di galeri konektor data Microsoft Azure Sentinel. Setiap konektor data mungkin hanya memiliki satu definisi UI.
Bangun antarmuka pengguna konektor data dengan API Definisi Konektor Data. Gunakan referensi Definisi konektor data sebagai suplemen untuk menjelaskan elemen API secara lebih rinci.
Catatan:
- Properti
kind
untuk konektor polling API harusCustomizable
selalu . - Karena ini adalah jenis konektor polling API, atur jenis ke
connectivityCriteria
hasDataConnectors
- Contohnya
instructionSteps
termasuk tombol jenisConnectionToggleButton
. Tombol ini membantu memicu penyebaran aturan konektor data berdasarkan parameter koneksi yang ditentukan.
Gunakan alat pengujian API untuk memanggil API definisi konektor data untuk membuat UI konektor data untuk memvalidasinya di galeri konektor data.
Untuk mempelajari dari contoh, lihat bagian Contoh referensi definisi konektor data.
Aturan koneksi data
Saat ini ada dua jenis aturan koneksi data yang mungkin untuk menentukan konektor data CCP Anda.
RestApiPoller
jenis memungkinkan Anda menyesuaikan halaman, otorisasi, dan payload permintaan/respons yang diharapkan untuk sumber data Anda. Untuk informasi selengkapnya, lihat Referensi aturan koneksi konektor data RestApiPoller.GCP
kind memungkinkan Anda mengurangi waktu pengembangan dengan mengonfigurasi halaman dan payload respons yang diharapkan secara otomatis untuk sumber data Google Cloud Platform (GCP). Untuk informasi selengkapnya, lihat Referensi aturan koneksi konektor data GCP
Gunakan alat pengujian API untuk memanggil API konektor data untuk membuat konektor data yang menggabungkan aturan koneksi dan komponen sebelumnya. Verifikasi bahwa konektor sekarang tersambung di UI.
Input rahasia yang aman
Apa pun autentikasi yang digunakan oleh konektor data CCP Anda, lakukan langkah-langkah ini untuk memastikan informasi rahasia tetap aman. Tujuannya adalah untuk meneruskan kredensial dari templat ARM ke PKT tanpa meninggalkan objek rahasia yang dapat dibaca dalam riwayat penyebaran Anda.
Buat label
Definisi konektor data membuat elemen UI untuk meminta kredensial keamanan. Misalnya, jika konektor data Anda mengautentikasi ke sumber log dengan OAuth, bagian definisi konektor data Anda menyertakan OAuthForm
jenis dalam instruksi. Ini menyiapkan templat ARM untuk meminta kredensial.
"instructions": [
{
"type": "OAuthForm",
"parameters": {
"UsernameLabel": "Username",
"PasswordLabel": "Password",
"connectButtonLabel": "Connect",
"disconnectButtonLabel": "Disconnect"
}
}
],
Simpan input rahasia
Bagian templat penyebaran ARM menyediakan tempat bagi administrator yang menyebarkan konektor data untuk memasukkan kata sandi. Gunakan securestring
untuk menjaga informasi rahasia tetap aman dalam objek yang tidak dapat dibaca setelah penyebaran. Untuk informasi selengkapnya, lihat Rekomendasi keamanan untuk parameter.
"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
}
}
Menggunakan objek securestring
Terakhir, PKT menggunakan objek kredensial di bagian konektor data.
"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"
}
},
Catatan
Sintaksis aneh untuk objek kredensial, "ClientSecret": "[[parameters('Password')]",
bukan salah ketik!
Untuk membuat templat penyebaran yang juga menggunakan parameter, Anda perlu menghindari parameter di bagian tersebut dengan awal[
ekstra. Ini memungkinkan parameter untuk menetapkan nilai berdasarkan interaksi pengguna dengan konektor.
Untuk informasi selengkapnya, lihat Ekspresi templat karakter escape.
Membuat templat penyebaran
Mengemas templat Azure Resource Management (ARM) secara manual menggunakan contoh sampel kode templat sebagai panduan Anda. Sampel kode ini dibagi dengan bagian templat ARM yang harus Anda pisahkan bersama-sama.
Jika Anda membuat konektor data CCP Google Cloud Platform (GCP), kemas templat penyebaran menggunakan contoh templat GCP CCP. Untuk informasi tentang cara mengisi templat GCP CCP, lihat Referensi aturan koneksi konektor data GCP.
Selain contoh templat, solusi yang diterbitkan yang tersedia di hub konten Microsoft Sentinel menggunakan CCP untuk konektor data mereka. Tinjau solusi berikut sebagai contoh lebih lanjut tentang cara menjahit komponen bersama-sama ke dalam templat ARM.
RestApiPoller
Contoh konektor data CCP
- Keamanan Browser Ermes
- Palo Alto Prisma Cloud CWPP
- Perlindungan Titik Akhir Sophos
- Workday
- Atlassian Jira
- Akses Menyeluruh Okta
GCP
Contoh konektor data CCP
Menyebarkan konektor
Sebarkan konektor tanpa kode Anda sebagai templat kustom.
Tip
Hapus sumber daya yang Anda buat di langkah-langkah sebelumnya. DCR dan tabel kustom dibuat dengan penyebaran. Jika Anda tidak menghapus sumber daya tersebut sebelum menyebarkan, lebih sulit untuk memverifikasi templat Anda.
- Salin konten templat penyebaran ARM.
- Ikuti instruksi Edit dan sebarkan templat dari artikel, Mulai Cepat: Membuat dan menyebarkan templat ARM dengan menggunakan portal Azure.
Mempertahankan isolasi jaringan untuk sumber pengelogan
Jika sumber pengelogan Anda memerlukan isolasi jaringan, konfigurasikan daftar izin alamat IP publik yang digunakan oleh CCP.
Jaringan virtual Azure menggunakan tag layanan untuk menentukan kontrol akses jaringan. Untuk CCP, tag layanan tersebut adalah Scuba.
Untuk menemukan rentang IP saat ini yang terkait dengan tag layanan Scuba , lihat Menggunakan API Penemuan Tag Layanan.
Memverifikasi konektor tanpa kode
Lihat konektor tanpa kode Anda di galeri konektor data. Buka konektor data dan selesaikan parameter autentikasi apa pun yang diperlukan untuk menyambungkan. Setelah berhasil tersambung, DCR dan tabel kustom dibuat. Lihat sumber daya DCR di grup sumber daya Anda dan tabel kustom apa pun dari ruang kerja analitik log.
Catatan
Mungkin perlu waktu hingga 30 menit untuk melihat data mulai diserap.
Contoh
Setiap langkah dalam membangun konektor tanpa kode diwakili di bagian contoh berikut.
- Contoh data
- Contoh tabel kustom
- Contoh aturan pengumpulan data
- Contoh definisi antarmuka pengguna konektor data
- Contoh aturan koneksi data
- Gunakan contoh data dengan contoh templat
Untuk menunjukkan sumber data kompleks dengan penyerapan ke lebih dari satu tabel, contoh ini menampilkan skema tabel output dan DCR dengan beberapa aliran output. Contoh DCR menyatukan ini bersama dengan transformasi KQL-nya. Definisi antarmuka pengguna konektor data dan contoh aturan koneksi berlanjut dari contoh sumber data yang sama ini. Terakhir, templat solusi menggunakan semua komponen contoh ini untuk menunjukkan cara membuat contoh konektor data CCP secara menyeluruh.
Contoh data
Sumber data mengembalikan JSON berikut saat menyambungkan ke titik akhirnya.
[
{
"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"
}
]
Respons ini berisi eventType
Pemberitahuan dan File. Peristiwa file akan diserap ke dalam tabel standar yang dinormalisasi, AsimFileEventLogs, sementara peristiwa pemberitahuan akan diserap ke dalam tabel kustom.
Contoh tabel kustom
Untuk informasi selengkapnya tentang struktur tabel ini, lihat Tables API. Nama tabel log kustom harus memiliki _CL
akhiran.
{
"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"
}
]
}
}
}
Contoh aturan pengumpulan data
DCR berikut mendefinisikan satu aliran Custom-ExampleConnectorInput
menggunakan contoh sumber data dan mengubah output menjadi dua tabel.
- Aliran data pertama mengarahkan
eventType
= Pemberitahuan ke tabel kustom.ExampleConnectorAlerts_CL
- aliran data kedua mengarahkan
eventType
= File ke tabel standar yang dinormalisasi, .ASimFileEventLogs
Untuk informasi selengkapnya tentang struktur contoh ini, lihat Struktur aturan pengumpulan data.
Untuk membuat DCR ini di lingkungan pengujian, ikuti API Aturan Pengumpulan Data. Elemen contoh dalam {{double curly braces}}
menunjukkan variabel yang memerlukan nilai untuk kemudahan penggunaan dengan alat pengujian API. Saat Anda membuat sumber daya ini di templat ARM, variabel yang dinyatakan di sini ditukar dengan parameter.
{
"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"
}
]
}
}
Contoh definisi antarmuka pengguna konektor data
Contoh ini terletak di referensi Definisi konektor data.
Contoh aturan koneksi konektor data
Contoh ini terletak di referensi Konektor data.
Contoh templat ARM
Bangun templat penyebaran ARM dengan struktur berikut, yang mencakup 4 bagian komponen JSON yang diperlukan untuk membangun konektor data CCP:
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {},
"variables": {},
"resources": [],
}
Jahit bagian bersama dengan editor sadar JSON seperti Visual Code untuk meminimalkan kesalahan sintaks seperti koma dan kurung siku penutup dan tanda kurung.
Untuk memandu proses pembuatan templat, komentar muncul di metadata description
atau sebaris dengan //
notasi komentar. Untuk informasi selengkapnya, lihat Praktik terbaik templat ARM - komentar.
Pertimbangkan untuk menggunakan toolkit pengujian templat ARM (arm-ttk) untuk memvalidasi templat yang Anda buat. Untuk informasi selengkapnya, lihat arm-ttk.
Contoh templat ARM - parameter
Untuk informasi selengkapnya, lihat Parameter dalam templat ARM.
Peringatan
Gunakan securestring
untuk semua kata sandi dan rahasia dalam objek yang dapat dibaca setelah penyebaran sumber daya.
Untuk informasi selengkapnya, lihat Mengamankan input rahasia dan Rekomendasi keamanan untuk parameter.
{
"$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
}
Contoh templat ARM - variabel
Variabel yang direkomendasikan ini membantu menyederhanakan templat. Gunakan kurang lebih sesuai kebutuhan. Untuk informasi selengkapnya, lihat Variabel dalam templat 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
Contoh templat ARM - sumber daya
Ada 5 sumber daya penyebaran ARM dalam panduan templat ini yang menampung komponen bangunan konektor data 4 CCP.
- contentTemplates (sumber daya induk)
- metadata
- dataCollectionRules - Untuk informasi selengkapnya, lihat Aturan pengumpulan data.
- tabel - Untuk informasi selengkapnya, lihat Definisi tabel output.
- dataConnectorDefinitions - Untuk informasi selengkapnya, lihat Antarmuka pengguna konektor data.
- metadata
- contentTemplates
- metadata
- RestApiPoller - Untuk informasi selengkapnya, lihat Aturan koneksi data.
- 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!
]
}
Konten terkait
Untuk informasi selengkapnya, lihat
- Tentang solusi Microsoft Azure Sentinel.
- Referensi templat ARM konektor data