<?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 Global object cleanup script in API / CLI Discussion</title>
    <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Global-object-cleanup-script/m-p/47036#M3145</link>
    <description>&lt;P&gt;&lt;A href="https://github.com/adi0s/CPCleanupGlobalObject" target="_blank" rel="noopener"&gt;https://github.com/adi0s/CPCleanupGlobalObject&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This tools provides a way how to determine, if some global object created in Check Point global policy is used across all domains or not.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="4"&gt;How does it work?&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Get all network objects from global policy (hosts,networks,groups,address-range)&lt;/LI&gt;&lt;LI&gt;Get list of all domains on MDS&lt;/LI&gt;&lt;LI&gt;Search over each domain to check if particular object is used or not - using where-used api command&lt;/LI&gt;&lt;LI&gt;Write down results and generate API CLI commands for object deletion for each object type&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;By default is generating list of objects, which are not used in any domain or just used in one domain. Example: you have 12 domains on MDS and reported object is not used in any of 12 domains or it's just used on 1 domain from 12 (this kind of object should be only local object)&lt;/P&gt;&lt;P&gt;Requirements: Download and install the Check Point API Python SDK repository, follow the instructions in the SDK repository.&lt;A href="https://github.com/CheckPointSW/cp_mgmt_api_python_sdk" target="_blank" rel="noopener"&gt;https://github.com/CheckPointSW/cp_mgmt_api_python_sdk&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Written for python3, but if you put in first line also this: from&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;future&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;import print_function it should run on python2&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;How to use?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;python global_object_cleanup.py -m management_ip -u username -p password -g "global domain name"&lt;/P&gt;</description>
    <pubDate>Fri, 15 Mar 2019 10:57:01 GMT</pubDate>
    <dc:creator>Martin_Valenta</dc:creator>
    <dc:date>2019-03-15T10:57:01Z</dc:date>
    <item>
      <title>Global object cleanup script</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Global-object-cleanup-script/m-p/47036#M3145</link>
      <description>&lt;P&gt;&lt;A href="https://github.com/adi0s/CPCleanupGlobalObject" target="_blank" rel="noopener"&gt;https://github.com/adi0s/CPCleanupGlobalObject&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This tools provides a way how to determine, if some global object created in Check Point global policy is used across all domains or not.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="4"&gt;How does it work?&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Get all network objects from global policy (hosts,networks,groups,address-range)&lt;/LI&gt;&lt;LI&gt;Get list of all domains on MDS&lt;/LI&gt;&lt;LI&gt;Search over each domain to check if particular object is used or not - using where-used api command&lt;/LI&gt;&lt;LI&gt;Write down results and generate API CLI commands for object deletion for each object type&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;By default is generating list of objects, which are not used in any domain or just used in one domain. Example: you have 12 domains on MDS and reported object is not used in any of 12 domains or it's just used on 1 domain from 12 (this kind of object should be only local object)&lt;/P&gt;&lt;P&gt;Requirements: Download and install the Check Point API Python SDK repository, follow the instructions in the SDK repository.&lt;A href="https://github.com/CheckPointSW/cp_mgmt_api_python_sdk" target="_blank" rel="noopener"&gt;https://github.com/CheckPointSW/cp_mgmt_api_python_sdk&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Written for python3, but if you put in first line also this: from&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;future&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;import print_function it should run on python2&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;How to use?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;python global_object_cleanup.py -m management_ip -u username -p password -g "global domain name"&lt;/P&gt;</description>
      <pubDate>Fri, 15 Mar 2019 10:57:01 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Global-object-cleanup-script/m-p/47036#M3145</guid>
      <dc:creator>Martin_Valenta</dc:creator>
      <dc:date>2019-03-15T10:57:01Z</dc:date>
    </item>
  </channel>
</rss>

