When it is written
AD FS writes 1210 to the Security log of the AD FS server, under the event source AD FS Auditing, when Extranet Smart Lockout locks a user out. Microsoft's lockout page says it is written each time a user is locked out. The support article that introduced smart lockout for AD FS in Windows Server 2016 describes the same audit as written when a request is rejected because the account is over the lockout threshold, so it can repeat while the lockout lasts. Microsoft gives the text and an example of the XML in that article without the event number; the lockout page gives 1210 the same layout.
Extranet lockout counts bad passwords per user only for user name and password requests that come through the Web Application Proxy (or a third-party proxy that supports MS-ADFSPIP); requests that reach AD FS directly from the intranet are not counted. Smart lockout keeps separate counts for a user's familiar and unfamiliar locations. Once a count passes ExtranetLockoutThreshold, AD FS refuses that user's password requests from those locations until ExtranetObservationWindow has passed, then allows one attempt per window. Active Directory lockout works independently: AD FS does not lock the domain account.
The events are written only while smart lockout runs in Log-Only or Enforce mode and AD FS auditing reaches the Security log. In log-only mode AD FS writes the event but refuses nothing. Microsoft does not say whether the older extranet lockout mode (ADPasswordCounter) writes 1210; the lockout audits it describes for that mode in Windows Server 2012 R2 are 512, 515 and 516.
How to turn it on
AD FS Auditing writes the event to the AD FS auditing (Event Viewer > Windows Logs > Security (event source AD FS Auditing)), which is off by default. Microsoft
AD FS writes its audit events to the Security log of each AD FS server, with AD FS Auditing as the event source. Microsoft says these audit logs are not enabled by default; its Connect Health steps add that the two Federation Service check boxes should already be selected. Three settings must all be in place:
- The user right. The AD FS service account must hold Generate security audits (Local Security Policy > Security Settings > Local Policies > User Rights Assignment). Where AD FS runs on a domain controller, Microsoft points to the Default Domain Controllers Policy instead of the local policy.
- The audit subcategory. Audit Application Generated (Object Access) for success and failure, by Group Policy (Advanced Audit Policy Configuration > Audit Policies > Object Access) or locally with
auditpol. Microsoft warns that a Group Policy can turn AD FS auditing off. - The Federation Service audits. In AD FS Management, Edit Federation Service Properties > Events: Success audits and Failure audits. Connect Health's steps make this change on the primary server only, because it is a setting of the farm.
From Windows Server 2016 the farm also has an audit level, shown as AuditLevel by Get-AdfsProperties: Basic, the default, logs no more than five events per request and includes 1200 to 1203; Verbose logs every event, including 411, 412 and 501 (Microsoft's Connect Health tables); None logs nothing. Microsoft Defender for Identity and Connect Health ask for Verbose.
Audit every AD FS server of the farm, because each one logs only the requests it handled. The Web Application Proxy servers do not need auditing. The extranet lockout events (512, 515, 516, 1210) also need extranet lockout to be enabled; the check command below shows its settings.
auditpol /get /subcategory:"Application Generated"auditpol /get /subcategory:"{0CCE9222-69AE-11D9-BED3-505054503030}"auditpol /set /subcategory:"Application Generated" /success:enable /failure:enableGet-AdfsProperties | Format-List AuditLevel, LogLevel, EnableExtranetLockout, ExtranetLockoutMode, ExtranetLockoutThreshold, ExtranetObservationWindowSet-AdfsProperties -AuditLevel VerboseNeeds extranet lockout turned on (EnableExtranetLockout true) in Extranet Smart Lockout mode, Log-Only (AdfsSmartLockoutLogOnly) or Enforce (AdfsSmartLockoutEnforce), and AD FS auditing reaching the Security log. Get-AdfsProperties shows EnableExtranetLockout, ExtranetLockoutMode, ExtranetLockoutThreshold and ExtranetObservationWindow.
Smart lockout came to AD FS in Windows Server 2016 with the 2018 updates (Microsoft's page asks for the June 2018 updates and the 2016 farm behavior level) and is built into AD FS in Windows Server 2019. Microsoft recommends a threshold below the Active Directory lockout threshold (10 against 20 in its example) and an observation window of 30 minutes.
Fields
The template of this event is not part of client Windows and Microsoft does not publish its XML field names, so the fields are named by the labels of Microsoft’s documentation.
| Field | What it holds |
|---|---|
| Activity ID | GUID that AD FS assigns to the request and logs in every event of it, in the audit, admin and debug logs and on every server the request passed through. All zeros for legacy authentication proxied by Exchange Online. |
| XML | Document with the details of the lockout (Additional Data, XML in Microsoft's example), of type ExtranetLockoutAudit. Besides the elements below, Microsoft's example holds the audit type and result, the relying party, the claims provider, the authentication protocol, the network location and the proxy and network addresses. Check the elements in your own events before you build a parser. |
| UserId | Element with the user the lockout applies to, in DOMAIN\user form in Microsoft's example. |
| IpAddress | Element with the client addresses AD FS saw, in the order x-ms-forwarded-client-ip, x-forwarded-for, x-ms-proxy-client-ip according to Microsoft's lockout page. It can hold more than one address. |
| Endpoint | Element with the AD FS endpoint the request reached, /adfs/ls in Microsoft's example. Microsoft recommends disabling legacy endpoints such as /adfs/services/trust/13/usernamemixed, which Exchange ActiveSync clients reach through Exchange Online, where they are not needed. |
| UserAgentString | Element with the user agent of the client, a browser string in Microsoft's example. Supplied by the client. |
| CurrentBadPasswordCount | Element with the user's bad password count when the event was written; 5 in Microsoft's example, the same as the configured count. |
| ConfigBadPasswordCount | Element with the configured bad password threshold; 5 in Microsoft's example. |
| LastBadAttempt | Element with the time of the user's last bad password attempt. |
| LockoutWindowConfig | Element with the configured lockout window; 00:30:00 in Microsoft's example, the 30 minutes Microsoft recommends for ExtranetObservationWindow. |
| FailureType | Element with the kind of failure; ExtranetLockoutError in Microsoft's example. |
| ErrorCode | Element with the error code of the audit; AccountRestrictedAudit in Microsoft's example. |
Values to know
IpAddress
| Value | Meaning | Signal |
|---|---|---|
First address | x-ms-forwarded-client-ipMicrosoft lists the addresses in the order x-ms-forwarded-client-ip, x-forwarded-for, x-ms-proxy-client-ip. The first is the client that reached the proxy, or the submitter behind Exchange Online. | Worth knowing |
One address, lockouts for many users | A password spray from that addressA spray that came back often enough to pass the threshold for several accounts. | Attack signal |
The user's own familiar address | A device of the user with an old passwordCheck with Get-ADFSAccountActivity and have the saved password updated. | Noise |
Activity ID
| Value | Meaning | Signal |
|---|---|---|
00000000-0000-0000-0000-000000000000 | Legacy authenticationMicrosoft says legacy authentication through Exchange Online has this activity ID. | Worth knowing |
ErrorCode
| Value | Meaning | Signal |
|---|---|---|
AccountRestrictedAudit | The value in Microsoft's example of the lockout eventShown with FailureType ExtranetLockoutError and AuditResult Failure in the same example. | Worth knowing |
Volume and noise
Lockouts are rare without an attack. The usual harmless cause is a phone or mail client that keeps submitting a user's old password from the user's own address; Microsoft's lockout troubleshooting also names applications with cached credentials and service accounts whose password changed. Lockouts whose address is a Microsoft one come from legacy authentication sent through Exchange Online.
Expect more events during log-only mode, which Microsoft recommends for 3 to 7 days before enforce mode so that AD FS learns the familiar locations of each user: nothing is blocked then, so a device with an old password keeps failing.
Keeping it manageable
- Keep every 1210: the library's lockout rule reads each one, and the volume is low.
- Parse
UserIdandIpAddressfrom the XML in the SIEM. The rule matches only the event ID and the provider, so a count of lockouts per client address (a spray) has to be built there. - To tell a device with an old password from an attack, compare the address with the user's familiar addresses:
Get-ADFSAccountActivitylists them and the bad password counts, as Microsoft suggests during log-only mode. - Use the log-only period to list the users and addresses that lock out without an attack, and have those devices updated before you move to enforce mode.
Attacks this event reveals
Detection rules that read this event:
Frequently asked questions
Does an AD FS extranet lockout lock the account in Active Directory?
No. Active Directory lockout works independently of extranet lockout, and AD FS only refuses the user's password requests from the extranet. Microsoft recommends an extranet threshold below the domain's lockout threshold, so that guessing through AD FS stops before it can lock the domain account. A lockout in the domain is event 4740 on the domain controllers.
Why do I see event 1210 although nothing is blocked?
In log-only mode, which Microsoft recommends for 3 to 7 days before enforce mode, AD FS writes the lockout audits but refuses no request. The event shows who would have been locked out. Check the mode with Get-AdfsProperties.
Where are the user and the client address in event 1210?
In the XML document of the event: the UserId element holds the user and the IpAddress element the client addresses, the forwarded client address first. The library's lockout rule matches only the event ID and the provider, so parse the XML in the SIEM to group lockouts by address.
References
- AD FS Extranet Lockout and Extranet Smart Lockout overview (Microsoft)
- Description of the Extranet Smart Lockout feature in Windows Server 2016, with an example event (Microsoft)
- Configure AD FS Extranet Lockout Protection (Microsoft)
- Troubleshoot AD FS with events and logging (Microsoft)
- Troubleshoot account lockout in AD FS on Windows Server (Microsoft)