Detect when a service is stopped in Windows

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

Detect when a service is stopped in Windows

L1 Bithead

One of the rules I am trying to create is to know when a particular service is stopped in Windows. Couple of things I have tried. 

1. Event IDs: Typically Event ID 7036/7040 is generated when a service is stopped. But I cannot get a single result with my query

dataset = xdr_data
| filter action_evtlog_event_id in (7036,7040) 

As per https://docs-cortex.paloaltonetworks.com/r/Cortex-XDR/Cortex-XDR-Pro-Administrator-Guide/Endpoint-Da...

7036 and 7040 are not monitored. 

2. Looking at host inventory services: 

The following query kind of works, but I cannot create a BIOC rule with this.

config case_sensitive = false
| preset = host_inventory_services | filter service_name contains "XXX" | fields endpoint_name, ip_address, path_name, service_name, service_state
| filter service_state != ENUM.SERVICE_RUNNING

 

What is a good way to do this?  Ideally, I am not looking to block this, but just generate a low level alert for the same.

 

2 REPLIES 2

L5 Sessionator

Hello @VarunPitale ,

 

You can use below sample:

dataset = xdr_data
| filter event_type = ENUM.PROCESS
| filter event_sub_type = ENUM.PROCESS_STOP

 

If you feel this has answered your query, please let us know by clicking like and  on "mark this as a Solution". Thank you.

Ashutosh Patil

Thanks @aspatil 

I tried this solution, but it did not work in some scenarios. We tries by going to services.msc and then in the GUI, picking the service and stopping it. This behavior should also show up in alerts

  • 131 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!