Active Directory Lockout Prevention¶
How AD Lockout Happens from WinRM¶
- WinRM quota exhaustion → shell creation fails
- Error message: "credentials rejected" (misleading - creds are fine)
- Ansible retries authentication automatically
- Each retry = failed NTLM attempt recorded by AD
- AD lockout threshold (typically 5 failures in 15 min) triggers
- Account locked → ALL hosts using that account lose access
Prevention Checklist¶
Before Running Parallel Tests¶
- [ ] Run
just auditto check current quota state - [ ] Run
just deploy-quotasif quotas are at Windows defaults - [ ] Verify tunnel is active:
just tunnel-status - [ ] Start in a separate terminal:
just monitor
During Testing¶
- [ ] Watch for "credentials rejected" errors - STOP IMMEDIATELY
- [ ] Do NOT retry failed playbooks without checking quota state
- [ ] Use
just benchmark-safebeforejust benchmark-unsafe
After an Incident¶
- STOP all automation immediately
- Check if account is locked:
Get-ADUser -Identity svc-ansible -Properties LockedOut - Unlock if needed:
Unlock-ADAccount -Identity svc-ansible(requires Domain Admin) - Wait for lockout duration to expire (typically 15-30 min)
- Run
just auditto verify quotas - Run
just deploy-quotasto elevate quotas - Resume with
just benchmark-safefirst
Key Rules¶
- NEVER retry after "credentials rejected" without checking quotas
- ALWAYS run quota audit before parallel testing
- ALWAYS use
serial: 1for molecule converge plays - PREFER pypsrp over pywinrm for production automation
- MONITOR connections during benchmark runs
AD Lockout Policy (Typical)¶
| Setting | Typical Value |
|---|---|
| Lockout Threshold | 5 failed attempts |
| Lockout Duration | 30 minutes |
| Reset Counter After | 15 minutes |
| Observation Window | 15 minutes |
Shared Account Risk¶
All managed Windows hosts share the svc-ansible AD account. One lockout = all hosts locked.
This is the primary risk factor for the forkbomb scenario.