<?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 Get zones info for two ip (multiple firewalls) in Automation/API Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/get-zones-info-for-two-ip-multiple-firewalls/m-p/360048#M2489</link>
    <description>&lt;P&gt;So, say i have a multiple firewalls of many zones.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If i want to create a rule between two servers in different firewall i need to create one rule in each firewall. For example trust to utrust and in the other firewall untrust to trust. (in some cases we allow it in one of the firewalls by default). If I need to type in this manualy in the automation job (no matter if its ansible or powershell or other) it feels like i almost can use the gui anyway. But if i can get this info via a script it would get alot easier.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So if you had a enviorment consisting of many firewall and need to find out the routing between two servers. How would you build that logic?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 31 Oct 2020 16:52:02 GMT</pubDate>
    <dc:creator>hbalzac</dc:creator>
    <dc:date>2020-10-31T16:52:02Z</dc:date>
    <item>
      <title>Get zones info for two ip (multiple firewalls)</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/get-zones-info-for-two-ip-multiple-firewalls/m-p/360048#M2489</link>
      <description>&lt;P&gt;So, say i have a multiple firewalls of many zones.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If i want to create a rule between two servers in different firewall i need to create one rule in each firewall. For example trust to utrust and in the other firewall untrust to trust. (in some cases we allow it in one of the firewalls by default). If I need to type in this manualy in the automation job (no matter if its ansible or powershell or other) it feels like i almost can use the gui anyway. But if i can get this info via a script it would get alot easier.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So if you had a enviorment consisting of many firewall and need to find out the routing between two servers. How would you build that logic?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 31 Oct 2020 16:52:02 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/get-zones-info-for-two-ip-multiple-firewalls/m-p/360048#M2489</guid>
      <dc:creator>hbalzac</dc:creator>
      <dc:date>2020-10-31T16:52:02Z</dc:date>
    </item>
    <item>
      <title>Re: Get zones info for two ip (multiple firewalls)</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/get-zones-info-for-two-ip-multiple-firewalls/m-p/366009#M2506</link>
      <description>&lt;P&gt;Greetings,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using the XML API you can get the routing table of each firewall and compare the results.&lt;/P&gt;&lt;P&gt;&lt;A href="https://172.16.4.7/api/?type=op&amp;amp;cmd=%3Cshow%3E%3Crouting%3E%3Cfib%3E%3C%2Ffib%3E%3C%2Frouting%3E%3C%2Fshow%3E&amp;amp;REST_API_TOKEN=1673185587" target="_rest_api"&gt;https://FIREWALLIP/api/?type=op&amp;amp;cmd=&amp;lt;show&amp;gt;&amp;lt;routing&amp;gt;&amp;lt;fib&amp;gt;&amp;lt;/fib&amp;gt;&amp;lt;/routing&amp;gt;&amp;lt;/show&amp;gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Example of a simple python method to get the routing table:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;import requests&lt;BR /&gt;import xmltodict&lt;BR /&gt;def &lt;/SPAN&gt;&lt;SPAN&gt;getRoutes&lt;/SPAN&gt;(FWIP, FW_API_KEY):&lt;BR /&gt;    URL = &lt;SPAN&gt;'https://' &lt;/SPAN&gt;+ FWIP + &lt;SPAN&gt;'/api'&lt;BR /&gt;&lt;/SPAN&gt;    params = {&lt;BR /&gt;        &lt;SPAN&gt;'type'&lt;/SPAN&gt;: &lt;SPAN&gt;'op'&lt;/SPAN&gt;,&lt;BR /&gt;        &lt;SPAN&gt;'key'&lt;/SPAN&gt;: FW_API_KEY,&lt;BR /&gt;        &lt;SPAN&gt;'cmd' &lt;/SPAN&gt;: &lt;SPAN&gt;'&amp;lt;show&amp;gt;&amp;lt;routing&amp;gt;&amp;lt;fib&amp;gt;&amp;lt;/fib&amp;gt;&amp;lt;/routing&amp;gt;&amp;lt;/show&amp;gt;'&lt;BR /&gt;&lt;/SPAN&gt;    }&lt;BR /&gt;    result = requests.get(URL, &lt;SPAN&gt;params&lt;/SPAN&gt;=params, &lt;SPAN&gt;verify&lt;/SPAN&gt;=&lt;SPAN&gt;False&lt;/SPAN&gt;)&lt;BR /&gt;    result = xmltodict.parse(result.text)&lt;BR /&gt;    routeList = result.get(&lt;SPAN&gt;'response'&lt;/SPAN&gt;).get(&lt;SPAN&gt;'result'&lt;/SPAN&gt;).get(&lt;SPAN&gt;'fibs'&lt;/SPAN&gt;).get(&lt;SPAN&gt;'entry'&lt;/SPAN&gt;)&lt;BR /&gt;    &lt;SPAN&gt;for &lt;/SPAN&gt;&lt;SPAN&gt;i &lt;/SPAN&gt;&lt;SPAN&gt;in &lt;/SPAN&gt;routeList:&lt;BR /&gt;        &lt;SPAN&gt;# do something&lt;/SPAN&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 27 Nov 2020 16:58:40 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/get-zones-info-for-two-ip-multiple-firewalls/m-p/366009#M2506</guid>
      <dc:creator>mrzepa2</dc:creator>
      <dc:date>2020-11-27T16:58:40Z</dc:date>
    </item>
  </channel>
</rss>

