<?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: Unused Services in General Topics</title>
    <link>https://live.paloaltonetworks.com/t5/general-topics/unused-services/m-p/188247#M57165</link>
    <description>&lt;P&gt;Hi Mate,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Would trust the migration tool. Its checking the xml for occurrances of the named object. If its not in the config it highlights it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;There's another handy bit of kit called the configurator. If you can get you head around the coding its very useful.&lt;/P&gt;&lt;P&gt;There's one cmd to delete all unused objects. If ye can delete them ye can probably parse them as well. All depends on how many ye have. 10 / 20 can check manually in the xml file yer self. 100's or 1000's maybe try sus out the configurator..&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://live.paloaltonetworks.com/t5/General-Topics/Pan-Configurator-service-edit-php/m-p/169839#M53921" target="_blank"&gt;https://live.paloaltonetworks.com/t5/General-Topics/Pan-Configurator-service-edit-php/m-p/169839#M53921&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/cpainchaud/pan-configurator" target="_blank"&gt;https://github.com/cpainchaud/pan-configurator&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;is open source, as far as I know a pan engineer developed it and maintains it..&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;some example of the code below&amp;nbsp;&lt;/P&gt;&lt;P&gt;Delete unused objects from a config :&lt;/P&gt;&lt;DIV class="highlight highlight-text-html-php"&gt;&lt;PRE&gt;&lt;SPAN class="pl-s1"&gt;    &lt;SPAN class="pl-k"&gt;foreach&lt;/SPAN&gt;(&lt;SPAN class="pl-smi"&gt;$pan&lt;/SPAN&gt;&lt;SPAN class="pl-k"&gt;-&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="pl-smi"&gt;addressStore&lt;/SPAN&gt;&lt;SPAN class="pl-k"&gt;-&amp;gt;&lt;/SPAN&gt;addressObjects() &lt;SPAN class="pl-k"&gt;as&lt;/SPAN&gt; &lt;SPAN class="pl-smi"&gt;$object&lt;/SPAN&gt; )&lt;/SPAN&gt;
&lt;SPAN class="pl-s1"&gt;      &lt;SPAN class="pl-k"&gt;if&lt;/SPAN&gt;( &lt;SPAN class="pl-smi"&gt;$object&lt;/SPAN&gt;&lt;SPAN class="pl-k"&gt;-&amp;gt;&lt;/SPAN&gt;countReferences() &lt;SPAN class="pl-k"&gt;==&lt;/SPAN&gt; &lt;SPAN class="pl-c1"&gt;0&lt;/SPAN&gt; )&lt;/SPAN&gt;
&lt;SPAN class="pl-s1"&gt;        &lt;SPAN class="pl-smi"&gt;$pan&lt;/SPAN&gt;&lt;SPAN class="pl-k"&gt;-&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="pl-smi"&gt;addressStore&lt;/SPAN&gt;&lt;SPAN class="pl-k"&gt;-&amp;gt;&lt;/SPAN&gt;remove(&lt;SPAN class="pl-smi"&gt;$object&lt;/SPAN&gt;);&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;P&gt;Want to know where an object is used ?&lt;/P&gt;&lt;DIV class="highlight highlight-text-html-php"&gt;&lt;PRE&gt;&lt;SPAN class="pl-s1"&gt;    &lt;SPAN class="pl-smi"&gt;$object&lt;/SPAN&gt; &lt;SPAN class="pl-k"&gt;=&lt;/SPAN&gt; &lt;SPAN class="pl-smi"&gt;$pan&lt;/SPAN&gt;&lt;SPAN class="pl-k"&gt;-&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="pl-smi"&gt;addressStore&lt;/SPAN&gt;&lt;SPAN class="pl-k"&gt;-&amp;gt;&lt;/SPAN&gt;find(&lt;SPAN class="pl-s"&gt;&lt;SPAN class="pl-pds"&gt;'&lt;/SPAN&gt;H-WebServer4&lt;SPAN class="pl-pds"&gt;'&lt;/SPAN&gt;&lt;/SPAN&gt;);&lt;/SPAN&gt;
&lt;SPAN class="pl-s1"&gt;    &lt;SPAN class="pl-k"&gt;foreach&lt;/SPAN&gt;( &lt;SPAN class="pl-smi"&gt;$object&lt;/SPAN&gt;&lt;SPAN class="pl-k"&gt;-&amp;gt;&lt;/SPAN&gt;getReferences() &lt;SPAN class="pl-k"&gt;as&lt;/SPAN&gt; &lt;SPAN class="pl-smi"&gt;$ref&lt;/SPAN&gt; )&lt;/SPAN&gt;
&lt;SPAN class="pl-s1"&gt;       &lt;SPAN class="pl-c1"&gt;print&lt;/SPAN&gt; &lt;SPAN class="pl-smi"&gt;$ref&lt;/SPAN&gt;&lt;SPAN class="pl-k"&gt;-&amp;gt;&lt;/SPAN&gt;toString()&lt;SPAN class="pl-k"&gt;.&lt;/SPAN&gt;&lt;SPAN class="pl-s"&gt;&lt;SPAN class="pl-pds"&gt;"&lt;/SPAN&gt;&lt;SPAN class="pl-cce"&gt;\n&lt;/SPAN&gt;&lt;SPAN class="pl-pds"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;cheers&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;rob&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 21 Nov 2017 22:48:57 GMT</pubDate>
    <dc:creator>DonohoeRobert</dc:creator>
    <dc:date>2017-11-21T22:48:57Z</dc:date>
    <item>
      <title>Unused Services</title>
      <link>https://live.paloaltonetworks.com/t5/general-topics/unused-services/m-p/188183#M57159</link>
      <description>&lt;P&gt;Is there a way to tell if a service is being used? I am trying to verify that the services the migration tool lists as unused can be deleted. It might be enough to go by what the migration tool says but I usually like to verify it a couple different ways.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Nov 2017 16:48:12 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/general-topics/unused-services/m-p/188183#M57159</guid>
      <dc:creator>jdprovine</dc:creator>
      <dc:date>2017-11-21T16:48:12Z</dc:date>
    </item>
    <item>
      <title>Re: Unused Services</title>
      <link>https://live.paloaltonetworks.com/t5/general-topics/unused-services/m-p/188247#M57165</link>
      <description>&lt;P&gt;Hi Mate,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Would trust the migration tool. Its checking the xml for occurrances of the named object. If its not in the config it highlights it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;There's another handy bit of kit called the configurator. If you can get you head around the coding its very useful.&lt;/P&gt;&lt;P&gt;There's one cmd to delete all unused objects. If ye can delete them ye can probably parse them as well. All depends on how many ye have. 10 / 20 can check manually in the xml file yer self. 100's or 1000's maybe try sus out the configurator..&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://live.paloaltonetworks.com/t5/General-Topics/Pan-Configurator-service-edit-php/m-p/169839#M53921" target="_blank"&gt;https://live.paloaltonetworks.com/t5/General-Topics/Pan-Configurator-service-edit-php/m-p/169839#M53921&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/cpainchaud/pan-configurator" target="_blank"&gt;https://github.com/cpainchaud/pan-configurator&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;is open source, as far as I know a pan engineer developed it and maintains it..&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;some example of the code below&amp;nbsp;&lt;/P&gt;&lt;P&gt;Delete unused objects from a config :&lt;/P&gt;&lt;DIV class="highlight highlight-text-html-php"&gt;&lt;PRE&gt;&lt;SPAN class="pl-s1"&gt;    &lt;SPAN class="pl-k"&gt;foreach&lt;/SPAN&gt;(&lt;SPAN class="pl-smi"&gt;$pan&lt;/SPAN&gt;&lt;SPAN class="pl-k"&gt;-&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="pl-smi"&gt;addressStore&lt;/SPAN&gt;&lt;SPAN class="pl-k"&gt;-&amp;gt;&lt;/SPAN&gt;addressObjects() &lt;SPAN class="pl-k"&gt;as&lt;/SPAN&gt; &lt;SPAN class="pl-smi"&gt;$object&lt;/SPAN&gt; )&lt;/SPAN&gt;
&lt;SPAN class="pl-s1"&gt;      &lt;SPAN class="pl-k"&gt;if&lt;/SPAN&gt;( &lt;SPAN class="pl-smi"&gt;$object&lt;/SPAN&gt;&lt;SPAN class="pl-k"&gt;-&amp;gt;&lt;/SPAN&gt;countReferences() &lt;SPAN class="pl-k"&gt;==&lt;/SPAN&gt; &lt;SPAN class="pl-c1"&gt;0&lt;/SPAN&gt; )&lt;/SPAN&gt;
&lt;SPAN class="pl-s1"&gt;        &lt;SPAN class="pl-smi"&gt;$pan&lt;/SPAN&gt;&lt;SPAN class="pl-k"&gt;-&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="pl-smi"&gt;addressStore&lt;/SPAN&gt;&lt;SPAN class="pl-k"&gt;-&amp;gt;&lt;/SPAN&gt;remove(&lt;SPAN class="pl-smi"&gt;$object&lt;/SPAN&gt;);&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;P&gt;Want to know where an object is used ?&lt;/P&gt;&lt;DIV class="highlight highlight-text-html-php"&gt;&lt;PRE&gt;&lt;SPAN class="pl-s1"&gt;    &lt;SPAN class="pl-smi"&gt;$object&lt;/SPAN&gt; &lt;SPAN class="pl-k"&gt;=&lt;/SPAN&gt; &lt;SPAN class="pl-smi"&gt;$pan&lt;/SPAN&gt;&lt;SPAN class="pl-k"&gt;-&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="pl-smi"&gt;addressStore&lt;/SPAN&gt;&lt;SPAN class="pl-k"&gt;-&amp;gt;&lt;/SPAN&gt;find(&lt;SPAN class="pl-s"&gt;&lt;SPAN class="pl-pds"&gt;'&lt;/SPAN&gt;H-WebServer4&lt;SPAN class="pl-pds"&gt;'&lt;/SPAN&gt;&lt;/SPAN&gt;);&lt;/SPAN&gt;
&lt;SPAN class="pl-s1"&gt;    &lt;SPAN class="pl-k"&gt;foreach&lt;/SPAN&gt;( &lt;SPAN class="pl-smi"&gt;$object&lt;/SPAN&gt;&lt;SPAN class="pl-k"&gt;-&amp;gt;&lt;/SPAN&gt;getReferences() &lt;SPAN class="pl-k"&gt;as&lt;/SPAN&gt; &lt;SPAN class="pl-smi"&gt;$ref&lt;/SPAN&gt; )&lt;/SPAN&gt;
&lt;SPAN class="pl-s1"&gt;       &lt;SPAN class="pl-c1"&gt;print&lt;/SPAN&gt; &lt;SPAN class="pl-smi"&gt;$ref&lt;/SPAN&gt;&lt;SPAN class="pl-k"&gt;-&amp;gt;&lt;/SPAN&gt;toString()&lt;SPAN class="pl-k"&gt;.&lt;/SPAN&gt;&lt;SPAN class="pl-s"&gt;&lt;SPAN class="pl-pds"&gt;"&lt;/SPAN&gt;&lt;SPAN class="pl-cce"&gt;\n&lt;/SPAN&gt;&lt;SPAN class="pl-pds"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;cheers&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;rob&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Nov 2017 22:48:57 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/general-topics/unused-services/m-p/188247#M57165</guid>
      <dc:creator>DonohoeRobert</dc:creator>
      <dc:date>2017-11-21T22:48:57Z</dc:date>
    </item>
    <item>
      <title>Re: Unused Services</title>
      <link>https://live.paloaltonetworks.com/t5/general-topics/unused-services/m-p/188281#M57167</link>
      <description>&lt;P&gt;and if you want to double-double check you can do a "Global Find" (top right search box or drop-down option on the service) that will search through your entire config and highlight all the places the object appears:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Global Find" style="width: 800px;"&gt;&lt;img src="https://live.paloaltonetworks.com/t5/image/serverpage/image-id/12569iFEEBCA504E6863F4/image-size/large?v=v2&amp;amp;px=999" role="button" title="global find.png" alt="Global Find" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Global Find&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Nov 2017 08:25:24 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/general-topics/unused-services/m-p/188281#M57167</guid>
      <dc:creator>reaper</dc:creator>
      <dc:date>2017-11-22T08:25:24Z</dc:date>
    </item>
    <item>
      <title>Re: Unused Services</title>
      <link>https://live.paloaltonetworks.com/t5/general-topics/unused-services/m-p/188766#M57249</link>
      <description>&lt;P&gt;regarding the solution mentioned above by using the pan-configurator:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I recommend the util script which are coming with the pan-configurator:&lt;/P&gt;&lt;P&gt;php service-edit.php in=api://[DEVICE-MGTM-IP] actions=delete 'filter=(object&amp;nbsp;&lt;SPAN&gt;is.unused.recursive&lt;/SPAN&gt;)'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With this your changes are done against the configuration available on your Palo Alto Networks firewall.&lt;/P&gt;&lt;P&gt;It is also possible to manipulate an offline PAN-OS config file:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;php service-edit.php in=[INPUT-FILE].xml out=[OUTPUT-FILE].xml actions=delete 'filter=(object&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;is.unused.recursive&lt;/SPAN&gt;&lt;SPAN&gt;)'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Nov 2017 15:21:02 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/general-topics/unused-services/m-p/188766#M57249</guid>
      <dc:creator>swaschkut</dc:creator>
      <dc:date>2017-11-27T15:21:02Z</dc:date>
    </item>
  </channel>
</rss>

