<?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: R80.10: Hosts Discovery and creation in API / CLI Discussion</title>
    <link>https://community.checkpoint.com/t5/API-CLI-Discussion/R80-10-Hosts-Discovery-and-creation/m-p/38710#M2307</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.checkpoint.com/migrated-users/4338"&gt;Nicolas Boisse&lt;/A&gt; I think this is a great script and could be very useful - especially in newer deployments.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Looking at the script I'm not sure if the "validading" portion looks for both the name and the IP and unique instances of one or the other. Would not want to create additional, unnecessary, objects.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A thought, why not pull the IP to host name using something like nslookup in order to provide a better object name. It could still be given a "discovered host" tag and/or be added to the discovered hosts group in order to distinguish between user created vs discovered object. This could help an administrator when viewing logs - rather than seeing "HostDiscovered_IP" they would see a network name that may be more useful to them.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Last thought to bother you with - can you give some other examples where this may be useful. The obvious one is with a new deployment where you quickly want to add hosts for use in the policy. I notice you gave the example of a cronjob running at 5 minute intervals - how would this be useful other than finding new hosts over a period of time?&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 28 Dec 2017 20:28:51 GMT</pubDate>
    <dc:creator>Chris_Hoff</dc:creator>
    <dc:date>2017-12-28T20:28:51Z</dc:date>
    <item>
      <title>R80.10: Hosts Discovery and creation</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/R80-10-Hosts-Discovery-and-creation/m-p/38708#M2305</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here a new way to save times... Automatic hosts discovery and creation. Know what is going on in your network!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let's discover some hosts!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How it works: Basically, from the management server (via the cprd_util command), I get the arp table from a gateway. With this info, I create a .csv file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Subsequently, I import the csv file into the R80 management with the command "mgmt_cli --batch file.csv". If the object already exists, it will not be created. This is supported by "mgmt_cli --batch".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the definition of the object, I include the following information with relevant comments: IP, Name, MAC address, behind which network interface of the fw, name of the firewall, timestamp.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="margin: 0in 0in 0pt;"&gt;&lt;SPAN style="color: #000000; font-size: 11.0pt;"&gt;All the information created here is retrieve via the arp file and automatically create with mgmt_cli:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in 0pt;"&gt;&lt;SPAN style="color: #1f497d; font-size: 11.0pt;"&gt;&lt;IMG __jive_id="57784" class="image-5 jive-image" src="https://community.checkpoint.com/legacyfs/online/checkpoint/57784_pastedImage_1.png" style="width: auto; height: auto;" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="57574" alt="" class="image-2 jive-image j-img-original" src="https://community.checkpoint.com/legacyfs/online/checkpoint/57574_hosts2.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also add 2 tags (new feature of R80). This allows quick searches in object list:&lt;/P&gt;&lt;P&gt;For example, if I search for objects behind the eth2 interface:&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="57575" alt="" class="image-3 jive-image j-img-original" src="https://community.checkpoint.com/legacyfs/online/checkpoint/57575_hosts3.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Searching for all object related to&amp;nbsp;a particular gateway:&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="57576" alt="" class="image-4 jive-image j-img-original" src="https://community.checkpoint.com/legacyfs/online/checkpoint/57576_hosts4.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;EXÉCUTION:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;3 options to run the script:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d; font-size: 30px;"&gt;&lt;EM&gt;&lt;STRONG&gt;1- Command line in expert mode:&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;&lt;IMG __jive_id="57804" class="image-6 jive-image" src="https://community.checkpoint.com/legacyfs/online/checkpoint/57804_pastedImage_4.png" style="width: auto; height: auto;" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;&lt;IMG __jive_id="57806" class="image-7 jive-image" src="https://community.checkpoint.com/legacyfs/online/checkpoint/57806_pastedImage_6.png" style="width: 620px; height: 798px;" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d; font-size: 30px;"&gt;&lt;EM&gt;&lt;STRONG&gt;2-&amp;nbsp;With a cronjob at every 5 minutes:&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;&lt;IMG __jive_id="57807" class="jive-image image-8" src="https://community.checkpoint.com/legacyfs/online/checkpoint/57807_pastedImage_7.png" style="width: 620px; height: 44px;" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d; font-size: 30px;"&gt;&lt;EM&gt;&lt;STRONG&gt;3- &lt;SPAN style="color: #1f497d;"&gt;Directly from the SmartConsole:&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;Go to Gateway and server view:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;&lt;IMG __jive_id="57808" class="image-9 jive-image" src="https://community.checkpoint.com/legacyfs/online/checkpoint/57808_pastedImage_8.png" style="width: auto; height: auto;" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;Create a new script and give a name, save and publish the change&amp;nbsp;:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;&lt;IMG __jive_id="57809" class="jive-image image-10" src="https://community.checkpoint.com/legacyfs/online/checkpoint/57809_pastedImage_9.png" style="width: auto; height: auto;" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;Run the script :&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;&lt;IMG __jive_id="57810" class="image-11 jive-image" src="https://community.checkpoint.com/legacyfs/online/checkpoint/57810_pastedImage_10.png" style="width: auto; height: auto;" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Two arguments are required. Gateway name and IP address of the gateway. Optional third argument: groupe name.&lt;SPAN style="color: #000000;"&gt;&amp;nbsp;If you specify a group name, all the discovered hosts will be added to that group. If you don’t, a group called "Discovered" will be created with all discovered hosts added to it.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&lt;IMG __jive_id="57811" class="image-12 jive-image" src="https://community.checkpoint.com/legacyfs/online/checkpoint/57811_pastedImage_12.png" style="width: auto; height: auto;" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;Run the script:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&lt;IMG __jive_id="57812" class="image-13 jive-image" src="https://community.checkpoint.com/legacyfs/online/checkpoint/57812_pastedImage_13.png" style="width: auto; height: auto;" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&lt;IMG __jive_id="57813" class="jive-image image-14" src="https://community.checkpoint.com/legacyfs/online/checkpoint/57813_pastedImage_14.png" style="width: auto; height: auto;" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: red;"&gt;Important Note: You must run the script on the management object because of the API calls.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is a basic example of what we can do via the API and R80. I believe this will be useful when deploying a new gateway and administrator need to&amp;nbsp;discover what is going on…&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Happy scripting!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Jul 2017 20:10:28 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/R80-10-Hosts-Discovery-and-creation/m-p/38708#M2305</guid>
      <dc:creator>Nicolas_Boisse</dc:creator>
      <dc:date>2017-07-26T20:10:28Z</dc:date>
    </item>
    <item>
      <title>Re: R80.10: Hosts Discovery and creation</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/R80-10-Hosts-Discovery-and-creation/m-p/38709#M2306</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P class=""&gt;Awesome !!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Aug 2017 03:49:13 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/R80-10-Hosts-Discovery-and-creation/m-p/38709#M2306</guid>
      <dc:creator>Moti</dc:creator>
      <dc:date>2017-08-04T03:49:13Z</dc:date>
    </item>
    <item>
      <title>Re: R80.10: Hosts Discovery and creation</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/R80-10-Hosts-Discovery-and-creation/m-p/38710#M2307</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.checkpoint.com/migrated-users/4338"&gt;Nicolas Boisse&lt;/A&gt; I think this is a great script and could be very useful - especially in newer deployments.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Looking at the script I'm not sure if the "validading" portion looks for both the name and the IP and unique instances of one or the other. Would not want to create additional, unnecessary, objects.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A thought, why not pull the IP to host name using something like nslookup in order to provide a better object name. It could still be given a "discovered host" tag and/or be added to the discovered hosts group in order to distinguish between user created vs discovered object. This could help an administrator when viewing logs - rather than seeing "HostDiscovered_IP" they would see a network name that may be more useful to them.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Last thought to bother you with - can you give some other examples where this may be useful. The obvious one is with a new deployment where you quickly want to add hosts for use in the policy. I notice you gave the example of a cronjob running at 5 minute intervals - how would this be useful other than finding new hosts over a period of time?&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Dec 2017 20:28:51 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/R80-10-Hosts-Discovery-and-creation/m-p/38710#M2307</guid>
      <dc:creator>Chris_Hoff</dc:creator>
      <dc:date>2017-12-28T20:28:51Z</dc:date>
    </item>
  </channel>
</rss>

