<?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: PTA rule creation with regular expression, how to write it? in PAM Self-Hosted Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/pam-self-hosted-discussions/pta-rule-creation-with-regular-expression-how-to-write-it/m-p/1413718#M85770</link>
    <description>&lt;P&gt;Hello, Robert, thanks for the reply!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How exactly? from all I see, is that I can define a scope and put some specifications based on the vault users/accounts/target machines,  but I don't see an option to specify the path, where I want this rule to be applied in. &lt;/P&gt;</description>
    <pubDate>Thu, 07 Nov 2024 07:49:59 GMT</pubDate>
    <dc:creator>CyberArkAlumni</dc:creator>
    <dc:date>2024-11-07T07:49:59Z</dc:date>
    <item>
      <title>PTA rule creation with regular expression, how to write it?</title>
      <link>https://live.paloaltonetworks.com/t5/pam-self-hosted-discussions/pta-rule-creation-with-regular-expression-how-to-write-it/m-p/1413716#M85768</link>
      <description>&lt;P&gt;Hello, CyberArk community!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to test and create a rule in the PTA that would prevent users from executing the rm -rf command in the linux OS machine, but merely creating the rule (.*)rm -rf(.*) would trigger a lot of false positives when users would attempt to use this command for legitimate purpose. &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can someone please help, how do I need to write this regular expression to limit the blocking of this command when users are in, let's say, /etc folder, but in any other locations it it's going to be legitimate and will not get triggered?&lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2024 05:27:49 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/pam-self-hosted-discussions/pta-rule-creation-with-regular-expression-how-to-write-it/m-p/1413716#M85768</guid>
      <dc:creator>CyberArkAlumni</dc:creator>
      <dc:date>2024-11-07T05:27:49Z</dc:date>
    </item>
    <item>
      <title>Re: PTA rule creation with regular expression, how to write it?</title>
      <link>https://live.paloaltonetworks.com/t5/pam-self-hosted-discussions/pta-rule-creation-with-regular-expression-how-to-write-it/m-p/1413717#M85769</link>
      <description>&lt;P&gt;You can create an exception to the rule by editing the scope option&lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2024 07:45:05 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/pam-self-hosted-discussions/pta-rule-creation-with-regular-expression-how-to-write-it/m-p/1413717#M85769</guid>
      <dc:creator>RobertS_Cyberark</dc:creator>
      <dc:date>2024-11-07T07:45:05Z</dc:date>
    </item>
    <item>
      <title>Re: PTA rule creation with regular expression, how to write it?</title>
      <link>https://live.paloaltonetworks.com/t5/pam-self-hosted-discussions/pta-rule-creation-with-regular-expression-how-to-write-it/m-p/1413718#M85770</link>
      <description>&lt;P&gt;Hello, Robert, thanks for the reply!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How exactly? from all I see, is that I can define a scope and put some specifications based on the vault users/accounts/target machines,  but I don't see an option to specify the path, where I want this rule to be applied in. &lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2024 07:49:59 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/pam-self-hosted-discussions/pta-rule-creation-with-regular-expression-how-to-write-it/m-p/1413718#M85770</guid>
      <dc:creator>CyberArkAlumni</dc:creator>
      <dc:date>2024-11-07T07:49:59Z</dc:date>
    </item>
    <item>
      <title>Re: PTA rule creation with regular expression, how to write it?</title>
      <link>https://live.paloaltonetworks.com/t5/pam-self-hosted-discussions/pta-rule-creation-with-regular-expression-how-to-write-it/m-p/1413719#M85771</link>
      <description>&lt;P&gt;Perhaps this may help&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To create a regular expression that blocks a command only when users are in the&amp;nbsp;&lt;/P&gt;&lt;P&gt;/etc&lt;/P&gt;&lt;P&gt;&amp;nbsp;folder, you can use the following approach:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;B&gt;Anchor the pattern to the start of the string&lt;/B&gt;&amp;nbsp;to ensure it matches the beginning of the path.&lt;/LI&gt;&lt;LI&gt;&lt;B&gt;Specify the&amp;nbsp;&lt;/B&gt;&lt;/LI&gt;&lt;LI&gt;&lt;B&gt;/etc&lt;/B&gt;&lt;/LI&gt;&lt;LI&gt;&lt;B&gt;&amp;nbsp;directory&lt;/B&gt;.&lt;/LI&gt;&lt;LI&gt;&lt;B&gt;Use a wildcard to match any subdirectories or files within&amp;nbsp;&lt;/B&gt;&lt;/LI&gt;&lt;LI&gt;&lt;B&gt;/etc&lt;/B&gt;&lt;/LI&gt;&lt;LI&gt;.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Here’s an example of how you can write this regular expression:&lt;/P&gt;&lt;P&gt;^/etc(/|$)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;^&lt;/LI&gt;&lt;LI&gt;&amp;nbsp;asserts the position at the start of the string.&lt;/LI&gt;&lt;LI&gt;/etc&lt;/LI&gt;&lt;LI&gt;&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;&amp;nbsp;matches the&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;/etc&lt;/LI&gt;&lt;LI&gt;&amp;nbsp;directory.&lt;/LI&gt;&lt;LI&gt;(/|$)&lt;/LI&gt;&lt;LI&gt;&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;&amp;nbsp;ensures that the match is either followed by a&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;/&lt;/LI&gt;&lt;LI&gt;&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;&amp;nbsp;(indicating a subdirectory or file within&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;/etc&lt;/LI&gt;&lt;LI&gt;&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;) or the end of the string (indicating exactly&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;/etc&lt;/LI&gt;&lt;LI&gt;).&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;This regex will match any path that starts with&amp;nbsp;&lt;/P&gt;&lt;P&gt;/etc&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;or is exactly&amp;nbsp;&lt;/P&gt;&lt;P&gt;/etc&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;, effectively blocking the command in the&amp;nbsp;&lt;/P&gt;&lt;P&gt;/etc&lt;/P&gt;&lt;P&gt;&amp;nbsp;directory and its subdirectories, but allowing it elsewhere.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2024 09:12:12 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/pam-self-hosted-discussions/pta-rule-creation-with-regular-expression-how-to-write-it/m-p/1413719#M85771</guid>
      <dc:creator>RobertS_Cyberark</dc:creator>
      <dc:date>2024-11-07T09:12:12Z</dc:date>
    </item>
    <item>
      <title>Re: PTA rule creation with regular expression, how to write it?</title>
      <link>https://live.paloaltonetworks.com/t5/pam-self-hosted-discussions/pta-rule-creation-with-regular-expression-how-to-write-it/m-p/1413720#M85772</link>
      <description>&lt;P&gt;Robert, is that what you meant?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Field_Content_versions_oct20__068Ht00000VfefKIAR.png"&gt;&lt;img src="https://live.paloaltonetworks.com/t5/image/serverpage/image-id/90579i91C5F051B715A191/image-size/large?v=v2&amp;amp;px=999" role="button" title="Field_Content_versions_oct20__068Ht00000VfefKIAR.png" alt="Field_Content_versions_oct20__068Ht00000VfefKIAR.png" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried this it didn't work, maybe I misunderstood something.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2024 09:26:52 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/pam-self-hosted-discussions/pta-rule-creation-with-regular-expression-how-to-write-it/m-p/1413720#M85772</guid>
      <dc:creator>CyberArkAlumni</dc:creator>
      <dc:date>2024-11-07T09:26:52Z</dc:date>
    </item>
    <item>
      <title>Re: PTA rule creation with regular expression, how to write it?</title>
      <link>https://live.paloaltonetworks.com/t5/pam-self-hosted-discussions/pta-rule-creation-with-regular-expression-how-to-write-it/m-p/1413721#M85773</link>
      <description>&lt;P&gt;Hey, Robert.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I just checked if I can get the chatGPT to write the regular expression for me, and I was able to get one: .*\brm\s+-r\s+/etc(/.*)?\b.*&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This one works for cases when the /etc folder is explicitely mentioned, but it doesn't if it's not. So if I am in the /etc folder and I run this prohibited command, it's not getting triggered. &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I assume it will not be possible to create a regex that would allow to cover this aspect as well, right? From my understanding we only specify in the patterns whatever we are tracking in user's commands execution, but not which directory they are in at the moment, is that correct?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2024 10:00:24 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/pam-self-hosted-discussions/pta-rule-creation-with-regular-expression-how-to-write-it/m-p/1413721#M85773</guid>
      <dc:creator>CyberArkAlumni</dc:creator>
      <dc:date>2024-11-07T10:00:24Z</dc:date>
    </item>
    <item>
      <title>Re: PTA rule creation with regular expression, how to write it?</title>
      <link>https://live.paloaltonetworks.com/t5/pam-self-hosted-discussions/pta-rule-creation-with-regular-expression-how-to-write-it/m-p/1413722#M85774</link>
      <description>&lt;P&gt;Hi @Almaz Akhmadullin​&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As the community has not yet provided an answer to this question for some time, were you able to find a solution?&lt;/P&gt;&lt;P&gt;If so, we'd appreciate it if you could share it.&lt;/P&gt;&lt;P&gt;Your solution could help other community members who have similar questions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks, Liad.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Nov 2024 14:52:55 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/pam-self-hosted-discussions/pta-rule-creation-with-regular-expression-how-to-write-it/m-p/1413722#M85774</guid>
      <dc:creator>CyberArkAlumni</dc:creator>
      <dc:date>2024-11-18T14:52:55Z</dc:date>
    </item>
    <item>
      <title>Re: PTA rule creation with regular expression, how to write it?</title>
      <link>https://live.paloaltonetworks.com/t5/pam-self-hosted-discussions/pta-rule-creation-with-regular-expression-how-to-write-it/m-p/1413723#M85775</link>
      <description>&lt;P&gt;Hello, LiadD,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes, I was able to get the regular expression that satisfied my requirement, it's: .*^\s*\brm\s+-r\s+(/etc\b|/etc/.*)\b\s*$&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It does what I want, terminates the session if a user tries to execute rm -r /etc/  &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Only one downside, is that if a user is in the /etc folder and tries to run the command without /etc then it wouldn't work. I still don't know if it's possible to capture this case somehow. &lt;/P&gt;</description>
      <pubDate>Tue, 19 Nov 2024 07:52:01 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/pam-self-hosted-discussions/pta-rule-creation-with-regular-expression-how-to-write-it/m-p/1413723#M85775</guid>
      <dc:creator>CyberArkAlumni</dc:creator>
      <dc:date>2024-11-19T07:52:01Z</dc:date>
    </item>
    <item>
      <title>Re: PTA rule creation with regular expression, how to write it?</title>
      <link>https://live.paloaltonetworks.com/t5/pam-self-hosted-discussions/pta-rule-creation-with-regular-expression-how-to-write-it/m-p/1413724#M85776</link>
      <description>&lt;P&gt;Hi @Almaz Akhmadullin​&amp;nbsp;I think you are correct ,however  I don't think Regex alone can fully solve this problem because it only matches command strings, not the directory context. What about this ,.. alog with pta , you can use Auditd (Linux auditing tool) to monitor and block rm commands executed within /etc/ directory .&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jan 2025 00:33:46 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/pam-self-hosted-discussions/pta-rule-creation-with-regular-expression-how-to-write-it/m-p/1413724#M85776</guid>
      <dc:creator>A.Weerasinghe346640</dc:creator>
      <dc:date>2025-01-29T00:33:46Z</dc:date>
    </item>
    <item>
      <title>Re: PTA rule creation with regular expression, how to write it?</title>
      <link>https://live.paloaltonetworks.com/t5/pam-self-hosted-discussions/pta-rule-creation-with-regular-expression-how-to-write-it/m-p/1413725#M85777</link>
      <description>&lt;P&gt;Also, we could try writing a regex to block all methods that allow users to navigate to the /etc directory.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ex-.*^\s*(\bcd\b|\bpushd\b|\balias\b\s*cd\s*=\s*(["'])?cd\s+/etc(/.*)?\b.*)$&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, it would be better to use the suspend action rather than terminate, so that a manager or authorized personnel can approve the action for legitimate use cases. Additionally, you can exclude specific users from this restriction if needed.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jan 2025 00:44:31 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/pam-self-hosted-discussions/pta-rule-creation-with-regular-expression-how-to-write-it/m-p/1413725#M85777</guid>
      <dc:creator>A.Weerasinghe346640</dc:creator>
      <dc:date>2025-01-29T00:44:31Z</dc:date>
    </item>
  </channel>
</rss>

