<?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: How can I export the access rulebase in API / CLI Discussion</title>
    <link>https://community.checkpoint.com/t5/API-CLI-Discussion/How-can-I-export-the-access-rulebase/m-p/128299#M6207</link>
    <description>&lt;P&gt;There isn't a single command to do this for a few reasons:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;There is a limit to the number of rules an API call will return, so you will need to make multiple calls using limit/offset to retrieve the full results if the rulebase has more than a handful of rules in it.&lt;/LI&gt;
&lt;LI&gt;The API will only return results from a single layer, not from any inline layers, which also must be queried.&lt;/LI&gt;
&lt;LI&gt;The rule number is not returned as part of the API, that said, you should be able to figure it out based on the number of results returned.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Also, each one of those fields is itself an array that requires parsing.&lt;BR /&gt;Bottom line: this is going to require a script or a program to achieve.&lt;/P&gt;
&lt;P&gt;However, we've already created a tool that will export a rulebase into HTML.&lt;BR /&gt;See:&amp;nbsp;&lt;A href="https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&amp;amp;solutionid=sk120342" target="_blank"&gt;https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&amp;amp;solutionid=sk120342&lt;/A&gt;&amp;nbsp;&lt;BR /&gt;Or if you're on R81+, there's the web-based SmartConsole, which you can give someone read-access to in order to see the rulebase.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 30 Aug 2021 04:40:34 GMT</pubDate>
    <dc:creator>PhoneBoy</dc:creator>
    <dc:date>2021-08-30T04:40:34Z</dc:date>
    <item>
      <title>How can I export the access rulebase</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/How-can-I-export-the-access-rulebase/m-p/128298#M6206</link>
      <description>&lt;P&gt;Hi Mates,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;could I ask for the exact mgmt_cli commands to export all the rules from access rulebase to csv file with the below filters ?&lt;/P&gt;&lt;P&gt;Rule No.&lt;/P&gt;&lt;P&gt;Name&lt;/P&gt;&lt;P&gt;Source&lt;/P&gt;&lt;P&gt;Destination&amp;nbsp;&lt;/P&gt;&lt;P&gt;VPN&lt;/P&gt;&lt;P&gt;Service &amp;amp; Application&lt;/P&gt;&lt;P&gt;Action&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Inline-layer rules will need to be displayed also,&lt;/P&gt;&lt;P&gt;* I need mgmt_cli command only as I may need to change the filters for later uses, I tried to use the jq command however I am not able to figure out the exact command to show the required fileds.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Aug 2021 04:11:36 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/How-can-I-export-the-access-rulebase/m-p/128298#M6206</guid>
      <dc:creator>RedPill15</dc:creator>
      <dc:date>2021-08-30T04:11:36Z</dc:date>
    </item>
    <item>
      <title>Re: How can I export the access rulebase</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/How-can-I-export-the-access-rulebase/m-p/128299#M6207</link>
      <description>&lt;P&gt;There isn't a single command to do this for a few reasons:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;There is a limit to the number of rules an API call will return, so you will need to make multiple calls using limit/offset to retrieve the full results if the rulebase has more than a handful of rules in it.&lt;/LI&gt;
&lt;LI&gt;The API will only return results from a single layer, not from any inline layers, which also must be queried.&lt;/LI&gt;
&lt;LI&gt;The rule number is not returned as part of the API, that said, you should be able to figure it out based on the number of results returned.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Also, each one of those fields is itself an array that requires parsing.&lt;BR /&gt;Bottom line: this is going to require a script or a program to achieve.&lt;/P&gt;
&lt;P&gt;However, we've already created a tool that will export a rulebase into HTML.&lt;BR /&gt;See:&amp;nbsp;&lt;A href="https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&amp;amp;solutionid=sk120342" target="_blank"&gt;https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&amp;amp;solutionid=sk120342&lt;/A&gt;&amp;nbsp;&lt;BR /&gt;Or if you're on R81+, there's the web-based SmartConsole, which you can give someone read-access to in order to see the rulebase.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Aug 2021 04:40:34 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/How-can-I-export-the-access-rulebase/m-p/128299#M6207</guid>
      <dc:creator>PhoneBoy</dc:creator>
      <dc:date>2021-08-30T04:40:34Z</dc:date>
    </item>
    <item>
      <title>Re: How can I export the access rulebase</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/How-can-I-export-the-access-rulebase/m-p/128304#M6208</link>
      <description>&lt;P&gt;thank you&amp;nbsp;&lt;a href="https://community.checkpoint.com/t5/user/viewprofilepage/user-id/7"&gt;@PhoneBoy&lt;/a&gt;&amp;nbsp;, so if it means even I only export the inline layer rules, for exmaple:&lt;/P&gt;&lt;P&gt;mgmt_cli -r true -d x.x.x.x show access-rulebase offset 0 limit 20 name "inline-layer-example" details-level "standard" use-object-dictionary true --version 1.1 --format json&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is still not possible to add the filter to show the mentioned fields?&lt;/P&gt;</description>
      <pubDate>Mon, 30 Aug 2021 05:18:22 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/How-can-I-export-the-access-rulebase/m-p/128304#M6208</guid>
      <dc:creator>RedPill15</dc:creator>
      <dc:date>2021-08-30T05:18:22Z</dc:date>
    </item>
    <item>
      <title>Re: How can I export the access rulebase</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/How-can-I-export-the-access-rulebase/m-p/128317#M6209</link>
      <description>&lt;P&gt;Sure, you can have jq give you the precise fields you want, except for rule number, which isn't in the API output.&lt;BR /&gt;But each one of those fields, except for the name, will return an array of uids.&lt;BR /&gt;That will require further processing to turn it into a CSV that will be meaningful to a human.&lt;/P&gt;
&lt;P&gt;If you're just looking for a CSV export of the rulebase, SmartConsole does this: &lt;A href="https://community.checkpoint.com/t5/Management/Smart-Console-filtered-rule-export-including-resolved-object/m-p/55191" target="_blank"&gt;https://community.checkpoint.com/t5/Management/Smart-Console-filtered-rule-export-including-resolved-object/m-p/55191&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Aug 2021 07:24:37 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/How-can-I-export-the-access-rulebase/m-p/128317#M6209</guid>
      <dc:creator>PhoneBoy</dc:creator>
      <dc:date>2021-08-30T07:24:37Z</dc:date>
    </item>
  </channel>
</rss>

