<?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: Using XML API to query policy post rules in Automation/API Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/using-xml-api-to-query-policy-post-rules/m-p/421689#M2731</link>
    <description>&lt;P&gt;Ding, ding, ding! We have a winner. So what I am looking to accomplish &lt;STRONG&gt;&lt;EM&gt;is&lt;/EM&gt;&lt;/STRONG&gt; audit/research level work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;On a competitor's product (which shall remain nameless) I am able to issue the following simple, single-line CLI command (on a device-by-device basis) and get back an exhaustive std output of every member rule matching the IP that I'm searching for --either as source or as destination:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;show access-list | include {{ lookupIP }}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;This is exactly the kind of functionality that I'm looking for from Panorama/PAN-OS.&lt;/P&gt;</description>
    <pubDate>Fri, 23 Jul 2021 15:49:23 GMT</pubDate>
    <dc:creator>julio.toledo</dc:creator>
    <dc:date>2021-07-23T15:49:23Z</dc:date>
    <item>
      <title>Using XML API to query policy post rules</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/using-xml-api-to-query-policy-post-rules/m-p/419337#M2724</link>
      <description>&lt;P&gt;Trying to find the correct syntax for querying Panorama for policy post rules by matching IP address (source or destination IP) using the PanOS XML API.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have looked at:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;our XML API Browser page (i.e. &lt;A target="_blank" rel="noopener"&gt;https://&amp;lt;mypanoramahostname&amp;gt;/api&lt;/A&gt;),&lt;/LI&gt;&lt;LI&gt;the online docs (&lt;A href="https://docs.paloaltonetworks.com/pan-os/9-1/pan-os-panorama-api/" target="_blank" rel="noopener"&gt;https://docs.paloaltonetworks.com/pan-os/9-1/pan-os-panorama-api/&lt;/A&gt;),&lt;/LI&gt;&lt;LI&gt;A documented Postman collection(&lt;A href="https://documenter.getpostman.com/view/2937330/7LgDQwG" target="_blank"&gt;https://documenter.getpostman.com/view/2937330/7LgDQwG&lt;/A&gt;), and&lt;/LI&gt;&lt;LI&gt;this LIVEcommunity site.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Still not finding what I am looking for. Is it me, or is API not sufficiently well documented? Can anyone point me to where I can find documentation for each PanOS XML API endpoint, preferably with syntax examples for all possible endpoint parameters?&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jul 2021 14:58:02 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/using-xml-api-to-query-policy-post-rules/m-p/419337#M2724</guid>
      <dc:creator>julio.toledo</dc:creator>
      <dc:date>2021-07-15T14:58:02Z</dc:date>
    </item>
    <item>
      <title>Re: Using XML API to query policy post rules</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/using-xml-api-to-query-policy-post-rules/m-p/420430#M2726</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/182385"&gt;@julio.toledo&lt;/a&gt;, I believe you're trying to use the "test policy match" feature via API? If so,&amp;nbsp;I did something similar a couple of weeks ago. I did NAT rules, but you could easily change the API call below to use security rules instead.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;https://{{panorama-host}}/api?key={{key}}&amp;amp;type=op&amp;amp;cmd=&amp;lt;request-batch&amp;gt;&amp;lt;op-command&amp;gt;&amp;lt;device&amp;gt;&amp;lt;entry name="{{fw1-serial}}"&amp;gt;&amp;lt;vsys&amp;gt;&amp;lt;list&amp;gt;&amp;lt;member&amp;gt;vsys1&amp;lt;/member&amp;gt;&amp;lt;/list&amp;gt;&amp;lt;/vsys&amp;gt;&amp;lt;/entry&amp;gt;&amp;lt;entry name="{{fw2-serial}}"&amp;gt;&amp;lt;vsys&amp;gt;&amp;lt;list&amp;gt;&amp;lt;member&amp;gt;vsys1&amp;lt;/member&amp;gt;&amp;lt;/list&amp;gt;&amp;lt;/vsys&amp;gt;&amp;lt;/entry&amp;gt;&amp;lt;/device&amp;gt;&amp;lt;test&amp;gt;&amp;lt;nat-policy-match&amp;gt;&amp;lt;from&amp;gt;Management&amp;lt;/from&amp;gt;&amp;lt;to&amp;gt;External&amp;lt;/to&amp;gt;&amp;lt;source&amp;gt;172.31.10.50&amp;lt;/source&amp;gt;&amp;lt;destination&amp;gt;8.8.8.8&amp;lt;/destination&amp;gt;&amp;lt;destination-port&amp;gt;443&amp;lt;/destination-port&amp;gt;&amp;lt;protocol&amp;gt;6&amp;lt;/protocol&amp;gt;&amp;lt;/nat-policy-match&amp;gt;&amp;lt;/test&amp;gt;&amp;lt;/op-command&amp;gt;&amp;lt;/request-batch&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I find the easiest way to find API calls is to &lt;A href="https://docs.paloaltonetworks.com/pan-os/10-0/pan-os-panorama-api/get-started-with-the-pan-os-xml-api/explore-the-api/use-the-web-interface-to-find-xml-api-syntax.html" target="_self"&gt;debug the GUI&lt;/A&gt;, or &lt;A href="https://docs.paloaltonetworks.com/pan-os/10-0/pan-os-panorama-api/get-started-with-the-pan-os-xml-api/explore-the-api/use-the-cli-to-find-xml-api-syntax.html" target="_self"&gt;debug the CLI&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jul 2021 17:13:19 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/using-xml-api-to-query-policy-post-rules/m-p/420430#M2726</guid>
      <dc:creator>JimmyHolland</dc:creator>
      <dc:date>2021-07-19T17:13:19Z</dc:date>
    </item>
    <item>
      <title>Re: Using XML API to query policy post rules</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/using-xml-api-to-query-policy-post-rules/m-p/420468#M2727</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/4294"&gt;@JimmyHolland&lt;/a&gt;. Yes, I am trying to query security rules via API, either aggregate rules from all devices or from a particular device. However I am not a network or firewall engineer, so things like PanOS CLI commands and Panorama schema (objects, properties, etc.) are new to me.&lt;/P&gt;&lt;P&gt;I find it hard to understand that there is no online reference to the Panorama schema and how it maps to either CLI commands and/or API requests. Reverse engineering it by debugging the GUI or the CLI seems rather backwards, don't you agree?&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jul 2021 18:31:04 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/using-xml-api-to-query-policy-post-rules/m-p/420468#M2727</guid>
      <dc:creator>julio.toledo</dc:creator>
      <dc:date>2021-07-19T18:31:04Z</dc:date>
    </item>
    <item>
      <title>Re: Using XML API to query policy post rules</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/using-xml-api-to-query-policy-post-rules/m-p/420477#M2728</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/182385"&gt;@julio.toledo&lt;/a&gt;, I understand learning the PAN-OS schema must be a challenge if you are new to PAN-OS and firewalls/network-security/networking. There is no exhaustive list of XML API endpoints to the full extent, which is why the debug approach usually works best, especially as the CLI/GUI are themselves clients of the XML API. The newer REST API is improving this situation, however, and continues to gain coverage with each release of PAN-OS, so that's something to keep an eye on.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jul 2021 19:44:58 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/using-xml-api-to-query-policy-post-rules/m-p/420477#M2728</guid>
      <dc:creator>JimmyHolland</dc:creator>
      <dc:date>2021-07-19T19:44:58Z</dc:date>
    </item>
    <item>
      <title>Re: Using XML API to query policy post rules</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/using-xml-api-to-query-policy-post-rules/m-p/421365#M2729</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/4294"&gt;@JimmyHolland&lt;/a&gt;&amp;nbsp;I figured out how to structure a 'security-policy-match', however it's requiring arguments that make the query far too specific/narrow. It seems that both 'protocol' and 'destination-port' are required, and neither one allows 'any' or '*' or even a range&amp;nbsp;of values (integers only).&lt;/P&gt;&lt;P&gt;Is there a way to match policies across:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;all PAN-OS devices (without having to explicitly enumerate them)&lt;/LI&gt;&lt;LI&gt;all destination-ports (i.e. "any")&lt;/LI&gt;&lt;LI&gt;all IP protocols ( i.e. "any", or at least {6,17} ).&lt;/LI&gt;&lt;/OL&gt;</description>
      <pubDate>Thu, 22 Jul 2021 16:23:21 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/using-xml-api-to-query-policy-post-rules/m-p/421365#M2729</guid>
      <dc:creator>julio.toledo</dc:creator>
      <dc:date>2021-07-22T16:23:21Z</dc:date>
    </item>
    <item>
      <title>Re: Using XML API to query policy post rules</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/using-xml-api-to-query-policy-post-rules/m-p/421621#M2730</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/182385"&gt;@julio.toledo&lt;/a&gt;, the API structure for this feature will match what you see in the GUI, where there are indeed mandatory fields (the red boxes) like destination ports, and protocol is a drop-down between TCP/UDP/ICMP:&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="Test Policy Match GUI Screenshot" style="width: 555px;"&gt;&lt;img src="https://live.paloaltonetworks.com/t5/image/serverpage/image-id/35190i67A5511214560B64/image-size/large/is-moderation-mode/true?v=v2&amp;amp;px=999" role="button" title="Screenshot 2021-07-23 at 10.00.25.png" alt="Test Policy Match GUI Screenshot" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Test Policy Match GUI Screenshot&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think this feature is designed to give people a way to test if specific traffic will theoretically pass through the firewall, rather than the very broad and almost audit-type requirement which you have. If you talk with your allocated Systems Engineer or reseller (if you're unsure who they are, send me a direct message on here and I will assist) then they will be able to discuss your requirements and potentially raise a feature request.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Other options to fulfil your requirements would involve an approach of systematically checking the live configurations of your firewall estate, by exporting the Panorama running config and walking through the XML data in your programming language of choice.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jul 2021 09:07:50 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/using-xml-api-to-query-policy-post-rules/m-p/421621#M2730</guid>
      <dc:creator>JimmyHolland</dc:creator>
      <dc:date>2021-07-23T09:07:50Z</dc:date>
    </item>
    <item>
      <title>Re: Using XML API to query policy post rules</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/using-xml-api-to-query-policy-post-rules/m-p/421689#M2731</link>
      <description>&lt;P&gt;Ding, ding, ding! We have a winner. So what I am looking to accomplish &lt;STRONG&gt;&lt;EM&gt;is&lt;/EM&gt;&lt;/STRONG&gt; audit/research level work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;On a competitor's product (which shall remain nameless) I am able to issue the following simple, single-line CLI command (on a device-by-device basis) and get back an exhaustive std output of every member rule matching the IP that I'm searching for --either as source or as destination:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;show access-list | include {{ lookupIP }}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;This is exactly the kind of functionality that I'm looking for from Panorama/PAN-OS.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jul 2021 15:49:23 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/using-xml-api-to-query-policy-post-rules/m-p/421689#M2731</guid>
      <dc:creator>julio.toledo</dc:creator>
      <dc:date>2021-07-23T15:49:23Z</dc:date>
    </item>
    <item>
      <title>Re: Using XML API to query policy post rules</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/using-xml-api-to-query-policy-post-rules/m-p/424132#M2739</link>
      <description>&lt;P&gt;Thanks for confirming&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/182385"&gt;@julio.toledo&lt;/a&gt;. Per DM, we've connected you with your SE in order to discuss this topic in more detail.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Aug 2021 09:30:55 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/using-xml-api-to-query-policy-post-rules/m-p/424132#M2739</guid>
      <dc:creator>JimmyHolland</dc:creator>
      <dc:date>2021-08-03T09:30:55Z</dc:date>
    </item>
  </channel>
</rss>

