💼 Management Samenvatting
WinRM (Windows extern beheerment) moet worden uitgeschakeld op workstations om het aanvalsoppervlak te verkleinen, tenzij remote PowerShell management een business requirement is.
✓ Windows 11
✓ Workstations
WINRM aanvalsoppervlak: WinRM is Windows implementation van WS-Management protocol voor extern beheerment. RISKS: Remote code execution capability via PowerShell remoting, Lateral movement vector (attackers gebruiken WinRM voor spreading), Diefstal van inloggegevens risk (basic auth over HTTP is plaintext), Open network port (5985 HTTP, 5986 HTTPS). ATTACK SCENARIOS: Attacker compromises één account → gebruikt WinRM to execute commands op other machines → Lateral movement over network → Domain-wide compromise. LEGITIMATE USE: IT admins need WinRM voor: Intune management agent (Deze gebruikt HTTPS), PowerShell remoting voor scripting, SCCM/extern beheerment. WORKSTATION vs SERVER: WORKSTATIONS: zelden need INBOUND WinRM (users don't beheren other machines), Can Schakel uit safely (Intune gebruikt alternative channels), SERVERS: vaak need WinRM voor management (especially domain controllers), kan niet Schakel uit zonder careful planning. aanbevolen APPROACH: Schakel uit op workstations, Schakel in alleen op servers die need extern beheerment, gebruiken HTTPS instead of HTTP (port 5986 instead of 5985), Restrict via firewall to authorized admin workstations only.
Connection:
Registry / ServiceRequired Modules:
Implementatie
Schakel uit WinRM automatische configuratie via: Registry: HKLM:\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service\AllowAutoConfig is 0. ALTERNATIVE: Schakel uit WinRM service entirely: Set-Service WinRM -StartupType Disabled. EFFECT: Inbound PowerShell remoting BLOCKED, Other machines kan niet connect to Deze machine via WinRM, Local PowerShell nog steeds works (no remoting), Intune management NIET affected (uses alternative protocols). IMPORTANT: Dit disabled alleen INBOUND WinRM. Machine can nog steeds connect OUTBOUND to other WinRM endpoints (voor admin tasks).
Vereisten
- Windows 10/11 workstations
- Verify: No business processes depend op inbound WinRM to workstations
- Intune management: gebruikt alternative protocols (not affected)
- Alternative: Cloud-gebaseerde management (Intune) instead of on-prem WinRM
Implementatie
Gebruik PowerShell-script allow-remote-server-management-through-winrm-is-set-to-disabled.ps1 (functie Invoke-Remediation) – Schakel uit WinRM auto-config.
Intune: Settings catalog → WinRM Service AutoConfig is Disabled. toepassen to workstations ONLY.
Monitoring
Gebruik PowerShell-script allow-remote-server-management-through-winrm-is-set-to-disabled.ps1 (functie Invoke-Monitoring) – Verifieer WinRM disabled op workstations.
Monitor: WinRM service status, netwerkverbindings op ports 5985/5986 (zou moeten zijn nul op workstations)
Compliance en Auditing
- CIS Windows Benchmark - Minimize aanvalsoppervlak
- BIO 12.06 - kwetsbaarheidsbeheer
- ISO 27001 A.12.6.1
Remediatie
Gebruik PowerShell-script allow-remote-server-management-through-winrm-is-set-to-disabled.ps1 (functie Invoke-Remediation) – Herstellen.
Compliance & Frameworks
- CIS M365: Control Windows Hardening (L1) - WinRM disabled op workstations
- BIO: 12.06.01 - aanvalsoppervlak reduction
- ISO 27001:2022: A.12.6.1 - Management of technical vulnerabilities
Automation
Gebruik het onderstaande PowerShell script om deze security control te monitoren en te implementeren. Het script bevat functies voor zowel monitoring (-Monitoring) als remediation (-Remediation).
Risico zonder implementatie
Management Samenvatting
Schakel uit WinRM op workstations (not servers). voorkomt lateral movement attacks. Intune nog steeds works (alternative protocols). toepassen to workstations only. Implementatie: 4-6 uur.
- Implementatietijd: 6 uur
- FTE required: 0.05 FTE