<?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: Add or remove application in a security rule in Panorama Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/panorama-discussions/add-or-remove-application-in-a-security-rule/m-p/569541#M2043</link>
    <description>&lt;P&gt;action=delete with the following syntax is not working for me&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://firewall/api/?type=config&amp;amp;action=delete&amp;amp;key=key&amp;amp;xpath=/config/shared/pre-rulebase/security/rules/entry[@name='45205-XXDOE-77787']/service/member[text()=service-https]" target="_blank"&gt;https://firewall/api/?type=config&amp;amp;action=delete&amp;amp;key=key&amp;amp;xpath=/config/shared/pre-rulebase/security/rules/entry[@name='45205-XXDOE-77787']/service/member[text()='service-https']&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;throwing the following error&lt;/P&gt;
&lt;DIV class="line"&gt;&lt;SPAN class="html-tag"&gt;&amp;lt;response&lt;SPAN class="html-attribute"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="html-attribute-name"&gt;status&lt;/SPAN&gt;="&lt;SPAN class="html-attribute-value"&gt;error&lt;/SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN class="html-attribute"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="html-attribute-name"&gt;code&lt;/SPAN&gt;="&lt;SPAN class="html-attribute-value"&gt;10&lt;/SPAN&gt;"&lt;/SPAN&gt;&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV class="opened"&gt;
&lt;DIV id="folder1" class="folder"&gt;
&lt;DIV class="line"&gt;&lt;SPAN class="html-tag"&gt;&amp;lt;msg&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV class="opened"&gt;
&lt;DIV id="folder2" class="folder"&gt;
&lt;DIV class="line"&gt;&lt;SPAN class="html-tag"&gt;&amp;lt;line&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV class="opened"&gt;
&lt;DIV class="line"&gt;&lt;SPAN&gt;&amp;lt;![CDATA[ shared -&amp;gt; pre-rulebase -&amp;gt; security -&amp;gt; rules -&amp;gt; 45205-XXDOE-77787 -&amp;gt; service is invalid. Missing service value ]]&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="line"&gt;&lt;SPAN class="html-tag"&gt;&amp;lt;/line&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="line"&gt;&lt;SPAN class="html-tag"&gt;&amp;lt;/msg&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="line"&gt;&lt;SPAN class="html-tag"&gt;&amp;lt;/response&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;</description>
    <pubDate>Tue, 12 Dec 2023 20:22:30 GMT</pubDate>
    <dc:creator>gmurugan</dc:creator>
    <dc:date>2023-12-12T20:22:30Z</dc:date>
    <item>
      <title>Add or remove application in a security rule</title>
      <link>https://live.paloaltonetworks.com/t5/panorama-discussions/add-or-remove-application-in-a-security-rule/m-p/560142#M1898</link>
      <description>&lt;P&gt;Hello.......&lt;BR /&gt;curl -k -X GET "&lt;A href="https://10.10.10.10/api/?key=LUFRPT16R......................Mg==&amp;amp;type=config&amp;amp;action=set&amp;amp;xpath=/config/devices/entry[@name='localhost.localdomain']/device-group/entry[@name='GP']/pre-rulebase/security/rules/entry[@name='Policy-1']&amp;amp;element=" target="_blank"&gt;https://10.10.10.10/api/?key=LUFRPT16R......................Mg==&amp;amp;type=config&amp;amp;action=set&amp;amp;xpath=/config/devices/entry[@name='localhost.localdomain']/device-group/entry[@name='GP']/pre-rulebase/security/rules/entry[@name='Policy-1']&amp;amp;element=&lt;/A&gt;&amp;lt;source&amp;gt;&amp;lt;member&amp;gt;any&amp;lt;/member&amp;gt;&amp;lt;/source&amp;gt;&amp;lt;destination&amp;gt;&amp;lt;member&amp;gt;any&amp;lt;/member&amp;gt;&amp;lt;/destination&amp;gt;&amp;lt;service&amp;gt;&amp;lt;member&amp;gt;any&amp;lt;/member&amp;gt;&amp;lt;/service&amp;gt;&amp;lt;application&amp;gt;&amp;lt;member&amp;gt;zoom&amp;lt;/member&amp;gt;&amp;lt;member&amp;gt;quic&amp;lt;/member&amp;gt;&amp;lt;/application&amp;gt;&amp;lt;action&amp;gt;allow&amp;lt;/action&amp;gt;&amp;lt;source-user&amp;gt;&amp;lt;member&amp;gt;any&amp;lt;/member&amp;gt;&amp;lt;/source-user&amp;gt;&amp;lt;option&amp;gt;&amp;lt;disable-server-response-inspection&amp;gt;no&amp;lt;/disable-server-response-inspection&amp;gt;&amp;lt;/option&amp;gt;&amp;lt;negate-source&amp;gt;no&amp;lt;/negate-source&amp;gt;&amp;lt;negate-destination&amp;gt;no&amp;lt;/negate-destination&amp;gt;&amp;lt;disabled&amp;gt;no&amp;lt;/disabled&amp;gt;&amp;lt;log-start&amp;gt;yes&amp;lt;/log-start&amp;gt;&amp;lt;log-end&amp;gt;yes&amp;lt;/log-end&amp;gt;&amp;lt;description&amp;gt;description&amp;lt;/description&amp;gt;&amp;lt;from&amp;gt;&amp;lt;member&amp;gt;trust&amp;lt;/member&amp;gt;&amp;lt;/from&amp;gt;&amp;lt;to&amp;gt;&amp;lt;member&amp;gt;untrust&amp;lt;/member&amp;gt;&amp;lt;/to&amp;gt;"&lt;BR /&gt;Using the above command I can create a policy. But If I want to add or delete applications in the same policy then what will be the way? I tried edit option instead of set but it shows&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;&amp;lt;response status="error" code="12"&amp;gt;&amp;lt;msg&amp;gt;&amp;lt;line&amp;gt;Edit breaks config validity&amp;lt;/line&amp;gt;&amp;lt;/msg&amp;gt;&amp;lt;/response&amp;gt; . Also I tried delete option to remove the application but it removes the Policy itself.&amp;nbsp;&amp;nbsp;&lt;BR /&gt;Maybe I am missing something. My goal is to update the policy by adding or removing applications using api.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 01 Oct 2023 17:40:51 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/panorama-discussions/add-or-remove-application-in-a-security-rule/m-p/560142#M1898</guid>
      <dc:creator>ssovee</dc:creator>
      <dc:date>2023-10-01T17:40:51Z</dc:date>
    </item>
    <item>
      <title>Re: Add or remove application in a security rule</title>
      <link>https://live.paloaltonetworks.com/t5/panorama-discussions/add-or-remove-application-in-a-security-rule/m-p/560240#M1899</link>
      <description>&lt;P&gt;Hi &lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/310948"&gt;@ssovee&lt;/a&gt; ,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The following URLs worked for me:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;To add an application to an existing rule: &amp;nbsp;
&lt;P&gt;https://&amp;lt;fw ip&amp;gt;/api/?key=&amp;lt;API-KEY&amp;gt;&amp;amp;type=config&amp;amp;action=set&amp;amp;xpath=/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys1']/rulebase/security/rules/entry[@name='Test']/application&amp;amp;element=&amp;lt;member&amp;gt;zoom&amp;lt;/member&amp;gt;&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;To delete an application from an existing rule: &amp;nbsp;&lt;/P&gt;
&lt;P&gt;https://&amp;lt;fw ip&amp;gt;/api/?key=&amp;lt;API-KEY&amp;gt;&amp;amp;type=config&amp;amp;action=delete&amp;amp;xpath=/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys1']/rulebase/security/rules/entry[@name='Test']/application/member[text()='zoom']&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;To replace all applications in an existing rule:&lt;/P&gt;
&lt;P&gt;https://&amp;lt;fw ip&amp;gt;/api/?key=&amp;lt;API-KEY&amp;gt;&amp;amp;type=config&amp;amp;action=edit&amp;amp;xpath=/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys1']/rulebase/security/rules/entry[@name='Test']/application&amp;amp;element=&amp;lt;application&amp;gt;&amp;lt;member&amp;gt;zoom&amp;lt;/member&amp;gt;&amp;lt;member&amp;gt;webex&amp;lt;/member&amp;gt;&amp;lt;member&amp;gt;ms-teams-audio-video&amp;lt;/member&amp;gt;&amp;lt;/application&amp;gt;&lt;/P&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Here is a list of XML API actions:&amp;nbsp; &lt;A href="https://docs.paloaltonetworks.com/pan-os/9-1/pan-os-panorama-api/pan-os-xml-api-request-types/pan-os-xml-api-request-types-and-actions/configuration-actions/actions-for-modifying-a-configuration" target="_blank"&gt;https://docs.paloaltonetworks.com/pan-os/9-1/pan-os-panorama-api/pan-os-xml-api-request-types/pan-os-xml-api-request-types-and-actions/configuration-actions/actions-for-modifying-a-configuration&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The action works on the xpath, which is why for set (add) and edit (replace) the application xpath is listed with specifics part of &amp;amp;element.&amp;nbsp; Since the delete action requires an xpath to the specific application, the /member[text()=''] is used.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Depending upon the automation desired, the REST API may be more consistent.&amp;nbsp; &lt;A href="https://docs.paloaltonetworks.com/pan-os/9-1/pan-os-panorama-api/get-started-with-the-pan-os-rest-api/methods-supported-rest-api#id8f0d57ab-ff2b-482a-913f-eb4f84525803" target="_blank"&gt;https://docs.paloaltonetworks.com/pan-os/9-1/pan-os-panorama-api/get-started-with-the-pan-os-rest-api/methods-supported-rest-api#id8f0d57ab-ff2b-482a-913f-eb4f84525803&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Tom&lt;/P&gt;</description>
      <pubDate>Mon, 02 Oct 2023 14:54:27 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/panorama-discussions/add-or-remove-application-in-a-security-rule/m-p/560240#M1899</guid>
      <dc:creator>TomYoung</dc:creator>
      <dc:date>2023-10-02T14:54:27Z</dc:date>
    </item>
    <item>
      <title>Re: Add or remove application in a security rule</title>
      <link>https://live.paloaltonetworks.com/t5/panorama-discussions/add-or-remove-application-in-a-security-rule/m-p/560320#M1900</link>
      <description>&lt;P&gt;Hi TomYoung,&lt;/P&gt;
&lt;P&gt;Thanks for the reply. It is very helpful. Add &amp;amp; Edit works for me. But delete didn't. Here below is the status of that.&lt;/P&gt;
&lt;P&gt;[root@ansible-manager-stg ~]# curl -k -X GET "https: //10.10.10.10/api/?key=LUFRPT16Rzg0ek03S3NINWZEanBPTFZmVFg0SFcyNWc9..........xdUUvenoyK0RkbTZOQ05Ga3dOTlFUMg==&amp;amp;type=config&amp;amp;action=delete&amp;amp;xpath=/config/devices/entry[@name='localhost.localdomain']/device-group/entry[@name='GP']/pre-rulebase/security/rules/entry[@name='Dcup']/application/member[text()='zoom']"&lt;BR /&gt;curl: (3) bad range in URL position 291:&lt;BR /&gt;https: //10.10.10.10/api/?key=LUFRPT16Rzg0ek03S3NINWZEanBPTFZmVFg0SFcyNWc9..........xdUUvenoyK0RkbTZOQ05Ga3dOTlFUMg==&amp;amp;type=config&amp;amp;action=delete&amp;amp;xpath=/config/devices/entry[@name='localhost.localdomain']/device-group/entry[@name='GP']/pre-rulebase/security/rules/entry[@name='Dcup']/application/member[text()='zoom']&lt;/P&gt;</description>
      <pubDate>Tue, 03 Oct 2023 05:08:47 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/panorama-discussions/add-or-remove-application-in-a-security-rule/m-p/560320#M1900</guid>
      <dc:creator>ssovee</dc:creator>
      <dc:date>2023-10-03T05:08:47Z</dc:date>
    </item>
    <item>
      <title>Re: Add or remove application in a security rule</title>
      <link>https://live.paloaltonetworks.com/t5/panorama-discussions/add-or-remove-application-in-a-security-rule/m-p/560321#M1901</link>
      <description>&lt;P&gt;Hi &lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/310948"&gt;@ssovee&lt;/a&gt; ,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I do not see the ] at the end of your delete URL.&amp;nbsp; Is it missing?&amp;nbsp; I promise I tested the delete syntax above.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, you should change your API key since you have posted it on this forum.&amp;nbsp; &lt;span class="lia-unicode-emoji" title=":smiling_face_with_smiling_eyes:"&gt;😊&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Tom&lt;/P&gt;</description>
      <pubDate>Tue, 03 Oct 2023 05:13:25 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/panorama-discussions/add-or-remove-application-in-a-security-rule/m-p/560321#M1901</guid>
      <dc:creator>TomYoung</dc:creator>
      <dc:date>2023-10-03T05:13:25Z</dc:date>
    </item>
    <item>
      <title>Re: Add or remove application in a security rule</title>
      <link>https://live.paloaltonetworks.com/t5/panorama-discussions/add-or-remove-application-in-a-security-rule/m-p/560331#M1904</link>
      <description>&lt;P&gt;Hi TomYoung&lt;/P&gt;
&lt;P&gt;Could you please give me the exact delete URL based on my given URL. Somehow I do not understand about missing ].&lt;/P&gt;</description>
      <pubDate>Tue, 03 Oct 2023 07:46:07 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/panorama-discussions/add-or-remove-application-in-a-security-rule/m-p/560331#M1904</guid>
      <dc:creator>ssovee</dc:creator>
      <dc:date>2023-10-03T07:46:07Z</dc:date>
    </item>
    <item>
      <title>Re: Add or remove application in a security rule</title>
      <link>https://live.paloaltonetworks.com/t5/panorama-discussions/add-or-remove-application-in-a-security-rule/m-p/560534#M1905</link>
      <description>&lt;P&gt;Hi &lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/310948"&gt;@ssovee&lt;/a&gt; ,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sorry!&amp;nbsp; I have been busy.&amp;nbsp; You should be able to get the exact URL from your API browser on Panorama and then add the /member[text()='zoom'] part to the end.&amp;nbsp; In order for a successful delete, the App-ID zoom will need to be in the rule.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Tom&lt;/P&gt;</description>
      <pubDate>Wed, 04 Oct 2023 13:43:55 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/panorama-discussions/add-or-remove-application-in-a-security-rule/m-p/560534#M1905</guid>
      <dc:creator>TomYoung</dc:creator>
      <dc:date>2023-10-04T13:43:55Z</dc:date>
    </item>
    <item>
      <title>Re: Add or remove application in a security rule</title>
      <link>https://live.paloaltonetworks.com/t5/panorama-discussions/add-or-remove-application-in-a-security-rule/m-p/569541#M2043</link>
      <description>&lt;P&gt;action=delete with the following syntax is not working for me&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://firewall/api/?type=config&amp;amp;action=delete&amp;amp;key=key&amp;amp;xpath=/config/shared/pre-rulebase/security/rules/entry[@name='45205-XXDOE-77787']/service/member[text()=service-https]" target="_blank"&gt;https://firewall/api/?type=config&amp;amp;action=delete&amp;amp;key=key&amp;amp;xpath=/config/shared/pre-rulebase/security/rules/entry[@name='45205-XXDOE-77787']/service/member[text()='service-https']&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;throwing the following error&lt;/P&gt;
&lt;DIV class="line"&gt;&lt;SPAN class="html-tag"&gt;&amp;lt;response&lt;SPAN class="html-attribute"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="html-attribute-name"&gt;status&lt;/SPAN&gt;="&lt;SPAN class="html-attribute-value"&gt;error&lt;/SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN class="html-attribute"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="html-attribute-name"&gt;code&lt;/SPAN&gt;="&lt;SPAN class="html-attribute-value"&gt;10&lt;/SPAN&gt;"&lt;/SPAN&gt;&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV class="opened"&gt;
&lt;DIV id="folder1" class="folder"&gt;
&lt;DIV class="line"&gt;&lt;SPAN class="html-tag"&gt;&amp;lt;msg&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV class="opened"&gt;
&lt;DIV id="folder2" class="folder"&gt;
&lt;DIV class="line"&gt;&lt;SPAN class="html-tag"&gt;&amp;lt;line&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV class="opened"&gt;
&lt;DIV class="line"&gt;&lt;SPAN&gt;&amp;lt;![CDATA[ shared -&amp;gt; pre-rulebase -&amp;gt; security -&amp;gt; rules -&amp;gt; 45205-XXDOE-77787 -&amp;gt; service is invalid. Missing service value ]]&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="line"&gt;&lt;SPAN class="html-tag"&gt;&amp;lt;/line&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="line"&gt;&lt;SPAN class="html-tag"&gt;&amp;lt;/msg&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="line"&gt;&lt;SPAN class="html-tag"&gt;&amp;lt;/response&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 12 Dec 2023 20:22:30 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/panorama-discussions/add-or-remove-application-in-a-security-rule/m-p/569541#M2043</guid>
      <dc:creator>gmurugan</dc:creator>
      <dc:date>2023-12-12T20:22:30Z</dc:date>
    </item>
  </channel>
</rss>

