To stop VPN brute force attacks from locking out your users, block known attacker IPs at the firewall before they reach the VPN login page, and keep your lockout policy. A login attempt that never reaches the portal cannot increment the user’s Active Directory badPwdCount, so it cannot lock the account.
Every failed VPN login from an attacker counts against the real user’s AD account. When badPwdCount reaches the Account lockout threshold in your domain policy, the account locks, even though the user did nothing wrong. (The Default Domain Policy ships with the threshold at 0, meaning never lock; Microsoft’s security baseline suggests 10.) The counter resets after a successful login or once the “Reset account lockout counter after” window passes, so a bot that keeps guessing re-locks the account soon after it unlocks. Microsoft’s own documentation warns that a lockout threshold lets an attacker lock any account whose name is known.
The Account Lockout Problem
A typical lockout campaign runs like this:
- A bot finds your VPN portal (GlobalProtect, FortiGate SSL VPN, AnyConnect and similar) by scanning.
- It loads a username list, often built from LinkedIn, your email address format or an earlier breach.
- It tries several passwords per username. The portal checks each one against Active Directory (directly over LDAP, or through RADIUS/NPS or Kerberos), and each failure increments
badPwdCounton that user’s account. Password spraying, one password across many usernames, locks fewer accounts per round but still adds to every counter it touches. - At the threshold, AD locks the account. The user loses VPN, file shares and every other service that signs in against on-premises AD.
- The helpdesk unlocks the account. The bot comes back and locks it again.
User Keeps Getting Locked Out of Active Directory? Check the VPN
Start with the Security log on the domain controller holding the PDC emulator role. With Audit User Account Management enabled, event ID 4740 records the lockout. Its Caller Computer Name identifies the computer from which the final attempt was received.
- Filter the PDC emulator’s Security log for event 4740 and the affected username. Microsoft’s LockoutStatus tool can show which domain controllers were involved.
- Correlate the time with event 4625, which records a failed logon on the computer where the logon was attempted, and event 4771 on a domain controller when Kerberos pre-authentication fails. Which event appears depends on the authentication path and enabled auditing.
- If the VPN sends authentication through RADIUS/NPS, the caller in event 4740 may be the NPS server. On that server, with auditing for the Network Policy Server subcategory enabled, review event 6273: it records a denied NPS request, and its Reason Code explains the failure. Match the username and time to the VPN log to recover the internet source IP.
- If the VPN authenticates over LDAP, Caller Computer Name is often blank or names a domain controller. Match the 4740 timestamps against failed logins in the VPN authentication log, which shows the source IPs.
Rule out saved or stale credentials
If the lockouts began after a password change, update or remove the old password everywhere it may still be used:
- mail or work-account profiles on phones;
- Windows Credential Manager entries and mapped drives;
- Windows services and scheduled tasks running as the user;
- saved Wi-Fi and VPN profiles.
Microsoft documents that Windows can persist credentials for services and scheduled tasks, while Credential Manager stores credentials for connected applications and networks. After correcting the stale credential, unlock the account and watch for another 4740 event before closing the case.
If the failures come from internet IPs
Repeated failures for many usernames from internet addresses in the VPN log indicate password spraying against the VPN. Keep MFA enabled, review the domain’s lockout threshold against Microsoft’s security baseline and your own risk, and remember that any nonzero threshold can be abused for denial of service. Block known attack sources at the firewall with a dynamic block list (EDL); this stops listed sources before authentication but cannot stop every brute-force attempt.
How the Attack Flow Causes Lockouts
Without a blocklist, every attempt reaches Active Directory:
Without an IP blocklist, every attack attempt reaches Active Directory
With ThreatListPro, listed attacker IPs are dropped at the firewall:
Listed attacker IPs never reach the VPN portal, so they cannot count against any account
Why the Obvious Fixes Create New Problems
Each quick fix trades a visible problem for a hidden one:
- Disabling the lockout policy ends the lockouts and also removes your defense against password guessing on every AD-backed service.
- Raising the threshold (say, from 5 to 50) only delays lockouts. A persistent bot reaches any threshold, and real attackers get more guesses.
- Shortening the lockout duration lets users unlock sooner, but they are locked again while the campaign runs, and password guessing meets less resistance.
Why MFA Does Not Stop Account Lockouts
MFA is essential, but it does not stop lockouts when the directory password is primary authentication. In Microsoft's NPS extension flow, NPS checks the RADIUS request against AD DS first and invokes the MFA extension only after primary authentication succeeds. A wrong password can therefore count toward AD lockout without ever reaching the MFA prompt.
This is why VPN password spraying can disrupt users even when MFA prevents the attacker from completing authentication. Keep MFA enabled, but add controls that reject hostile traffic before the password check.
Prevent FortiGate SSL VPN Lockouts
These steps apply to FortiGate releases that still run SSL VPN. Fortinet removed SSL VPN tunnel mode in FortiOS 7.6.3 and later, so check your release before you plan these changes.
Put legitimate users on a non-default SSL VPN realm
Fortinet documents SSL VPN realms as additional URL paths with separate authentication settings. Configure a non-default realm for legitimate users and update their FortiClient remote gateway to include that path. Map the default realm to an empty group and a dummy portal with web and tunnel access disabled so requests to the ordinary URL are not sent to LDAP or RADIUS.
Check the IP-based login limits
FortiGate defaults login-attempt-limit to 2 and login-block-time to 60 seconds. Fortinet says two consecutive incorrect username/password combinations from one IP within that window cause a 60-second block. Setting either value to 0 disables the block. The limit does not apply to SAML user groups.
config vpn ssl settings
set login-attempt-limit 2
set login-block-time 60
end
These settings block the source IP, not the AD account. Choose values that fit your users and test them before deployment; they supplement the realm design rather than replacing it.
Disable web mode when it is unused
Disable web mode on each unused SSL VPN portal. On FortiOS 7.4.2 and later, where the feature is supported, Fortinet documents globally disabling it after it is disabled on every portal; browser requests then receive a 403 response. Fortinet notes this can break the FortiClient macOS internal browser for SAML on IKEv2 dial-up, fixed in FortiClient macOS 7.0.12, 7.2.4, and 7.4.0.
config system global
set sslvpn-web-mode disable
end
Harden SonicWall SSL VPN Against Login Floods
For Gen7 firewalls, SonicWall directs administrators to Device > Settings > Administration > Login/Multiple Administrators to configure failed-login and lockout controls. Its guidance says turning Local administrator account lockout off blocks the attempting IP instead of locking the local administrator account; the documented maximum lockout period is 60 minutes.
The same SonicWall guidance recommends enabling login uniqueness under Device > Users > Settings. If Virtual Office is unused, go to Network > SSL VPN > Portal Settings and enable Disable Virtual Office on Non-LAN Interfaces. Geo-IP and Botnet Filter controls provide additional exposure reduction. See the SonicWall protection guide for the blocklist setup.
Solutions Ranked by Effectiveness and Speed
Only controls that act before the password check prevent lockouts. Everything else changes how fast they happen.
IP Blocklist (EDL)
Add the ThreatListPro URL as an External Dynamic List, reference it in a deny rule above your VPN rules, and commit. Listed attacker IPs never reach the login page.
Geo-Blocking
Deny VPN access from countries where you have no users. It cuts bot traffic but misses attackers renting servers in your own country. Pair it with a blocklist.
Rate Limiting
Cap connection attempts per source IP. It slows attackers, but the attempts that get through still count toward lockout, and the limits need tuning.
MFA Enforcement
Essential against stolen passwords, but in primary-password-first flows such as Microsoft's NPS extension, AD DS checks the password before the MFA extension runs.
| Method | Prevents Lockout? | Reduces Breach Risk? | Setup Effort | Maintenance |
|---|---|---|---|---|
| IP Blocklist (EDL) | Yes, for listed IPs: blocked before the login attempt | Yes, for listed IPs | A few minutes | None: the firewall re-fetches the list |
| Increase lockout threshold | Reduces frequency | No: gives attackers more guesses | Low | None |
| MFA only | No in primary-password-first flows | Yes | High | User enrollment |
| Geo-blocking | Partial: misses domestic IPs | Partial | Low | Manual updates |
| Fail2Ban-style reactive bans | Only after N failures | Partial: reactive only | Medium | Log monitoring |
How ThreatListPro Cuts Lockouts
ThreatListPro works at the network layer instead of making authentication more tolerant of attacks. Add the list as an EDL on your firewall and deny traffic from it to your VPN portal. A connection from a listed IP is dropped before the portal sees a login, so Active Directory never records a failure and the user’s badPwdCount never moves.
On a Palo Alto firewall, setup is three steps:
- Under Objects > External Dynamic Lists, add an IP List with your ThreatListPro URL as the source. An hourly check is plenty; the list republishes every 6 hours.
- Under Policies > Security, add a deny rule with the EDL as the source address and your GlobalProtect portal and gateway as the destination. Place it above the rules that allow VPN traffic.
- Commit, then watch the rule’s hit count and the 4740 events on your domain controller.
Other firewalls use the same pattern: import the list as a dynamic address object, deny it inbound to the VPN. On FortiGate, SSL VPN traffic terminates on the firewall itself, so the deny belongs in a local-in policy rather than a regular firewall policy; see FortiGate SSL VPN hardening.
The list comes from real attacks on live production Palo Alto GlobalProtect VPN portals in the US and covers 5.4M+ IPv4 addresses. For how these campaigns work, see VPN brute force attacks explained.
badPwdCount. Attackers that are not on the list yet can still cause lockouts; the list is checked for new attackers every 6 hours.
Frequently Asked Questions
Why does my AD account keep getting locked out?
Repeated bad passwords are reaching Active Directory. The source may be an old password saved on a phone, mapped drive, service, scheduled task, Wi-Fi profile or VPN profile, or it may be an internet attack against your VPN. Start with event 4740 and its Caller Computer Name, then correlate the same time across authentication logs.
How do I find the source of Active Directory account lockouts?
On the PDC emulator, open Security event 4740 and note Caller Computer Name. Use LockoutStatus to identify the domain controllers involved, then correlate event 4625 for failed logons or event 4771 for Kerberos pre-authentication failures. If VPN authentication uses RADIUS/NPS, inspect event 6273 and its Reason Code on the NPS server.
Why do VPN brute force attacks cause account lockouts?
Because the VPN portal checks passwords against Active Directory, which enforces your lockout policy. Each failed attempt from the attacker increments badPwdCount on the user's AD account. When the count reaches the lockout threshold set in your domain policy, the account locks, even though the user did nothing wrong.
Should I disable my account lockout policy to prevent VPN lockouts?
No. The lockout policy protects every AD-backed service against password guessing. Block attacker IPs at the firewall instead, with an IP blocklist such as ThreatListPro. Attempts that never reach the VPN portal cannot trigger lockouts, and your policy stays in place.
How many accounts typically get locked out during a VPN brute force attack?
It depends on the attacker's username list, your lockout threshold and the attack volume. Our own portals saw 50+ account lockouts per day during active brute force campaigns.
How quickly can I stop VPN-caused account lockouts?
Setup takes a few minutes: add the ThreatListPro URL as an External Dynamic List (EDL) on your firewall, create a deny rule that references it, and commit. From then on, IPs on the list cannot reach your VPN portal to trigger failed logins. Attackers not yet on the list can still cause lockouts.
Does MFA prevent VPN brute force account lockouts?
No, not when the directory password is primary authentication. In Microsoft's NPS extension flow, NPS checks the RADIUS request against AD DS first and invokes the MFA extension only after primary authentication succeeds. A wrong password can therefore count toward AD lockout without ever reaching the MFA prompt. Keep MFA, and block hostile traffic before authentication.
How do FortiGate SSL VPN realms prevent AD lockouts?
Fortinet's design sends legitimate users to a non-default realm URL and maps the default realm to an empty group and dummy portal. Requests to the ordinary SSL VPN URL then avoid LDAP or RADIUS. Update FortiClient gateways and map every remote-authentication group correctly, or some requests can still reach the directory.
Sources
- Microsoft Scripting Blog: Find account lockouts on the PDC emulator
- Microsoft: Event 4625, an account failed to log on
- Microsoft: Event 4771, Kerberos pre-authentication failed
- Microsoft: Troubleshoot NPS events and reason codes
- Microsoft: Account Lockout and Management Tools
- Microsoft Download Center: Account Lockout Status (LockoutStatus.exe)
- Microsoft: Credentials processes in Windows authentication
- Microsoft Support: Credential Manager in Windows
- Microsoft Support: Update an Outlook Mobile account password
- Microsoft: VPN profiles and remembered user credentials
- Microsoft: Use Microsoft Entra multifactor authentication with NPS
- Microsoft: Account lockout threshold
- Microsoft: Bad-Pwd-Count attribute
- Fortinet: Prevent remote-server lockouts with SSL VPN realms
- Fortinet: Limit SSL VPN login attempts and block duration
- Fortinet: Prevent the SSL VPN web login portal from displaying
- Fortinet: Local-in policy versus firewall policy
- SonicWall: SSLVPN license exhaustion and Gen7 hardening
- Palo Alto Networks: Enforce policy on an External Dynamic List