<?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 How to add a firewall policy to a specific package via api in API / CLI Discussion</title>
    <link>https://community.checkpoint.com/t5/API-CLI-Discussion/How-to-add-a-firewall-policy-to-a-specific-package-via-api/m-p/32891#M2040</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, I've got two policy packages on an R80.20 SMS (Standard and TestPackage):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.checkpoint.com/legacyfs/online/checkpoint/78406_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I want to do is to import a set of firewall rules into the TestPackage via the api with the following command:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;mgmt_cli add access-rule --batch fwpolicy-final.csv&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem though is that the firewall rules are added to the Standard package and NOT the TestPackage one.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So my question is, is there an argument I could add to the above command to specify the policy package I want to add the firewall rules to? I can't find one in the api reference:&amp;nbsp;&lt;A class="link-titled" href="https://sc1.checkpoint.com/documents/latest/APIs/index.html#cli/add-access-rule~v1.1%20" title="https://sc1.checkpoint.com/documents/latest/APIs/index.html#cli/add-access-rule~v1.1%20"&gt;Check Point - Management API reference&lt;/A&gt;&amp;nbsp;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 13 Feb 2019 09:16:41 GMT</pubDate>
    <dc:creator>Nick_Doropoulos</dc:creator>
    <dc:date>2019-02-13T09:16:41Z</dc:date>
    <item>
      <title>How to add a firewall policy to a specific package via api</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/How-to-add-a-firewall-policy-to-a-specific-package-via-api/m-p/32891#M2040</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, I've got two policy packages on an R80.20 SMS (Standard and TestPackage):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.checkpoint.com/legacyfs/online/checkpoint/78406_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I want to do is to import a set of firewall rules into the TestPackage via the api with the following command:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;mgmt_cli add access-rule --batch fwpolicy-final.csv&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem though is that the firewall rules are added to the Standard package and NOT the TestPackage one.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So my question is, is there an argument I could add to the above command to specify the policy package I want to add the firewall rules to? I can't find one in the api reference:&amp;nbsp;&lt;A class="link-titled" href="https://sc1.checkpoint.com/documents/latest/APIs/index.html#cli/add-access-rule~v1.1%20" title="https://sc1.checkpoint.com/documents/latest/APIs/index.html#cli/add-access-rule~v1.1%20"&gt;Check Point - Management API reference&lt;/A&gt;&amp;nbsp;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Feb 2019 09:16:41 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/How-to-add-a-firewall-policy-to-a-specific-package-via-api/m-p/32891#M2040</guid>
      <dc:creator>Nick_Doropoulos</dc:creator>
      <dc:date>2019-02-13T09:16:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to add a firewall policy to a specific package via api</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/How-to-add-a-firewall-policy-to-a-specific-package-via-api/m-p/32892#M2041</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What are the headers of the used csv file "&lt;SPAN style="color: #333333; background-color: #ffffff;"&gt;fwpolicy-final.csv"&lt;/SPAN&gt;? Or to be precise - which command arguments are you currently using in order to create new rules?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Feb 2019 10:28:34 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/How-to-add-a-firewall-policy-to-a-specific-package-via-api/m-p/32892#M2041</guid>
      <dc:creator>Maik</dc:creator>
      <dc:date>2019-02-13T10:28:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to add a firewall policy to a specific package via api</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/How-to-add-a-firewall-policy-to-a-specific-package-via-api/m-p/32893#M2042</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Maik,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The headers of the csv file are the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; width: 881px;"&gt;&lt;TBODY&gt;&lt;TR style="height: 25px;"&gt;&lt;TD style="height: 25px; width: 33px;"&gt;layer&lt;/TD&gt;&lt;TD style="width: 52px; height: 25px;"&gt;position&lt;/TD&gt;&lt;TD style="width: 38px; height: 25px;"&gt;name&lt;/TD&gt;&lt;TD style="width: 46px; height: 25px;"&gt;source&lt;/TD&gt;&lt;TD style="width: 73px; height: 25px;"&gt;destination&lt;/TD&gt;&lt;TD style="width: 25px; height: 25px;"&gt;vpn&lt;/TD&gt;&lt;TD style="width: 306px; height: 25px;"&gt;service action&lt;/TD&gt;&lt;TD style="width: 252px; height: 25px;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;The issue though is that the same problem occurs when trying to add a single rule via the api as well. I've tried the package "TestPackage" argument as well but it doesn't seem to work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Feb 2019 10:44:10 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/How-to-add-a-firewall-policy-to-a-specific-package-via-api/m-p/32893#M2042</guid>
      <dc:creator>Nick_Doropoulos</dc:creator>
      <dc:date>2019-02-13T10:44:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to add a firewall policy to a specific package via api</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/How-to-add-a-firewall-policy-to-a-specific-package-via-api/m-p/32894#M2043</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Nicholas,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I see what you mean. Did you create that policy package before? Because the parameter "layer" is actually referring to a policy package and inline layers as well. That means if you execute the api command "show access-layers" it will provide you with a list of all access layers - including the policy packages (name wise). Each object in the list that the previously mentioned command provides to you can then be used to mention in the "layer" argument of the "add access-rule" command.&lt;STRONG&gt; The strange thing, that I also currently do not understand, is that the names often include a " Network" at the end of their name which is not visible via the SmartConsole. So for example, a package that you see in the SmartConsole which is named "TestPackage" is actually called "TestPackage Network" when accessing it via the API. Some older packages in my environment also include the ending of " Security" instead of " Network".&lt;/STRONG&gt; You can verify this - again - with the command show access-layers.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Feb 2019 11:49:29 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/How-to-add-a-firewall-policy-to-a-specific-package-via-api/m-p/32894#M2043</guid>
      <dc:creator>Maik</dc:creator>
      <dc:date>2019-02-13T11:49:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to add a firewall policy to a specific package via api</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/How-to-add-a-firewall-policy-to-a-specific-package-via-api/m-p/32895#M2044</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks to your comment Maik, I made it work with the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;mgmt_cli add access-rule layer "TestPackage" position 1 name "Rule 1"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will now try the batch mode which should work just as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Feb 2019 13:05:44 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/How-to-add-a-firewall-policy-to-a-specific-package-via-api/m-p/32895#M2044</guid>
      <dc:creator>Nick_Doropoulos</dc:creator>
      <dc:date>2019-02-13T13:05:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to add a firewall policy to a specific package via api</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/How-to-add-a-firewall-policy-to-a-specific-package-via-api/m-p/91280#M5018</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Please help me verify this header of csv. I got problem with "action"&amp;nbsp;&lt;/P&gt;&lt;P&gt;layer,name,position,comments,source.1,source.2,source.3,source.4,destination.1,destination.2,destination.3,destination.4,service.1,service.2,service.3,service.4,service.5,service.6,service.7,service.8,service.9,service.10,service.11,service.12,service.13,service.14,service.15,service.16,service.17,service.18,service.19,service.20,service.21,service.22,service.23,service.24,action,track&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;API Version 1.6&lt;/P&gt;&lt;P&gt;R80.40&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jul 2020 05:49:29 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/How-to-add-a-firewall-policy-to-a-specific-package-via-api/m-p/91280#M5018</guid>
      <dc:creator>Security_Consul</dc:creator>
      <dc:date>2020-07-13T05:49:29Z</dc:date>
    </item>
  </channel>
</rss>

