<?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: Blocking Powershell Execution in Cortex XDR Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/blocking-powershell-execution/m-p/539853#M4218</link>
    <description>&lt;P&gt;Hi Jtalton,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Usually, PowerShell is used by multiple legitimate applications in the environment. A BIOC rule get disabled automatically after 5000 alerts. I believe continuous whitelisting and provide excpetions is the only way. Please help in case you believe there are better ways to achieve the following usecase:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Reuiqrement:&lt;/P&gt;
&lt;P&gt;Block PowerShell usage in the environment and allow only legitimate ones. We have identified the legitimate CGO's but unable to identify a method to whitelist these processes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Queries:&lt;/P&gt;
&lt;P&gt;1. Restrisction policy - Is it possible to whitelist legitimate parent processes (CGO's) in the restriction profile and block all other PowerShell executions?&lt;/P&gt;
&lt;P&gt;2. BIOC rule - Exceptions can be provided but rule gets disabled once it hits 5k alerts in 24 hours which is by design?&lt;/P&gt;
&lt;P&gt;3. Do let us know if there is any other method to achieve this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&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;Rahul&lt;/P&gt;</description>
    <pubDate>Mon, 24 Apr 2023 05:24:15 GMT</pubDate>
    <dc:creator>Rahul9</dc:creator>
    <dc:date>2023-04-24T05:24:15Z</dc:date>
    <item>
      <title>Blocking Powershell Execution</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/blocking-powershell-execution/m-p/532881#M3742</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is it possible to block PowerShell execution on all endpoints through CortexXDR, if possible kindly give the process to do the same?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Mar 2023 06:04:19 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/blocking-powershell-execution/m-p/532881#M3742</guid>
      <dc:creator>Shahwaz_Md</dc:creator>
      <dc:date>2023-03-02T06:04:19Z</dc:date>
    </item>
    <item>
      <title>Re: Blocking Powershell Execution</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/blocking-powershell-execution/m-p/532987#M3752</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi&amp;nbsp;Shahwaz_Md,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;XDR utilizes custom BIOC rules where you create BIOC rules based on the set of attribute-value pairs to automatically convert the leads into alerts. Please also reference detections in the &lt;/SPAN&gt;&lt;A href="https://docs-cortex.paloaltonetworks.com/r/Cortex-XDR/Cortex-XDR-Analytics-Alert-Reference/Cortex-XDR-Analytics-Alert-Reference" target="_blank"&gt;&lt;SPAN&gt;XDR analytics alert reference&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt; for possible alerts relating uncommon PowerShell&amp;nbsp;commands/ scheduled tasks.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;To create a BIOC rule, navigate to &lt;STRONG&gt;Incident Response&amp;gt; Query Builder&lt;/STRONG&gt;&lt;STRONG&gt;&amp;gt; then&lt;/STRONG&gt;&amp;nbsp;select &lt;STRONG&gt;XQL search&lt;/STRONG&gt;. Here, you can enter an XQL query to identify endpoints executing PowerShell. To get started, here is a query to test:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;dataset = xdr_data // Using the XDR dataset
| filter lowercase(actor_process_image_name) = "powershell.exe"and action_evtlog_username not contains "system"// Filtering for parent process is powershell.exe and filtering out system
| filter event_type = ENUM.PROCESS and event_sub_type = ENUM.PROCESS_START and lowercase(actor_process_image_name) = "powershell.exe" // Filtering for parent process is powershell.exe
| alter process_cmd = if(lowercase(action_process_image_command_line) contains "c:\users", replex(lowercase(action_process_image_command_line), "c:\\users\\[a-zA-Z0-9.]*", "c:\\users\\USERNAME"), action_process_image_command_line) // Running an alter command to make sure the functions later ignore differences in user paths
| fields action_process_image_name as process_name, action_process_image_command_line as process_cmd, event_id,agent_hostname as hostname, actor_process_image_path as process_path, causality_actor_process_image_path as cgo_path, causality_actor_process_command_line as cgo_cmd // Getting the relevant fields&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Once the XQL query is complete, you can create a BIOC rule utilizing its insightful information. BIOC rules can be added via &lt;STRONG&gt;Detection Rules &amp;gt; BIOC &amp;gt; + Add BIOC&lt;/STRONG&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;To block, you can add the BIOC rule via a Customer Prevention rule in the Restrictions Profile.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The Restriction profile allows you to apply custom made BIOC's that upon detection will be prevented by the agent, in case you are using the default profiles then no prevention will take place but the detection will happen if the BIOC rule is configured in your BIOC repository (preconfigured or custom made BIOCs).&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Here is a walkthrough&amp;nbsp;of the&amp;nbsp;&lt;/SPAN&gt;process Custom&lt;A href="https://live.paloaltonetworks.com/t5/cortex-xdr-how-to-videos/custom-prevention-rules/ta-p/347271" target="_blank"&gt;&lt;SPAN&gt;&amp;nbsp;Prevention Rules| Palo Alto Networks&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;After testing is complete, to narrow the scope, consider applying this BIOC/Restrictions profile to endpoints via a policy applied to an endpoint group.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If you found this response helpful, please like and click Accept as Solution.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thanks,&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Jtalton&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Mar 2023 17:02:28 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/blocking-powershell-execution/m-p/532987#M3752</guid>
      <dc:creator>jtalton</dc:creator>
      <dc:date>2023-03-02T17:02:28Z</dc:date>
    </item>
    <item>
      <title>Re: Blocking Powershell Execution</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/blocking-powershell-execution/m-p/539853#M4218</link>
      <description>&lt;P&gt;Hi Jtalton,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Usually, PowerShell is used by multiple legitimate applications in the environment. A BIOC rule get disabled automatically after 5000 alerts. I believe continuous whitelisting and provide excpetions is the only way. Please help in case you believe there are better ways to achieve the following usecase:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Reuiqrement:&lt;/P&gt;
&lt;P&gt;Block PowerShell usage in the environment and allow only legitimate ones. We have identified the legitimate CGO's but unable to identify a method to whitelist these processes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Queries:&lt;/P&gt;
&lt;P&gt;1. Restrisction policy - Is it possible to whitelist legitimate parent processes (CGO's) in the restriction profile and block all other PowerShell executions?&lt;/P&gt;
&lt;P&gt;2. BIOC rule - Exceptions can be provided but rule gets disabled once it hits 5k alerts in 24 hours which is by design?&lt;/P&gt;
&lt;P&gt;3. Do let us know if there is any other method to achieve this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&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;Rahul&lt;/P&gt;</description>
      <pubDate>Mon, 24 Apr 2023 05:24:15 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/blocking-powershell-execution/m-p/539853#M4218</guid>
      <dc:creator>Rahul9</dc:creator>
      <dc:date>2023-04-24T05:24:15Z</dc:date>
    </item>
  </channel>
</rss>

