# Account lockout threshold should be retrievable

Account lockout threshold is one of the most important defenses against brute-force attacks:

Source: https://maester.dev/docs/tests/AD-PWDPOL-07

<!-- This file is generated by website/scripts/generate-test-docs.mjs. Do not edit manually. -->

<div class="test-byline"><div class="test-byline-avatars"><a class="test-byline-avatar test-byline-avatar--author" href="/contributors/soulemike" title="Michael Soule · Original author"><img src="https://github.com/soulemike.png" alt="Michael Soule" width="28" height="28" loading="lazy" decoding="async" /></a></div><div class="test-byline-meta"><span class="test-byline-text">Contributed by <a href="/contributors/soulemike">Michael Soule</a></span><a class="test-byline-link" href="/contributors">All contributors →</a></div></div>

<p class="test-part">Part of <a href="/docs/tests/ad">Active Directory</a> · Active Directory · Password policy · <a href="/docs/tests">All checks</a></p>

```powershell title="Run this check"
Invoke-Maester -TestId AD-PWDPOL-07
```

## Overview

Account lockout threshold is one of the most important defenses against brute-force attacks:

* **Prevents automated attacks**: Limits the number of passwords an attacker can try
* **Detects attacks**: Lockout events can trigger alerts for security monitoring
* **Protects weak passwords**: Even users with weaker passwords get some protection

A threshold of 5 or fewer failed attempts provides strong protection while allowing for the occasional user mistake. Setting it to 0 (never lock out) removes this critical protection entirely.

#### Control Type

**Preventive**

#### Security Recommendation

Configure the account lockout threshold to **5 or fewer failed attempts**. Never disable account lockout (threshold = 0) as this removes critical protection against brute-force attacks.

To configure this setting:
1. Open **Group Policy Management**
2. Navigate to the Default Domain Policy
3. Edit: Computer Configuration > Policies > Windows Settings > Security Settings > Account Policies > Account Lockout Policy
4. Set **Account lockout threshold** to **5 or fewer invalid logon attempts**

**Note**: When you set the lockout threshold, Windows will suggest appropriate values for:
* Account lockout duration (recommend: 30 minutes)
* Reset account lockout counter after (recommend: 30 minutes)

#### How the Test Works

- Current lockout threshold (number of failed attempts)
- Recommended maximum (5 attempts)
- Critical warning if lockout is disabled

#### Related Tests

- `Test-MtAdAccountLockoutDuration` - Checks how long accounts remain locked

## Details

<details>
<summary>Every attribute of this check</summary>

| Field | Value |
| --- | --- |
| Test ID | AD-PWDPOL-07 |
| Severity | Info |
| Suite | Active Directory |
| Product | Active Directory |
| Feature | Password policy |
| Area | Authentication |
| Resource type | Tenant |
| MITRE ATT&CK | T1110 Brute Force |
| PowerShell test | [Test-MtAdAccountLockoutThreshold](https://github.com/maester365/maester/blob/main/tests/ad/password-policy/Test.AD-PWDPOL-07.ps1) |
| Services | ActiveDirectory |
| Permissions | ActiveDirectory:Ldap:domainDNS.lockoutThreshold:ReadProperty |

</details>

## Source

- Test: [`tests/ad/password-policy/Test.AD-PWDPOL-07.ps1`](https://github.com/maester365/maester/blob/main/tests/ad/password-policy/Test.AD-PWDPOL-07.ps1)
- Documentation: [`tests/ad/password-policy/Test.AD-PWDPOL-07.md`](https://github.com/maester365/maester/blob/main/tests/ad/password-policy/Test.AD-PWDPOL-07.md)
