<?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: Script to create users and their certificates in API / CLI Discussion</title>
    <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Script-to-create-users-and-their-certificates/m-p/163882#M7320</link>
    <description>&lt;P&gt;How is the nesting handled with mgmt_cli?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 01 Dec 2022 15:00:05 GMT</pubDate>
    <dc:creator>vishardb</dc:creator>
    <dc:date>2022-12-01T15:00:05Z</dc:date>
    <item>
      <title>Script to create users and their certificates</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Script-to-create-users-and-their-certificates/m-p/79994#M4640</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Our company is sending most of its employees to work from home in order to protect us from covid-19. We are relying on Checkpoint VPN Mobile Client to provide connectivity to our virtual Wokplaces.&lt;/P&gt;&lt;P&gt;Because of that, I have to create a large list of users on our Check Point firewall and their associated certificate (internalCA) Is there a way to automate user and certificate creation? I have created some manually, but that is not efficient.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Alex Lansac&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Mar 2020 15:49:09 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Script-to-create-users-and-their-certificates/m-p/79994#M4640</guid>
      <dc:creator>Alejandro_Lansa</dc:creator>
      <dc:date>2020-03-27T15:49:09Z</dc:date>
    </item>
    <item>
      <title>Re: Script to create users and their certificates</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Script-to-create-users-and-their-certificates/m-p/80049#M4641</link>
      <description>There aren't formal APIs for this.&lt;BR /&gt;However, there is a different approach you can take.&lt;BR /&gt;&lt;BR /&gt;You can generate registration keys for each of your users which they can enter into their VPN client to generate a key on the fly.&lt;BR /&gt;You can see the process for generating these keys and mailing them to users demonstrated here: &lt;A href="https://community.checkpoint.com/t5/Check-Point-for-Beginners-CP4B/Installing-Remote-Access-VPN-and-Mobile-Access-Blade-from/ba-p/79723#distregkey" target="_blank"&gt;https://community.checkpoint.com/t5/Check-Point-for-Beginners-CP4B/Installing-Remote-Access-VPN-and-Mobile-Access-Blade-from/ba-p/79723#distregkey&lt;/A&gt;</description>
      <pubDate>Sat, 28 Mar 2020 02:33:22 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Script-to-create-users-and-their-certificates/m-p/80049#M4641</guid>
      <dc:creator>PhoneBoy</dc:creator>
      <dc:date>2020-03-28T02:33:22Z</dc:date>
    </item>
    <item>
      <title>Re: Script to create users and their certificates</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Script-to-create-users-and-their-certificates/m-p/80160#M4644</link>
      <description>&lt;P&gt;Thanks PhoneBoy. Your approach is very interesting and a clean way to create and distribute certificates. In fact we have to create the users and a certificate for each user. With your solution the seccond part would be solved. Is there a way to create the users from script or CSV file?&lt;/P&gt;</description>
      <pubDate>Mon, 30 Mar 2020 05:35:23 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Script-to-create-users-and-their-certificates/m-p/80160#M4644</guid>
      <dc:creator>Alejandro_Lansa</dc:creator>
      <dc:date>2020-03-30T05:35:23Z</dc:date>
    </item>
    <item>
      <title>Re: Script to create users and their certificates</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Script-to-create-users-and-their-certificates/m-p/80174#M4645</link>
      <description>&lt;P&gt;Since there's no API support for it at the moment, you will have to use the generic-object API to do it.&lt;/P&gt;&lt;P&gt;Jim has explained it all in detail in this post: &lt;A href="https://community.checkpoint.com/t5/API-CLI-Discussion-and-Samples/Add-new-user-and-assign-to-an-existing-group-using-the-generic/m-p/39687" target="_blank"&gt;https://community.checkpoint.com/t5/API-CLI-Discussion-and-Samples/Add-new-user-and-assign-to-an-existing-group-using-the-generic/m-p/39687&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/Sigbjorn&lt;/P&gt;</description>
      <pubDate>Mon, 30 Mar 2020 08:54:00 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Script-to-create-users-and-their-certificates/m-p/80174#M4645</guid>
      <dc:creator>Sigbjorn</dc:creator>
      <dc:date>2020-03-30T08:54:00Z</dc:date>
    </item>
    <item>
      <title>Re: Script to create users and their certificates</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Script-to-create-users-and-their-certificates/m-p/99219#M5241</link>
      <description>&lt;P&gt;The manual "&lt;A title="Management API Reference v1.6.1" href="https://sc1.checkpoint.com/documents/latest/APIs/index.html#gui-cli/set-user~v1.6.1" target="_blank" rel="noopener"&gt;&lt;STRONG&gt;Management API&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;Reference v1.6.1&lt;/A&gt;" describes the ability to create certificate and registration keys for users.&lt;/P&gt;&lt;P&gt;But I don't understand the syntax.&amp;nbsp;I need to get a registration key. What's wrong?&lt;/P&gt;&lt;P&gt;&amp;gt; set user name test05 certificates add&lt;BR /&gt;code: "generic_err_invalid_parameter"&lt;BR /&gt;message: "Invalid parameter for [certificates]. The invalid value: [add]"&lt;/P&gt;</description>
      <pubDate>Thu, 15 Oct 2020 14:01:01 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Script-to-create-users-and-their-certificates/m-p/99219#M5241</guid>
      <dc:creator>CepKpy</dc:creator>
      <dc:date>2020-10-15T14:01:01Z</dc:date>
    </item>
    <item>
      <title>Re: Script to create users and their certificates</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Script-to-create-users-and-their-certificates/m-p/132723#M6375</link>
      <description>&lt;P&gt;Hey, i have the same problem, did you find a way to execute this command?&lt;/P&gt;</description>
      <pubDate>Wed, 27 Oct 2021 15:04:13 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Script-to-create-users-and-their-certificates/m-p/132723#M6375</guid>
      <dc:creator>even</dc:creator>
      <dc:date>2021-10-27T15:04:13Z</dc:date>
    </item>
    <item>
      <title>Re: Script to create users and their certificates</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Script-to-create-users-and-their-certificates/m-p/141271#M6603</link>
      <description>&lt;P&gt;Nesting must be used. Example:&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;{{server}}&lt;/SPAN&gt;/set-user&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;"name"&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;:&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;"testlogin-1234"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;"details-level"&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;:&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;"full"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;"certificates"&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;:&amp;nbsp;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t;SPAN&gt;}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;___________________&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;details-level"&amp;nbsp;:&amp;nbsp;"full"&amp;nbsp; &amp;nbsp;--&amp;nbsp;needed to get the token from the response&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;If you need other parameters, then use them.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Important! First, create a user, publish, and then set up a certificate. Same as in smart console.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 11 Feb 2022 14:16:28 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Script-to-create-users-and-their-certificates/m-p/141271#M6603</guid>
      <dc:creator>a38c9a68-afd0-4</dc:creator>
      <dc:date>2022-02-11T14:16:28Z</dc:date>
    </item>
    <item>
      <title>Re: Script to create users and their certificates</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Script-to-create-users-and-their-certificates/m-p/163882#M7320</link>
      <description>&lt;P&gt;How is the nesting handled with mgmt_cli?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Dec 2022 15:00:05 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Script-to-create-users-and-their-certificates/m-p/163882#M7320</guid>
      <dc:creator>vishardb</dc:creator>
      <dc:date>2022-12-01T15:00:05Z</dc:date>
    </item>
    <item>
      <title>Re: Script to create users and their certificates</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Script-to-create-users-and-their-certificates/m-p/163887#M7321</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I believe, using the example above, it’s something like:&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;set user name test05 certificates.add.registration-key.expiration-days 14&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Dec 2022 15:22:35 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Script-to-create-users-and-their-certificates/m-p/163887#M7321</guid>
      <dc:creator>PhoneBoy</dc:creator>
      <dc:date>2022-12-01T15:22:35Z</dc:date>
    </item>
    <item>
      <title>Re: Script to create users and their certificates</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Script-to-create-users-and-their-certificates/m-p/163889#M7322</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.checkpoint.com/t5/user/viewprofilepage/user-id/7"&gt;@PhoneBoy&lt;/a&gt;&amp;nbsp;!!!&lt;/P&gt;&lt;P&gt;I have SSHed in the management server and used that info to try to generate a user certificate ant worked!&lt;/P&gt;&lt;P&gt;But I've run into another problem&amp;nbsp;I generateed the certificate using the mgmt_cli like below:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;set user name test05 certificates.add.&lt;/SPAN&gt;&lt;SPAN&gt;certificate-file.password "mypass"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;However, I don't know where is the certificate saved? Do you have any idea where it is saved? The command was executed in&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;/home/admin but there p12 file was not there.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Dec 2022 15:39:08 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Script-to-create-users-and-their-certificates/m-p/163889#M7322</guid>
      <dc:creator>vishardb</dc:creator>
      <dc:date>2022-12-01T15:39:08Z</dc:date>
    </item>
    <item>
      <title>Re: Script to create users and their certificates</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Script-to-create-users-and-their-certificates/m-p/163927#M7323</link>
      <description>&lt;P&gt;Hi vishardb&lt;/P&gt;&lt;P&gt;The command "set user" returns the certificates as result. If the user has more than one certificate you have to select the correct one.&lt;BR /&gt;I have built a script to create VPN users and certificates from a CSV file and I use the word "Zert" in the certificate comment field in order to identify the new certificate.&lt;/P&gt;&lt;P&gt;In my Windows script the command to create and get the certificate for an existing user (username=newuser, password=newpassword) is:&lt;/P&gt;&lt;P&gt;mgmt_cli -s session.id set user name "newuser" certificates.add.certificate-file.password "newpassword" certificates.add.certificate-file.comment "Zert" --format json | jq-win64.exe -r ".certificates[] | select(.comments==\"Zert\") |.\"base64-certificate\"" &amp;gt; certb64.tmp&lt;BR /&gt;certutil -decode certb64.tmp newuser.p12&lt;/P&gt;</description>
      <pubDate>Fri, 02 Dec 2022 06:28:38 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Script-to-create-users-and-their-certificates/m-p/163927#M7323</guid>
      <dc:creator>Alejandro_Lansa</dc:creator>
      <dc:date>2022-12-02T06:28:38Z</dc:date>
    </item>
    <item>
      <title>Re: Script to create users and their certificates</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Script-to-create-users-and-their-certificates/m-p/164118#M7327</link>
      <description>&lt;P&gt;Thank you for feedback&amp;nbsp;&lt;a href="https://community.checkpoint.com/t5/user/viewprofilepage/user-id/17358"&gt;@Alejandro_Lansa&lt;/a&gt;!&lt;/P&gt;&lt;P&gt;You mentioned that you are doing this from your Windows machine. Our policy requires us to login with a certificate, do you know if I can use mgmt_cli from Windows with a certifcate?&lt;/P&gt;</description>
      <pubDate>Mon, 05 Dec 2022 08:18:11 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Script-to-create-users-and-their-certificates/m-p/164118#M7327</guid>
      <dc:creator>vishardb</dc:creator>
      <dc:date>2022-12-05T08:18:11Z</dc:date>
    </item>
    <item>
      <title>Re: Script to create users and their certificates</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Script-to-create-users-and-their-certificates/m-p/164200#M7328</link>
      <description>&lt;P&gt;As far as I know, yes.&lt;BR /&gt;You can review the command line options supported by running mgmt_cli without any arguments.&lt;BR /&gt;You can also set your admin user to use API keys, which might be better to use in a fully automated situation.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Dec 2022 15:26:58 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Script-to-create-users-and-their-certificates/m-p/164200#M7328</guid>
      <dc:creator>PhoneBoy</dc:creator>
      <dc:date>2022-12-05T15:26:58Z</dc:date>
    </item>
    <item>
      <title>Re: Script to create users and their certificates</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Script-to-create-users-and-their-certificates/m-p/164223#M7329</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; I think the API key would be much better.&lt;/P&gt;&lt;P&gt;For accountability and auditing, we need to use individual/unique accounts when managing the firewall.&amp;nbsp;&lt;/P&gt;&lt;P&gt;After I reviewed&amp;nbsp;&lt;A href="https://sc1.checkpoint.com/documents/R81/WebAdminGuides/EN/CP_R81_SecurityManagement_AdminGuide/Topics-SECMG/API-key-auth.htm" target="_blank"&gt;API Key Authentication (checkpoint.com)&lt;/A&gt;&amp;nbsp;and saw that an API key can only be created for a new account.&lt;/P&gt;&lt;P&gt;I also tried&amp;nbsp;&lt;SPAN&gt;mgmt_cli add api-key but got the error "This command can work only on domains of type MDS. Cannot execute it in the current domain (current domain type is Domain)."&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Can you help me understand what I did wrong?&lt;/P&gt;</description>
      <pubDate>Mon, 05 Dec 2022 17:31:52 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Script-to-create-users-and-their-certificates/m-p/164223#M7329</guid>
      <dc:creator>vishardb</dc:creator>
      <dc:date>2022-12-05T17:31:52Z</dc:date>
    </item>
    <item>
      <title>Re: Script to create users and their certificates</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Script-to-create-users-and-their-certificates/m-p/164237#M7330</link>
      <description>&lt;P&gt;Right, because SmartConsole users aren’t created in same “domain” as Access Policy and Threat Prevention rules/objects.&lt;BR /&gt;It requires a separate login to the System Domain where these users can be modified (see:&amp;nbsp;&lt;A href="https://sc1.checkpoint.com/documents/latest/APIs/index.html#cli/login~v1.9%20" target="_blank"&gt;https://sc1.checkpoint.com/documents/latest/APIs/index.html#cli/login~v1.9%20&lt;/A&gt;&amp;nbsp;)&lt;/P&gt;</description>
      <pubDate>Mon, 05 Dec 2022 18:19:42 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Script-to-create-users-and-their-certificates/m-p/164237#M7330</guid>
      <dc:creator>PhoneBoy</dc:creator>
      <dc:date>2022-12-05T18:19:42Z</dc:date>
    </item>
  </channel>
</rss>

