<?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 Usage of regex for an executable application definition's 'parameter' not working as expected in Endpoint Privilege Manager (EPM) Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/endpoint-privilege-manager-epm/usage-of-regex-for-an-executable-application-definition-s/m-p/1370016#M4226</link>
    <description>&lt;P&gt;We have CyberArk EPM SaaS version (25.10.0.5070)&lt;/P&gt;&lt;P&gt;I want to use below regular expression to block few powershell commands that fetch from the internet and pipe straight into Invoke-Expression. We drafted below regex, but when configured in the 'Parameter' property field's value, is not able to detect the sample commands listed. Has anyone experience this issue with using regex?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;RegEx: &lt;/P&gt;&lt;CODE&gt;^.*(iwr|invoke-webrequest)[^|]*\|\s*(iex|invoke-expression).*&lt;/CODE&gt;&lt;P&gt;RegEx explanation:&lt;/P&gt;&lt;CODE&gt;(iwr|invoke-webrequest) -&amp;gt; matches 'iwr' or 'invoke-webrequest' commands to download from internet
[^|]*\| -&amp;gt; eats everything from the end of iwr up to the first |
\s*(iex|invoke-expression) -&amp;gt; confirms the next token is 'iex' or 'invoke-expression'&lt;/CODE&gt;&lt;P&gt;Sample lines of command the regular expression should be able to catch:&lt;/P&gt;&lt;CODE&gt;powershell.exe iwr https://google.com | iex
powershell.exe iwr https://google.com | invoke-expression
powershell.exe invoke-webrequest https://google.com | iex&lt;/CODE&gt;&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper" image-alt="Field_Content_versions_oct20__068Vy00000uzKSzIAM.png"&gt;&lt;img src="https://live.paloaltonetworks.com/t5/image/serverpage/image-id/93997i4CCB6612DCD76D04/image-size/large?v=v2&amp;amp;px=999" role="button" title="Field_Content_versions_oct20__068Vy00000uzKSzIAM.png" alt="Field_Content_versions_oct20__068Vy00000uzKSzIAM.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 21 Oct 2025 20:11:34 GMT</pubDate>
    <dc:creator>ajit_sutreja</dc:creator>
    <dc:date>2025-10-21T20:11:34Z</dc:date>
    <item>
      <title>Usage of regex for an executable application definition's 'parameter' not working as expected</title>
      <link>https://live.paloaltonetworks.com/t5/endpoint-privilege-manager-epm/usage-of-regex-for-an-executable-application-definition-s/m-p/1370016#M4226</link>
      <description>&lt;P&gt;We have CyberArk EPM SaaS version (25.10.0.5070)&lt;/P&gt;&lt;P&gt;I want to use below regular expression to block few powershell commands that fetch from the internet and pipe straight into Invoke-Expression. We drafted below regex, but when configured in the 'Parameter' property field's value, is not able to detect the sample commands listed. Has anyone experience this issue with using regex?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;RegEx: &lt;/P&gt;&lt;CODE&gt;^.*(iwr|invoke-webrequest)[^|]*\|\s*(iex|invoke-expression).*&lt;/CODE&gt;&lt;P&gt;RegEx explanation:&lt;/P&gt;&lt;CODE&gt;(iwr|invoke-webrequest) -&amp;gt; matches 'iwr' or 'invoke-webrequest' commands to download from internet
[^|]*\| -&amp;gt; eats everything from the end of iwr up to the first |
\s*(iex|invoke-expression) -&amp;gt; confirms the next token is 'iex' or 'invoke-expression'&lt;/CODE&gt;&lt;P&gt;Sample lines of command the regular expression should be able to catch:&lt;/P&gt;&lt;CODE&gt;powershell.exe iwr https://google.com | iex
powershell.exe iwr https://google.com | invoke-expression
powershell.exe invoke-webrequest https://google.com | iex&lt;/CODE&gt;&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper" image-alt="Field_Content_versions_oct20__068Vy00000uzKSzIAM.png"&gt;&lt;img src="https://live.paloaltonetworks.com/t5/image/serverpage/image-id/93997i4CCB6612DCD76D04/image-size/large?v=v2&amp;amp;px=999" role="button" title="Field_Content_versions_oct20__068Vy00000uzKSzIAM.png" alt="Field_Content_versions_oct20__068Vy00000uzKSzIAM.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Oct 2025 20:11:34 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/endpoint-privilege-manager-epm/usage-of-regex-for-an-executable-application-definition-s/m-p/1370016#M4226</guid>
      <dc:creator>ajit_sutreja</dc:creator>
      <dc:date>2025-10-21T20:11:34Z</dc:date>
    </item>
    <item>
      <title>Re: Usage of regex for an executable application definition's 'parameter' not working as expected</title>
      <link>https://live.paloaltonetworks.com/t5/endpoint-privilege-manager-epm/usage-of-regex-for-an-executable-application-definition-s/m-p/1370017#M4227</link>
      <description>&lt;P&gt;CyberArk EPM uses the CAtlRegExp class; therefore, we must use the syntax and features supported by CAtlRegExp&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt; &lt;A alt="https://docs.cyberark.com/EPM-onprem/10.10/en/Content/EPM/Server%20User%20Guide/Appendix%20E%20-%20Regular%20Expression%20Syntax.htm" href="https://docs.cyberark.com/EPM-onprem/10.10/en/Content/EPM/Server%20User%20Guide/Appendix%20E%20-%20Regular%20Expression%20Syntax.htm" target="_blank"&gt;Regular Expression Syntax&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below simple example match either "iwr" or  "invoke-webrequest" match&lt;/P&gt;&lt;CODE&gt;.*((iwr)|(invoke-webrequest)).*&lt;/CODE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Field_Content_versions_oct20__068Vy00000v4OZEIA2.png"&gt;&lt;img src="https://live.paloaltonetworks.com/t5/image/serverpage/image-id/94005i4B76F1AD9FA74B4F/image-size/large?v=v2&amp;amp;px=999" role="button" title="Field_Content_versions_oct20__068Vy00000v4OZEIA2.png" alt="Field_Content_versions_oct20__068Vy00000v4OZEIA2.png" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Oct 2025 09:24:09 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/endpoint-privilege-manager-epm/usage-of-regex-for-an-executable-application-definition-s/m-p/1370017#M4227</guid>
      <dc:creator>mkris</dc:creator>
      <dc:date>2025-10-22T09:24:09Z</dc:date>
    </item>
    <item>
      <title>Re: Usage of regex for an executable application definition's 'parameter' not working as expected</title>
      <link>https://live.paloaltonetworks.com/t5/endpoint-privilege-manager-epm/usage-of-regex-for-an-executable-application-definition-s/m-p/1370018#M4228</link>
      <description>&lt;P&gt;Thank you so much @Manikandan Krishnasamy​&amp;nbsp;for this sample regex. I was able to only match the command when there is no pipe (|) used at all in the command. For example this below regex,&lt;/P&gt;&lt;CODE&gt;.*((iwr)|(invoke-webrequest)).*((http)|(https)).*((iex)|(invoke-expression)).*&lt;/CODE&gt;&lt;P&gt;is able to match this command: &lt;/P&gt;&lt;CODE&gt;powershell.exe iwr https://google.com iex&lt;/CODE&gt;&lt;P&gt;but NOT able to match this command because there is a pipe:&lt;/P&gt;&lt;CODE&gt;powershell.exe iwr https://google.com | iex&lt;/CODE&gt;&lt;P&gt;Could someone from CyberArk EPM support/engineer confirm for sure if this truly a limitation?&lt;/P&gt;</description>
      <pubDate>Thu, 23 Oct 2025 02:11:13 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/endpoint-privilege-manager-epm/usage-of-regex-for-an-executable-application-definition-s/m-p/1370018#M4228</guid>
      <dc:creator>ajit_sutreja</dc:creator>
      <dc:date>2025-10-23T02:11:13Z</dc:date>
    </item>
  </channel>
</rss>

