Alert for each time a usb device is plugged

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

Alert for each time a usb device is plugged

L0 Member


Is there any way to set up an alert for each time a USB device is plugged into a host?
Even if it's not malicious.


L3 Networker



Are you looking for USB device plugin alert or alert on activity such as File operation, execution operation via removable media?


USB Device plugin alert may not be possible but definitely you should be able to create a BIOC rule for USB/RemovableMedia file operation, process operation activity with a low severity priority which will only trigger an alert in Alerts Table but not create an Incident.


Will be keen to know if someone has other idea.

Kind Regards

L3 Networker

Hi JoaoSantos20,


In the Restrictions Profile you have the option to configure notifications for Removable Media for file executions launched from external drives attached to endpoints in your network. To configure:

  1. From Cortex XDR, select Endpoints > Policy Management > Prevention Profiles > + New Profile.
  2. Select the OS to which the profile applies and Restrictions as the profile type.
  3. Click Next.
  4. Enter a Profile Name to identify the profile and Description
  5. Uncheck Use Default
  6. Select which option best fits your use case
    Notify—Allow the file to execute but notify the user that the file is attempting to run from a suspicious location. The Cortex XDR agent also reports the event to Cortex XDR.
    Report—Allow the file to execute but report it to Cortex XDR.

**You may add files or folders to an allow list or block list as well.


Save and then apply the Restrictions profile to the Security Profiles to Endpoints.

If you already have a Restrictions Profile configured, you may edit and follow steps 5 - 8


You may also create an alert via a BIOC rule from an XQL Query for event logs for Windows and Linux system. For example, an XQL query for the Windows event ID 6416: A new external device was recognized by the system. To build the BIOC rule query through a specific entity:


Navigate to Detection Rules > BIOC > + Add BIOC > Select the  Event Log Icon

Enter EVENT_ID = 6416 (optional to enter other parameters), Save



Select the Type, Severity, Optional select a MITRE Technique or Tactic to associate with the event, such as Technique - T1092 Removal Media and Tactic - TA0010 - Exfiltration. Enter a comment for tracking, then OK



The rule will be displayed in the BIOC Rules table. Right-Click on the Rule to add it to the appropriate Restrictions Profile shown in the sub menu for the endpoints you would like monitored. 








Add a New Restrictions Security Profile (

Create a BIOC Rule (

If you found this answer helpful, please select Accept as Solution.

Hi @jtalton 

Pretty cool way of monitoring of removable media activity, i think the only thing which will be required from the endpoint side will be enable event logging for Removable media?


Kind Regards

Isnt it enabled in windows by default ? 

Really good and creative solution from Jtalton. 

That deserves likes, isnt it ? 

Thanks... Microsoft TechDoc doesn't specify if its enabled by default Monitor the use of removable storage devices (Windows 10) - Windows security | Microsoft Docs

If you found this answer helpful, please select Accept as Solution.


Open windows event viewer and go to 

Applications and Service Logs > Microsoft > Windows > DriverFrameworks-UserMode

as shown in the pic1




Double click there and you will see the value is 0 

Right click on it and select properties. You will find enable logging check box empty. See pic2


I believe it should be possible to propagate this setting through all your endpoints using GPO instead of manually configuring each endpoint.





Additionally in the registry we see that the enable value is 0 for the registry key 


Changing the value to 1 should also work








Hi @eluis and @jtalton 


For monitoring any new USB device it will be Event-ID 6416 but for monitoring removable media which is already registered by the system it will be 4719. So i guess a BIOC with a combination of 6416 and 4719 Event ID will help.





Kind Regards

L2 Linker

Very interesting solution @eluis @jtalton 

I'm referencing this Cortex XDR documentation:


Will those Events (6416 & 4719) be collected automatically or would it be necessary to use the Broker VM to collect this additional IDs?

Multiple analytics alerts track USB activities that do not require BrokerVM


A user connected a USB storage device to a host for the first time

A user connected a new USB storage device to a host

A user connected a new USB storage device to multiple hosts


But you are correct, configuring the BrokerVM Windows Event Collector would allow you to specify collection for event IDs 6416 & 4719

If you found this answer helpful, please select Accept as Solution.

@micomi Don't see Cortex XDR looking for those EVIDs (6416&4719) in default collection, I think Broker VM would be required in this case.

Probably @eluis or @jtalton can let us know?

Kind Regards

L3 Networker

We created a bioc using a reg key

Seems to work 


preset = xdr_registry
| filter (action_registry_key_name contains "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\USBSTOR\Enum" and event_sub_type = REGISTRY_CREATE_KEY)




L5 Sessionator

Hi All,

You can also consider using the following BIOC to raise alerts when a USB device is plugged in.

You can play around with the filters to whitelist allowed device IDs/vendors.






  • 13 replies
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!