你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Azure 防火墙诊断日志(旧版)

诊断日志是原始Azure 防火墙日志查询,以非结构化或自由格式的文本格式输出日志数据。

诊断日志支持以下日志类别:

  • Azure 防火墙应用程序规则
  • Azure 防火墙网络规则
  • Azure 防火墙 DNS 代理

应用程序规则日志

仅当为每个 Azure 防火墙启用了应用程序规则日志时,才会将此日志保存到存储帐户、流式传输到事件中心和/或发送到 Azure Monitor 日志。 每当建立与某个配置的应用程序规则匹配的新连接,就会为接受/拒绝的连接生成一条日志。 如以下示例中所示,数据以 JSON 格式记录:

Category: application rule logs.
Time: log timestamp.
Properties: currently contains the full message.
note: this field will be parsed to specific fields in the future, while maintaining backward compatibility with the existing properties field.
{
 "category": "AzureFirewallApplicationRule",
 "time": "2018-04-16T23:45:04.8295030Z",
 "resourceId": "/SUBSCRIPTIONS/{subscriptionId}/RESOURCEGROUPS/{resourceGroupName}/PROVIDERS/MICROSOFT.NETWORK/AZUREFIREWALLS/{resourceName}",
 "operationName": "AzureFirewallApplicationRuleLog",
 "properties": {
     "msg": "HTTPS request from 10.1.0.5:55640 to mydestination.com:443. Action: Allow. Rule Collection: collection1000. Rule: rule1002"
 }
}
{
  "category": "AzureFirewallApplicationRule",
  "time": "2018-04-16T23:45:04.8295030Z",
  "resourceId": "/SUBSCRIPTIONS/{subscriptionId}/RESOURCEGROUPS/{resourceGroupName}/PROVIDERS/MICROSOFT.NETWORK/AZUREFIREWALLS/{resourceName}",
  "operationName": "AzureFirewallApplicationRuleLog",
  "properties": {
      "msg": "HTTPS request from 10.11.2.4:53344 to www.bing.com:443. Action: Allow. Rule Collection: ExampleRuleCollection. Rule: ExampleRule. Web Category: SearchEnginesAndPortals"
  }
}

网络规则日志

仅当为每个 Azure 防火墙启用了网络规则日志时,才会将此日志保存到存储帐户、流式传输到事件中心和/或发送到 Azure Monitor 日志。 每当建立与某个配置的网络规则匹配的新连接,就会为接受/拒绝的连接生成一条日志。 如以下示例中所示,数据以 JSON 格式记录:

Category: network rule logs.
Time: log timestamp.
Properties: currently contains the full message.
note: this field will be parsed to specific fields in the future, while maintaining backward compatibility with the existing properties field.
{
 "category": "AzureFirewallNetworkRule",
 "time": "2018-06-14T23:44:11.0590400Z",
 "resourceId": "/SUBSCRIPTIONS/{subscriptionId}/RESOURCEGROUPS/{resourceGroupName}/PROVIDERS/MICROSOFT.NETWORK/AZUREFIREWALLS/{resourceName}",
 "operationName": "AzureFirewallNetworkRuleLog",
 "properties": {
     "msg": "TCP request from 111.35.136.173:12518 to 13.78.143.217:2323. Action: Deny"
 }
}

DNS 代理日志

仅当为每个Azure 防火墙启用 DNS 代理日志时,DNS 代理日志才会保存到存储帐户、流式传输到事件中心和/或发送到 Azure Monitor 日志。 此日志跟踪发送到使用 DNS 代理配置的 DNS 服务器的 DNS 消息。 如以下示例中所示,数据以 JSON 格式记录:

Category: DNS proxy logs.
Time: log timestamp.
Properties: currently contains the full message.
note: this field will be parsed to specific fields in the future, while maintaining backward compatibility with the existing properties field.

成功:

{
  "category": "AzureFirewallDnsProxy",
  "time": "2020-09-02T19:12:33.751Z",
  "resourceId": "/SUBSCRIPTIONS/{subscriptionId}/RESOURCEGROUPS/{resourceGroupName}/PROVIDERS/MICROSOFT.NETWORK/AZUREFIREWALLS/{resourceName}",
  "operationName": "AzureFirewallDnsProxyLog",
  "properties": {
      "msg": "DNS Request: 11.5.0.7:48197 – 15676 AAA IN md-l1l1pg5lcmkq.blob.core.windows.net. udp 55 false 512 NOERROR - 0 2.000301956s"
  }
}

失败:

{
  "category": "AzureFirewallDnsProxy",
  "time": "2020-09-02T19:12:33.751Z",
  "resourceId": "/SUBSCRIPTIONS/{subscriptionId}/RESOURCEGROUPS/{resourceGroupName}/PROVIDERS/MICROSOFT.NETWORK/AZUREFIREWALLS/{resourceName}",
  "operationName": "AzureFirewallDnsProxyLog",
  "properties": {
      "msg": " Error: 2 time.windows.com.reddog.microsoft.com. A: read udp 10.0.1.5:49126->168.63.129.160:53: i/o timeout”
  }
}

消息格式:

[client’s IP address]:[client’s port] – [query ID] [type of the request] [class of the request] [name of the request] [protocol used] [request size in bytes] [EDNS0 DO (DNSSEC OK) bit set in the query] [EDNS0 buffer size advertised in the query] [response CODE] [response flags] [response size] [response duration]

存储

可通过三种方式存储日志:

  • 存储帐户:如果日志存储时间较长并且希望能根据需要随时查看,则最好使用存储帐户。
  • 事件中心:若要集成其他安全信息和事件管理 (SEIM) 工具,获取资源警报,则事件中心是很好的选择。
  • Azure Monitor 日志:Azure Monitor 日志最适合用于应用程序常规实时监视或查看趋势。

启用诊断日志

若要了解如何使用Azure 门户启用诊断日志记录,请参阅“监视Azure 防火墙日志(旧版)和指标

后续步骤