<?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: CPRIDUTIL SMB - Get Firmware version from all SMBs, including managed through SmartProvisioning in Automation and APIs</title>
    <link>https://community.checkpoint.com/t5/Automation-and-APIs/CPRIDUTIL-SMB-Get-Firmware-version-from-all-SMBs-including/m-p/148052#M10</link>
    <description>&lt;DIV class=""&gt;
&lt;P&gt;&lt;STRONG&gt;Thanks for sharing.&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;I checked the lengthy Python script that just runs &lt;CODE&gt;show diag&lt;/CODE&gt; on all SMB devices and figured this could be done as a simple bash one-liner as well. Can be executed as one-time script from within SmartConsole or directly from SmartCenter server's expert mode:&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;echo; for i in `grep 'sic_name\|ipaddr' $FWDIR/conf/objects.C|grep -A1 sic_name|grep 'ipaddr '|tr -d ':ipadr ()\t'`; do cprid_util -server $i -verbose rexec -rcmd /bin/bash -c "hostname; clish -c 'show diag'"; done&lt;/LI-CODE&gt;
&lt;P&gt;Of course some grep commands would need to be added to filter the output of &lt;CODE&gt;show diag&lt;/CODE&gt; and check the SMB type but that would be really easy and adjustable for everyone's needs.&lt;/P&gt;
&lt;/DIV&gt;</description>
    <pubDate>Fri, 06 May 2022 17:39:39 GMT</pubDate>
    <dc:creator>Danny</dc:creator>
    <dc:date>2022-05-06T17:39:39Z</dc:date>
    <item>
      <title>CPRIDUTIL SMB - Get Firmware version from all SMBs, including managed through SmartProvisioning</title>
      <link>https://community.checkpoint.com/t5/Automation-and-APIs/CPRIDUTIL-SMB-Get-Firmware-version-from-all-SMBs-including/m-p/147981#M9</link>
      <description>&lt;P&gt;Little project which is utilizing&amp;nbsp;&lt;EM&gt;cpridutil&lt;/EM&gt; over&amp;nbsp;&lt;EM&gt;run-script&lt;/EM&gt;&amp;nbsp;CHKP MGMT API call to get firmware version of all SMB devices managed by the domain. The interesting part is that we are listing LSM (SmartProvisioning) managed devices as well. At the end, we write all output into CSV file (default &lt;EM&gt;output.csv)&lt;/EM&gt;.&lt;/P&gt;
&lt;DIV&gt;
&lt;DIV&gt;&lt;LI-CODE lang="python"&gt;GW,Image,Serial,MAC,IP,Status
SMB-1500-GW,R80_992002665_20_40,XX12X12345,00:1C:DE:AD:BE:EF,192.168.1.1,Successful&lt;/LI-CODE&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;This way you have a list of all SMB devices and their firmware version.&lt;BR /&gt;We are utilizing Python CHKP MGMT API SDK for the API communication.&lt;BR /&gt;You can run the code either directly on the CHKP MGMT server or a separate machine with API access to the CHKP MGMT API.&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Additional integration with&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Check Point SourceGuard&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;for code security scan on each code change, as well as latest Check Point's acquisition of&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;SpectralOps&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;to scan for any potential Secrets leak like passwords or API keys. All running as Github Actions workflow.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The code is under MIT License:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://github.com/Senas23/cp_cpridutil" target="_blank" rel="noopener"&gt;https://github.com/Senas23/cp_cpridutil&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="logo.png" style="width: 400px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/16398i5C3B3FE12EC6FD5E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="logo.png" alt="logo.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 05 May 2022 21:03:39 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Automation-and-APIs/CPRIDUTIL-SMB-Get-Firmware-version-from-all-SMBs-including/m-p/147981#M9</guid>
      <dc:creator>Art_Zalenekas</dc:creator>
      <dc:date>2022-05-05T21:03:39Z</dc:date>
    </item>
    <item>
      <title>Re: CPRIDUTIL SMB - Get Firmware version from all SMBs, including managed through SmartProvisioning</title>
      <link>https://community.checkpoint.com/t5/Automation-and-APIs/CPRIDUTIL-SMB-Get-Firmware-version-from-all-SMBs-including/m-p/148052#M10</link>
      <description>&lt;DIV class=""&gt;
&lt;P&gt;&lt;STRONG&gt;Thanks for sharing.&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;I checked the lengthy Python script that just runs &lt;CODE&gt;show diag&lt;/CODE&gt; on all SMB devices and figured this could be done as a simple bash one-liner as well. Can be executed as one-time script from within SmartConsole or directly from SmartCenter server's expert mode:&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;echo; for i in `grep 'sic_name\|ipaddr' $FWDIR/conf/objects.C|grep -A1 sic_name|grep 'ipaddr '|tr -d ':ipadr ()\t'`; do cprid_util -server $i -verbose rexec -rcmd /bin/bash -c "hostname; clish -c 'show diag'"; done&lt;/LI-CODE&gt;
&lt;P&gt;Of course some grep commands would need to be added to filter the output of &lt;CODE&gt;show diag&lt;/CODE&gt; and check the SMB type but that would be really easy and adjustable for everyone's needs.&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Fri, 06 May 2022 17:39:39 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Automation-and-APIs/CPRIDUTIL-SMB-Get-Firmware-version-from-all-SMBs-including/m-p/148052#M10</guid>
      <dc:creator>Danny</dc:creator>
      <dc:date>2022-05-06T17:39:39Z</dc:date>
    </item>
    <item>
      <title>Re: CPRIDUTIL SMB - Get Firmware version from all SMBs, including managed through SmartProvisioning</title>
      <link>https://community.checkpoint.com/t5/Automation-and-APIs/CPRIDUTIL-SMB-Get-Firmware-version-from-all-SMBs-including/m-p/148057#M11</link>
      <description>&lt;P&gt;Thx Danny, but unfortunately that is not helping here. We need to know the Type of the GW, as we are looking just for SMB devices. Second, we need to list LSM managed GWs too, which you don't see in&amp;nbsp;&lt;EM&gt;objects.C&lt;/EM&gt; at all.&lt;/P&gt;
&lt;P&gt;Furthermore, there is no need to dig under the hood of the MGMT server and live on the BASH as uid 0. Best case, nobody should be living on the BASH. Many other reasons why not to keep your scripts and code on the management. Separation is the key here.&lt;/P&gt;</description>
      <pubDate>Fri, 06 May 2022 15:55:50 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Automation-and-APIs/CPRIDUTIL-SMB-Get-Firmware-version-from-all-SMBs-including/m-p/148057#M11</guid>
      <dc:creator>Art_Zalenekas</dc:creator>
      <dc:date>2022-05-06T15:55:50Z</dc:date>
    </item>
  </channel>
</rss>

