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

使用 Azure Monitor 工作簿可视化 Microsoft Defender for IoT 数据

Azure Monitor 工作簿提供可直观反映存储在 Azure Resource Graph 订阅中的数据的图形、图表和仪表板,并可直接在 Microsoft Defender for IoT 中使用。

在 Azure 门户中,使用 Defender for IoT“工作簿”页可以查看由 Microsoft 创建并提供的现成工作簿,也可以查看由客户创建并在社区共享的工作簿。

每个工作簿图形或图表都基于对数据运行的 Azure Resource Graph (ARG) 查询。 在 Defender for IoT 中,可以使用 ARG 查询来:

  • 收集传感器状态
  • 识别网络中的新设备
  • 查找与特定 IP 地址相关的警报
  • 了解每个传感器看到的警报

查看工作簿

若要查看由 Microsoft 创建的现成工作簿,或已保存到订阅的其他工作簿:

  1. 在 Azure 门户中,转到“Defender for IoT”并选择左侧的“工作簿”。

    工作簿页的屏幕截图。

  2. 根据需要修改筛选选项,然后选择一个工作簿将其打开。

Defender for IoT 提供以下现成的工作簿:

  • 传感器运行状况。 显示有关传感器运行状况的数据,例如传感器上安装的传感器控制台软件版本。
  • 警报。 显示有关传感器上出现的警报的数据,包括按传感器、警报类型、最近生成的警报等分类的警报。
  • 设备。 显示有关设备清单的数据,包括按供应商、子类型和新识别设备分类的设备。
  • 漏洞。 显示有关在你的网络中的 OT 设备中检测到的漏洞的数据。 选择“设备漏洞”、“易受攻击设备”或“易受攻击组件”表中的项,以在右侧表中查看相关信息。

创建自定义工作簿

使用 Defender for IoT“工作簿”页在 Defender for IoT 中直接创建自定义 Azure Monitor 工作簿。

  1. 在“工作簿”页上,选择“新建”,或从其他模板开始,打开模板工作簿并选择“编辑”。

  2. 在新的工作簿中,选择“添加”,然后选择要添加到工作簿的选项。 如果编辑现有工作簿或模板,请选择右侧的选项(“...”)按钮访问“添加”菜单。

    可以将以下任何元素添加到工作簿:

    选项 说明
    文本 添加文本以描述工作簿上显示的图形或任何所需的其他操作。
    参数 定义要在工作簿文本和查询中使用的参数。
    链接/选项卡 将导航元素添加到工作簿,包括列表、指向其他目标的链接、额外的选项卡或工具栏。
    查询 添加在创建工作簿图形和图表时要使用的查询。

    - 请确保选择“Azure Resource Graph”作为“数据源”,然后选择所有相关订阅。
    - 从“可视化效果”选项中选择一个类型,为数据添加图形表示形式。
    指标 添加在创建工作簿图形和图表时要使用的指标。
    添加组以将工作簿组织到子区域中。

    对于每个选项,在定义所有可用设置后,选择“添加...”或“运行...”按钮以创建该工作簿元素。 例如“添加参数”或“运行查询”。

    提示

    可以在“Azure Resource Graph 资源管理器”中生成查询,并将其复制到工作簿查询中。

  3. 在工具栏中,选择“保存”或“另存为”以保存工作簿,然后选择“完成编辑”。

  4. 选择“工作簿”,返回到包含完整工作簿列表的主工作簿页。

查询中的引用参数

创建参数后,使用以下语法在查询中引用它:{ParameterName}。 例如:

iotsecurityresources
| where type == "microsoft.iotsecurity/sensors"
| extend Name=name
| extend Status= properties.sensorStatus
| where Name=={SensorName}
| project Name,Status

示例查询

本部分提供 Defender for IoT 工作簿中常用的示例查询。

警报查询

跨传感器的警报分布

iotsecurityresources
| where type == "microsoft.iotsecurity/locations/devicegroups/alerts"
| extend Sensor=properties.extendedProperties.SensorId
| where properties.status!='Closed'
| summarize Alerts=count() by tostring(Sensor)
| sort by Alerts desc

过去 24 小时的新警报

iotsecurityresources
| where type == "microsoft.iotsecurity/locations/devicegroups/alerts"
| where properties.status!='Closed'
| extend AlertTime=properties.startTimeUtc
| extend Type=properties.displayName
| where AlertTime > ago(1d)
| project AlertTime, Type

按源 IP 地址分类的警报

iotsecurityresources
| where type == "microsoft.iotsecurity/locations/devicegroups/alerts"
| extend Type=properties.displayName
| extend Source_IP=properties.extendedProperties.SourceDeviceAddress
| extend Destination_IP=properties.extendedProperties.DestinationDeviceAddress
| where Source_IP=='192.168.10.1'
| project Source_IP, Destination_IP, Type

设备查询

按供应商分类的 OT 设备清单

iotsecurityresources
| extend Vendor= properties.hardware.vendor
| where properties.deviceDataSource=='OtSensor'
| summarize Devices=count() by tostring(Vendor)
| sort by Devices

按子类型分类的 OT 设备清单,例如 PLC、嵌入式设备、UPS 等

iotsecurityresources
| where type == "microsoft.iotsecurity/locations/devicegroups/devices"
| extend SubType=properties.deviceSubTypeDisplayName
| summarize Devices=count() by tostring(SubType)
| sort by Devices

按传感器、站点和 IPv4 地址分类的新 OT 设备

iotsecurityresources
| where type == "microsoft.iotsecurity/locations/devicegroups/devices"
| extend TimeFirstSeen=properties.firstSeen
| where TimeFirstSeen > ago(1d)
| extend DeviceName=properties.deviceName
| extend Site=properties.sensor.site
| extend Sensor=properties.sensor.name
| extend IPv4=properties.nics.[0].ipv4Address
| where properties.deviceDataSource=='OtSensor'
| project TimeFirstSeen, Site, Sensor, DeviceName, IPv4

按 Purdue 级别汇总警报

iotsecurityresources
    | where type == "microsoft.iotsecurity/locations/devicegroups/alerts"
    | project 
        resourceId = id,
        affectedResource = tostring(properties.extendedProperties.DeviceResourceIds),
        id = properties.systemAlertId
    | join kind=leftouter (
        iotsecurityresources | where type == "microsoft.iotsecurity/locations/devicegroups/devices" 
        | project 
            sensor = properties.sensor.name,
            zone = properties.sensor.zone,
            site = properties.sensor.site,
            deviceProperties=properties,
            affectedResource = tostring(id)
    ) on affectedResource
    | project-away affectedResource1
    | where deviceProperties.deviceDataSource == 'OtSensor'
    | summarize Alerts=count() by tostring(deviceProperties.purdueLevel)

后续步骤

详细了解如何在传感器控制台上查看仪表板和报表:

详细了解 Azure Monitor 工作簿和 Azure Resource Graph: