收集 Microsoft Azure 資源記錄
本文說明如何使用 Microsoft Azure Blob 儲存體 V2 設定 Google Security Operations 資訊提供,藉此收集 Microsoft Azure 資源記錄。
Azure 資源記錄可深入瞭解 Azure 資源中執行的作業。這些記錄會擷取資源作業、狀態和成效指標的詳細資訊。內容會因資源類型而異,包括驗證事件、設定變更、存取嘗試和作業指標等資料。
事前準備
請確認您已完成下列事前準備事項:
- Google SecOps 執行個體
具備下列權限的 Microsoft Azure 入口網站特殊存取權:
- 建立儲存空間帳戶
- 設定 Azure 資源的診斷設定
- 管理存取金鑰
設定 Azure 儲存體帳戶
建立儲存空間帳戶
- 在 Azure 入口網站中,搜尋「儲存體帳戶」。
- 點選「+ 建立」。
請提供下列設定詳細資料:
設定 值 訂閱項目 選取 Azure 訂閱項目 資源群組 選取現有項目或建立新項目 儲存體帳戶名稱 輸入不重複的名稱 (例如 azureresourcelogs)區域 選取區域 (例如 East US)效能 標準 (建議) 備援功能 GRS (異地備援儲存空間) 或 LRS (本機備援儲存空間) 按一下「Review + create」。
查看帳戶總覽,然後按一下「建立」。
等待部署作業完成。
取得儲存空間帳戶憑證
- 前往您剛建立的「儲存空間帳戶」。
- 在左側導覽中,選取「Security + networking」(安全性 + 網路) 下方的「Access keys」(存取金鑰)。
- 按一下「顯示金鑰」。
複製並儲存下列項目,以供日後使用:
- 儲存體帳戶名稱:
azureresourcelogs - 「金鑰 1」或「金鑰 2」:共用存取金鑰 (採用 Base64 編碼的 512 位元隨機字串)
- 儲存體帳戶名稱:
取得 Blob 服務端點
- 在同一個儲存空間帳戶中,選取左側導覽列的「Endpoints」(端點)。
- 複製並儲存 Blob 服務端點網址。
- 範例:
https://azureresourcelogs.blob.core.windows.net/
- 範例:
設定 Azure 資源診斷設定
根據預設,系統不會收集 Azure 資源記錄。您必須為每個 Azure 資源建立診斷設定,才能將記錄檔傳送至儲存體帳戶。
- 在 Azure 入口網站中,前往要監控的 Azure 資源。
- 在左側導覽面板中,選取「監控」下方的「診斷設定」。
- 按一下「+ 新增診斷設定」。
- 請提供下列設定詳細資料:
- 診斷設定名稱:輸入描述性名稱 (例如
export-to-secops)。 - 在「記錄」部分,選取要收集的記錄類別。可用的類別因資源類型而異。常見類別包括:
- 管理 (適用於活動記錄)
- 安全性 (適用於活動記錄)
- AuditEvent (適用於 Key Vault)
- ApplicationGatewayAccessLog (適用於應用程式閘道)
- ApplicationGatewayFirewallLog (適用於應用程式閘道)
- NetworkSecurityGroupEvent (適用於網路安全性群組)
- 在「指標」部分 (選用),選取「AllMetrics」,將平台指標傳送至儲存空間帳戶。
- 在「目的地詳細資料」部分,選取「封存至儲存空間帳戶」核取方塊。
- 訂閱項目:選取包含儲存空間帳戶的訂閱項目。
- 儲存空間帳戶:選取您建立的儲存空間帳戶 (例如
azureresourcelogs)。
- 診斷設定名稱:輸入描述性名稱 (例如
- 按一下 [儲存]。
設定完成後,系統會自動將記錄檔匯出至儲存空間帳戶中的容器。Azure 會使用 insights-logs-<log-category-name> 命名模式建立容器。例如:
- Key Vault 稽核記錄:
insights-logs-auditevent - 應用程式閘道存取記錄:
insights-logs-applicationgatewayaccesslog - 應用程式閘道防火牆記錄:
insights-logs-applicationgatewayfirewalllog 網路安全性群組事件:
insights-logs-networksecuritygroupevent
在 Google SecOps 中設定資訊提供,擷取 Azure 資源記錄
- 依序前往「SIEM 設定」>「動態饋給」。
- 按一下「新增動態消息」。
- 在下一個頁面中,按一下「設定單一動態饋給」。
- 在「動態饋給名稱」欄位中輸入動態饋給名稱 (例如
Azure Resource Logs - Key Vault)。 - 選取「Microsoft Azure Blob Storage V2」做為「來源類型」。
- 選取「Microsoft Azure Resource」(Microsoft Azure 資源) 做為「記錄類型」。
- 點選「下一步」。
指定下列輸入參數的值:
- Azure URI:輸入 Blob 服務端點網址和容器路徑:
https://azureresourcelogs.blob.core.windows.net/insights-logs-auditevent/- 取代下列項目:
azureresourcelogs:您的 Azure 儲存體帳戶名稱。insights-logs-auditevent:儲存記錄的 Blob 容器名稱 (因資源類型和記錄類別而異)。
來源刪除選項:根據偏好設定選取刪除選項:
- 永不:轉移後一律不刪除任何檔案。
- 刪除已轉移的檔案:成功轉移檔案後刪除檔案。
- 刪除已轉移的檔案和空白目錄:成功轉移後刪除檔案和空白目錄。
檔案存在時間上限:包含在過去天數內修改的檔案。預設值為 180 天。
共用金鑰:輸入您在步驟 3 中,從儲存空間帳戶擷取的共用金鑰值 (存取金鑰)。
資產命名空間:資產命名空間。
擷取標籤:要套用至這個動態饋給事件的標籤。
點選「下一步」。
在「Finalize」(完成) 畫面中檢查新的動態饋給設定,然後按一下「Submit」(提交)。
設定 Azure 儲存空間防火牆 (如已啟用)
如果 Azure 儲存體帳戶使用防火牆,您必須新增 Google SecOps IP 範圍。
- 在 Azure 入口網站中,前往您的儲存體帳戶 (例如
azureresourcelogs)。 - 選取「Security + networking」(安全性 + 網路) 下方的「Networking」(網路)。
- 在「防火牆和虛擬網路」下方,選取「從所選虛擬網路和 IP 位址啟用」。
- 在「防火牆」部分的「位址範圍」下方,按一下「+ 新增 IP 範圍」。
以 CIDR 標記法新增每個 Google SecOps IP 範圍。
- 如要取得目前的 IP 範圍,請選擇下列其中一個選項:
- 請參閱 IP 許可清單說明文件
- 使用 Feed Management API 以程式輔助方式擷取這些 ID
- 如要取得目前的 IP 範圍,請選擇下列其中一個選項:
按一下 [儲存]。
UDM 對應表
| 記錄欄位 | UDM 對應 | 邏輯 |
|---|---|---|
| 各種其他欄位*_標籤欄位 | additional.fields | 從各種額外欄位*_label 欄位合併 |
| authenticationMethod | extensions.auth.mechanism | 如果 authenticationMethod 為 Password,請設為 USERNAME_PASSWORD |
| category、event_type | extensions.auth.type | 針對 SQLSecurityAuditEvents 設為 MACHINE;針對特定類別設為 SSO;針對其他類別設為 AUTHTYPE_UNSPECIFIED |
| properties.partialipaddress | intermediary.ip | 如果 properties.partialipaddress 不是空白,則為該屬性的值 |
| properties.event_time、stage_time、risk_time、last_update_time、time | metadata.collected_timestamp | 使用 ISO8601 從 properties.event_time、stage_time、risk_time、last_update_time 或 time 轉換,並採用後備 grok |
| properties.message、properties.activity、properties.log.stage | metadata.description | 如果 properties.message 不為空白,則取自該屬性;否則取自 properties.activity;否則取自 properties.log.stage |
| event_type | metadata.event_type | 如果 event_type 不為空值,則為該值,否則為 GENERIC_EVENT |
| category、record.category | metadata.product_event_type | 直接從類別或 record.category 複製的值 |
| properties.event_id、properties.log.auditID | metadata.product_log_id | 如果 properties.event_id 不為空白,則為該值;否則為 properties.log.auditID |
| properties.log.apiVersion | metadata.product_version | 直接從 properties.log.apiVersion 複製的值 |
| 通訊協定 | network.application_protocol | 直接從通訊協定複製的值 |
| properties.log.verb | network.dhcp.opcode | 直接從 properties.log.verb 複製的值 (大寫) |
| properties.CsMethod、record.properties.CsMethod | network.http.method | 直接從 properties.CsMethod 或 record.properties.CsMethod 複製的值 |
| user_agent | network.http.parsed_user_agent | 從 user_agent 轉換 |
| properties.Referer、uri | network.http.referral_url | 屬性的值。如果不是空白,則為 Referer;否則為 uri |
| properties.ScStatus、record.properties.ScStatus、properties.statusCode、record.properties.statusCode、responseStatus.code | network.http.response_code | 從屬性轉換為整數。ScStatus、record.properties.ScStatus、properties.statusCode、record.properties.statusCode 或 responseStatus.code |
| user_agent | network.http.user_agent | 直接從 user_agent 複製的值 |
| properties.ScBytes、record.properties.ScBytes、properties.responseLength | network.received_bytes | 從屬性轉換為 uinteger。ScBytes、record.properties.ScBytes 或 properties.responseLength |
| properties.CsBytes、record.properties.CsBytes、properties.requestLength | network.sent_bytes | 從 properties.CsBytes、record.properties.CsBytes 或 properties.requestLength 轉換為 uinteger |
| properties.session_id | network.session_id | 直接從 properties.session_id 複製的值 (已轉換為字串) |
| properties.tlsVersion | network.tls.version | 直接從 properties.tlsVersion 複製的值 |
| domain_name_value | principal.administrative_domain | 直接從 domain_name_value 複製的值 |
| properties.clientAppUsed、target_application | principal.application | 如果 properties.clientAppUsed 不為空白,則取自該屬性;否則取自 target_application |
| prop_device_id | principal.asset.asset_id | 設為裝置 ID:如果 prop_device_id 不是空值,則為 prop_device_id |
| 硬體 | principal.asset.hardware | 從硬體合併 |
| properties.host_name、properties.CIp、record.properties.CIp、properties.ComputerName、record.properties.ComputerName、properties.CsHost、record.properties.CsHost、properties.server_instance_name、record.properties.server_instance_name、server_name | principal.asset.hostname | 如果屬性.host_name 不為空白,則取自該屬性;否則取自屬性.CIp (grok IP)、記錄.屬性.CIp (grok IP)、屬性.ComputerName、記錄.屬性.ComputerName、屬性.CsHost、記錄.屬性.CsHost、屬性.server_instance_name、記錄.屬性.server_instance_name 或 server_name |
| src_ip、src_ip1、properties.client_ip、record.properties.clientIpAddress、properties.clientIpAddress、callerIpAddress、properties.ipAddress、ip | principal.asset.ip | src_ip、src_ip1、properties.client_ip (grok IP)、record.properties.clientIpAddress、properties.clientIpAddress (grok IP)、record.properties.clientIpAddress、callerIpAddress (grok IP)、properties.ipAddress 或 ip 的值 |
| properties.host_name、properties.CsHost、record.properties.CsHost | principal.hostname | 如果 properties.host_name 不是空白,則取自該屬性;否則取自 properties.CsHost 或 record.properties.CsHost |
| src_ip、src_ip1、properties.client_ip、record.properties.clientIpAddress、properties.clientIpAddress、callerIpAddress、properties.ipAddress、ip | principal.ip | src_ip、src_ip1、properties.client_ip (grok IP)、record.properties.clientIpAddress、properties.clientIpAddress (grok IP)、record.properties.clientIpAddress、callerIpAddress (grok IP)、properties.ipAddress 或 ip 的值 |
| properties.location.city、provisioning_steps_city | principal.location.city | 如果 properties.location.city 不為空白,則取自該值;否則取自 provisioning_steps_city |
| properties.location.countryOrRegion、provisioning_steps_country、location、Region | principal.location.country_or_region | 如果 properties.location.countryOrRegion 不為空白,則取自該屬性;否則取自 provisioning_steps_country;否則取自 location;否則取自 Region |
| properties.location.geoCoordinates.latitude | principal.location.region_latitude | 直接從 properties.location.geoCoordinates.latitude 複製的值 |
| properties.location.geoCoordinates.longitude | principal.location.region_longitude | 直接從 properties.location.geoCoordinates.longitude 複製的值 |
| properties.location.state | principal.location.state | 直接從 properties.location.state 複製的值 |
| prop_os | principal.platform | 如果 prop_os 符合 (?i)Win,請設為 WINDOWS;如果符合 (?i)Lin,請設為 LINUX;如果符合 (?i)Mac,請設為 MAC |
| properties.deviceDetail.operatingSystem | principal.platform_version | 直接從 properties.deviceDetail.operatingSystem 複製的值 |
| src_port | principal.port | 從 src_port 轉換為整數 |
| is_compliant_label、is_managed_label、serice_type_label、serice_credential_label | principal.resource.attribute.labels | 已從 is_compliant_label、is_managed_label、serice_type_label、serice_credential_label 合併 |
| properties.sourceSystem.Name | principal.resource.name | 直接從 properties.sourceSystem.Name 複製的值 |
| properties.sourceSystem.Id | principal.resource.product_object_id | 直接從 properties.sourceSystem.Id 複製的值 |
| properties.server_principal_name、source_user_principal_name、user_principal_name、local_account_username_value | principal.user.email_addresses | 從 properties.server_principal_name (如果與電子郵件相符)、source_user_principal_name (如果與電子郵件相符)、user_principal_name (如果與電子郵件相符) 或 local_account_username_value (如果與電子郵件相符) 合併 |
| properties.sequence_group_id、grpname、properties.log.user.groups | principal.user.group_identifiers | 從 properties.sequence_group_id、grpname 或 properties.log.user.groups 合併 |
| properties.sourceIdentity.details.id、properties.userId、details_id_not_present | principal.user.product_object_id | 如果 properties.sourceIdentity.details.id 不為空,則為該值;否則為 properties.userId;否則為 details_id_not_present |
| properties.ServicePrincipalDisplayName、properties.servicePrincipalName、properties.sourceIdentity.details.DisplayName、properties.userDisplayName、record.properties.log.user.username | principal.user.user_display_name | 如果屬性.ServicePrincipalDisplayName 不為空,則取自該屬性;否則取自屬性.servicePrincipalName;否則取自屬性.sourceIdentity.details.DisplayName;否則取自屬性.userDisplayName;否則取自記錄.屬性.log.user.username |
| properties.servicePrincipalId、user_userPrincipalName、source_user_principal_name、details_user_principal_name、user_principal_name、properties.accountName、record.properties.log.user.uid | principal.user.userid | 如果屬性.servicePrincipalId 的值不為空,則使用該值;否則使用 user_userPrincipalName 的值;否則使用 source_user_principal_name 的值;否則使用 details_user_principal_name 的值;否則使用 user_principal_name 的值;否則使用屬性.accountName 的值;否則使用 record.properties.log.user.uid 的值 |
| security_action、succeeded、statusText、resultType | security_result.action | 如果 security_action 為 allow,則設為 ALLOW;如果 succeeded 為 true、statusText 為 Success 或 resultType 為 success,則設為 ALLOW;如果 succeeded 為 false、statusText 為 failed 或 resultType 為 failed,則設為 BLOCK |
| properties.action_name | security_result.action_details | 直接從 properties.action_name 複製的值 |
| status_label | security_result.about.resource.attribute.labels | 已從 status_label 合併 |
| properties_log_label、corr_key_label、resultType_label、resultSignature_label、networkName_label、networkType_label、method_label、authentication_step_requirement_label、authentication_step_result_detail_label、stepdate_label、initiatedby_name_label、initiatedby_id_label、initiatedby_type_label、targetSystem_id_label、targetSystem_name_label、containerID_label、pod_label、authentication_label、api_name_label、scale_unit_label、namespace_name_label、subscription_id_label、activity_id_label_1、task_name_label、environment_label、cookie、additional_field_event_ip、additional_field_event_primary_stamp、additional_field_event_stamp_type、source、correlationId_field、activityDateTime_field、detectedDateTime_field、lastUpdatedDateTime_field、count_label、total_label、minimum_label、maximum_label、average_label、metricName_label、timeGrain_label、ApiName_label、Authentication_label、GeoType_label、old_label、new_label、add_label、keyId_label、sr_result.rule_name、sr_result.rule_id、resultField、sr_result.detection_fields | security_result.detection_fields | 從 properties_log_label、corr_key_label、resultType_label、resultSignature_label、networkName_label、networkType_label、method_label、authentication_step_requirement_label、authentication_step_result_detail_label、stepdate_label、initiatedby_name_label、initiatedby_id_label、initiatedby_type_label、targetSystem_id_label、targetSystem_name_label、containerID_label、pod_label、authentication_label、api_name_label、scale_unit_label、namespace_name_label、subscription_id_label、activity_id_label_1、task_name_label、environment_label、cookie、additional_field_event_ip、additional_field_event_primary_stamp、additional_field_event_stamp_type、source、correlationId_field、activityDateTime_field、detectedDateTime_field、lastUpdatedDateTime_field、count_label、total_label、minimum_label、maximum_label、average_label、metricName_label、timeGrain_label、ApiName_label、Authentication_label、GeoType_label、old_label、new_label、add_label、keyId_label、sr_result.rule_name、sr_result.rule_id、resultField、sr_result.detection_fields 合併 |
| resultDescription、sec_result.description、properties.queryexecutionstatus | security_result.description | resultDescription 中的值 (gsub newlines);否則為 sec_result.description 中的值;否則為 properties.queryexecutionstatus 中的值 |
| policy_id_value | security_result.rule_id | 直接從 policy_id_value 複製的值 |
| properties.Result、statusText、properties.queryexecutionstatus | security_result.summary | 屬性的值。如果不是空白,則為結果;否則為 statusText;否則為屬性的 queryexecutionstatus |
| target_application | target.application | 來自 target_application 的值 |
| properties.ComputerName、record.properties.ComputerName、properties.server_instance_name、record.properties.server_instance_name | target.asset.hostname | 來自 properties.ComputerName、record.properties.ComputerName、properties.server_instance_name 或 record.properties.server_instance_name 的值 |
| (硬式編碼) | target.cloud.environment | 設為「MICROSOFT_AZURE」 |
| properties.SPort、record.properties.SPort | target.port | 從屬性轉換為整數。SPort 或 record.properties.SPort |
| properties.querytext.query | target.process.command_line | 直接從 properties.querytext.query 複製的值 |
| properties.processId | target.process.pid | 從 properties.processId 轉換為字串 |
| subscription_id_label、resource_group_label、request_resource_type_label、request_resource_id_label、additional_objectKey、additional_clientRequestId、additional_RiskEventType、additional_tokenIssuerType、keyId_label、appid_label | target.resource.attribute.labels | 從 subscription_id_label、resource_group_label、request_resource_type_label、request_resource_id_label、additional_objectKey、additional_clientRequestId、additional_RiskEventType、additional_tokenIssuerType、keyId_label、appid_label 合併 |
| properties_databasename、properties.resourceDisplayName、record.properties.databasename、record.properties.databaseName | target.resource.name | 如果 properties_databasename 不是空白,則取自該屬性;否則取自 properties.resourceDisplayName;否則取自 record.properties.databasename;否則取自 record.properties.databaseName |
| resourceId、properties.resourceId | target.resource.product_object_id | 如果 resourceId 不為空白,則為該值;否則為 properties.resourceId |
| properties_collectionname、properties.resourceDisplayName、record.properties.collectionname、record.properties.collectionName、properties.log.objectRef.resource | target.resource.resource_subtype | 如果 properties_collectionname 不是空白,則取自該屬性;否則取自 properties.resourceDisplayName;否則取自 record.properties.collectionname;否則取自 record.properties.collectionName;否則取自 properties.log.objectRef.resource |
| resourceId、message | target.resource.resource_type | 如果 resourceId 符合模式,則設為 DATABASE;如果訊息符合 MANAGEDCLUSTERS,則設為 CLUSTER;如果符合 MANAGEDINSTANCES,則設為 VIRTUAL_MACHINE;如果符合 DATABASEACCOUNTS,則設為 DATABASE |
| resourceType | target.resource.type | 直接從 resourceType 複製的值 |
| properties.CsUriStem、properties.log.requestURI、value (來自 additionalInfo) | target.url | 如果 properties.CsUriStem 不是空白,則取自該值;否則取自 properties.log.requestURI;否則取自值 (來自 additionalInfo) |
| user_principal_name | target.user.email_addresses | 從 user_principal_name 合併 (如果與電子郵件相符) |
| properties.userId | target.user.product_object_id | 直接從 properties.userId 複製的值 |
| properties.userDisplayName | target.user.user_display_name | 直接從 properties.userDisplayName 複製的值 |
| user_principal_name、properties.userPrincipalName | target.user.userid | 如果 user_principal_name 不為空白,則取自該屬性;否則取自 properties.userPrincipalName |
| (硬式編碼) | metadata.product_name | 設為「Azure 資源記錄」 |
| (硬式編碼) | metadata.vendor_name | 設為「Microsoft」 |
還有其他問題嗎?向社群成員和 Google SecOps 專業人員尋求答案。