<?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 Query Help in Cortex XDR Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/xql-query-help/m-p/600027#M7299</link>
    <description>&lt;P&gt;I'm trying to write a few XQL queries in Cortex XDR, but I’m quite new to it and running into some difficulties. I’d really appreciate any guidance or examples you can provide for any of the following queries:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;To detect when the Cortex XDR Agent is uninstalled,&lt;/LI&gt;
&lt;LI&gt;To trigger an alert for Tamper Detection,&lt;/LI&gt;
&lt;LI&gt;To monitor if a live terminal session is initiated on any machine,&lt;/LI&gt;
&lt;LI&gt;To identify Domain Admin logon events occurring between 19:30 and 07:30 (I believe Event ID 4672 can be used here).&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;Thank you very much for your help &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 10 Oct 2024 10:05:25 GMT</pubDate>
    <dc:creator>Y.Kiroglu</dc:creator>
    <dc:date>2024-10-10T10:05:25Z</dc:date>
    <item>
      <title>XQL Query Help</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/xql-query-help/m-p/600027#M7299</link>
      <description>&lt;P&gt;I'm trying to write a few XQL queries in Cortex XDR, but I’m quite new to it and running into some difficulties. I’d really appreciate any guidance or examples you can provide for any of the following queries:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;To detect when the Cortex XDR Agent is uninstalled,&lt;/LI&gt;
&lt;LI&gt;To trigger an alert for Tamper Detection,&lt;/LI&gt;
&lt;LI&gt;To monitor if a live terminal session is initiated on any machine,&lt;/LI&gt;
&lt;LI&gt;To identify Domain Admin logon events occurring between 19:30 and 07:30 (I believe Event ID 4672 can be used here).&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;Thank you very much for your help &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Oct 2024 10:05:25 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/xql-query-help/m-p/600027#M7299</guid>
      <dc:creator>Y.Kiroglu</dc:creator>
      <dc:date>2024-10-10T10:05:25Z</dc:date>
    </item>
    <item>
      <title>Re: XQL Query Help</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/xql-query-help/m-p/600065#M7304</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/1233674317"&gt;@Y.Kiroglu&lt;/a&gt;, thanks for reaching us using the Live Community.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let me try to help you with your questions:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1 &amp;amp; 2 - You can see all those events in Settings - Agent Audit logs, and you can forward those events to get alerted. &lt;A href="https://docs-cortex.paloaltonetworks.com/r/Cortex-XDR/Cortex-XDR-Documentation/Monitor-agent-activity" target="_self"&gt;This is the document&lt;/A&gt; you should check.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3- This events are stored in Settings - Management Audit Logs, and you can forward the events in the same way as the Agent Audit logs. Check &lt;A href="https://docs-cortex.paloaltonetworks.com/r/Cortex-XDR/Cortex-XDR-Documentation/Monitor-administrative-activity" target="_self"&gt;this doc&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;4- Try this XQL query, it may not be complete but can help:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;dataset = xdr_data // Using the xdr dataset&lt;BR /&gt;| filter event_type = ENUM.EVENT_LOG and action_evtlog_event_id = 4672 // Filtering by windows event log and id 4672&lt;BR /&gt;| alter Security_ID =arrayindex(regextract(action_evtlog_message, "Security:\r\n.*\r\n"),0), &lt;BR /&gt;Account_Name = arrayindex(regextract(action_evtlog_message, "Account Name:.*?(\w.*)\r\n"),0), &lt;BR /&gt;Domain = arrayindex(regextract(action_evtlog_message, "Account Domain:.*?(\w.*?)\r\n"),0), &lt;BR /&gt;Privileges = arrayindex(regextract(action_evtlog_message, "Privileges:.*?(\d+\.\d+\.\d+\.\d+)\r\n"),0)&lt;/P&gt;
&lt;P&gt;| fields Security_ID, Account_Name, Domain, Privileges // Select all the fields to show them&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I saw some other posts with this questions, I'll point them to this topic.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post answers your question, please mark it as the solution.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Oct 2024 13:59:33 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/xql-query-help/m-p/600065#M7304</guid>
      <dc:creator>jmazzeo</dc:creator>
      <dc:date>2024-10-10T13:59:33Z</dc:date>
    </item>
  </channel>
</rss>

