- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
Content translations are temporarily unavailable due to site maintenance. We apologize for any inconvenience.
10-17-2023 01:56 AM
Dear LIVEcommunity,
I've been wondering about using XQL query to locate locked AD accounts. Been looking at the dataset "msft_azure_ad_raw" which contained Azure AD Authentication Logs and have no success so far. FYI, We also ingest data via Cloud Identity Engine. Appreciate anyone could shed some light on this, i.e. Is this even possible, what dataset and the field to search for.
Thank you.
10-17-2023 06:23 AM
This can be done in different ways, easiest is to use what the XDR agent collects natively as part of its "Microsoft-Windows-Security-Auditing" Windows Event Collection, where XDR agent can
1- Collect Event ID 4740 - A user account was locked out
2- Collect Event ID 4767 - A user account was unlocked
These event IDs are going to be ingested and normalized into the dataset = xdr_data, hence a simple XQL query looking for these events can get you started and then can be filtered out down the road if you need to add more details to it, an example of this query can be :
dataset = xdr_data // Using the xdr dataset
| filter event_type = ENUM.EVENT_LOG and action_evtlog_event_id in (4740 ,4767)
If you focus only on the locked account , then Event ID 4767 can be removed, and the query can look like:
dataset = xdr_data // Using the xdr dataset
| filter event_type = ENUM.EVENT_LOG and action_evtlog_event_id =4740
In the query results , please make sure you select the fields related "action_evtlog*" as seen in the screenshot in order to see the Event log details
I hope that was helpful and shed some light, please feel free to mark the response as "Accept as Solution" if it answers your query.
10-17-2023 06:23 AM
This can be done in different ways, easiest is to use what the XDR agent collects natively as part of its "Microsoft-Windows-Security-Auditing" Windows Event Collection, where XDR agent can
1- Collect Event ID 4740 - A user account was locked out
2- Collect Event ID 4767 - A user account was unlocked
These event IDs are going to be ingested and normalized into the dataset = xdr_data, hence a simple XQL query looking for these events can get you started and then can be filtered out down the road if you need to add more details to it, an example of this query can be :
dataset = xdr_data // Using the xdr dataset
| filter event_type = ENUM.EVENT_LOG and action_evtlog_event_id in (4740 ,4767)
If you focus only on the locked account , then Event ID 4767 can be removed, and the query can look like:
dataset = xdr_data // Using the xdr dataset
| filter event_type = ENUM.EVENT_LOG and action_evtlog_event_id =4740
In the query results , please make sure you select the fields related "action_evtlog*" as seen in the screenshot in order to see the Event log details
I hope that was helpful and shed some light, please feel free to mark the response as "Accept as Solution" if it answers your query.
10-18-2023 03:15 AM
@zarnous
Thank you! I didn't know that xdr_data dataset consisted of windows security event logs. I make a few simple searches and it worked like a charm.
Click Accept as Solution to acknowledge that the answer to your question has been provided.
The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!
These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!
The LIVEcommunity thanks you for your participation!