1. Resources
  2. Detection sources
  3. Event ID 515

Event ID 515: The following user account was in a locked out state, and the correct password was provided

Written by AD FS when the correct password arrives for a user in the extranet lockout state. Microsoft's own text adds that the account might be compromised. Read by the library's high-severity AD FS rule.

Log source
AD FS auditing
Detection value
Supporting
Volume
Low (estimate)
Last updated
Log
AD FS auditing (AD FS Auditing, off by default)
Logged on
Member servers only
Event versions
Not published
Detects
1 attack (1 rule · 1 detection logic)
MITRE ATT&CK
2 techniques in 1 tactic
Threat groups
14 groups that MITRE ATT&CK records using these techniques
Fields the rules read
The event ID and the provider only

When it is written

AD FS writes 515 to the Security log of the AD FS server, under the event source AD FS Auditing, when a user is in the extranet lockout state and the correct password is supplied. Its text adds that the account might be compromised, and it names the activity ID, the user and the client IP. A 2015 Microsoft post on extranet lockout in AD FS for Windows Server 2012 R2 names the audit ExtranetLockoutUserThrottleTransitionAudit and says it is written for a successful sign-in after the observation window has passed, the one attempt extranet lockout allows a locked user per window. Microsoft's current lockout page lists it with the Extranet Smart Lockout events.

A user reaches the lockout state because bad passwords were submitted for it from the extranet. A correct password then means that someone knows it: the owner, signing in while the attack runs, or whoever submitted the bad passwords and has now found the right one. Like the other lockout events, it needs extranet lockout and AD FS auditing, and covers only user name and password requests that come through the Web Application Proxy.

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:

  1. 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.
  2. 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.
  3. 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.

Check the Application Generated subcategory
auditpol /get /subcategory:"Application Generated"
Based on vendor documentation.
The same on a Windows in another display language
auditpol /get /subcategory:"{0CCE9222-69AE-11D9-BED3-505054503030}"
Based on vendor documentation.
Turn the subcategory on (local policy; a domain GPO overrides it)
auditpol /set /subcategory:"Application Generated" /success:enable /failure:enable
Based on vendor documentation.
Show the audit level and the extranet lockout settings of the farm
Get-AdfsProperties | Format-List AuditLevel, LogLevel, EnableExtranetLockout, ExtranetLockoutMode, ExtranetLockoutThreshold, ExtranetObservationWindow
Based on vendor documentation.
Log every audit event, including 411 (AD FS 2016 and later; much more volume)
Set-AdfsProperties -AuditLevel Verbose
Based on vendor documentation.

Needs extranet lockout turned on (EnableExtranetLockout true; with Extranet Smart Lockout, in Log-Only or Enforce mode) and AD FS auditing reaching the Security log. Get-AdfsProperties shows the lockout settings.

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.

FieldWhat it holds
Activity IDGUID 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. Use it to find the other events of the same sign-in.
UserThe locked out user whose correct password was supplied. Microsoft's lockout cmdlets take the user principal name; check which form your events carry.
Client IPAddress of the client that supplied the password. Microsoft notes that it can be one of Microsoft's addresses when Exchange Online sends a legacy authentication request for the client.

Values to know

Client IP

ValueMeaningSignal
An address that failed for this or other usersThe source of the bad passwords supplied the right oneTreat the password as known to an attacker. Reset it and end the user's sessions.Attack signal
The user's own familiar addressProbably the owner signing in after the lockoutThe account was still being sent bad passwords; find out from where.Worth knowing
A Microsoft addressLegacy authentication through Exchange OnlineMicrosoft says the submitter is then in x-ms-forwarded-client-ip, not in this field.Worth knowing

Volume and noise

The common harmless case is the owner of an account that a device with an old password keeps locking out: once the window passes, the owner signs in with the current password from a usual address. The account was still being sent bad passwords, so the event is worth a look even then. During a spray, a 515 from the address behind the failures marks the account whose password the spray found.

Keeping it manageable

  • Keep and alert on every 515: the library's rule reads it at high severity, and the volume is very low.
  • Compare Client IP with the user's familiar addresses (Get-ADFSAccountActivity lists them) and with the addresses behind recent failures (1203, 411) and lockouts (516, 1210). The owner's usual address lowers the priority; an address that failed for other users makes it urgent.
  • Do not exclude users from this event. A user excluded because a device keeps locking it out is excluded when the next spray finds that password too.

Attacks this event reveals

Detection rules that read this event:

Frequently asked questions

What should I do when AD FS logs event 515?

Treat the password as known to someone else until you know otherwise. Compare the client address with the addresses behind the bad passwords and with the user's usual ones, reset the password, end the user's sessions in the federated applications and require multifactor authentication for the account. Review what the account did after the sign-in.

Is event 515 always an attack?

No. The owner of an account that was locked out, for example by a phone with an old password, also produces it when signing in with the current password. But the account had been sent enough bad passwords to be locked out, and Microsoft's own text says it might be compromised, so check where the bad passwords came from.

References