收集 Azure 應用程式閘道記錄
支援的國家/地區:
Google SecOps
SIEM
本文說明如何設定 Google Security Operations 資訊提供,以收集 Azure 應用程式閘道記錄。這個剖析器會處理單一和多筆記錄的 JSON 結構、從「記錄」陣列中擷取欄位、執行資料類型轉換、將欄位對應至 UDM,並使用中繼資料和衍生欄位 (例如網路連線類型) 擴充資料。此外,這個函式也會處理不同 operationName
值的特定邏輯,並擷取相關 IP 位址、子網路和其他設定詳細資料。
事前準備
請確認您已完成下列事前準備事項:
- Google SecOps 執行個體
- Azure 訂用帳戶的特殊存取權
- Azure 中的 Azure 應用程式閘道環境 (租戶)
設定 Azure 儲存體帳戶
- 在 Azure 控制台中,搜尋「Storage accounts」(儲存體帳戶)。
- 點選「建立」。
- 指定下列輸入參數的值:
- 訂閱:選取訂閱方案。
- 資源群組:選取資源群組。
- 區域:選取區域。
- 成效:選取成效 (建議使用「標準」)。
- 備援:選取備援 (建議使用 GRS 或 LRS)。
- 「儲存體帳戶名稱」:輸入新儲存體帳戶的名稱。
- 按一下「Review + create」。
- 查看帳戶總覽,然後按一下「建立」。
- 在「儲存空間帳戶總覽」頁面中,選取「安全性 + 網路」中的「存取金鑰」子選單。
- 按一下「key1」或「key2」旁邊的「顯示」
- 按一下「複製到剪貼簿」即可複製金鑰。
- 將金鑰儲存於安全的位置,以供日後使用。
- 在「儲存空間帳戶總覽」頁面中,選取「設定」中的「端點」子選單。
- 按一下「複製到剪貼簿」,複製 Blob 服務端點網址。(例如
https://<storageaccountname>.blob.core.windows.net
) - 請將端點網址儲存於安全位置,以供日後使用。
如何設定 Azure 應用程式閘道
- 登入 Azure 入口網站。
- 前往所需資源群組。
- 選取「Application gateway」(應用程式閘道) (「Application gateway」視窗隨即顯示)。
- 在「監控」部分,依序選取「診斷設定」>「開啟診斷」。
- 選取「新增診斷設定」 (「診斷設定」視窗會顯示診斷記錄的設定)。
- 在「記錄」部分執行下列操作:
- 勾選「ApplicationGatewayAccessLog」ApplicationGatewayAccessLog核取方塊。
- 選取「ApplicationGatewayFirewallLog」ApplicationGatewayFirewallLog核取方塊。
- 如要在儲存空間帳戶中儲存記錄,請按照下列步驟操作:
- 勾選「封存至儲存空間帳戶」核取方塊。
- 在「訂閱」清單中,選取現有訂閱方案。
- 在「Storage account」(儲存空間帳戶) 清單中,選取現有儲存空間帳戶。
設定動態饋給
在 Google SecOps 平台中,有兩種不同的進入點可設定動態饋給:
- 「SIEM 設定」>「動態消息」
- 內容中心 > 內容包
依序前往「SIEM 設定」>「動態消息」,設定動態消息
如要為這個產品系列中的不同記錄類型設定多個動態饋給,請參閱「依產品設定動態饋給」。
如要設定單一動態饋給,請按照下列步驟操作:
- 依序前往「SIEM 設定」>「動態饋給」。
- 按一下「新增動態消息」。
- 在下一個頁面中,按一下「設定單一動態饋給」。
- 在「Feed name」(動態消息名稱) 欄位中,輸入動態消息的名稱 (例如「Azure Application Gateway Logs」)。
- 選取「Microsoft Azure Blob Storage」做為「來源類型」。
- 選取「Azure Application Gateway」做為「記錄類型」。
- 點選「下一步」。
指定下列輸入參數的值:
- Azure URI:Blob 端點網址。
ENDPOINT_URL/BLOB_NAME
- 取代下列項目:
ENDPOINT_URL
:Blob 端點網址。(https://<storageaccountname>.blob.core.windows.net
)BLOB_NAME
:Blob 的名稱。(例如insights-logs-<logname>
)
- 取代下列項目:
- URI 為:根據記錄串流設定選取 URI 類型 (「單一檔案」、「目錄」或「包含子目錄的目錄」)。
- 來源刪除選項:根據擷取偏好設定選取刪除選項。
- 共用金鑰:Azure Blob 儲存體的存取金鑰。
- 資產命名空間:資產命名空間。
- 擷取標籤:要套用至這個動態饋給事件的標籤。
- Azure URI:Blob 端點網址。
點選「下一步」。
在「Finalize」畫面上檢查新的動態饋給設定,然後按一下「Submit」。
從內容中心設定動態饋給
為下列欄位指定值:
- Azure URI:Blob 端點 URL。
ENDPOINT_URL/BLOB_NAME
- 取代下列項目:
ENDPOINT_URL
:Blob 端點網址 (https://<storageaccountname>.blob.core.windows.net
)BLOB_NAME
:Blob 的名稱 (例如insights-logs-<logname>
)
- 取代下列項目:
- URI 為:根據記錄串流設定選取 URI 類型 (「單一檔案」|「目錄」|「包含子目錄的目錄」)。
- 來源刪除選項:根據擷取偏好設定選取刪除選項。
- 共用金鑰:Azure Blob 儲存體的存取金鑰。
進階選項
- 動態饋給名稱:系統預先填入的值,用於識別動態饋給。
- 來源類型:將記錄收集到 Google SecOps 的方法。
- 資產命名空間:與動態饋給相關聯的命名空間。
- 擷取標籤:套用至這個動態饋給所有事件的標籤。
UDM 對應表
記錄欄位 | UDM 對應 | 邏輯 |
---|---|---|
Category |
metadata.product_event_type |
直接從「Category 」欄位對應。 |
ClientOperationId |
additional.fields[].key:"ClientOperationId", value.string_value |
直接從「ClientOperationId 」欄位對應。 |
CorrelationRequestId |
additional.fields[].key:"CorrelationRequestId", value.string_value |
直接從「CorrelationRequestId 」欄位對應。 |
GatewayManagerVersion |
additional.fields[].key:"GatewayManagerVersion", value.string_value |
直接從「GatewayManagerVersion 」欄位對應。 |
category |
metadata.product_event_type |
直接從「category 」欄位對應。 |
level |
security_result.severity |
直接從 level 欄位對應,並轉換為大寫。如果值為「WARNING」,嚴重程度會設為「HIGH」,且 security_result.severity_details 會設為原始值。 |
properties.clientIP |
principal.ip 、principal.asset.ip |
直接從「properties.clientIP 」欄位對應。 |
properties.clientPort |
principal.port |
直接從 properties.clientPort 欄位對應,並轉換為整數。 |
properties.clientResponseTime |
additional.fields[].key:"clientResponseTime", value.string_value |
直接從「properties.clientResponseTime 」欄位對應。 |
properties.configuration.BgpConfiguration.GatewayConfig.Asn |
security_result.detection_fields[].key:"ASN", value |
當 operationName 為「SetGatewayConfiguration」時,直接從 properties.configuration.BgpConfiguration.GatewayConfig.Asn 欄位對應。 |
properties.configuration.BgpConfiguration.GatewayConfig.PeerAddress |
target.ip 、target.asset.ip |
當 operationName 為「SetGatewayConfiguration」時,直接從 properties.configuration.BgpConfiguration.GatewayConfig.PeerAddress 欄位對應。 |
properties.configuration.BgpConfiguration.GatewayConfig.PeerType |
security_result.detection_fields[].key:"PeerType", value |
當 operationName 為「SetGatewayConfiguration」時,直接從 properties.configuration.BgpConfiguration.GatewayConfig.PeerType 欄位對應。 |
properties.configuration.IkeVersion |
principal.resource.attribute.labels[].key:"ike_version", value |
當 operationName 為「SetConnectionConfiguration」時,直接從 properties.configuration.IkeVersion 欄位對應。 |
properties.configuration.LocalSubnets |
principal.resource.attribute.labels[].key:"local subnets", value |
當 operationName 為「SetConnectionConfiguration」時,properties.configuration.LocalSubnets 陣列中的 IP 位址會串連成字串。 |
properties.configuration.LocalTunnelEndpoint |
principal.ip 、principal.asset.ip |
當 operationName 為「SetConnectionConfiguration」時,直接從 properties.configuration.LocalTunnelEndpoint 欄位對應。 |
properties.configuration.Name |
principal.hostname 、principal.asset.hostname |
直接從「properties.configuration.Name 」欄位對應。如果為空白,系統會從 properties.instance 取得值。 |
properties.configuration.RemoteSite |
target.hostname 、target.asset.hostname |
直接從「properties.configuration.RemoteSite 」欄位對應。 |
properties.configuration.RemoteSubnets |
principal.resource.attribute.labels[].key:"remote subnets", value |
當 operationName 為「SetConnectionConfiguration」時,properties.configuration.RemoteSubnets 陣列中的 IP 位址會串連成字串。 |
properties.configuration.RemoteTunnelEndpoint |
target.ip 、target.asset.ip |
當 operationName 為「SetConnectionConfiguration」時,直接從 properties.configuration.RemoteTunnelEndpoint 欄位對應。 |
properties.configuration.VIPAddress |
principal.ip 、principal.asset.ip |
當 operationName 為「SetGatewayConfiguration」時,直接從 properties.configuration.VIPAddress 欄位對應。 |
properties.configuration.VirtualNetworkRanges |
principal.resource.attribute.labels[].key:"virutal network ranges", value |
當 operationName 為「SetGatewayConfiguration」時,properties.configuration.VirtualNetworkRanges 陣列中的 IP 位址會串連成字串。 |
properties.configuration.VirtualNetworkSubnets |
principal.resource.attribute.labels[].key:"virtual network subnets", value |
當 operationName 為「SetGatewayConfiguration」時,properties.configuration.VirtualNetworkSubnets 陣列中的 IP 位址會串連成字串。 |
properties.error_info |
additional.fields[].key:"error_info", value.string_value |
直接從「properties.error_info 」欄位對應。 |
properties.host |
principal.hostname 、principal.asset.hostname |
如果 properties.originalHost 為空,則直接從 properties.host 欄位對應。 |
properties.httpMethod |
network.http.method |
直接從「properties.httpMethod 」欄位對應。 |
properties.httpStatus |
network.http.response_code |
直接從 properties.httpStatus 欄位對應,並轉換為整數。 |
properties.httpVersion |
network.application_protocol |
如果 properties.httpVersion 欄位包含「HTTP」,請設為「HTTP」。 |
properties.instance |
principal.hostname 、principal.asset.hostname |
如果 properties.configuration.Name 為空,則做為 principal.hostname 的值。 |
properties.message |
metadata.description |
直接從「properties.message 」欄位對應。 |
properties.operationName |
additional.fields[].key:"operationName", value.string_value |
直接從「properties.operationName 」欄位對應。 |
properties.operationStatus |
security_result.category_details |
直接從「properties.operationStatus 」欄位對應。如果值為「Success」或「InProgress」,security_result.action 會設為「ALLOW」。 |
properties.originalHost |
principal.hostname 、principal.asset.hostname |
直接從「properties.originalHost 」欄位對應。 |
properties.originalRequestUriWithArgs |
additional.fields[].key:"originalRequestUriWithArgs", value.string_value |
直接從「properties.originalRequestUriWithArgs 」欄位對應。 |
properties.receivedBytes |
network.received_bytes |
直接從 properties.receivedBytes 欄位對應,並轉換為不帶正負號的整數。 |
properties.requestQuery |
additional.fields[].key:"requestQuery", value.string_value |
直接從「properties.requestQuery 」欄位對應。 |
properties.requestUri |
target.url |
直接從「properties.requestUri 」欄位對應。 |
properties.sentBytes |
network.sent_bytes |
直接從 properties.sentBytes 欄位對應,並轉換為不帶正負號的整數。 |
properties.serverResponseLatency |
additional.fields[].key:"Server Response Latency", value.string_value |
直接從「properties.serverResponseLatency 」欄位對應。 |
properties.serverRouted |
target.ip 、target.asset.ip 、target.port |
系統會使用規則運算式,從 properties.serverRouted 欄位擷取 IP 和通訊埠。 |
properties.sslCipher |
network.tls.cipher |
直接從「properties.sslCipher 」欄位對應。 |
properties.sslClientCertificateIssuerName |
network.tls.server.certificate.issuer |
直接從「properties.sslClientCertificateIssuerName 」欄位對應。 |
properties.sslProtocol |
network.tls.version |
直接從「properties.sslProtocol 」欄位對應。 |
properties.timeTaken |
additional.fields[].key:"timeTaken", value.string_value |
直接從「properties.timeTaken 」欄位對應。 |
properties.transactionId |
network.session_id |
直接從「properties.transactionId 」欄位對應。 |
properties.userAgent |
network.http.user_agent 、network.http.parsed_user_agent |
直接從「properties.userAgent 」欄位對應。此外,該欄位會轉換為已剖析的使用者代理程式,並對應至 network.http.parsed_user_agent 。 |
properties.WAFEvaluationTime |
additional.fields[].key:"WAFEvaluationTime", value.string_value |
直接從「properties.WAFEvaluationTime 」欄位對應。 |
properties.WAFMode |
additional.fields[].key:"WAFMode", value.string_value |
直接從「properties.WAFMode 」欄位對應。 |
resourceId |
target.resource.id |
直接從「resourceId 」欄位對應。 |
resourceid |
target.resource.product_object_id |
直接從「resourceid 」欄位對應。 |
ruleName |
security_result.rule_name |
直接從「ruleName 」欄位對應。 |
time /timeStamp |
metadata.event_timestamp 、timestamp |
以 RFC 3339 或 ISO8601 格式剖析為時間戳記。建議使用 timeStamp ,但如果沒有 timeStamp ,則使用 time 。 |
(剖析器邏輯) | metadata.event_type |
如果主體和目標都存在,請設為「NETWORK_CONNECTION」;如果只有主體存在,請設為「STATUS_UPDATE」;否則請設為「GENERIC_EVENT」。 |
(剖析器邏輯) | metadata.product_name |
設為「Azure 閘道」。 |
(剖析器邏輯) | metadata.vendor_name |
設為「Microsoft」。 |
(剖析器邏輯) | has_principal |
布林值旗標。如果擷取任何主體資訊 (主機名稱、IP 或連接埠),則設為「true」,否則設為「false」。 |
(剖析器邏輯) | has_target |
布林值旗標。如果系統擷取任何目標資訊 (主機名稱、IP、連接埠、資源 ID 或網址),則設為「true」,否則設為「false」。 |
(剖析器邏輯) | disambiguation_key |
從單一記錄項目擷取多個事件時新增。 |