mcpField
H
hardening-windows-endpoint-with-cis-benchmark

hardening-windows-endpoint-with-cis-benchmark

github.com/mukul975安全35.2k108 次安装8 周前更新
代码仓库

关于 hardening-windows-endpoint-with-cis-benchmark

用于依据 CIS Benchmark 加固 Windows 10/11 和 Server 2019/2022 终端的安全技能。内容包括选择 Level 1 或 Level 2、部署 GPO 基线、评估合规性、记录例外并持续监测。

主要功能

  1. 01选择 CIS Level 1 或 Level 2 配置
  2. 02部署 GPO 基线
  3. 03使用 CIS-CAT 评估合规性
  4. 04记录例外及补偿控制
  5. 05安排定期合规扫描

适用场景

  1. 01建立 Windows 终端安全基线
  2. 02修复 CIS 审计发现
  3. 03依据 CIS 验证终端配置
  4. 04持续监测合规偏移

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/mukul975/anthropic-cybersecurity-skills --skill hardening-windows-endpoint-with-cis-benchmark

安装后在 Claude Code 中输入/hardening-windows-endpoint-with-cis-benchmark确认已加载。

包含的文件

除 SKILL.md 外,安装时一起下载的参考资料和脚本。

LICENSE
assets/
template.md
references/
api-reference.md
standards.md
workflows.md
scripts/
agent.py
process.py

详细介绍

使用 CIS Benchmark 强化 Windows 端点

何时使用

在以下情况下使用此技能:

  • 部署需要安全强化的全新 Windows 10/11 或 Server 2019/2022 端点
  • 使用 CIS Level 1 或 Level 2 配置文件建立组织范围的安全基线
  • 修复合规审计(PCI DSS、HIPAA、SOC 2)中引用 CIS benchmarks 的发现项
  • 根据当前 CIS benchmark 版本验证现有端点配置

请勿使用此技能处理 Linux 端点(请使用 hardening-linux-endpoint-with-cis-benchmark),或处理需要 CIS 云 benchmarks 的云原生工作负载。

先决条件

  • Windows 10/11 Enterprise 或 Windows Server 2019/2022 目标端点
  • 用于企业部署的 Active Directory 组策略管理控制台(GPMC)
  • 用于自动化 benchmark 评估的 CIS-CAT Pro Assessor 或 CIS-CAT Lite
  • 对目标端点或域控制器的管理访问权限
  • 目标 Windows 版本的当前 CIS Benchmark PDF(从 cisecurity.org 下载)

工作流

步骤 1:选择 CIS Benchmark 配置文件级别

CIS 为 Windows 端点提供两个配置文件级别:

Level 1 (L1) - 企业/公司环境:

  • 可应用于大多数组织的实用强化设置
  • 对功能和用户体验影响最小
  • 涵盖:密码策略、审核策略、用户权限、安全选项、Windows Firewall

Level 2 (L2) - 高安全/敏感数据:

  • 包含所有 L1 设置以及额外限制
  • 可能影响可用性(禁用自动运行、限制远程桌面、增强审核日志记录)
  • 适用于处理 PII、PHI、PCI 数据或机密信息的系统

根据端点的数据分类和风险承受能力选择配置文件。

步骤 2:导入 CIS GPO 基线

CIS 为每个 benchmark 版本提供预构建的 GPO 模板(Build Kits):

# Download CIS Build Kit from CIS WorkBench (requires CIS SecureSuite membership)
# Extract the GPO backup to a staging directory

# Import the CIS GPO into Active Directory
Import-GPO -BackupGpoName "CIS Microsoft Windows 11 Enterprise v3.0.0 L1" `
  -TargetName "CIS-Win11-L1-Baseline" `
  -Path "C:\CIS-GPO-Backups\Win11-Enterprise" `
  -CreateIfNeeded

# Link GPO to target OU
New-GPLink -Name "CIS-Win11-L1-Baseline" `
  -Target "OU=Workstations,DC=corp,DC=example,DC=com" `
  -LinkEnabled Yes
步骤 3:应用关键 CIS Benchmark 类别

账户策略(第 1 节):

Password Policy:
  - Minimum password length: 14 characters (1.1.4)
  - Maximum password age: 365 days (1.1.3)
  - Password complexity: Enabled (1.1.5)
  - Store passwords using reversible encryption: Disabled (1.1.6)

Account Lockout Policy:
  - Account lockout threshold: 5 invalid logon attempts (1.2.1)
  - Account lockout duration: 15 minutes (1.2.2)
  - Reset account lockout counter after: 15 minutes (1.2.3)

本地策略 - 审核策略(第 17 节):

Audit Policy Configuration:
  - Audit Credential Validation: Success and Failure (17.1.1)
  - Audit Security Group Management: Success (17.2.5)
  - Audit Logon: Success and Failure (17.5.1)
  - Audit Process Creation: Success (17.6.1)
  - Audit Removable Storage: Success and Failure (17.6.4)

安全选项(第 2.3 节):

  - Interactive logon: Do not display last user name: Enabled (2.3.7.1)
  - Interactive logon: Machine inactivity limit: 900 seconds (2.3.7.3)
  - Network access: Do not allow anonymous enumeration of SAM accounts: Enabled (2.3.10.2)
  - Network security: LAN Manager authentication level: Send NTLMv2 response only (2.3.11.7)
  - UAC: Run all administrators in Admin Approval Mode: Enabled (2.3.17.6)

Windows Firewall(第 9 节):

  - Domain Profile: Firewall state: On (9.1.1)
  - Domain Profile: Inbound connections: Block (9.1.2)
  - Private Profile: Firewall state: On (9.2.1)
  - Public Profile: Firewall state: On (9.3.1)
  - Public Profile: Inbound connections: Block (9.3.2)
步骤 4:使用 CIS-CAT 评估进行验证
# Run CIS-CAT Pro Assessor against target endpoint
# CIS-CAT produces an HTML/XML report with pass/fail per recommendation

.\Assessor-CLI.bat `
  -b "benchmarks\CIS_Microsoft_Windows_11_Enterprise_Benchmark_v3.0.0-xccdf.xml" `
  -p "Level 1 (L1) - Corporate/Enterprise Environment" `
  -rd "C:\CIS-Reports" `
  -nts

# Review report for failed controls
# Score target: 95%+ for L1, 90%+ for L2 (due to operational exceptions)
步骤 5:记录例外和补偿性控制措施

对于每一项无法应用的 CIS 建议:

  1. 记录具体建议 ID 和标题
  2. 说明例外的业务理由
  3. 定义用于处理剩余风险的补偿性控制措施
  4. 设置复查日期(每季度)以重新评估该例外
  5. 获得信息安全官的签字批准

示例例外:

Recommendation: 2.3.7.3 - Interactive logon: Machine inactivity limit: 900 seconds
Exception: Kiosk systems in manufacturing floor require 1800 seconds
Compensating Control: Physical badge-access to manufacturing area, CCTV monitoring
Review Date: 2026-06-01
Approved By: CISO
步骤 6:持续合规监控

通过计划任务或 SCCM 配置定期 CIS-CAT 扫描:

# Create scheduled task for weekly CIS-CAT assessment
$action = New-ScheduledTaskAction -Execute "C:\CIS-CAT\Assessor-CLI.bat" `
  -Argument "-b benchmarks\CIS_Win11_v3.0.0-xccdf.xml -p Level1 -rd C:\CIS-Reports -nts"
$trigger = New-ScheduledTaskTrigger -Weekly -DaysOfWeek Sunday -At 2am
$principal = New-ScheduledTaskPrincipal -UserId "SYSTEM" -RunLevel Highest
Register-ScheduledTask -TaskName "CIS-Benchmark-Scan" -Action $action `
  -Trigger $trigger -Principal $principal

将结果输入 SIEM,用于漂移检测和仪表板报告。

关键概念

术语定义
CIS Benchmark由 CIS 在政府、行业和学术界参与下制定的基于共识的安全配置指南
Level 1 Profile适用于大多数组织且运营影响最小的实用安全基线
Level 2 Profile适用于高安全环境的扩展安全基线,可能会降低功能
CIS-CATCIS Configuration Assessment Tool,可自动化进行 benchmark 合规检查
Build Kit由 CIS 提供的预配置 GPO 模板,用于实施 benchmark 建议
ScoringCIS 建议分为 Scored(可衡量合规性)或 Not Scored(最佳实践指导)

工具与系统

  • CIS-CAT Pro Assessor:自动化基准合规扫描器(需要 CIS SecureSuite 许可证)
  • Microsoft Security Compliance Toolkit (SCT):Microsoft 自有的 GPO 基线(与 CIS 互补)
  • Group Policy Management Console (GPMC):企业级 GPO 部署与管理
  • LGPO.exe:Microsoft 工具,用于将 GPO 应用到独立(非域)系统
  • Nessus/Tenable:带有 CIS 基准审计文件的漏洞扫描器

常见陷阱

  • 对所有终端应用 L2:Level 2 限制(禁用自动播放、限制远程桌面)会破坏标准工作站上的工作流。请将 L2 保留给处理敏感数据的终端。
  • 未在试点 OU 中测试 GPO:在全组织范围推广之前,先将 CIS GPO 部署到具有代表性硬件/软件的测试 OU,以避免破坏业务线应用程序。
  • 忽视 CIS 基准版本更新:CIS 基准会随每个 Windows 功能版本更新。运行过时的基准会遗漏新的安全设置并生成错误的合规报告。
  • 遗忘本地管理员账户:CIS 基准假定终端已加入域。独立系统需要 LGPO.exe 或 Microsoft Intune 来强制执行基线。
  • 没有例外流程:100% 应用 CIS 建议几乎不可行。如果没有正式的例外流程,团队要么忽视加固,要么破坏应用程序。

评论

支持 Markdown