<?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 XQL Search- to get the source of the file in Cortex XDR Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/xql-search-to-get-the-source-of-the-file/m-p/537547#M4045</link>
    <description>&lt;P&gt;I want to know the XQL query or filters which helps in the analysis of alerts &amp;amp; to know the source of file where it is coming into our system.&lt;/P&gt;
&lt;P&gt;For example- whether user downloaded the file from browser or someone sent through outlook, from portable device, etc.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 04 Apr 2023 07:28:25 GMT</pubDate>
    <dc:creator>Seth_Sakshi</dc:creator>
    <dc:date>2023-04-04T07:28:25Z</dc:date>
    <item>
      <title>XQL Search- to get the source of the file</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/xql-search-to-get-the-source-of-the-file/m-p/537547#M4045</link>
      <description>&lt;P&gt;I want to know the XQL query or filters which helps in the analysis of alerts &amp;amp; to know the source of file where it is coming into our system.&lt;/P&gt;
&lt;P&gt;For example- whether user downloaded the file from browser or someone sent through outlook, from portable device, etc.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Apr 2023 07:28:25 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/xql-search-to-get-the-source-of-the-file/m-p/537547#M4045</guid>
      <dc:creator>Seth_Sakshi</dc:creator>
      <dc:date>2023-04-04T07:28:25Z</dc:date>
    </item>
    <item>
      <title>Re: XQL Search- to get the source of the file</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/xql-search-to-get-the-source-of-the-file/m-p/537946#M4057</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;SPAN class="UserName lia-user-name lia-user-rank-L0-Member lia-component-message-view-widget-author-username"&gt;&lt;A id="link_9" class="lia-link-navigation lia-page-link lia-user-name-link" href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/188171" target="_self" aria-label="View Profile of Seth_Sakshi"&gt;&lt;SPAN class=""&gt;Seth_Sakshi&lt;/SPAN&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;1- For the incident and alert data, they are not currently exposed to any XDR dataset , hence you cannot directly query incident and alerts but this is subject to change in the future.&lt;BR /&gt;However, leads and data that is collected by the XDR agent they are exposed to XQL by using the&amp;nbsp;dataset = xdr_data.&lt;BR /&gt;&lt;BR /&gt;To query file actions for example, you can use in your search either of&amp;nbsp; the below as your data source&amp;nbsp; :&lt;BR /&gt;dataset = xdr_data&lt;BR /&gt;OR&lt;BR /&gt;preset = xdr_file &lt;BR /&gt;&lt;BR /&gt;Then you can consult eh schema buy navigating to the "Schema" tab to see what fields are there that you can use to build your filter based on your use case such as&amp;nbsp;&lt;BR /&gt;action_file_name&lt;BR /&gt;action_file_path&lt;BR /&gt;action_file_previous_file_path&lt;BR /&gt;&lt;BR /&gt;And more.&lt;BR /&gt;&lt;BR /&gt;Please note, downloading a file doesnt trigger an event that is exposed to XQL since it is not a type of event that is natively collected by the XDR agent unlike executions events like file actions and process executions, such as File write and File create, ...&lt;BR /&gt;&lt;BR /&gt;Example below for a query that looks for Binary file dropped to Public user folder:&lt;BR /&gt;&lt;BR /&gt;preset = xdr_file // Using the XDR file preset&lt;BR /&gt;| filter lowercase(action_file_path) ~= "c:\\users\\public\\.*?.(exe|dll|sys|scr|msi)" and event_sub_type = ENUM.FILE_WRITE and action_file_sha256 != null //Filtering for binary files created under c:\users\public with a sha256 value&lt;BR /&gt;| fields action_file_path as file_path, action_file_sha256 as file_sha256, actor_process_image_path as process_path, actor_process_command_line as process_cmd, causality_actor_process_image_path as cgo_path, causality_actor_process_command_line as cgo_cmd // Selecting the relevant fields&lt;BR /&gt;| dedup file_path, file_sha256, process_path, process_cmd, cgo_path, cgo_cmd by asc _time // Dedupping values to only show the first time a file was written&lt;BR /&gt;&lt;BR /&gt;Hope that was helpful and shed some light!&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Apr 2023 23:11:39 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/xql-search-to-get-the-source-of-the-file/m-p/537946#M4057</guid>
      <dc:creator>zarnous</dc:creator>
      <dc:date>2023-04-06T23:11:39Z</dc:date>
    </item>
    <item>
      <title>Re: XQL Search- to get the source of the file</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/xql-search-to-get-the-source-of-the-file/m-p/537954#M4058</link>
      <description>&lt;P&gt;Hello Zarnous,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for your input.&lt;/P&gt;
&lt;P&gt;I have some more queries regarding this-&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Can we get the logs of a file which is not executed but only detected during the weekly malware scan? I want to know by when and where this file comes into the system.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Thanks in advance.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Sakshi Seth&lt;/P&gt;</description>
      <pubDate>Fri, 07 Apr 2023 05:08:03 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/xql-search-to-get-the-source-of-the-file/m-p/537954#M4058</guid>
      <dc:creator>Seth_Sakshi</dc:creator>
      <dc:date>2023-04-07T05:08:03Z</dc:date>
    </item>
    <item>
      <title>Re: XQL Search- to get the source of the file</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/xql-search-to-get-the-source-of-the-file/m-p/538002#M4061</link>
      <description>&lt;P&gt;as long as this information was captured by the agent then yes for sure, you can start with something as simple as looking for a file name or a part of the file name/ extension:&lt;/P&gt;
&lt;P&gt;For example, i am looking for file that have ".json"&amp;nbsp;&lt;BR /&gt;preset = xdr_file &lt;BR /&gt;| filter (action_file_name contains """.json""")&lt;BR /&gt;&lt;BR /&gt;Then you can define the Event sub type you are looking for,&amp;nbsp; such as&amp;nbsp;&lt;BR /&gt;FILE_CREATE_NEW&lt;BR /&gt;FILE_REMOVE&lt;BR /&gt;FILE_RENAME&lt;BR /&gt;&lt;BR /&gt;Or you can just leave it with no specific sub event type to see all actions taken on that specific file , like in the below screenshot that looks for all files with ".json" with no specific sub event type specified&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="zarnous_0-1680877630787.png" style="width: 400px;"&gt;&lt;img src="https://live.paloaltonetworks.com/t5/image/serverpage/image-id/49329i24C218906776BA3E/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400" role="button" title="zarnous_0-1680877630787.png" alt="zarnous_0-1680877630787.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then lets say you want to filter on more actions / field, you can do that by simply filter on the field you would like to look for then you can easily export the grid filter up toe the XQ-Filed as seen below&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="zarnous_2-1680878290403.png" style="width: 400px;"&gt;&lt;img src="https://live.paloaltonetworks.com/t5/image/serverpage/image-id/49330i37895C32A76E01E8/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400" role="button" title="zarnous_2-1680878290403.png" alt="zarnous_2-1680878290403.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;This way you can build your filters to apply to the use case you are looking for&lt;BR /&gt;&lt;BR /&gt;Hope that helps!&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Apr 2023 14:38:42 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/xql-search-to-get-the-source-of-the-file/m-p/538002#M4061</guid>
      <dc:creator>zarnous</dc:creator>
      <dc:date>2023-04-07T14:38:42Z</dc:date>
    </item>
  </channel>
</rss>

