使用高级搜寻集中查询应用程序控制事件

Windows Defender应用程序控制 (WDAC) 策略以强制或审核模式在 Windows 事件查看器本地记录事件。 虽然事件查看器有助于了解对单个系统的影响,但 IT 专业人员希望跨多个系统对其进行衡量。

2018 年 11 月,我们在 Microsoft Defender for Endpoint 中添加了功能,以便从所有连接的系统中集中查看 WDAC 事件。

Microsoft Defender for Endpoint中的高级搜寻允许客户使用一组丰富的功能查询数据。 可以使用以“AppControl”开头的 ActionType 查询 WDAC 事件。 从 Windows 版本 1607 开始支持此功能。

操作类型

ActionType 名称 ETW 源事件 ID 描述
AppControlCodeIntegrityDriverRevoked 3023 验证中的驱动程序文件不符合通过应用程序控制策略的要求。
AppControlCodeIntegrityImageRevoked 3036 验证中的已签名文件由 Microsoft 或证书颁发机构吊销的代码签名证书进行签名。
AppControlCodeIntegrityPolicyAudited 3076 此事件是审核模式策略main Windows Defender应用程序控制阻止事件。 它指示如果强制实施 WDAC 策略,文件将被阻止。
AppControlCodeIntegrityPolicyBlocked 3077 此事件是强制实施策略main Windows Defender应用程序控制阻止事件。 它指示文件未通过 WDAC 策略并被阻止。
AppControlExecutableAudited 8003 仅当启用“仅审核”强制模式时应用。 指定启用“强制实施规则”模式时将阻止 .exe 或 .dll 文件。
AppControlExecutableBlocked 8004 .exe 或 .dll 文件无法运行。
AppControlPackagedAppAudited 8021 仅当启用“仅审核”强制模式时应用。 指定如果启用“强制实施规则”模式,将阻止打包的应用。
AppControlPackagedAppBlocked 8022 该策略阻止了打包的应用。
AppControlScriptAudited 8006 仅当启用“仅审核”强制模式时应用。 指定脚本或 .msi 启用强制规则强制模式时将阻止文件。
AppControlScriptBlocked 8007 管理员限制对文件名的访问。 仅当通过组策略继承直接或间接设置“强制实施规则”模式时应用。 脚本或 .msi 文件无法运行。
AppControlCIScriptAudited 8028 由 Windows 锁定策略生成的审核脚本/MSI 文件 (WLDP) 由脚本主机自己调用。
AppControlCIScriptBlocked 8029 阻止由 Windows 锁定策略生成的脚本/MSI 文件 (WLDP) 由脚本主机自己调用。
AppControlCodeIntegrityOriginAllowed 3090 由于 ISG) 或安装源 (托管安装程序) 的良好信誉 (允许文件。
AppControlCodeIntegrityOriginAudited 3091 信誉 (ISG) 和安装源 (托管安装程序) 审核文件的信息。
AppControlCodeIntegrityOriginBlocked 3092 信誉 (ISG) 和安装源 (托管安装程序) 阻止文件的信息。
AppControlCodeIntegrityPolicyLoaded 3099 指示已成功加载策略。
AppControlCodeIntegritySigningInformation 3089 签名信息事件与 3076 或 3077 事件相关。 为文件的每个签名生成一个 3089 事件。
AppControlPolicyApplied 8001 指示 AppLocker 策略已成功应用于计算机。

详细了解 Windows) (了解应用程序控制事件 ID

高级搜寻应用程序控制查询示例

查询示例 1:查询过去七天按类型汇总的应用程序控制操作类型

下面是一个简单的示例查询,其中显示了过去 7 天内由 Microsoft Defender for Endpoint 监视的计算机生成的所有Windows Defender应用程序控制事件:

DeviceEvents
| where Timestamp > ago(7d) and
ActionType startswith "AppControl"
| summarize Machines=dcount(DeviceName) by ActionType
| order by Machines desc

查询结果可用于与管理Windows Defender应用程序控制相关的几个重要功能,包括:

  • 评估在审核模式下部署策略的影响 由于应用程序仍在审核模式下运行,因此这是查看策略中包含的规则的影响和正确性的理想方法。 通过将生成的事件与高级搜寻集成,可以更轻松地广泛部署审核模式策略,并了解包含的规则如何影响这些系统在实际使用中。 此审核模式数据将有助于简化到在强制模式下使用策略的转换。
  • 在强制模式下监视策略的阻止 在强制模式下部署的策略可能会阻止不符合任何包含的允许规则的可执行文件或脚本。 可以阻止合法的新应用程序和更新,或者可能不需要的或恶意软件。 在任一情况下,高级搜寻查询会报告块以供进一步调查。

查询示例 #2:用于确定过去 7 天内的审核块的查询

DeviceEvents 
| where ActionType startswith "AppControlExecutableAudited"
| where Timestamp > ago(7d)
|project DeviceId,                               // the device ID where the audit block happened
FileName,                                        // The audit blocked app's filename
FolderPath,                                      // The audit blocked app's system path without the FileName
InitiatingProcessFileName,                       // The file name of the parent process loading the executable
InitiatingProcessVersionInfoCompanyName,         // The company name of the parent process loading the executable
InitiatingProcessVersionInfoOriginalFileName,    // The original file name of the parent process loading the executable
InitiatingProcessVersionInfoProductName,         // The product name of the parent process loading the executable
InitiatingProcessSHA256,                         // The SHA256 flat hash of the parent process loading the executable
Timestamp,                                       // The event creation timestamp
ReportId,                                        // The report ID - randomly generated by MDE AH
InitiatingProcessVersionInfoProductVersion,      // The product version of the parent process loading the executable
InitiatingProcessVersionInfoFileDescription,     // The file description of the parent process loading the executable
AdditionalFields                                 // Additional fields contains FQBN for signed binaries.  These contain the CN of the leaf certificate, product name, original filename and version of the audited binary