# Configuring Windows Defender Advanced Settings

> 配置 Microsoft Defender for Endpoint（MDE）高级防护设置，包括攻击面缩减规则、受控文件夹访问、 网络保护和漏洞利用防护。适用于在默认 Defender 设置基础上加固 Windows 端点、部署企业级端点防护 或满足高级恶意软件防御合规要求的场景。

- Skill: `killvxk/configuring-windows-defender-advanced-settings` (Agent Skill, multi-file: 8 files)
- Install (CLI): `npx skillmds@latest add killvxk/configuring-windows-defender-advanced-settings`
- Raw SKILL.md: https://api.skillmd.com/api/skills/killvxk/configuring-windows-defender-advanced-settings/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- License: Apache-2.0
- Author: killvxk (https://skillmd.com/u/killvxk)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/killvxk/configuring-windows-defender-advanced-settings

---

# 配置 Windows Defender 高级设置

## 使用场景

在以下情况下使用本技能：
- 在默认设置基础上配置 Microsoft Defender for Endpoint（MDE）以增强防护
- 实施攻击面缩减（ASR）规则以阻断常见攻击手法
- 启用受控文件夹访问以防护勒索软件
- 配置网络保护和漏洞利用防护功能
- 通过 Intune、SCCM 或组策略在企业范围内部署 Defender 设置

**不适用于**第三方 EDR 部署（CrowdStrike、SentinelOne）或 Microsoft Defender for Cloud（Azure 工作负载保护）。

## 前置条件

- 已启用 Microsoft Defender 防病毒的 Windows 10/11 企业版
- Microsoft 365 E5 或 Microsoft Defender for Endpoint Plan 2 许可证（使用完整 MDE 功能）
- 用于企业策略部署的 Microsoft Intune 或 SCCM
- Microsoft 365 Defender 门户访问权限（security.microsoft.com）
- 端点上未以主动模式运行第三方杀毒软件（否则 Defender 将进入被动模式）

## 操作流程

### 步骤 1：配置攻击面缩减（ASR）规则

ASR 规则阻断恶意软件和攻击者常用的特定行为：

```powershell
# 通过 PowerShell 启用 ASR 规则（或通过 Intune/GPO 部署）
# 模式：0=禁用, 1=阻断, 2=审计, 6=警告

# 阻断来自电子邮件客户端和 Webmail 的可执行内容
Set-MpPreference -AttackSurfaceReductionRules_Ids BE9BA2D9-53EA-4CDC-84E5-9B1EEEE46550 `
  -AttackSurfaceReductionRules_Actions 1

# 阻断所有 Office 应用程序创建子进程
Set-MpPreference -AttackSurfaceReductionRules_Ids D4F940AB-401B-4EFC-AADC-AD5F3C50688A `
  -AttackSurfaceReductionRules_Actions 1

# 阻断 Office 应用程序创建可执行内容
Set-MpPreference -AttackSurfaceReductionRules_Ids 3B576869-A4EC-4529-8536-B80A7769E899 `
  -AttackSurfaceReductionRules_Actions 1

# 阻断 Office 应用程序向其他进程注入代码
Set-MpPreference -AttackSurfaceReductionRules_Ids 75668C1F-73B5-4CF0-BB93-3ECF5CB7CC84 `
  -AttackSurfaceReductionRules_Actions 1

# 阻断 JavaScript 或 VBScript 启动已下载的可执行内容
Set-MpPreference -AttackSurfaceReductionRules_Ids D3E037E1-3EB8-44C8-A917-57927947596D `
  -AttackSurfaceReductionRules_Actions 1

# 阻断执行可能混淆的脚本
Set-MpPreference -AttackSurfaceReductionRules_Ids 5BEB7EFE-FD9A-4556-801D-275E5FFC04CC `
  -AttackSurfaceReductionRules_Actions 1

# 阻断 Office 宏调用 Win32 API
Set-MpPreference -AttackSurfaceReductionRules_Ids 92E97FA1-2EDF-4476-BDD6-9DD0B4DDDC7B `
  -AttackSurfaceReductionRules_Actions 1

# 阻断从 Windows LSASS 窃取凭据
Set-MpPreference -AttackSurfaceReductionRules_Ids 9E6C4E1F-7D60-472F-BA1A-A39EF669E4B2 `
  -AttackSurfaceReductionRules_Actions 1

# 阻断通过 PSExec 和 WMI 命令创建进程
Set-MpPreference -AttackSurfaceReductionRules_Ids D1E49AAC-8F56-4280-B9BA-993A6D77406C `
  -AttackSurfaceReductionRules_Actions 1

# 阻断来自 USB 的不受信任和未签名进程
Set-MpPreference -AttackSurfaceReductionRules_Ids B2B3F03D-6A65-4F7B-A9C7-1C7EF74A9BA4 `
  -AttackSurfaceReductionRules_Actions 1

# 阻断通过 WMI 事件订阅实现的持久化
Set-MpPreference -AttackSurfaceReductionRules_Ids E6DB77E5-3DF2-4CF1-B95A-636979351E5B `
  -AttackSurfaceReductionRules_Actions 1

# 阻断滥用易受攻击的已签名驱动程序
Set-MpPreference -AttackSurfaceReductionRules_Ids 56A863A9-875E-4185-98A7-B882C64B5CE5 `
  -AttackSurfaceReductionRules_Actions 1
```

### 步骤 2：配置受控文件夹访问（勒索软件防护）

```powershell
# 启用受控文件夹访问
Set-MpPreference -EnableControlledFolderAccess Enabled

# 默认受保护文件夹：文档、图片、视频、音乐、桌面、收藏夹
# 添加自定义受保护文件夹
Add-MpPreference -ControlledFolderAccessProtectedFolders "C:\CriticalData"
Add-MpPreference -ControlledFolderAccessProtectedFolders "D:\SharedDrives"

# 允许特定应用程序访问受保护文件夹
Add-MpPreference -ControlledFolderAccessAllowedApplications "C:\Program Files\CustomApp\app.exe"
Add-MpPreference -ControlledFolderAccessAllowedApplications "C:\Program Files\Backup\backup.exe"

# 先设为审计模式，识别需要访问权限的合法应用程序
Set-MpPreference -EnableControlledFolderAccess AuditMode
# 事件 ID 1124 记录在 Microsoft-Windows-Windows Defender/Operational 日志中
```

### 步骤 3：配置网络保护

```powershell
# 启用网络保护（阻断到恶意域/IP 的连接）
Set-MpPreference -EnableNetworkProtection Enabled

# 网络保护利用 Microsoft SmartScreen 情报
# 阻断：钓鱼网站、漏洞利用托管域、C2 域名、恶意软件下载 URL

# 先设为审计模式：
Set-MpPreference -EnableNetworkProtection AuditMode
# 事件日志：Microsoft-Windows-Windows Defender/Operational，事件 ID 1125

# 配置 Web 内容过滤（需要 MDE P2 许可证）
# 通过 Microsoft 365 Defender 门户管理：
# 设置 → 端点 → Web 内容过滤 → 添加策略
# 需要阻断的类别：恶意软件、钓鱼、成人内容、高带宽
```

### 步骤 4：配置漏洞利用防护

```powershell
# 导出当前漏洞利用防护设置
Get-ProcessMitigation -RegistryConfigFilePath "C:\Defender\current_mitigations.xml"

# 配置系统级缓解措施
Set-ProcessMitigation -System -Enable DEP, SEHOP, ForceRelocateImages, BottomUp

# 配置每个应用程序的缓解措施
# 示例：加固 Microsoft Office 防止漏洞利用
Set-ProcessMitigation -Name "WINWORD.EXE" `
  -Enable DEP, SEHOP, ForceRelocateImages, CFG, StrictHandle

Set-ProcessMitigation -Name "EXCEL.EXE" `
  -Enable DEP, SEHOP, ForceRelocateImages, CFG, StrictHandle

Set-ProcessMitigation -Name "POWERPNT.EXE" `
  -Enable DEP, SEHOP, ForceRelocateImages, CFG, StrictHandle

# 从 XML 模板导入漏洞利用防护配置
Set-ProcessMitigation -PolicyFilePath "C:\Defender\exploit_protection_template.xml"
```

### 步骤 5：配置云提供的防护

```powershell
# 启用云提供的防护（实时威胁情报）
Set-MpPreference -MAPSReporting Advanced
Set-MpPreference -SubmitSamplesConsent SendAllSamples

# 启用首次见即阻断（BAFS）
# 前提：已启用云防护 + 已启用样本提交
Set-MpPreference -DisableBlockAtFirstSeen $false

# 将云阻断超时设置为最大值（60 秒）
Set-MpPreference -CloudBlockLevel High
Set-MpPreference -CloudExtendedTimeout 50

# 启用潜在不需要的应用程序（PUA）防护
Set-MpPreference -PUAProtection Enabled
```

### 步骤 6：配置扫描和更新设置

```powershell
# 配置实时保护
Set-MpPreference -DisableRealtimeMonitoring $false
Set-MpPreference -DisableBehaviorMonitoring $false
Set-MpPreference -DisableIOAVProtection $false
Set-MpPreference -DisableScriptScanning $false

# 配置计划扫描
Set-MpPreference -ScanScheduleQuickScanTime 12:00:00
Set-MpPreference -ScanParameters QuickScan
Set-MpPreference -ScanScheduleDay 0  # 每天
Set-MpPreference -RemediationScheduleDay 0

# 配置特征库更新
Set-MpPreference -SignatureUpdateInterval 1  # 每小时检查一次
Set-MpPreference -SignatureFallbackOrder "MicrosoftUpdateServer|MMPC"

# 启用防篡改保护（防止对 Defender 设置进行未授权更改）
# 通过 Microsoft 365 Defender 门户管理：
# 设置 → 端点 → 高级功能 → 防篡改保护：开启
```

### 步骤 7：通过 Intune 部署（企业版）

```
Intune 部署路径：
1. 端点安全 → 攻击面缩减 → 创建配置文件
   - 平台：Windows 10 及更高版本
   - 配置文件：攻击面缩减规则
   - 将每条 ASR 规则配置为阻断或审计

2. 端点安全 → 防病毒 → 创建配置文件
   - Microsoft Defender 防病毒
   - 配置：云保护、PUA、实时保护

3. 端点安全 → 防病毒 → 创建配置文件
   - Microsoft Defender 防病毒排除项
   - 为业务应用程序添加路径/进程/扩展名排除项

4. 设备 → 配置文件 → 创建配置文件
   - 端点保护 → Microsoft Defender Exploit Guard
   - 配置：受控文件夹访问、网络保护
```

### 步骤 8：在 Microsoft 365 Defender 门户中监控

```
仪表板监控：
1. security.microsoft.com → 报告 → 端点
   - 设备健康状况：整个部署范围内的防护状态
   - ASR 规则检测：哪些规则被触发
   - 存在漏洞的设备：缺少安全更新的设备

2. 威胁分析：
   - 活跃威胁活动及 Defender 覆盖情况
   - 推荐的安全操作

3. 高级搜寻（KQL）：
   DeviceEvents
   | where ActionType startswith "Asr"
   | summarize Count=count() by ActionType, FileName
   | sort by Count desc

   DeviceEvents
   | where ActionType == "ControlledFolderAccessViolationBlocked"
   | project Timestamp, DeviceName, FileName, FolderPath
```

## 关键概念

| 术语 | 定义 |
|------|------|
| **ASR 规则** | 攻击面缩减规则，在端点级别阻断特定高风险行为 |
| **受控文件夹访问** | 勒索软件防护功能，防止未授权应用程序修改受保护文件夹中的文件 |
| **网络保护** | 利用 SmartScreen 情报阻断到低信誉或已知恶意域名的出站连接 |
| **漏洞利用防护** | 系统和每个应用程序的内存缓解措施（DEP、ASLR、CFG），防止漏洞利用 |
| **BAFS（首次见即阻断）** | 基于云的零日防护，在允许执行前将可疑文件提交云端分析 |
| **防篡改保护** | 防止对 Defender 安全设置进行未授权更改，即使是本地管理员也不行 |

## 工具与系统

- **Microsoft 365 Defender 门户**：security.microsoft.com，用于集中管理和报告
- **Microsoft Intune**：基于云的端点管理，用于 Defender 策略部署
- **PowerShell（Set-MpPreference）**：本地配置 Defender 设置
- **WDAC（Windows Defender 应用程序控制）**：配套的应用程序控制技术
- **Microsoft Defender for Endpoint API**：用于自动化和自定义集成的 REST API

## 常见误区

- **立即以阻断模式启用所有 ASR 规则**：某些 ASR 规则与合法软件（Office 宏、管理脚本）会产生误报。始终先在审计模式下部署，监控 2-4 周。
- **未配置受控文件夹访问排除项**：备份软件、数据库应用程序和开发工具可能被阻止写入受保护文件夹。提前添加排除项。
- **忽视防篡改保护**：没有防篡改保护，恶意软件或内部人员可通过 PowerShell 或注册表编辑禁用 Defender。通过 M365 Defender 门户启用防篡改保护。
- **同时运行 Defender 和第三方杀毒软件**：存在第三方杀毒软件时，Defender 进入被动模式。确保使用预期的杀毒方案，并适当配置 Defender（如保留第三方杀毒软件则使用仅 EDR 模式）。
- **忽视云连接要求**：云提供的防护和 BAFS 需要端点能够访问 Microsoft 云服务。验证代理/防火墙规则允许 Defender 云流量通过。

