<?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: Retrieving Security and NAT rules through API in Automation/API Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/retrieving-security-and-nat-rules-through-api/m-p/182887#M1476</link>
    <description>Yes, this is in reference to the panorama API.&lt;BR /&gt;Right now I am just trying to find out what information is available in a valid response'schema so I can see what data I can sort, etc. with my scripts.&lt;BR /&gt;&lt;BR /&gt;Basically I am doing some scripting to assist another engineer. I'm new to the Palo world but have been a coder for some time.</description>
    <pubDate>Thu, 19 Oct 2017 22:22:16 GMT</pubDate>
    <dc:creator>f1r3withf1r3</dc:creator>
    <dc:date>2017-10-19T22:22:16Z</dc:date>
    <item>
      <title>Retrieving Security and NAT rules through API</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/retrieving-security-and-nat-rules-through-api/m-p/182833#M1474</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So far I've been able to sort out and match various device group objects according to my needs.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now I'm trying to find in the API where I can retrieve information on Security and NAT rules so I can view attributes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My goal is to see what sub-tags are available in the schema for those objects so I can discover via a script I'll write which of my objects are utilizing security rules.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The API browser shows "&amp;lt;show&amp;gt;&amp;lt;rule-use&amp;gt;&amp;lt;type&amp;gt;used&amp;lt;/type&amp;gt;&amp;lt;/rule-use&amp;gt;&amp;lt;/show&amp;gt;" as an option, but when attempting to submit it states that rule-base is required. I added that tag into the query, then got a message saying device-group is required.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, I added that as well along with my intended device group name, but then got the following as output:&lt;/P&gt;&lt;PRE&gt;&amp;lt;response status="success" code="19"&amp;gt;
&amp;lt;result&amp;gt;
&amp;lt;msg&amp;gt;
&amp;lt;line&amp;gt;query job enqueued with jobid 222269&amp;lt;/line&amp;gt;
&amp;lt;/msg&amp;gt;
&amp;lt;job&amp;gt;222269&amp;lt;/job&amp;gt;
&amp;lt;/result&amp;gt;
&amp;lt;/response&amp;gt;&lt;/PRE&gt;&lt;DIV class="line"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Not really the information I'm after. If anyone knows the appropriate way to view what security rules are applied to device groups (or perhaps what device groups have security rules associated with them), or simply suggest a way to get more information on security or NAT rules, I'd be very grateful.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;</description>
      <pubDate>Thu, 19 Oct 2017 20:22:00 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/retrieving-security-and-nat-rules-through-api/m-p/182833#M1474</guid>
      <dc:creator>f1r3withf1r3</dc:creator>
      <dc:date>2017-10-19T20:22:00Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieving Security and NAT rules through API</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/retrieving-security-and-nat-rules-through-api/m-p/182859#M1475</link>
      <description>&lt;P&gt;I think I understand what you're saying, but just to be clear:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;this is in reference to the Panorama API?&lt;/LI&gt;&lt;LI&gt;what information are you trying to gather as far as the security policies is concerned, and what are you using to identify them? Tags? Just the rule name?&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Thu, 19 Oct 2017 20:47:51 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/retrieving-security-and-nat-rules-through-api/m-p/182859#M1475</guid>
      <dc:creator>nigelswift</dc:creator>
      <dc:date>2017-10-19T20:47:51Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieving Security and NAT rules through API</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/retrieving-security-and-nat-rules-through-api/m-p/182887#M1476</link>
      <description>Yes, this is in reference to the panorama API.&lt;BR /&gt;Right now I am just trying to find out what information is available in a valid response'schema so I can see what data I can sort, etc. with my scripts.&lt;BR /&gt;&lt;BR /&gt;Basically I am doing some scripting to assist another engineer. I'm new to the Palo world but have been a coder for some time.</description>
      <pubDate>Thu, 19 Oct 2017 22:22:16 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/retrieving-security-and-nat-rules-through-api/m-p/182887#M1476</guid>
      <dc:creator>f1r3withf1r3</dc:creator>
      <dc:date>2017-10-19T22:22:16Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieving Security and NAT rules through API</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/retrieving-security-and-nat-rules-through-api/m-p/182997#M1477</link>
      <description>&lt;P&gt;I would recommend looking at the API browser and see what the call returns to write your logic. There is some variance between PAN-OS versions so without specifically what you're trying to look into it would be hard to assess one way or the other.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Oct 2017 13:13:02 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/retrieving-security-and-nat-rules-through-api/m-p/182997#M1477</guid>
      <dc:creator>nigelswift</dc:creator>
      <dc:date>2017-10-20T13:13:02Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieving Security and NAT rules through API</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/retrieving-security-and-nat-rules-through-api/m-p/183081#M1478</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The query you are performing is to look at which rules have been used on the firewall since last reboot, not to query for the rules configured. I use this function to look for unused rules on our firewalls.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To get the rules for a firewall in Panorama I have used the following xpath:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;?type=op&amp;amp;cmd=&amp;lt;show&amp;gt;&amp;lt;config&amp;gt;&amp;lt;running&amp;gt;&amp;lt;xpath&amp;gt;devices/entry/device-group/entry[@name="DEVICEGROUP"]/post-rulebase/security&amp;lt;/xpath&amp;gt;&amp;lt;/running&amp;gt;&amp;lt;/config&amp;gt;&amp;lt;/show&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Of course, adjust the post/pre-rulebase and security/nat as you see fit.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope that helps!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 21 Oct 2017 15:29:25 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/retrieving-security-and-nat-rules-through-api/m-p/183081#M1478</guid>
      <dc:creator>rodvand</dc:creator>
      <dc:date>2017-10-21T15:29:25Z</dc:date>
    </item>
  </channel>
</rss>

