implementing-anti-ransomware-group-policy について
Active Directory 管理者向けに、グループポリシーで Windows 環境を強化し、ランサムウェアの実行と拡散を抑えるセキュリティスキルです。アプリ制御、フォルダー保護、攻撃面削減、横展開の制限を扱い、他の防御策との併用を前提とします。
主な機能
- 01AppLocker または WDAC による実行制限
- 02コントロールされたフォルダーアクセスの有効化
- 03攻撃面削減ルールの設定
- 04SMB、RDP、WMI の制限
- 05GPO 準拠状況の監査と検証
活用シーン
- 01Active Directory ドメインの Windows 端末の強化
- 02ユーザー書き込み可能な場所での不正実行の阻止
- 03ドメイン内でのランサムウェア横展開の抑制
- 04テスト OU での事前検証後にポリシーを展開
インストール
コマンドをコピーしてターミナルで実行します。
$
npx skills add https:/ / github.com/ mukul975/ anthropic-cybersecurity-skills --skill implementing-anti-ransomware-group-policyインストール後、Claude Code で/implementing-anti-ransomware-group-policyを入力して読み込まれたか確認します。
同梱ファイル
SKILL.md と一緒にインストールされる参考資料やスクリプト。
LICENSEreferences/api-reference.mdscripts/agent.py詳細
Anti-Ransomware グループポリシーの実装
使用するタイミング
- ランサムウェアの実行と拡散に対して Windows Active Directory 環境を強化する場合
- グループポリシーによってランサムウェアの実行経路をブロックし、多層防御を実装する場合
- ユーザーが書き込み可能なディレクトリで不正な実行ファイルが実行されないよう、AppLocker または WDAC のルールを構成する場合
- 重要なディレクトリへの不正なファイル変更を防ぐため、コントロールされたフォルダー アクセスを有効にする場合
- ランサムウェアがドメイン全体に拡散する際に使用する横方向移動の経路(RDP、SMB、WMI)を制限する場合
単独のランサムウェア対策としては使用しないでください。 GPO の設定は、エンドポイント検出、バックアップ、ネットワークセグメンテーション、ユーザー教育を補完するものであり、これらに代わるものではありません。
前提条件
- Group Policy Management Console(GPMC)を備えた Windows Server 2016 以降の Active Directory 環境
- ドメイン管理者または グループ ポリシー作成者所有者の権限
- Windows 10/11 Enterprise または Education(AppLocker と WDAC に必要)
- Microsoft Defender ウイルス対策が有効であること(コントロールされたフォルダー アクセスと ASR ルールに必要)
- GPO のコンプライアンスを検証する監査スクリプト用の Python 3.8 以降
- ドメイン全体に展開する前に GPO 設定を検証するためのテスト OU
ワークフロー
ステップ 1: AppLocker で ランサムウェアの実行経路をブロックする
一般的なランサムウェアのステージング先で実行ファイルが実行されないよう、AppLocker を構成します。
AppLocker GPO Path:
Computer Configuration → Policies → Windows Settings →
Security Settings → Application Control Policies → AppLocker
Key Rules:
━━━━━━━━━
1. DENY executable rules for user-writable paths:
- %USERPROFILE%\AppData\Local\Temp\* (email attachment extraction)
- %USERPROFILE%\AppData\Roaming\* (CryptoLocker staging)
- %USERPROFILE%\Downloads\* (web downloads)
- %TEMP%\* (temporary extraction)
- %USERPROFILE%\Desktop\* (social engineering drops)
2. ALLOW default rules:
- C:\Windows\* (signed by Microsoft)
- C:\Program Files\* and C:\Program Files (x86)\*
- Administrator group: all paths
3. Enable Application Identity service:
Computer Configuration → Policies → Windows Settings →
Security Settings → System Services →
Application Identity → Automatic
ステップ 2: コントロールされたフォルダー アクセスを有効にする
重要なディレクトリを不正な変更から保護します。
Controlled Folder Access GPO Path:
Computer Configuration → Administrative Templates →
Windows Components → Microsoft Defender Antivirus →
Microsoft Defender Exploit Guard → Controlled Folder Access
Settings:
━━━━━━━━━
1. Configure Controlled folder access: Enabled → Block mode
2. Configure protected folders: Add custom paths
- \\fileserver\shares\finance
- \\fileserver\shares\hr
- C:\Users\*\Documents
- C:\Users\*\Desktop
3. Configure allowed applications: Whitelist trusted apps
- C:\Program Files\Microsoft Office\*
- C:\Program Files\Adobe\*
- Line-of-business applications
Default protected folders (automatic):
Documents, Pictures, Videos, Music, Desktop, Favorites
ステップ 3: 攻撃面の縮小(ASR)ルールを構成する
ランサムウェアの配布手段を対象とした ASR ルールを有効にします。
ASR Rules GPO Path:
Computer Configuration → Administrative Templates →
Windows Components → Microsoft Defender Antivirus →
Microsoft Defender Exploit Guard → Attack Surface Reduction
Critical ASR Rules for Ransomware Prevention:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
GUID Rule
BE9BA2D9-53EA-4CDC-84E5-9B1EEEE46550 Block executable content from email
D4F940AB-401B-4EFC-AADC-AD5F3C50688A Block Office apps from creating child processes
3B576869-A4EC-4529-8536-B80A7769E899 Block Office apps from creating executable content
75668C1F-73B5-4CF0-BB93-3ECF5CB7CC84 Block Office apps from injecting into processes
D3E037E1-3EB8-44C8-A917-57927947596D Block JavaScript/VBScript from launching downloads
5BEB7EFE-FD9A-4556-801D-275E5FFC04CC Block execution of obfuscated scripts
92E97FA1-2EDF-4476-BDD6-9DD0B4DDDC7B Block Win32 API calls from Office macros
01443614-CD74-433A-B99E-2ECDC07BFC25 Block executable files unless they meet prevalence criteria
Set each rule to: Block (1) or Audit (2) for initial testing
ステップ 4: 横方向移動の経路を制限する
SMB、RDP、WMI をロックダウンし、ランサムウェアの拡散を抑制します。
Network Restrictions:
━━━━━━━━━━━━━━━━━━━━
1. Disable SMBv1:
Computer Configuration → Administrative Templates →
Network → Lanman Workstation → Enable insecure guest logons: Disabled
Computer Configuration → Administrative Templates →
MS Security Guide → Configure SMBv1 server: Disabled
2. Restrict Remote Desktop:
Computer Configuration → Administrative Templates →
Windows Components → Remote Desktop Services →
Remote Desktop Session Host → Connections →
Allow users to connect remotely: Disabled (or restricted to specific groups)
3. Disable remote WMI:
Windows Firewall → Inbound Rules →
Block Windows Management Instrumentation (WMI) inbound
4. Disable AutoPlay/AutoRun:
Computer Configuration → Administrative Templates →
Windows Components → AutoPlay Policies →
Turn off AutoPlay: Enabled (All drives)
5. Disable PowerShell remoting for non-admin users:
Computer Configuration → Administrative Templates →
Windows Components → Windows PowerShell →
Turn on Script Execution: Allow only signed scripts
ステップ 5: GPO のコンプライアンスを監査して検証する
GPO 設定がドメイン全体に正しく適用されていることを確認します。
# Check GPO application on endpoint
gpresult /r /scope:computer
# Verify AppLocker rules
Get-AppLockerPolicy -Effective | Select-Object -ExpandProperty RuleCollections
# Check Controlled Folder Access status
Get-MpPreference | Select-Object EnableControlledFolderAccess
# List protected folders
Get-MpPreference | Select-Object -ExpandProperty ControlledFolderAccessProtectedFolders
# Check ASR rules
Get-MpPreference | Select-Object -ExpandProperty AttackSurfaceReductionRules_Ids
Get-MpPreference | Select-Object -ExpandProperty AttackSurfaceReductionRules_Actions
検証
- テスト用エンドポイントで
gpresult /rを実行し、GPO が適用されていることを確認します %AppData%\Tempから実行ファイルを起動しようとし、AppLocker によってブロックされることを確認します- 許可リストにないアプリケーションから保護されたフォルダー内のファイルを変更し、CFA によってブロックされることを確認します
- マクロ有効ドキュメントを開き、子プロセスがブロックされることを確認して ASR ルールをテストします
- 許可リストに含まれる正規のアプリケーションが引き続き正常に動作することを検証します
- Windows イベント ログで AppLocker のイベント(イベント ID 8003、8004)と CFA のイベント(1123、1124)を確認します
主要な概念
| 用語 | 定義 |
|---|---|
| AppLocker | 発行元、パス、またはハッシュのルールに基づき、ユーザーが実行できる実行ファイル、スクリプト、DLL を制限する Windows のアプリケーション制御機能 |
| コントロールされたフォルダー アクセス | 信頼されていないアプリケーションによる保護対象ディレクトリ内のファイル変更を防ぐ Microsoft Defender の機能 |
| 攻撃面の縮小(ASR) | Office マクロによる子プロセスの生成など、特定の攻撃動作をブロックする Microsoft Defender Exploit Guard のルールセット |
| ソフトウェア制限のポリシー(SRP) | 実行ファイルを制限するレガシーな Windows 機能(Win 11 では非推奨)。AppLocker と WDAC に置き換えられています |
| WDAC | Windows Defender Application Control。コード整合性ポリシーを用いてより強力な強制力を提供する、AppLocker の後継機能 |
ツールとシステム
- Group Policy Management Console(GPMC): Active Directory で GPO を作成および管理するための主要ツール
- AppLocker: 組み込みの Windows アプリケーションのホワイトリスト化およびブラックリスト化エンジン
- Microsoft Defender Exploit Guard: CFA、ASR ルール、ネットワーク保護を含むスイート
- GPResult: エンドポイントで GPO の適用状況を確認するためのコマンドラインツール
- PowerShell Get-MpPreference: ASR と CFA の状態を含む Microsoft Defender の構成を照会するためのコマンドレット
コメント
Markdown 対応