Skip to content

Automated Windows 10/11 security hardening PowerShell script implementing defence-in-depth controls based on NIST, CIS, and Microsoft security baselines. Features include advanced firewall rules, ASR deployment, BitLocker enforcement, network protocol lockdown, exploit mitigation, and rollback-safe operations for enterprise or standalone deployment

License

Notifications You must be signed in to change notification settings

Br3thren-Org/Windows-Device-Hardener

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

10 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Windows Endpoint Hardener

Version License PowerShell Bash

Comprehensive security hardening scripts for Windows endpoints implementing CISA/NSA compliance standards

Enterprise-grade security hardening solutions that automate the implementation of defense-in-depth security controls across Windows 10/11 systems. Built for government agencies, security professionals, and organizations requiring high-security baseline configurations.


🎯 Features

Windows Endpoint Hardener (v2.2.0)

  • βœ… Three Security Levels: Quick (30 min), Standard (60 min), Maximum (60+ min)
  • βœ… Pre-Flight Validation: Automatic compatibility checks before execution
  • βœ… Real-Time Progress Tracking: Visual progress indicators with percentage completion
  • βœ… Compliance Reporting: Automated JSON + HTML compliance reports with scoring
  • βœ… Enterprise Deployment: Intune/SCCM/RMM ready with silent execution
  • βœ… Idempotent Design: Safe to run multiple times without breaking system
  • βœ… Comprehensive Backup: Automatic backup before all changes with rollback capability
  • βœ… 150+ Security Controls: Complete CISA/NSA hardening baseline

πŸš€ Quick Start

Windows

# Download the script
git clone https://github.com/yourusername/endpoint-hardener.git
cd endpoint-hardener

# Run as Administrator - Standard hardening
.\Windows-Endpoint-Hardener-Complete.ps1 -SecurityLevel Standard

# Preview mode (see changes without applying)
.\Windows-Endpoint-Hardener-Complete.ps1 -Preview -SecurityLevel Quick

# Generate compliance report
.\Windows-Endpoint-Hardener-Complete.ps1 -SecurityLevel Maximum -ComplianceReport

πŸ“‹ Security Controls Implemented

Windows Security Domains

Domain Controls Description
Windows Defender Real-time protection, ASR rules, tamper protection, cloud protection, PUA protection Complete endpoint protection configuration
Firewall Profile hardening, logging, rule management Network perimeter security
Network Security LLMNR, NetBIOS, SMB, WinRM, NTLM hardening Protocol-level attack prevention
Credential Protection LSA Protection, Credential Guard, WDigest disable Credential theft mitigation
BitLocker Full disk encryption with TPM/recovery password Data at rest protection
TLS/SSL Disable weak protocols (SSL 2/3, TLS 1.0/1.1), enable TLS 1.2/1.3 Transport security
Audit Policy Complete CISA/NSA audit logging Security monitoring
UAC Advanced User Account Control with STIG compliance Privilege escalation prevention
Services Disable 15+ dangerous services per CISA guidance Attack surface reduction
Boot Security Secure Boot, TPM validation, HVCI, VBS Firmware-level security
Certificate/PKI Weak hash algorithm disable, certificate validation PKI security
Exploit Protection DEP, SEHOP, CFG, ASLR, control flow guard Memory corruption prevention
PowerShell Script block logging, module logging, transcription, PSv2 removal PowerShell security
RDP NLA, security layer, encryption Remote access security
Print Spooler Point and Print restrictions, RPC security PrintNightmare mitigation
DMA Protection Kernel DMA protection, Thunderbolt disable DMA attack prevention
AppLocker Application whitelisting baseline Application control
Windows Update Automatic updates, Microsoft Update Patch management

πŸ“Š Security Levels Explained

Quick Level (15-30 minutes)

Use Case: Immediate security improvement, time-sensitive deployments

Windows: ~30 operations covering firewall, basic Defender, ASR core, TLS basics, basic audit, basic UAC

Standard Level (30-60 minutes)

Use Case: Recommended for most production environments

Windows: ~80 operations including all Quick controls plus LSA Protection, SMB/RDP/NTLM hardening, network protocols, PowerShell security, Print Spooler hardening

Maximum Level (60+ minutes)

Use Case: High-security environments, government/military, compliance requirements

Windows: ~150 operations - complete CISA/NSA baseline including boot security, certificate security, HVCI, Credential Guard, DMA protection, AppLocker, advanced network hardening


πŸ”§ Requirements

Windows

  • βœ… Windows 10 or Windows 11 (build 14393+)
  • βœ… PowerShell 5.1 or later
  • βœ… Administrator privileges
  • βœ… 1GB+ free disk space
  • ⚠️ Windows Professional, Enterprise, or Education edition recommended (some features unavailable on Home)

πŸ“– Usage Examples

Windows

Enterprise Deployment

# Silent execution for RMM tools
.\Windows-Endpoint-Hardener-Complete.ps1 -SecurityLevel Standard -EnterpriseMode -Silent

# Domain-joined systems with compliance report
.\Windows-Endpoint-Hardener-Complete.ps1 -SecurityLevel Maximum -EnterpriseMode -ComplianceReport

# Standalone workstation
.\Windows-Endpoint-Hardener-Complete.ps1 -SecurityLevel Standard -StandaloneMode

Rollback

# Restore from most recent backup
.\Windows-Endpoint-Hardener-Complete.ps1 -RollbackMode

Custom Configuration

# Use custom ASR rules
.\Windows-Endpoint-Hardener-Complete.ps1 -ASRRules "guid1,guid2,guid3"

# Disable IPv6
.\Windows-Endpoint-Hardener-Complete.ps1 -SecurityLevel Maximum -DisableIPv6

# Custom exploit protection XML
.\Windows-Endpoint-Hardener-Complete.ps1 -ExploitProtectionXml "C:\config\exploit-protection.xml"

πŸ“‚ Output & Logs

Windows

  • Logs: C:\HardeningLogs\
  • Transcripts: C:\HardeningLogs\Transcript-YYYYMMDD-HHmmss.log
  • Compliance Reports: C:\HardeningLogs\ComplianceReport-YYYYMMDD-HHmmss.json|.html
  • Backups: C:\HardeningBackup\YYYYMMDD-HHmmss\

πŸ”„ Exit Codes

Code Meaning Action
0 Success, no reboot required Continue operations
1 Errors encountered Review logs
3010 Success, reboot required Schedule system reboot
3011 Rollback completed Verify system state
1601 Invalid parameters Check command syntax
1603 Incompatible system Verify requirements

πŸ›‘οΈ Security Considerations

Testing Required

⚠️ ALWAYS test in a non-production environment first!

These scripts make significant system changes that can affect:

  • Network connectivity
  • Application compatibility
  • Remote access capabilities
  • System performance

Backup Strategy

  • Scripts automatically create backups before changes
  • Manual VM snapshots recommended for critical systems
  • Test rollback procedures before production deployment

Known Impacts

Windows:

  • Maximum level may disable legacy protocols (SMBv1, TLS 1.0/1.1)
  • Some applications may require exceptions in AppLocker/Controlled Folder Access
  • Remote management tools may need reconfiguration

πŸ“Š Compliance & Standards

Frameworks Covered

  • βœ… CISA/NSA Security Guidelines
  • βœ… CIS Benchmarks (Level 1 & 2)
  • βœ… NIST Cybersecurity Framework
  • βœ… DISA STIGs (Security Technical Implementation Guides)
  • βœ… PCI DSS (Payment Card Industry Data Security Standard)
  • βœ… HIPAA (Health Insurance Portability and Accountability Act)
  • βœ… ISO 27001/27002 (Information Security Management)

Compliance Reporting (Windows v2.2.0)

The Windows script generates comprehensive compliance reports including:

  • Security posture assessment (13 checks across 6 categories)
  • Compliance scoring (0-100% with ratings)
  • Detailed findings by security control
  • Actionable recommendations
  • Dual format: JSON (automation) + HTML (executive review)

πŸ” What's New

Version 2.2.0 (Windows - 2025-10-27)

  • ✨ Pre-flight system compatibility checks
  • ✨ Real-time progress tracking with percentage
  • ✨ Enhanced compliance reporting (JSON + HTML)
  • ✨ Improved error handling (PSScriptAnalyzer compliant)
  • ✨ Better initialization with visual separators
  • πŸ› Fixed null comparison warnings
  • πŸ› Enhanced reboot detection (added CBS check)

Version 2.1.0 (Windows)

  • Unified script (all CISA/NSA modules integrated)
  • Three security levels (Quick/Standard/Maximum)
  • Enterprise and Standalone modes

🀝 Contributing

Contributions are welcome! Please read CONTRIBUTING.md for details on:

  • Code of conduct
  • Development process
  • How to submit pull requests
  • Coding standards

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


⚠️ Disclaimer

USE AT YOUR OWN RISK

This software is provided "as is" without warranty of any kind. The authors are not responsible for any damage or data loss that may result from using these scripts. Always:

  1. Test thoroughly in non-production environments
  2. Create complete system backups before execution
  3. Review all changes in preview mode first
  4. Understand the security controls being implemented
  5. Have a rollback plan ready

These scripts are designed for security professionals and system administrators who understand the implications of system hardening.


πŸ“ž Support


πŸ™ Acknowledgments

  • CISA/NSA for comprehensive security guidelines
  • Microsoft Security Team for Windows hardening best practices
  • CIS Benchmarks authors
  • DISA STIG contributors

πŸ“š Additional Resources


Made with ❀️ for security professionals worldwide

About

Automated Windows 10/11 security hardening PowerShell script implementing defence-in-depth controls based on NIST, CIS, and Microsoft security baselines. Features include advanced firewall rules, ASR deployment, BitLocker enforcement, network protocol lockdown, exploit mitigation, and rollback-safe operations for enterprise or standalone deployment

Topics

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published