<?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 mgmt_cli without authentication ? in API / CLI Discussion</title>
    <link>https://community.checkpoint.com/t5/API-CLI-Discussion/mgmt-cli-without-authentication/m-p/4874#M403</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;With dbedit it is possible to start operations without authenticating : dbedit -local ... does not require to enter adminname and password.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;mgmt_cli always needs a login phase to start the session.&lt;/P&gt;&lt;P&gt;For scripts (like run from cron) this means that adminname and credentials must somehow be available to the script.&lt;/P&gt;&lt;P&gt;Consequently, if the developer or sysadmin keeps a backup of the script, there is not only the functionality of the script, but also the credentials to gain access to the management server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Personally, I would prefer to let the script focus on the functionality, and not hold credentials that might be changed independently (making the script fail on the next run after restore) or get lost in unauthorized hands who then might abuse them via the GUI ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Would it make sense to formulate a feature request ?&lt;/P&gt;&lt;P&gt;- allow unauthenticated API access if connecting from/to 127.0.0.1 (like dbedit -local now)&lt;/P&gt;&lt;P&gt;- extend permission profile to state : API login only&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (if API is only accessible on 127.0.0.1 - the default - the account cannot be abused via GUI)&lt;/P&gt;&lt;P&gt;- extend permission profile to hold : source IP from where this administrator can connect&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (if we could specify 127.0.0.1 there, abuse via GUI gets harder - it would need ssh port forwarding&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and hence that admin would already need a Gaia login account to the management server)&lt;/P&gt;&lt;P&gt;- both if the above : "API login only" + "allowed source IP"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your thoughts on this ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 02 Aug 2017 13:21:43 GMT</pubDate>
    <dc:creator>Marc_Lampo</dc:creator>
    <dc:date>2017-08-02T13:21:43Z</dc:date>
    <item>
      <title>mgmt_cli without authentication ?</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/mgmt-cli-without-authentication/m-p/4874#M403</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;With dbedit it is possible to start operations without authenticating : dbedit -local ... does not require to enter adminname and password.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;mgmt_cli always needs a login phase to start the session.&lt;/P&gt;&lt;P&gt;For scripts (like run from cron) this means that adminname and credentials must somehow be available to the script.&lt;/P&gt;&lt;P&gt;Consequently, if the developer or sysadmin keeps a backup of the script, there is not only the functionality of the script, but also the credentials to gain access to the management server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Personally, I would prefer to let the script focus on the functionality, and not hold credentials that might be changed independently (making the script fail on the next run after restore) or get lost in unauthorized hands who then might abuse them via the GUI ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Would it make sense to formulate a feature request ?&lt;/P&gt;&lt;P&gt;- allow unauthenticated API access if connecting from/to 127.0.0.1 (like dbedit -local now)&lt;/P&gt;&lt;P&gt;- extend permission profile to state : API login only&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (if API is only accessible on 127.0.0.1 - the default - the account cannot be abused via GUI)&lt;/P&gt;&lt;P&gt;- extend permission profile to hold : source IP from where this administrator can connect&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (if we could specify 127.0.0.1 there, abuse via GUI gets harder - it would need ssh port forwarding&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and hence that admin would already need a Gaia login account to the management server)&lt;/P&gt;&lt;P&gt;- both if the above : "API login only" + "allowed source IP"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your thoughts on this ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Aug 2017 13:21:43 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/mgmt-cli-without-authentication/m-p/4874#M403</guid>
      <dc:creator>Marc_Lampo</dc:creator>
      <dc:date>2017-08-02T13:21:43Z</dc:date>
    </item>
    <item>
      <title>Re: mgmt_cli without authentication ?</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/mgmt-cli-without-authentication/m-p/4875#M404</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SmartConsole would also appear to be an API client (versus using mgmt_cli or similar), so restricting to API-only may not necessarily be possible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;While I understand the convenience of dbedit -local (I've personally used it on occasion),&amp;nbsp;I recall that the feature logged requests as "admin" or something similarly generic.&lt;/P&gt;&lt;P&gt;There is not an easy way to strongly associate these activities with a specific user.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In terms of creating your scripts, keep in mind each mgmt_cli command after authentication needs a session ID passed, which you get from executing the correct login commands.&lt;/P&gt;&lt;P&gt;You could separate the "authentication" function and the "task" functions into separate scripts.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Aug 2017 15:15:46 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/mgmt-cli-without-authentication/m-p/4875#M404</guid>
      <dc:creator>PhoneBoy</dc:creator>
      <dc:date>2017-08-02T15:15:46Z</dc:date>
    </item>
    <item>
      <title>Re: mgmt_cli without authentication ?</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/mgmt-cli-without-authentication/m-p/4876#M405</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.checkpoint.com/migrated-users/43555"&gt;https://community.checkpoint.com/people/ubialik&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. "&lt;SPAN style="color: #333333; background-color: #ffffff;"&gt;allow unauthenticated API access if connecting from/to 127.0.0.1 (like dbedit -local now)"&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; background-color: #ffffff;"&gt;You can use mgmt_cli -r true&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; background-color: #ffffff;"&gt;'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; background-color: #ffffff;"&gt;[--root, -r] {true|false}&lt;BR /&gt; When running on the management server, use this flag with value set to 'true' to login as Super User administrator.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; background-color: #ffffff;"&gt;'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; background-color: #ffffff;"&gt;2. "&lt;/SPAN&gt;extend permission profile to state : API login only"&lt;/P&gt;&lt;P&gt;I think that will be nice idea , +1&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. "&lt;SPAN style="color: #333333; background-color: #ffffff;"&gt;extend permission profile to hold"&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #3d3d3d;"&gt;I think that will be nice idea , +1&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Aug 2017 16:44:24 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/mgmt-cli-without-authentication/m-p/4876#M405</guid>
      <dc:creator>Ofir_Shikolski</dc:creator>
      <dc:date>2017-08-02T16:44:24Z</dc:date>
    </item>
    <item>
      <title>Re: mgmt_cli without authentication ?</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/mgmt-cli-without-authentication/m-p/4877#M406</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I had forgotten about the -r true option, nice one &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://community.checkpoint.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Aug 2017 18:27:53 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/mgmt-cli-without-authentication/m-p/4877#M406</guid>
      <dc:creator>PhoneBoy</dc:creator>
      <dc:date>2017-08-02T18:27:53Z</dc:date>
    </item>
    <item>
      <title>Re: mgmt_cli without authentication ?</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/mgmt-cli-without-authentication/m-p/4878#M407</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for this one as well !&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Actually, it is : mgmt_cli login -r true&amp;nbsp; ("login" as argument still needed)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And, by the way, also not documented in the on-line documentation.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Aug 2017 19:00:13 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/mgmt-cli-without-authentication/m-p/4878#M407</guid>
      <dc:creator>Marc_Lampo</dc:creator>
      <dc:date>2017-08-02T19:00:13Z</dc:date>
    </item>
    <item>
      <title>Re: mgmt_cli without authentication ?</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/mgmt-cli-without-authentication/m-p/4879#M408</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="color: #333333; background-color: #ffffff; border: 0px;"&gt;I found it here&amp;nbsp;&lt;SPAN style="color: #7ed529; border: 0px; font-weight: inherit;"&gt;&lt;A href="https://community.checkpoint.com/message/1151" target="_blank"&gt;https://community.checkpoint.com/message/1151&lt;/A&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #333333; background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="color: #7ed529; border: 0px; font-weight: inherit;"&gt;&lt;STRONG style="border: 0px; font-weight: bold;"&gt;# login as root without providing credentials&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #333333; background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="color: #3334ca; border: 0px; font-weight: inherit;"&gt;mgmt_cli login --root true &amp;gt; id.txt&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #333333; background-color: #ffffff; border: 0px;"&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Jun 2019 08:56:22 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/mgmt-cli-without-authentication/m-p/4879#M408</guid>
      <dc:creator>Ofir_Shikolski</dc:creator>
      <dc:date>2019-06-21T08:56:22Z</dc:date>
    </item>
    <item>
      <title>Re: mgmt_cli without authentication ?</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/mgmt-cli-without-authentication/m-p/4880#M409</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have been using&amp;nbsp;&lt;SPAN style="color: #3334ca; background-color: #ffffff;"&gt;mgmt_cli login --root true &amp;gt; id.txt in my scripts.&amp;nbsp; For each script it has a separate id.txt file.&amp;nbsp; Now the scripts are failing with&amp;nbsp;Error: Failed to login to the management server.&amp;nbsp; I can use that command with a separate user account and it works there.&amp;nbsp; Seems like the root authentication is broken.&amp;nbsp; I restarted managment server, api server, cpstop, cpstart.&amp;nbsp; Those didn't help.&amp;nbsp; Any idea why this just started happening?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Oct 2017 13:49:20 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/mgmt-cli-without-authentication/m-p/4880#M409</guid>
      <dc:creator>Bill_Ng</dc:creator>
      <dc:date>2017-10-16T13:49:20Z</dc:date>
    </item>
    <item>
      <title>Re: mgmt_cli without authentication ?</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/mgmt-cli-without-authentication/m-p/4881#M410</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We figured out what was going on.&amp;nbsp; My script wasn't logging out of the sessions and I hit the 150 session limit.&amp;nbsp; I have since added the logout to the script.&amp;nbsp; I had to remove the inactive sessions as well.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Oct 2017 15:46:21 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/mgmt-cli-without-authentication/m-p/4881#M410</guid>
      <dc:creator>Bill_Ng</dc:creator>
      <dc:date>2017-10-19T15:46:21Z</dc:date>
    </item>
  </channel>
</rss>

