<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Find USB mounted storage devices on Windows and macOS in Cortex XDR Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/find-usb-mounted-storage-devices-on-windows-and-macos/m-p/1232495#M8481</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/308232"&gt;@aspatil&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;would you be able to share a sample output of the following query, that would help understanding your env better.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;dataset = xdr_data 
| filter event_type = ENUM.DEVICE and event_sub_type = ENUM.DEVICE_PLUG 
| alter deviceinfo = to_string(actor_process_device_info)
| comp count() by deviceinfo&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 24 Jun 2025 18:10:59 GMT</pubDate>
    <dc:creator>A.Elzedy</dc:creator>
    <dc:date>2025-06-24T18:10:59Z</dc:date>
    <item>
      <title>Find USB mounted storage devices on Windows and macOS</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/find-usb-mounted-storage-devices-on-windows-and-macos/m-p/1232395#M8474</link>
      <description>&lt;P&gt;Hi All, looking for some help here. We've been using a query a colleague wrote to find computers with USB's mounted.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is the query:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;// Description: Show drive mount activity&lt;/P&gt;
&lt;P&gt;dataset = xdr_data&lt;/P&gt;
&lt;P&gt;| filter event_type = ENUM.MOUNT&lt;/P&gt;
&lt;P&gt;| alter mount_point = action_mount_device_info -&amp;gt; storage_device_mount_point&lt;/P&gt;
&lt;P&gt;| alter storage_device_class_name = action_mount_device_info -&amp;gt; storage_device_class_name&lt;/P&gt;
&lt;P&gt;| alter vendor_id = action_mount_device_info -&amp;gt; storage_device_vendor_id&lt;/P&gt;
&lt;P&gt;| alter product_id = action_mount_device_info -&amp;gt; storage_device_product_id&lt;/P&gt;
&lt;P&gt;| alter storage_device_drive_type = action_mount_device_info -&amp;gt; storage_device_drive_type&lt;/P&gt;
&lt;P&gt;| fields _time, agent_hostname, action_mount_device_info, mount_point, storage_device_*, vendor_id, product_id, agent_os_type, agent_os_sub_type&lt;/P&gt;
&lt;P&gt;//| filter storage_device_drive_type = "2" or&lt;/P&gt;
&lt;P&gt;| FILTER storage_device_drive_type = "DEVICE_REMOVABLE"// 2: Removable&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The problem here is that this is only grabbing Windows and no macOS. I've tried a few other queries found here in the Live Community but nothing seems to be working accurately for the macOS.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any suggestions?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you in advance.&lt;/P&gt;
&lt;P&gt;Joe&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jun 2025 20:17:25 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/find-usb-mounted-storage-devices-on-windows-and-macos/m-p/1232395#M8474</guid>
      <dc:creator>Joe_Carissimo</dc:creator>
      <dc:date>2025-06-23T20:17:25Z</dc:date>
    </item>
    <item>
      <title>Re: Find USB mounted storage devices on Windows and macOS</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/find-usb-mounted-storage-devices-on-windows-and-macos/m-p/1232448#M8478</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;Try below:&lt;BR /&gt;&lt;SPAN&gt;preset = device_control | filter event_sub_type = MOUNT_DRIVE_MOUNT and agent_os_type = AGENT_OS_MAC and action_device_bus_type = USB&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If you feel this has answered your query, please let us know by clicking like and&amp;nbsp; on "mark this as a Solution". Thank you.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jun 2025 04:55:05 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/find-usb-mounted-storage-devices-on-windows-and-macos/m-p/1232448#M8478</guid>
      <dc:creator>aspatil</dc:creator>
      <dc:date>2025-06-24T04:55:05Z</dc:date>
    </item>
    <item>
      <title>Re: Find USB mounted storage devices on Windows and macOS</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/find-usb-mounted-storage-devices-on-windows-and-macos/m-p/1232485#M8480</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/308232"&gt;@aspatil&lt;/a&gt;, thank you for your reply. Unfortunately that only returns one computer and I'm expecting many more. We have almost 1000 Mac endpoints in our environment and I'm certain there are more than one that have USB storage drives mounted.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;BR /&gt;Joe&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jun 2025 13:58:41 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/find-usb-mounted-storage-devices-on-windows-and-macos/m-p/1232485#M8480</guid>
      <dc:creator>Joe_Carissimo</dc:creator>
      <dc:date>2025-06-24T13:58:41Z</dc:date>
    </item>
    <item>
      <title>Re: Find USB mounted storage devices on Windows and macOS</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/find-usb-mounted-storage-devices-on-windows-and-macos/m-p/1232495#M8481</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/308232"&gt;@aspatil&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;would you be able to share a sample output of the following query, that would help understanding your env better.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;dataset = xdr_data 
| filter event_type = ENUM.DEVICE and event_sub_type = ENUM.DEVICE_PLUG 
| alter deviceinfo = to_string(actor_process_device_info)
| comp count() by deviceinfo&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jun 2025 18:10:59 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/find-usb-mounted-storage-devices-on-windows-and-macos/m-p/1232495#M8481</guid>
      <dc:creator>A.Elzedy</dc:creator>
      <dc:date>2025-06-24T18:10:59Z</dc:date>
    </item>
    <item>
      <title>Re: Find USB mounted storage devices on Windows and macOS</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/find-usb-mounted-storage-devices-on-windows-and-macos/m-p/1232496#M8482</link>
      <description>&lt;P&gt;Thank you, here's a screenshot of the query results.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Joe&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jun 2025 18:27:04 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/find-usb-mounted-storage-devices-on-windows-and-macos/m-p/1232496#M8482</guid>
      <dc:creator>Joe_Carissimo</dc:creator>
      <dc:date>2025-06-24T18:27:04Z</dc:date>
    </item>
    <item>
      <title>Re: Find USB mounted storage devices on Windows and macOS</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/find-usb-mounted-storage-devices-on-windows-and-macos/m-p/1232498#M8483</link>
      <description>&lt;P&gt;I think you may need to expand the timeframe up to 30d if it was not set to it&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;also try to run this one too&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;dataset = xdr_data 
| comp count() by    agent_os_type , action_device_usb_vendor_name    , action_device_usb_product_name ,   action_device_usb_vendor_id   &lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 24 Jun 2025 18:59:01 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/find-usb-mounted-storage-devices-on-windows-and-macos/m-p/1232498#M8483</guid>
      <dc:creator>A.Elzedy</dc:creator>
      <dc:date>2025-06-24T18:59:01Z</dc:date>
    </item>
    <item>
      <title>Re: Find USB mounted storage devices on Windows and macOS</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/find-usb-mounted-storage-devices-on-windows-and-macos/m-p/1232501#M8484</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/928866483"&gt;@A.Elzedy&lt;/a&gt;,&amp;nbsp;thank you again. Attached is a .zip file with the query results of this most recent run. This one is definitely set to 30 days.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you,&lt;/P&gt;
&lt;P&gt;Joe&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jun 2025 21:53:01 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/find-usb-mounted-storage-devices-on-windows-and-macos/m-p/1232501#M8484</guid>
      <dc:creator>Joe_Carissimo</dc:creator>
      <dc:date>2025-06-24T21:53:01Z</dc:date>
    </item>
    <item>
      <title>Re: Find USB mounted storage devices on Windows and macOS</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/find-usb-mounted-storage-devices-on-windows-and-macos/m-p/1232502#M8485</link>
      <description>&lt;P&gt;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/928866483"&gt;@A.Elzedy&lt;/a&gt;, here is the query results with set to 30 days. Thanks, Joe&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jun 2025 21:56:14 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/find-usb-mounted-storage-devices-on-windows-and-macos/m-p/1232502#M8485</guid>
      <dc:creator>Joe_Carissimo</dc:creator>
      <dc:date>2025-06-24T21:56:14Z</dc:date>
    </item>
    <item>
      <title>Re: Find USB mounted storage devices on Windows and macOS</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/find-usb-mounted-storage-devices-on-windows-and-macos/m-p/1232586#M8486</link>
      <description>&lt;P&gt;Alright, after reviewing the logs, there aren't much activities from MAC devices, there could be a policy in place that's blocking them from connecting usb disks&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;at the time being I have drafted a query that could help monitor usb activities/changes&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;dataset = xdr_data
| filter event_type in (ENUM.DEVICE, ENUM.MOUNT , ENUM.FILE )
| filter action_device_usb_vendor_id != null
| sort asc _time
| windowcomp first_value(event_timestamp) by agent_hostname, action_device_usb_serial_number sort asc _time as plug_time
| windowcomp last_value(event_timestamp) by agent_hostname, action_device_usb_serial_number sort desc _time as unplug_time
| dedup agent_hostname, action_device_usb_vendor_id
| alter plug_ts = to_timestamp(plug_time, "MILLIS"),
unplug_ts = to_timestamp(unplug_time, "MILLIS") 
| alter
 plug_time_readable = format_timestamp("%Y-%m-%d %H:%M:%S", plug_ts, "America/New_York"),
unplug_time_readable = format_timestamp("%Y-%m-%d %H:%M:%S", unplug_ts, "America/New_York")
| alter session_duration_minutes = timestamp_diff(unplug_ts, plug_ts, "MINUTE")
| join type = right   (
    dataset = xdr_data
    | filter event_type = ENUM.FILE
    | filter action_device_usb_vendor_id != null
    | filter actor_effective_username not in ("NT AUTHORITY\SYSTEM")
           | filter actor_effective_username not contains  "\root"
    | alter  op =    if(event_sub_type = 1, "New file creation",
   event_sub_type = 2, "File access/opening",
   event_sub_type = 3, "File renaming",
   event_sub_type = 4, "File linking",
   event_sub_type = 5, "File deletion",
   event_sub_type = 6, "File modification",
   event_sub_type = 7, "File attribute changes",
   event_sub_type = 8, "Directory creation",
   event_sub_type = 9, "Directory access",
   event_sub_type = 10, "Directory renaming",
   event_sub_type = 11, "Directory linking",
   event_sub_type = 12, "Directory deletion",
   event_sub_type = 13, "File reparse operations",
   event_sub_type = 14, "File security changes",
   event_sub_type = 15, "File permission changes",
   event_sub_type = 16, "File ownership changes",
   to_string(event_sub_type))
| alter sanitized_path = replex(action_file_path, "[^a-zA-Z0-9_./\\-]", "")
    | alter file_op = to_string(concat(op, " : ", sanitized_path))
    | comp 
        count() as file_event_count, 
        values(file_op) as file_operations,
        values(actor_effective_username) as usernames
      by agent_hostname, action_device_usb_serial_number 
      | alter file_operations_top_100 = arrayrange(file_operations, 0, 100)
| fields file_event_count , file_operations_top_100, usernames , agent_hostname , action_device_usb_serial_number  
) as file_activity
file_activity.agent_hostname = agent_hostname and 
file_activity.action_device_usb_serial_number = action_device_usb_serial_number
| alter vendor_product = concat(  action_device_usb_vendor_name  , "   ", replace(action_device_usb_product_name,"unknown"," "))
| fields agent_os_type, agent_hostname, usernames, vendor_product,
         plug_time_readable, unplug_time_readable, session_duration_minutes,
         file_event_count, file_operations_top_100
| sort asc plug_time_readable

&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 25 Jun 2025 16:23:45 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/find-usb-mounted-storage-devices-on-windows-and-macos/m-p/1232586#M8486</guid>
      <dc:creator>A.Elzedy</dc:creator>
      <dc:date>2025-06-25T16:23:45Z</dc:date>
    </item>
    <item>
      <title>Re: Find USB mounted storage devices on Windows and macOS</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/find-usb-mounted-storage-devices-on-windows-and-macos/m-p/1232587#M8487</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/928866483"&gt;@A.Elzedy&lt;/a&gt;,&amp;nbsp;thank you, I'll have a look at this query. As for a policy blocking USB on Mac devices, there are none in place at the moment. Though that is something that we are working towards.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ideally, what I'm trying to do is determine on both Mac and Windows, how many people are using USB storage devices over a 30 day period. So strange how difficult this is to find on macOS.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Feel free to let me know if you come up with anything else and thank you for your efforts.&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Joe&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jun 2025 16:41:11 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/find-usb-mounted-storage-devices-on-windows-and-macos/m-p/1232587#M8487</guid>
      <dc:creator>Joe_Carissimo</dc:creator>
      <dc:date>2025-06-25T16:41:11Z</dc:date>
    </item>
  </channel>
</rss>

