收集 Azure 應用程式閘道記錄
支援以下發布途徑:
Google secops
Siem
本文說明如何設定 Google Security Operations 動態饋給,收集 Azure Application Gateway 記錄。這個剖析器可處理單一和多筆記錄 JSON 結構,從「records」陣列中擷取欄位、執行資料類型轉換、將欄位對應至 UDM,並使用中繼資料和衍生欄位 (例如網路連線類型) 強化資料。它也會處理不同 operationName
值的特定邏輯,擷取相關 IP 位址、子網路和其他設定詳細資料。
事前準備
請確認您已完成下列必要條件:
- Google SecOps 執行個體
- 對 Azure 訂閱的特殊權限存取權
- Azure 中的 Azure 應用程式閘道環境 (租用戶)
設定 Azure 儲存體帳戶
- 在 Azure 控制台中搜尋「儲存體帳戶」。
- 按一下 [建立]。
- 指定下列輸入參數的值:
- 訂閱:選取訂閱項目。
- 資源群組:選取資源群組。
- 區域:選取區域。
- 成效:選取成效 (建議使用標準)。
- 備援功能:選取備援功能 (建議使用 GRS 或 LRS)。
- 儲存體帳戶名稱:輸入新儲存體帳戶的名稱。
- 按一下「Review + create」。
- 查看帳戶總覽,然後按一下「建立」。
- 在「儲存空間帳戶總覽」頁面中,選取「安全性與網路」的「存取金鑰」子選單。
- 按一下 key1 或 key2 旁邊的「顯示」
- 按一下「複製到剪貼簿」即可複製金鑰。
- 將金鑰儲存於安全的位置,以供日後使用。
- 在「儲存空間帳戶總覽」頁面中,選取「設定」中的「端點」子選單。
- 點選「複製到剪貼簿」即可複製 Blob 服務端點網址。(例如
https://<storageaccountname>.blob.core.windows.net
) - 將端點網址儲存於安全位置,以供日後使用。
如何設定 Azure Application Gateway
- 登入 Azure 入口網站。
- 前往所需資源群組。
- 選取「Application gateway」 (畫面上會顯示「Application gateway」視窗)。
- 在「Monitoring」部分,依序選取「Diagnostic settings」>「>」「Turn on diagnostics」。
- 選取「新增診斷設定」 (「診斷設定」視窗會顯示診斷記錄的設定)。
- 在「log」部分執行下列操作:
- 勾選「ApplicationGatewayAccessLog」ApplicationGatewayAccessLog核取方塊。
- 勾選「ApplicationGatewayFirewallLog」ApplicationGatewayFirewallLog核取方塊。
- 如要將記錄儲存在儲存空間帳戶中,請按照下列步驟操作:
- 勾選「將資料封存至儲存空間帳戶」核取方塊。
- 在「訂閱」清單中,選取現有的訂閱項目。
- 在「Storage account」清單中,選取現有的儲存空間帳戶。
設定動態饋給
在 Google SecOps 平台中,有兩個不同的入口可用來設定動態消息:
- SIEM 設定 > 動態饋給
- 內容中心 > 內容包
依序前往「SIEM 設定」>「動態」設定動態
如要針對這個產品系列中的不同記錄類型設定多個動態饋給,請參閱「依產品設定動態饋給」。
如要設定單一動態饋給,請按照下列步驟操作:
- 依序前往「SIEM 設定」>「動態饋給」。
- 按一下「新增動態消息」。
- 在下一頁中,按一下「設定單一動態饋給」。
- 在「動態饋給名稱」欄位中,輸入動態饋給的名稱 (例如「Azure Application Gateway Logs」)。
- 選取「Microsoft Azure Blob Storage」做為「Source type」。
- 選取 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 端點網址。
點選「下一步」。
在「完成」畫面中查看新的動態饋給設定,然後按一下「提交」。
透過內容中心設定動態饋給
指定下列欄位的值:
- 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 儲存體的存取金鑰。
進階選項
- 動態饋給名稱:預先填入的值,用於識別動態饋給。
- 來源類型:用於收集記錄並匯入 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 Gateway」。 |
(剖析器邏輯) | metadata.vendor_name |
設為「Microsoft」。 |
(剖析器邏輯) | has_principal |
布林值標記,如果擷取任何主要資訊 (主機名稱、IP 或連接埠),則設為「true」,否則設為「false」。 |
(剖析器邏輯) | has_target |
布林值標記,如果擷取任何目標資訊 (主機名稱、IP、連接埠、資源 ID 或網址),則設為「true」,否則設為「false」。 |
(剖析器邏輯) | disambiguation_key |
從單一記錄項目擷取多個事件時會新增。 |
異動
2024-04-19
- 新增對多個事件 JSON 記錄的支援。
2023-12-22
- 已將「resourceid」對應至「target.resource.id」。
- 將「properties.operationStatus」對應至「security_result.category_details」。
- 將「properties.configuration.Name」對應至「principal.hostname」。
- 將「properties.message」對應至「metadata.description」。
- 將「properties.configuration.RemoteStie」對應至「target.hostname」。
- 將「level」對應至「security_result.severity_details」。
- 將「properties.configuration.Ikeversion」對應至「principal.resource.attribute.labels」。
- 將「properties.configuration.LocalTunnelEndpoint」對應至「principal.ip」。
- 將「properties.configuration.RemoteTunnelEndpoint」對應至「target.ip」。
- 將「properties.configuration.LocalSubnets」、「properties.configuration.RemoteSubnets」、「properties.configuration.VirtualNetworkRanges」和「properties.configuration.VirtualNetworkSubnets」對應至「principal.resource.attribute.labels」。
- 將「properties.configuration.VIPAddress」對應至「principal.ip」。
- 將「properties.configuration.BgpConfiguration.GatewayConfig.PeerAddress」對應至「targrt.ip」。
- 將「properties.configuration.BgpConfiguration.GatewayConfig.PeerType」和「properties.configuration.BgpConfiguration.GatewayConfig.Asn」對應至「security_result.detection_fields」。
2023-11-16
- 新建的剖析器。