macOS 上Microsoft Defender for Endpoint中的故障排除模式

本文介绍如何在 macOS 上的 Microsoft Defender for Endpoint 中启用故障排除模式,以便管理员可以暂时对各种Microsoft Defender防病毒功能进行故障排除,即使组织策略管理设备也是如此。

例如,如果启用了篡改防护,则无法修改或关闭某些设置,但可以在设备上使用故障排除模式来临时编辑这些设置。

默认情况下,故障排除模式处于禁用状态;若要使用,需要你为某个设备(和/或一组设备)在限定时间内启用该模式。 故障排除模式是一项仅限企业的功能,需要访问Microsoft Defender门户

开始之前需要了解的内容

在故障排除模式下,可以执行以下操作:

  • macOS 上使用 Microsoft Defender for Endpoint 进行功能故障排除/应用程序兼容性(误报)。

  • 具有适当权限的本地管理员可以更改单个终结点上的以下策略锁定配置:

    设置 启用 禁用/删除
    实时保护/被动模式/按需 mdatp config real-time-protection --value enabled mdatp config real-time-protection --value disabled
    网络保护 mdatp config network-protection enforcement-level --value block mdatp config network-protection enforcement-level --value disabled
    realTimeProtectionStatistics mdatp config real-time-protection-statistics --value enabled mdatp config real-time-protection-statistics --value disabled
    标签 mdatp edr tag set --name GROUP --value [name] mdatp edr tag remove --tag-name [name]
    groupIds mdatp edr group-ids --group-id [group]
    终端 DLP mdatp config data_loss_prevention --value enabled mdatp config data_loss_prevention --value disabled

在故障排除模式下,无法执行以下操作:

  • 在 macOS 上对Microsoft Defender for Endpoint禁用篡改保护。
  • 卸载 macOS 上的Microsoft Defender for Endpoint。

先决条件

  • Microsoft Defender for Endpoint 支持的 macOS 版本。
  • Microsoft Defender for Endpoint 必须已注册到租户并在设备上处于活动状态。
  • Microsoft Defender for Endpoint中“管理安全中心的安全设置”的权限。
  • 平台更新版本:101.23122.0005 或更高版本。

在 macOS 上启用故障排除模式

  1. 转到Microsoft Defender门户并登录。

  2. 导航到要打开故障排除模式的设备页面。 然后,选择省略号 (...) 并选择 “打开故障排除模式”。

    显示 mac 上故障排除模式的屏幕截图。

    注意

    打开故障排除模式 ”选项在所有设备上都可用,即使设备不符合故障排除模式的先决条件也是如此。 有关详细信息,请参阅本文后面的 故障排除模式问题 部分。

  3. 阅读窗格中显示的信息,准备就绪后,选择“ 提交 ”以确认要为该设备启用故障排除模式。

  4. 你会看到显示的 更改可能需要几分钟才能生效 文本。 在此期间,当你再次选择省略号图标时,你会看到启用故障排除模式(待定)选项显示为灰色。

  5. 完成后,设备页显示设备现在处于故障排除模式。

    如果最终用户在 macOS 设备上登录,他们将看到以下文本:

    故障排除模式已启动。 此模式允许暂时更改管理员管理的设置。 到期时间:YEAR-MM-DDTHH:MM:SSZ。

    选择“确定”

  6. 启用后,可以测试在故障排除模式 (TS 模式) 中可切换到的不同命令行选项。

    例如,使用 mdatp config real-time-protection --value disabled 命令禁用实时保护时,系统会提示输入密码。 输入密码后选择 “确定 ”。

    显示已禁用实时保护的屏幕截图。

    运行 mdatp health 且 real_time_protection_enabled 为“false”、tamper_protection 为“block”时,将显示与如下截图类似的输出报告。

    显示运行 mdatp health 命令时输出报告的屏幕截图。

用于检测的高级搜寻查询

有一些预生成的高级搜寻查询,可让你了解环境中发生的故障排除事件。 可以使用这些查询 创建检测规则 ,以在设备处于故障排除模式时生成警报。

获取特定设备的故障排除事件

您可以使用以下查询按 deviceIddeviceName 进行搜索,只需注释掉相应的行即可。

//let deviceName = "<deviceName>";   // update with device name
let deviceId = "<deviceID>";   // update with device id
DeviceEvents
| where DeviceId == deviceId
//| where DeviceName  == deviceName
| where ActionType == "AntivirusTroubleshootModeEvent"
| extend _tsmodeproperties = parse_json(AdditionalFields)
| project Timestamp,DeviceId, DeviceName, _tsmodeproperties,
 _tsmodeproperties.TroubleshootingState, _tsmodeproperties.TroubleshootingPreviousState, _tsmodeproperties.TroubleshootingStartTime,
 _tsmodeproperties.TroubleshootingStateExpiry, _tsmodeproperties.TroubleshootingStateRemainingMinutes,
 _tsmodeproperties.TroubleshootingStateChangeReason, _tsmodeproperties.TroubleshootingStateChangeSource

当前处于故障排除模式的设备

可以使用以下查询查找当前处于故障排除模式的设备:

DeviceEvents
| where Timestamp > ago(3h) // troubleshooting mode automatically disables after 4 hours
| where ActionType == "AntivirusTroubleshootModeEvent"
| extend _tsmodeproperties = parse_json(AdditionalFields)
| where _tsmodeproperties.TroubleshootingStateChangeReason contains "started"
|summarize (Timestamp, ReportId)=arg_max(Timestamp, ReportId), count() by DeviceId
| order by Timestamp desc

按设备统计的故障排除模式实例计数

可以使用以下查询查找设备的故障排除模式实例数:

DeviceEvents
| where ActionType == "AntivirusTroubleshootModeEvent"
| extend _tsmodeproperties = parse_json(AdditionalFields)
| where Timestamp > ago(30d)  // choose the date range you want
| where _tsmodeproperties.TroubleshootingStateChangeReason contains "started"
| summarize (Timestamp, ReportId)=arg_max(Timestamp, ReportId), count() by DeviceId
| sort by count_

总数

可以使用以下查询了解故障排除模式实例的总计数:

DeviceEvents
| where ActionType == "AntivirusTroubleshootModeEvent"
| extend _tsmodeproperties = parse_json(AdditionalFields)
| where Timestamp > ago(2d) //beginning of time range
| where Timestamp < ago(1d) //end of time range
| where _tsmodeproperties.TroubleshootingStateChangeReason contains "started"
| summarize (Timestamp, ReportId)=arg_max(Timestamp, ReportId), count()
| where count_ > 5          // choose your max # of TS mode instances for your time range

故障排除模式的问题

如果无法启用故障排除模式,请在目标 Mac 上执行以下故障排除步骤:

  • 运行以下命令验证应用版本:

    mdatp health --field app_version
    

    如前所述,需要平台更新版本:101.23122.0005 或更高版本。

  • 运行以下命令,验证设备是否已注册并处于活动状态:

    mdatp health --field edr_machine_id
    
    mdatp connectivity test
    

    所有终结点都应显示 [确定]。

  • 通过运行以下命令验证配置源:

    mdatp health --field managed_by
    

    MDE 表示 Microsoft Defender for Endpoint Attach,并且具有优先级。 MEM 指示Microsoft Intune或 Apple Jamf。

  • 验证所需的配置文件路径:

    • /Library/Preferences/com.microsoft.mdeattach.plist
    • /Library/Managed Preferences/com.microsoft.wdav*.plist

若要提升日志记录并收集诊断,请运行以下命令,然后再次尝试启用故障排除模式:


sudo mdatp log level set --level debug

sudo mdatp diagnostic create

sudo mdatp log level set --level info