Windows Hardening
Windows is the dominant OS in enterprise environments, which makes it the dominant target. Active Directory, SMB, RDP, DCOM, WMI, these are all powerful features that also happen to be the bread and butter of how attackers move through corporate networks. Hardening Windows, whether it’s a workstation, a server, or a domain controller, is about systematically closing those doors. This page covers the practical steps, what to actually configure, and the tools to help you do it.Start with Microsoft’s Security Baselines
Microsoft publishes Security Baselines - Group Policy templates with their recommended security configurations for each Windows version. These are free and are the official starting point:- Download from the Microsoft Security Compliance Toolkit
- Baselines exist for Windows 10, Windows 11, Windows Server 2019, 2022, and Microsoft 365 Apps
Account and Authentication Hardening
Local Account Policies
Opensecpol.msc (Local Security Policy) or configure via Group Policy:
Account Policies > Password Policy:
- Minimum password length: 14+ characters
- Maximum password age: 90 days (or never, if using MFA)
- Password history: 24
- Complexity requirements: Enabled
- Account lockout threshold: 5 invalid attempts
- Lockout duration: 15 minutes
- Reset lockout counter after: 15 minutes
Disable the Built-in Administrator Account
The defaultAdministrator account with a well-known SID (S-1-5-21-…-500) is a consistent attack target:
Disable the Guest Account
Local Administrator Password Solution (LAPS)
In domain environments, every machine having the same local admin password is a massive lateral movement risk. Microsoft LAPS (or the newer Windows LAPS built into Windows Server 2022/Windows 11) generates unique, random, rotated passwords for local admin accounts:Windows Defender and Antivirus
On modern Windows, Microsoft Defender is actually quite solid - but its default configuration can be improved:Remote Desktop Protocol (RDP)
RDP is one of the most attacked services on Windows - ransomware gangs love it. If you must use RDP:- Enable Network Level Authentication (NLA) -
Computer Config > Admin Templates > Windows Components > Remote Desktop Services > Require NLA - Set maximum session time limits
- Use Remote Desktop Gateway instead of direct RDP exposure
- Consider changing the default port (3389) - not a security control, but reduces automated scanning noise
Windows Firewall
Windows Firewall with Advanced Security is actually capable - it’s just rarely configured well.SMB Hardening
SMB is the protocol behind Windows file sharing and a common attack vector (EternalBlue, lateral movement, credential relay).Disabling Unnecessary Services and Features
Windows Features to Remove
PowerShell Security
PowerShell is both essential and one of the most abused tools by attackers. Harden it without breaking legitimate use:Credential Protection
Enable Credential Guard
Credential Guard uses virtualization-based security to protect LSASS credentials, preventing tools like Mimikatz from dumping them:Disable NTLM Where Possible
NTLM is an older authentication protocol that’s frequently abused for relay attacks. Where Kerberos can be used, it should be:Disable WDigest Authentication
WDigest stores plaintext credentials in memory - it shouldn’t be enabled on modern Windows, but sometimes gets re-enabled:Windows Event Logging
Default Windows logging is insufficient for any meaningful detection or forensics. You need to increase log sizes and enable additional audit policies.Audit Policy
Increase Log Sizes
Default Windows log sizes are way too small for any real environment:Enable Sysmon
Sysmon (System Monitor) from Sysinternals is a free tool that dramatically improves Windows visibility. It logs process creation, network connections, file creation, and more with much more detail than native audit logging:AppLocker and Windows Defender Application Control (WDAC)
Control which applications are allowed to run - one of the most effective defenses against malware and ransomware. AppLocker (older, easier to configure):- Available in Enterprise/Education editions
- Configure via Group Policy:
Computer Config > Windows Settings > Security Settings > Application Control Policies > AppLocker - Start in Audit mode to understand what would be blocked before enforcing
- Works at the kernel level, harder to bypass than AppLocker
- Managed via Group Policy or Intune
- Microsoft provides a WDAC Wizard to help build policies
Windows Update and Patch Management
Useful Tools
Active Directory Specific Hardening
If you’re hardening in a domain environment, AD hardening deserves its own attention:- Tier model - Separate admin accounts by tier (T0: Domain Controllers, T1: Servers, T2: Workstations). Never use the same account across tiers.
- Protected Users group - Add sensitive accounts to the Protected Users security group to restrict credential caching and weak auth
- Disable unconstrained delegation - Extremely dangerous. Audit with:
Get-ADComputer -Filter {TrustedForDelegation -eq $true} - Review AdminSDHolder - Controls ACLs on privileged accounts
- Monitor Kerberoastable accounts - Service accounts with SPNs and weak passwords:
Get-ADUser -Filter {ServicePrincipalName -ne "$null"} - Run Pingcastle or BloodHound - These tools specifically find AD attack paths
Reference
- Microsoft Security Baselines
- CIS Windows Benchmark
- DISA STIG for Windows
- Sysmon + SwiftOnSecurity config
- Pingcastle AD Audit
Windows hardening in enterprise environments is a team sport. Most of it happens through Group Policy and requires coordination between IT and security. Start with the Microsoft Security Baselines and work outward from there.
