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

Event ID 411: Token validation failed

Written by AD FS when a token validation fails, a wrong user name or password included, with the user principal name and the submitter's address. Microsoft's bad password event for AD FS on Windows Server 2012 R2 and 2016.

Log source
AD FS auditing
Detection value
Supporting
Volume
Medium (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 · 2 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 411 to the Security log of the AD FS server, under the event source AD FS Auditing, when it fails to validate a token. Microsoft's troubleshooting article for AD FS on Windows Server 2012 R2 and 2016 tells administrators to search the Security log of every AD FS server for 411 to find bad credential submissions: the event contains the user principal name of the targeted user and the address of the submitter, and its message says whether it is a bad password attempt or an account lockout.

On AD FS in Windows Server 2016 and later, Microsoft's Connect Health page lists 411 (SecurityTokenValidationFailureAudit) among the events of the Verbose audit level, so the default Basic level does not write it; the failed password event of the Basic level is 1203. Audit levels came with Windows Server 2016: on AD FS in Windows Server 2012 R2, auditing writes many events per request, 411 among them. On AD FS 2.0 and 2.1 (Windows Server 2008 R2 and 2012), Microsoft says 411 lacks these details and correlates 4625 with AD FS event 501 instead.

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 AD FS auditing to reach the Security log (the user right, the Application Generated subcategory and the Federation Service audits). On AD FS in Windows Server 2016 and later it also needs Set-AdfsProperties -AuditLevel Verbose; Get-AdfsProperties shows the current AuditLevel.

The submitter's address is missing on servers without the updates that added it. Microsoft's troubleshooting article names the February 2016 update 3134222 for Windows Server 2012 R2 (its update list also has 3134787, for AD FS logs without the client address in account lockout scenarios), and its update list says the August 2017 update 4034661 fixed 411 events logged without the caller's address on Windows Server 2016.

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 request.
User principal name and messageMicrosoft documents that the event contains the user principal name of the targeted user and a message saying whether the failure is a bad password attempt or an account lockout. Its search script reads both from the third value of the event: the user principal name, a hyphen, then the message, such as The user name or password is incorrect. Connect Health, which builds its bad password report from these audits, notes that the user ID is what was typed, so it can be a wrong or unknown name.
IP addressAddress of the submitter. Microsoft's search script reads it from the fifth value of the event. Missing on servers without the updates that added it.

Values to know

User principal name and message

ValueMeaningSignal
<UPN>-The user name or password is incorrectA wrong user name or passwordWhat spraying and guessing produce. Microsoft's search script keeps only these 411 events.Failure
Other message textAnother token validation failureMicrosoft says the message tells a bad password apart from an account lockout. Other failures are not password attempts.Worth knowing

IP address

ValueMeaningSignal
Empty or missingThe server lacks the update that logs the addressInstall the updates Microsoft names (3134222 on Windows Server 2012 R2, 4034661 on Windows Server 2016).Worth knowing
One address, many usersFailures for many accounts from one clientWhat a password spray looks like and what the library's spray hypothesis counts.Attack signal

Volume and noise

411 reports failed token validations in general, and Microsoft says its message tells a bad password apart from an account lockout; Microsoft's own search script keeps only the events whose message contains The user name or password is incorrect. Among those, every farm has a steady level of mistyped passwords and of clients that keep submitting an old password: Microsoft's lockout troubleshooting names applications that cache credentials and service accounts whose password changed.

Microsoft's password spray playbook names a rise in 411 events as an indicator of a spray. On AD FS 2016 and later, raising the audit level to Verbose to get 411 also adds every other Verbose event of each request.

Keeping it manageable

  • Keep every 411 from every AD FS server that writes it: the library's rule reports each failure and its spray hypotheses count distinct users per client address.
  • For counting, keep the events whose message is a bad password. Match the known message text rather than the first hyphen: Microsoft's script takes the user principal name as the text before the first -, which cuts names that contain one.
  • On AD FS 2016 and later, 1203 at the default Basic level already records every bad password. Raise the level to Verbose for 411 only if you need it or use a product that asks for it (Defender for Identity and Connect Health do).
  • Collect the Security log of the AD FS servers only: the Web Application Proxy servers need no auditing.

Attacks this event reveals

Detection rules that read this event:

Frequently asked questions

Why is there no event 411 on my AD FS 2016 or later servers?

From Windows Server 2016, AD FS has audit levels, and Microsoft lists 411 among the events of the Verbose level. The default Basic level records a failed password as event 1203 instead. Get-AdfsProperties shows the current level; raise it to Verbose only if you need 411, because Verbose logs every event of each request.

Why is the IP address missing from event 411?

The address was added to the event by updates. Microsoft names the February 2016 update 3134222 for AD FS on Windows Server 2012 R2, and the August 2017 update 4034661 for 411 events without the caller's address on Windows Server 2016. A server with current updates logs it.

How do I get the user and the address out of event 411?

Microsoft's own search script reads the third value of the event, which starts with the user principal name followed by a hyphen and the message, and the fifth value, the address of the submitter. It keeps only events whose message contains The user name or password is incorrect. Split at that message rather than at the first hyphen, so names that contain a hyphen stay whole.

References