收集 Azure Application Gateway 日志
支持的语言:
Google SecOps
SIEM
本文档介绍了如何通过设置 Google Security Operations Feed 来收集 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 门户。
- 前往所需资源组。
- 选择应用网关(系统随即会显示应用网关窗口)。
- 在监控部分,依次选择诊断设置 > 开启诊断。
- 选择添加诊断设置(诊断设置窗口会显示诊断日志的设置)。
- 在日志部分中,执行以下操作:
- 选中 ApplicationGatewayAccessLog 复选框。
- 选中 ApplicationGatewayFirewallLog 复选框。
- 如需将日志存储在存储账号中,请执行以下操作:
- 选中归档到存储账号复选框。
- 在订阅列表中,选择现有订阅。
- 在存储账号列表中,选择一个现有存储账号。
设置 Feed
您可以通过两种不同的入口点在 Google SecOps 平台中设置 Feed:
- SIEM 设置 > Feed
- 内容中心 > 内容包
通过“SIEM 设置”>“Feed”设置 Feed
如需为相应产品系列中的不同日志类型配置多个 Feed,请参阅按产品配置 Feed。
如需配置单个 Feed,请按以下步骤操作:
- 依次前往 SIEM 设置> Feed。
- 点击添加新 Feed。
- 在下一页上,点击配置单个 Feed。
- 在 Feed 名称字段中,输入 Feed 的名称(例如 Azure Application Gateway 日志)。
- 选择 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 is a:根据日志流配置选择 URI 类型(Single file | Directory | Directory which includes subdirectories)。
- 源删除选项:根据您的提取偏好设置选择删除选项。
- 共享密钥:Azure Blob Storage 的访问密钥。
- 资源命名空间:资源命名空间。
- 注入标签:要应用于此 Feed 中事件的标签。
- Azure URI:Blob 端点网址。
点击下一步。
在最终确定界面中查看新的 Feed 配置,然后点击提交。
设置来自内容中心的 Feed
为以下字段指定值:
- Azure URI:Blob 端点网址。
ENDPOINT_URL/BLOB_NAME
- 替换以下内容:
ENDPOINT_URL
:Blob 端点网址 (https://<storageaccountname>.blob.core.windows.net
)BLOB_NAME
:Blob 的名称(例如insights-logs-<logname>
)
- 替换以下内容:
- URI is a:根据日志流配置选择 URI 类型(Single file [单个文件] | Directory [目录] | Directory which includes subdirectories [包含子目录的目录])。
- 源删除选项:根据您的提取偏好设置选择删除选项。
- 共享密钥:Azure Blob Storage 的访问密钥。
高级选项
- Feed 名称:用于标识 Feed 的预填充值。
- 来源类型:用于将日志收集到 Google SecOps 中的方法。
- 资产命名空间:与 Feed 关联的命名空间。
- 提取标签:应用于相应 Feed 中所有事件的标签。
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 |
当从单个日志条目中提取多个事件时添加。 |
变化
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
- 新创建的解析器。