<?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: Show Local Device Policies in Automation/API Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/show-local-device-policies/m-p/189199#M1512</link>
    <description>&lt;P&gt;Ended up realizing my own fail - was using the URL for panorama and not the device I wanted to target (d'oh!)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For anyone seeing this later, here's a Powershell function I wrote to pull the information I was after:&lt;/P&gt;&lt;P&gt;Function Get-LocalDeviceSecurityPolicies($DeviceIP)&lt;BR /&gt;{&lt;BR /&gt;$response = Invoke-RestMethod "https://$DeviceIP/api/?key=$apiKey&amp;amp;type=config&amp;amp;action=get&amp;amp;xpath=/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys1']/rulebase/security"&lt;BR /&gt;return $response.response.result.security.rules.entry&lt;BR /&gt;}&lt;/P&gt;</description>
    <pubDate>Wed, 29 Nov 2017 20:35:21 GMT</pubDate>
    <dc:creator>f1r3withf1r3</dc:creator>
    <dc:date>2017-11-29T20:35:21Z</dc:date>
    <item>
      <title>Show Local Device Policies</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/show-local-device-policies/m-p/189120#M1508</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm searching through the API browser on my PAN-OS 8 instance, and wondering where the syntax exists for exploring/getting the local policies per-physical device.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Or for clarity's sake - what API endpoint would return all of the local device's security policies. I am using some from Panorama globally, and cleaning up local security policies.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Not asking for someone to write a query for me, just point me to the right place in the API, please.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help appreciated!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Nov 2017 14:08:41 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/show-local-device-policies/m-p/189120#M1508</guid>
      <dc:creator>f1r3withf1r3</dc:creator>
      <dc:date>2017-11-29T14:08:41Z</dc:date>
    </item>
    <item>
      <title>Re: Show Local Device Policies</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/show-local-device-policies/m-p/189164#M1509</link>
      <description>&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;Policies on firewalls are located in `rulebase` under the vsys (for vsys1 below):&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="p1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys1']/rulebase&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="p1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;Policies on panorama are split between `pre-rulebase` and `post-rulebase` (for device group `Some group` below):&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="p1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;/config/devices/entry[@name='localhost.localdomain']/device-group/entry[@name='Some group']/pre-rulebase&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;/config/devices/entry[@name='localhost.localdomain']/device-group/entry[@name='Some group']/post-rulebase&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Nov 2017 16:58:23 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/show-local-device-policies/m-p/189164#M1509</guid>
      <dc:creator>gfreeman</dc:creator>
      <dc:date>2017-11-29T16:58:23Z</dc:date>
    </item>
    <item>
      <title>Re: Show Local Device Policies</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/show-local-device-policies/m-p/189172#M1510</link>
      <description>&lt;P&gt;Awesome, thanks so much &lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/46544"&gt;@gfreeman&lt;/a&gt;!&lt;/P&gt;</description>
      <pubDate>Wed, 29 Nov 2017 18:13:52 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/show-local-device-policies/m-p/189172#M1510</guid>
      <dc:creator>f1r3withf1r3</dc:creator>
      <dc:date>2017-11-29T18:13:52Z</dc:date>
    </item>
    <item>
      <title>Re: Show Local Device Policies</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/show-local-device-policies/m-p/189173#M1511</link>
      <description>&lt;P&gt;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/46544"&gt;@gfreeman&lt;/a&gt;, if I enter:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys1']/rulebase&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;into the XPath search in the API browser, I get a 403 response of:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;panCmsHandleDeviceContextReq: getRemoteContent() got response code 403&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and same response if I try and submit:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='nameofmyfirewall']/rulebase&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm a super user on my Panorama instance, and have 1 vsys in it, so not sure why that query when hitting submit isn't working.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Halps?&lt;/P&gt;</description>
      <pubDate>Wed, 29 Nov 2017 18:46:42 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/show-local-device-policies/m-p/189173#M1511</guid>
      <dc:creator>f1r3withf1r3</dc:creator>
      <dc:date>2017-11-29T18:46:42Z</dc:date>
    </item>
    <item>
      <title>Re: Show Local Device Policies</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/show-local-device-policies/m-p/189199#M1512</link>
      <description>&lt;P&gt;Ended up realizing my own fail - was using the URL for panorama and not the device I wanted to target (d'oh!)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For anyone seeing this later, here's a Powershell function I wrote to pull the information I was after:&lt;/P&gt;&lt;P&gt;Function Get-LocalDeviceSecurityPolicies($DeviceIP)&lt;BR /&gt;{&lt;BR /&gt;$response = Invoke-RestMethod "https://$DeviceIP/api/?key=$apiKey&amp;amp;type=config&amp;amp;action=get&amp;amp;xpath=/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys1']/rulebase/security"&lt;BR /&gt;return $response.response.result.security.rules.entry&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Wed, 29 Nov 2017 20:35:21 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/show-local-device-policies/m-p/189199#M1512</guid>
      <dc:creator>f1r3withf1r3</dc:creator>
      <dc:date>2017-11-29T20:35:21Z</dc:date>
    </item>
  </channel>
</rss>

