<?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>Getting into Cellular and security with nRF9160</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/105499/getting-into-cellular-and-security-with-nrf9160</link><description>Hello. I am just getting into nRF and in particular cellular devices. 
 
 After playing around with nRF9160DK, I have come up with a number of questions that is not fully clear to me. I would appreciate if someone could help me with the questions 
 1</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 13 Nov 2023 14:19:40 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/105499/getting-into-cellular-and-security-with-nrf9160" /><item><title>RE: Getting into Cellular and security with nRF9160</title><link>https://devzone.nordicsemi.com/thread/455331?ContentTypeID=1</link><pubDate>Mon, 13 Nov 2023 14:19:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e2ae8515-cebc-49d3-8f45-6643eff6aee7</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="zazas321"]1. By using the secure image, I can place the certificate there and just make the special API calls to get the credentials when needed. Is that how it works?[/quote]
&lt;p&gt;Certificates are stored in the modem, and you access them by referencing the specific security tag where you initially stored the credentials.&lt;/p&gt;
&lt;p&gt;I think your questions are valid, like for instance this one:&lt;/p&gt;
[quote user=""]How do I decide if I need this in my application or not? [/quote]
&lt;p&gt;The answer to this question is based on the nRF9160 hardware model.&lt;/p&gt;
&lt;p&gt;The modem can only communicate with the application in a &amp;quot;non-secure mode&amp;quot;, and the default boot-up mode for a Cortex M33 CPU core is &amp;quot;secure mode&amp;quot;.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This means that if you want to use the modem, you have to do this in the non-secure mode, ie. with board &amp;quot;nrf9160dk_nrf9160_ns&amp;quot; (or other equivilant board _ns prefix&amp;#39;ed).&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I hope this clarifies the reason why everything for nRF9160 will include TF-M.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;That being said; you have several image sizes (feature sets) for TF-M. If you need crypto-acceleration in your application space, this will effectively be a non-secure callable function to the secure part.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Now, to answer your question directly: Where does the credentials go?&lt;/p&gt;
&lt;p&gt;Normally you provision your device from a 3rd party, like a computer in production (or a webservice for that matter) - this way, credentials are never stored in the .hex, but rather fetched and stored into the modem from an external source.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user="zazas321"]2. How does the merged hex file look like in that case? Does it hash the whole part of secure image to ensure is not availae to extract any information from it?[/quote]
&lt;p&gt;You reference the sec_tag where you initially provisioned the certificates - they&amp;#39;re now stored in the modem itself.&lt;/p&gt;
&lt;p&gt;You can program the specific tag using our tools, for instance in nRF connect for desktop - Cellular monitor (PC application):&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/5466.pastedimage1699885081263v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;This takes in a certificate, and wraps it around the AT%CMNG call to write it into the modem itself.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user="zazas321"]3. Can you recommend which sample project would be best suited for example that I have explained above? In the NCS sample directory there is quite a few different security and TF-M samples available. I can fully decide which one would suit my particular application best[/quote]
&lt;p&gt;at_client can take in AT commands via uart.&lt;/p&gt;
&lt;p&gt;If you want to use a CLI based tool, you can look at this blog post:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/guides/cellular-iot-guides/b/software-and-protocols/posts/automating-nrf91-tls-credential-management-via-serial-port-at-commands"&gt;Automating nRF91 TLS credential management via serial port AT commands&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;And also this project:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/NordicSemiconductor/nrfcredstore"&gt;https://github.com/NordicSemiconductor/nrfcredstore&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Getting into Cellular and security with nRF9160</title><link>https://devzone.nordicsemi.com/thread/454745?ContentTypeID=1</link><pubDate>Wed, 08 Nov 2023 15:56:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:377bc8c5-5d40-4011-bc9e-fada09207743</guid><dc:creator>zazas321</dc:creator><description>&lt;p&gt;Thank you for your quick reply. Before we close this ticket, i would like to explain a scenario and I would like you to confirm this to ensure I understand this correct.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I could use TF-M and multi image in the following scenario:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Lets say I want to use MQTT TLS with the nRF91DK. TLS requires a certificate that I want to protect.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Normally, I would just include the certificate in the header file and just use it. That is a security vulnerability since everyone who have access to firmware hex file could extract the certificate if they put some effort ( it would not be easy because the certificate normally is a bunch of random characters) but this data would be somewhere within plain sight in the hex file I think.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;1. By using the secure image, I can place the certificate there and just make the special API calls to get the credentials when needed. Is that how it works?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;2. How does the merged hex file look like in that case? Does it hash the whole part of secure image to ensure is not availae to extract any information from it?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;3. Can you recommend which sample project would be best suited for example that I have explained above? In the NCS sample directory there is quite a few different security and TF-M samples available. I can fully decide which one would suit my particular application best&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I would appreciate if you could respond to each of my questions one by one. That way it would be very clear for me. Thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Getting into Cellular and security with nRF9160</title><link>https://devzone.nordicsemi.com/thread/454692?ContentTypeID=1</link><pubDate>Wed, 08 Nov 2023 13:31:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d7bda96a-fc05-4903-a019-3d2ca7d6791a</guid><dc:creator>&amp;#216;yvind</dc:creator><description>&lt;p&gt;Hello,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;As mentioned in lesson one of the Cellular IoT fundementals course, the nRF9160 has two domains, the secure and non-secure domain.&amp;nbsp;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;span&gt;At boot-up, the application always starts execution from the secure domain. From there, the Trusted Firmware-M (TF-M) is started (&lt;strong&gt;image one&lt;/strong&gt;), which will configure part of the memory and peripherals as non-secure and then jump to the main application (&lt;strong&gt;image two&lt;/strong&gt;) in the non-secure area.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;This is all automated by the nRF Connect SDK when building your application for the non-secure domain. As you can see from the figure, the modem library, which interfaces with the LTE modem, is defined in the non-secure domain.&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;strong&gt;Therefore, when building for the nRF9160, you should always build for the non-secure domain.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;All nRF9160 applications (the parent image) require&amp;nbsp;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/ug_tfm.html#ug-tfm"&gt;Trusted Firmware-M&lt;/a&gt;&amp;nbsp;(the child image) to be programmed together with the actual application. When building an application for the non-secure domain, TF-M is automatically included as the child image, making it a multi-image build.&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;span&gt;In your case, as you are new to this, I would recommend not thinking about the TF-M child image at this stage as it is automatically included. More information on secure build can be found under &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.0/nrf/device_guides/working_with_nrf/nrf91/nrf9160.html#build-targets"&gt;Build targets&lt;/a&gt;&amp;nbsp;in our documentation. If you feel something is not covered or missing in course, please leave feedback in Feedback button on DevAcademy.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Have a look at our documentation for &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.0/nrf/device_guides/nrf91.html#working-with-nrf91-series"&gt;Working with the nRF91 series&lt;/a&gt;, and please &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.0/nrf/samples/cellular.html#cellular-samples"&gt;test the Cellular samples&lt;/a&gt;&amp;nbsp;in our nRF Connect SDK. We also have&amp;nbsp;Precompiled application and modem firmware packages which includes our most used samples and applications to test with your development kit. These are f&lt;a href="https://www.nordicsemi.com/Products/Development-hardware/nRF9160-DK/Download?lang=en#infotabs"&gt;ound in the Downloads tab of the nRF9160DK product page&lt;/a&gt;.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Kind regards,&lt;br /&gt;Øyvind&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>