<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>How do I implement security for the CLI?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/42529/how-do-i-implement-security-for-the-cli</link><description>We are using Nordic SDK version 15.2, and have successfully implemented many functions using the CLI API but are stuck on how to secure the CLI. We have a USB and RTT CLI set up that we only want to be available to authorized developers at our company</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 15 Jan 2019 23:14:59 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/42529/how-do-i-implement-security-for-the-cli" /><item><title>RE: How do I implement security for the CLI?</title><link>https://devzone.nordicsemi.com/thread/165841?ContentTypeID=1</link><pubDate>Tue, 15 Jan 2019 23:14:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3445c97b-8e31-4ccd-af76-8821e4e5dde3</guid><dc:creator>ibeckermayer</dc:creator><description>&lt;p&gt;Hi Jakub,&lt;/p&gt;
&lt;p&gt;Thanks for the quick reply. The solution you suggested was my naive instinct, but as you point out it&amp;#39;s not exactly secure. Keep in mind that at least for this chip, we do have the&amp;nbsp;&lt;a href="https://www.nordicsemi.com/DocLib/Content/Product_Spec/nRF52840/latest/cryptocell?fbclid=IwAR1AH8Oee2b2vk994gAgtt4OiTLrCsNh3DArLoXcJrWccmWNNNYRFcnGKNE"&gt;CryptoCell 310&lt;/a&gt;&amp;nbsp;hardware feature which allows for various cryptography protocols including SHA-256 and SRP. This is by no means my domain of expertise, however I&amp;#39;m delving in to how Linux-based OS&amp;#39;s generally&amp;nbsp;implement password security to see if I can imitate it.&lt;/p&gt;
&lt;p&gt;This is the type of feature we generally take for granted in modern computing, and it&amp;#39;s interesting to me personally to dig in to how it&amp;#39;s actually implemented.&amp;nbsp;But it would be equally as awesome if Nordic implemented something&amp;nbsp;similar to Linux security for the CLI in a future release of the SDK, as I&amp;#39;m sure there is a wide demand for it.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Appreciate the help and happy to collaborate on this further.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do I implement security for the CLI?</title><link>https://devzone.nordicsemi.com/thread/165642?ContentTypeID=1</link><pubDate>Tue, 15 Jan 2019 07:49:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b919ff3d-86e8-4f8c-933b-d74a958a5b0b</guid><dc:creator>Jakub Rzeszutko</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;So far we are not supporting this kind of security. However it&amp;#39;s great idea, I will think about it a bit more.&lt;/p&gt;
&lt;p&gt;There is quite easy solution to provide basic security level. You can implement 2 commands like: cli_lock, cli_unlock where you will set a global variable for example: cli_lock_passwd with some password. As long as cli_lock_passwd will not have expected value NRF_CLI will not execute any other command than cli_unlock. It is possible to implement Tab function to not prompt any other command but cli_unlock.&lt;/p&gt;
&lt;p&gt;All you need to do is to add a global variable and modify 2 functions:&amp;nbsp;&lt;strong&gt;cli_execute&lt;/strong&gt; and&amp;nbsp;&lt;strong&gt;cli_tab_handle.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Problem with this solution is that as long as variable cli_lock_passwd is not securly stored some &amp;quot;hacker&amp;quot; can easly read/modify RAM and this variable. Or he can read Flash to find out expected password.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>