<?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 Script that collects specific rules and exports them into csv/xml (R80.20) in API / CLI Discussion</title>
    <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Script-that-collects-specific-rules-and-exports-them-into-csv/m-p/59154#M3747</link>
    <description>I'm trying to make a script that collects rules with time objects and outputs them into an xml/csv file. The file must contain: the access policy package name the rules are behind and rules that have a time object. The rules with time objects will be listed if the rules are going to expire in 1 to 7 days (if a temporal rule expires in 8 days then it won't be listed, if it's 7 or less days then it will). What kind of info is shown about the rule when it's being exported? Number, Name, Source, Destination, VPN, Services &amp;amp; Applications, Time and Comments</description>
    <pubDate>Fri, 02 Aug 2019 09:48:23 GMT</pubDate>
    <dc:creator>Arthur_Nadaryan</dc:creator>
    <dc:date>2019-08-02T09:48:23Z</dc:date>
    <item>
      <title>Script that collects specific rules and exports them into csv/xml (R80.20)</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Script-that-collects-specific-rules-and-exports-them-into-csv/m-p/59154#M3747</link>
      <description>I'm trying to make a script that collects rules with time objects and outputs them into an xml/csv file. The file must contain: the access policy package name the rules are behind and rules that have a time object. The rules with time objects will be listed if the rules are going to expire in 1 to 7 days (if a temporal rule expires in 8 days then it won't be listed, if it's 7 or less days then it will). What kind of info is shown about the rule when it's being exported? Number, Name, Source, Destination, VPN, Services &amp;amp; Applications, Time and Comments</description>
      <pubDate>Fri, 02 Aug 2019 09:48:23 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Script-that-collects-specific-rules-and-exports-them-into-csv/m-p/59154#M3747</guid>
      <dc:creator>Arthur_Nadaryan</dc:creator>
      <dc:date>2019-08-02T09:48:23Z</dc:date>
    </item>
    <item>
      <title>Re: Script that collects specific policies into csv/xml (R80.20)</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Script-that-collects-specific-rules-and-exports-them-into-csv/m-p/59171#M3749</link>
      <description>&lt;P&gt;How is your time expiration objects built? Do you name them by their expiration date?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jul 2019 15:44:19 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Script-that-collects-specific-rules-and-exports-them-into-csv/m-p/59171#M3749</guid>
      <dc:creator>Adam_Forester</dc:creator>
      <dc:date>2019-07-29T15:44:19Z</dc:date>
    </item>
    <item>
      <title>Re: Script that collects specific policies into csv/xml (R80.20)</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Script-that-collects-specific-rules-and-exports-them-into-csv/m-p/59173#M3750</link>
      <description>&lt;P&gt;Yes, all time objects have a date as a name (numbers) and the format is &lt;EM&gt;day-month-year (29.07.2019).&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jul 2019 15:56:13 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Script-that-collects-specific-rules-and-exports-them-into-csv/m-p/59173#M3750</guid>
      <dc:creator>Arthur_Nadaryan</dc:creator>
      <dc:date>2019-07-29T15:56:13Z</dc:date>
    </item>
    <item>
      <title>Re: Script that collects specific policies into csv/xml (R80.20)</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Script-that-collects-specific-rules-and-exports-them-into-csv/m-p/59181#M3751</link>
      <description>&lt;P&gt;You can run a filter based on the time object.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="p1"&gt;mgmt_cli -r true show access-rulebase name "POLICY NAME" details-level "standard" use-object-dictionary true filter "TIME Object Name" --format json&lt;/P&gt;
&lt;P class="p1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="p1"&gt;You can then use JQ to export csv once you format the JSON to your needs.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jul 2019 16:11:58 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Script-that-collects-specific-rules-and-exports-them-into-csv/m-p/59181#M3751</guid>
      <dc:creator>Adam_Forester</dc:creator>
      <dc:date>2019-07-29T16:11:58Z</dc:date>
    </item>
    <item>
      <title>Re: Script that collects specific policies into csv/xml (R80.20)</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Script-that-collects-specific-rules-and-exports-them-into-csv/m-p/59184#M3752</link>
      <description>&lt;P&gt;Wrote a quick sample bash script. It will search the object database for time objects that are +7 days from the current system date, you can change that easily by changing the +X date. Then it will filter the rulebase for those objects and output the in json. It's interactive to play with but you can hardset the variables. Should give you a starting point;&lt;/P&gt;
&lt;P&gt;Script is expiring-rules.sh&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/WadesWeaponShed/Rulebase-Audit" target="_blank"&gt;https://github.com/WadesWeaponShed/Rulebase-Audit&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jul 2019 16:21:40 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Script-that-collects-specific-rules-and-exports-them-into-csv/m-p/59184#M3752</guid>
      <dc:creator>Adam_Forester</dc:creator>
      <dc:date>2019-07-29T16:21:40Z</dc:date>
    </item>
    <item>
      <title>Re: Script that collects specific policies into csv/xml (R80.20)</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Script-that-collects-specific-rules-and-exports-them-into-csv/m-p/59639#M3769</link>
      <description>Thanks for the help but I have one question. The script outputs a lot of info about a specific rule. I'm having mixed results with jq and I would like to know how to filter the output to only show the following: Policy name, rule number, source, destination, service/applications, action, time and comments. ipv4-addresses included for src and dst. Comments for me appear as null. Trying to get other information will result in an error. Bellow is a basic sample that finds rules with "01.01.2020" that are behind a specific policy/FW. The output gives one result but there are 2 rules that contain "01.01.2020". mgmt_cli -r true show access-rulebase name "Policy-Name-Here" details-level "standard" use-object-dictionary true filter "01.01.2020" --format json | jq '{name: .name}' &amp;gt;&amp;gt;TEMPORALS.txt</description>
      <pubDate>Mon, 05 Aug 2019 10:11:10 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Script-that-collects-specific-rules-and-exports-them-into-csv/m-p/59639#M3769</guid>
      <dc:creator>Arthur_Nadaryan</dc:creator>
      <dc:date>2019-08-05T10:11:10Z</dc:date>
    </item>
    <item>
      <title>Re: Script that collects specific policies into csv/xml (R80.20)</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Script-that-collects-specific-rules-and-exports-them-into-csv/m-p/59648#M3770</link>
      <description>&lt;P&gt;I updated on github, should give you a start. Show access-rulebase uses UID for objects and references the object tree so I changed it to take the UID of the rule and do show access-rule to get the detail then spit them out. Should give you a good start, If I get more time this week I'll look at it more to get better detail of what you are asking for, but I hope this is something you can start work with and tweak.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Aug 2019 13:58:24 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Script-that-collects-specific-rules-and-exports-them-into-csv/m-p/59648#M3770</guid>
      <dc:creator>Adam_Forester</dc:creator>
      <dc:date>2019-08-05T13:58:24Z</dc:date>
    </item>
    <item>
      <title>Re: Script that collects specific policies into csv/xml (R80.20)</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Script-that-collects-specific-rules-and-exports-them-into-csv/m-p/60021#M3780</link>
      <description>So far I've managed to write a script that lists rules that contain a time object along with other minor details (requirements changed).&lt;BR /&gt;&lt;BR /&gt;Currently the "rule will expire in X days" part isn't done.</description>
      <pubDate>Sat, 10 Aug 2019 17:38:49 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Script-that-collects-specific-rules-and-exports-them-into-csv/m-p/60021#M3780</guid>
      <dc:creator>Arthur_Nadaryan</dc:creator>
      <dc:date>2019-08-10T17:38:49Z</dc:date>
    </item>
  </channel>
</rss>

