XQL query for locked AD account

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

XQL query for locked AD account

L2 Linker

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.

Cortex XDR 

AC
1 accepted solution

Accepted Solutions

L2 Linker

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 details2023-10-17 09_21_33-Epic Pen Content Surface_ __._DISPLAY2.png

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.

 




Z

View solution in original post

2 REPLIES 2

L2 Linker

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 details2023-10-17 09_21_33-Epic Pen Content Surface_ __._DISPLAY2.png

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.

 




Z

@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. 

AC
  • 1 accepted solution
  • 1270 Views
  • 2 replies
  • 0 Likes
Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

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!