Skip to content
advanced Phase 4 · Linux and Windows Security Administration

Windows Group Policy Hardening

Enforce password, audit, and endpoint settings centrally via GPO.

55m
0 problems
Topic Progress 0%

Windows Group Policy Hardening: Core Concepts

Windows Group Policy Hardening: Core Concepts

In a Windows domain, configuring security settings on each machine individually is impossible at scale. Group Policy Objects (GPOs) solve this by providing a centralized mechanism to enforce security configurations across thousands of computers and users from a single management point.

The GPO Architecture

A GPO is a collection of settings that define how a computer or user should be configured. GPOs are stored in two locations:

  • Group Policy Container (GPC) — Stored in Active Directory, contains the GPO's attributes and version information.
  • Group Policy Template (GPT) — Stored in the SYSVOL share on domain controllers, contains the actual settings, scripts, and administrative templates.

When a GPO is linked to an Organizational Unit (OU), site, or domain, the settings apply to all users and computers within that scope. Group Policy replicates across all domain controllers via the File Replication Service (FRS) or Distributed File System Replication (DFSR).

Processing Order: LSDOU

When multiple GPOs apply to a computer or user, they are processed in a specific order:

  1. Local — The local GPO on the machine itself
  2. Site — GPOs linked to the site
  3. Domain — GPOs linked to the domain
  4. OU — GPOs linked to the Organizational Unit (processed parent to child)

Later GPOs override earlier ones when there is a conflict. This means an OU-level GPO can override a domain-level GPO, which can override the local GPO. The gpresult /r command shows which GPOs applied and which won.

Key Security Settings

Password Policy (found in Computer Configuration → Policies → Windows Settings → Security Settings → Account Policies → Password Policy):

  • Enforce password history — Prevents reuse of recent passwords (recommend 24)
  • Maximum password age — Forces periodic password changes (recommend 60-90 days)
  • Minimum password age — Prevents immediate password changes to bypass history (recommend 1 day)
  • Minimum password length — Enforces complexity (recommend 14+ characters)
  • Password must meet complexity requirements — Requires uppercase, lowercase, digit, and special character

Account Lockout Policy:

  • Account lockout threshold — Number of failed attempts before lockout (recommend 5)
  • Account lockout duration — How long the account stays locked (recommend 30 minutes)
  • Reset account lockout counter after — Time window for counting failures (recommend 30 minutes)

Audit Policy (Computer Configuration → Policies → Windows Settings → Security Settings → Advanced Audit Policy Configuration):

  • Audit account logon events
  • Audit account management
  • Audit logon events
  • Audit object access
  • Audit policy change
  • Audit privilege use
  • Audit process tracking
  • Audit system events

Software Restriction Policies / AppLocker:

Control which applications can run on a system:

  • Allow only approved software (whitelisting)
  • Block known malicious executables
  • Restrict software by path, hash, or publisher certificate

Where It Fits

Group Policy is the enforcement mechanism for Windows security baselines. It works alongside Active Directory (which provides the identity and organizational structure) and complements host-level controls like Windows Defender and BitLocker. Study Active Directory Fundamentals first to understand the domain structure that GPOs depend on.

Windows Group Policy Hardening: Practice

Windows Group Policy Hardening: Practice

Group Policy changes affect every computer and user in the linked scope. A mistake can lock out administrators or disable critical services. The exercises below follow a methodical approach to implementing and verifying GPO changes.

Exercise 1: Configure Password and Lockout Policies

Open the Group Policy Management Console (gpmc.msc) and create a new GPO:

1. Right-click the target OU → "Create a GPO in this domain, and Link it here..."
2. Name: "Security Baseline - Password Policy"
3. Edit the GPO:
   Navigate to: Computer Configuration → Policies → Windows Settings →
                Security Settings → Account Policies → Password Policy

4. Configure:
   - Enforce password history: 24 passwords remembered
   - Maximum password age: 60 days
   - Minimum password age: 1 day
   - Minimum password length: 14 characters
   - Password must meet complexity requirements: Enabled
   - Store passwords using reversible encryption: Disabled

5. Navigate to: Account Policies → Account Lockout Policy
   - Account lockout threshold: 5 invalid logon attempts
   - Account lockout duration: 30 minutes
   - Reset account lockout counter after: 30 minutes

Force a Group Policy update and verify:

# On a target computer, force GP update
gpupdate /force

# Verify the applied policy
gpresult /r

# Check specific password policy settings
net accounts

Exercise 2: Enable Advanced Auditing

1. Edit the GPO: "Security Baseline - Audit Policy"
   Navigate to: Computer Configuration → Policies → Windows Settings →
                Security Settings → Advanced Audit Policy Configuration →
                Audit Policies

2. Configure:
   - Audit Account Logon Events: Success and Failure
   - Audit Account Management: Success and Failure
   - Audit Logon Events: Success and Failure
   - Audit Object Access: Success and Failure
   - Audit Policy Change: Success and Failure
   - Audit Privilege Use: Failure
   - Audit Process Tracking: Success and Failure
   - Audit System Events: Success and Failure

Verify auditing is working:

# Check audit policy
auditpol /get /category:*

# Generate a test event and check the Security log
wevtutil qe Security /c:5 /rd:true /f:text

Exercise 3: Deploy Software Restriction via AppLocker

1. Edit the GPO: "Security Baseline - AppLocker"
   Navigate to: Computer Configuration → Policies → Windows Settings →
                Security Settings → Application Control Policies → AppLocker

2. Create Executable Rules:
   - Default rule: Allow everyone to run files in Program Files
   - Default rule: Allow everyone to run files in Windows
   - Custom rule: Deny everyone from running executables in %TEMP%

3. Set AppLocker to Enforce rules (not just Audit)

Test by attempting to run an executable from a blocked location.

Check Your Understanding

  • Why does the LSDOU processing order matter when multiple GPOs conflict?
  • What happens if you set "Minimum password age" to 0 days?
  • How do you verify which GPOs actually applied to a computer?

Windows Group Policy Hardening: Trade-offs and Interviews

Windows Group Policy Hardening: Trade-offs and Interviews

Group Policy is powerful but introduces complexity that can create operational problems. Understanding the trade-offs is essential for designing maintainable security policies.

The Complexity Problem

In large environments, hundreds of GPOs may apply to a single computer. Troubleshooting why a particular setting is applied (or not applied) becomes difficult. The gpresult /h report.html command generates a comprehensive HTML report showing all applied GPOs, but interpreting it requires experience.

Best practices to manage complexity:

  • Use a naming convention that includes the purpose, target, and version (e.g., SEC-PasswordPolicy-v2.0)
  • Document every GPO with a description of its purpose and the settings it contains
  • Minimize the number of GPOs — consolidate related settings into fewer GPOs
  • Use WMI filtering and security filtering to target GPOs precisely rather than linking broadly and blocking

When Group Policy Is the Wrong Tool

  • Standalone (non-domain) computers: Group Policy requires Active Directory. For standalone machines, use Local Group Policy (gpedit.msc) or PowerShell Desired State Configuration (DSC).
  • Cloud-managed environments: In Azure AD / Intune environments, many traditional GPO settings are replaced by Intune configuration profiles. While Group Policy still works for hybrid-joined machines, cloud-native management is the direction Microsoft is moving.
  • Application-specific configuration: GPO is designed for OS and security settings. Application-specific configuration (e.g., database connection strings) should be managed through application deployment tools or configuration management systems.

Security Risks of Group Policy

  • GPO delegation: If an attacker gains permission to edit GPOs, they can push malicious settings to every computer in the domain. Protect GPO editing permissions carefully.
  • SYSVOL exposure: GPO settings are stored in SYSVOL, which is readable by all domain users. Never store sensitive data (passwords, keys) in GPOs.
  • Stale GPOs: Old GPOs that are no longer needed but still linked can contain outdated or insecure settings. Regularly audit and clean up GPOs.

How This Comes Up in Interviews

  • "How do you enforce a password policy across 10,000 computers?" Create a GPO with the password policy settings, link it to the appropriate OU, and use gpupdate /force to apply immediately. Verify with gpresult /r.
  • "A user says they cannot run a legitimate application after a GPO change. How do you troubleshoot?" Run gpresult /h report.html to see which GPOs applied, check if AppLocker or Software Restriction Policies are blocking the application, and verify the user's OU membership.
  • "How do you secure Group Policy itself?" Delegate GPO editing permissions to a small group of trusted administrators, audit GPO changes with Advanced Audit Policy, and regularly review GPO settings against a security baseline.

Practice Problems

0 / 2 solved

Solution
1. Open gpmc.msc, right-click the Workstations OU, create a GPO named "SEC-PasswordPolicy"
2. Edit the GPO and navigate to Computer Configuration → Policies → Windows Settings → Security Settings → Account Policies → Password Policy
3. Set: Enforce password history = 24, Maximum password age = 60, Minimum password age = 1, Minimum password length = 14, Complexity requirements = Enabled, Reversible encryption = Disabled
4. Navigate to Account Lockout Policy: Lockout threshold = 5, Lockout duration = 30 minutes, Reset counter = 30 minutes
5. Run gpupdate /force on a test computer and verify with gpresult /r and net accounts

Solution
14 characters. GPOs are processed in LSDOU order (Local, Site, Domain, OU), and later GPOs override earlier ones. The OU-level GPO is processed after the domain-level GPO, so its setting wins.

Quiz

1. What is the correct order of Group Policy processing (LSDOU)?

Question 1 options

2. What does 'Enforce password history: 24' accomplish?

Question 2 options

3. Which command shows which GPOs applied to a computer and which won in conflicts?

Question 3 options

4. Why should you never store passwords or encryption keys in a GPO?

Question 4 options

Flashcards

Question

What does LSDOU stand for in Group Policy processing?

Answer

Local, Site, Domain, OU — the order in which GPOs are processed. Later GPOs override earlier ones.

Question

What are the two components of a GPO?

Answer

The Group Policy Container (GPC) stored in Active Directory, and the Group Policy Template (GPT) stored in SYSVOL.

Question

What does 'Account lockout threshold: 5' accomplish?

Answer

Locks a user account after 5 failed logon attempts, preventing brute-force password attacks.

Question

Which command generates an HTML report of all applied GPOs?

Answer

gpresult /h report.html — generates a comprehensive HTML report showing all applied GPOs and their settings.

Question

What is AppLocker used for in Group Policy?

Answer

Application control — restricting which executables can run on a system based on path, hash, or publisher certificate.

Revision Notes

Key Takeaways

  • 1. GPOs provide centralized security configuration across a Windows domain.
  • 2. LSDOU processing order determines which GPO wins in conflicts.
  • 3. Password policy and account lockout policy are the most impactful account security controls.
  • 4. Advanced Audit Policy provides granular control over what events are logged.
  • 5. GPO settings are stored in SYSVOL and readable by all domain users — never store secrets in GPOs.

Interview Tips

  • • Explain the LSDOU processing order and how it affects policy conflicts.
  • • Describe how to troubleshoot GPO application issues using gpresult.
  • • Discuss the security risks of Group Policy (delegation, SYSVOL exposure, stale GPOs).
  • • Connect Group Policy to the broader Windows security architecture: Active Directory, Defender, BitLocker.

Cheat Sheet

Windows Group Policy Cheat Sheet

Phase: Linux and Windows Security Administration | Level: advanced

GPO Architecture:

  • GPC (Group Policy Container) — Stored in Active Directory
  • GPT (Group Policy Template) — Stored in SYSVOL
  • Processing order: LSDOU (Local → Site → Domain → OU)
  • Later GPOs override earlier ones

Key Security Settings:

  • Password Policy: History=24, Max age=60, Min age=1, Length=14, Complexity=Enabled
  • Account Lockout: Threshold=5, Duration=30min, Reset=30min
  • Audit Policy: Enable Success+Failure for all categories
  • AppLocker: Whitelist approved software, block %TEMP% executables

Key Commands:

  • gpmc.msc — Group Policy Management Console
  • gpedit.msc — Local Group Policy Editor
  • gpupdate /force — Force GP refresh
  • gpresult /r — Show applied GPOs
  • gpresult /h report.html — Generate HTML report
  • auditpol /get /category:* — Check audit policy

Tags: windows, hardening

Continue Learning

Before You Start

  • No prerequisites listed.