26
X-CUBE-SBSFU Expansion software for STM32Cube Secure boot & secure firmware update

Efficient solution for secure firmware install and upgrade ... · • ST proposal • Allow Industries to develop their own Secure Boot / Root of Trust method • Propose a way to

Embed Size (px)

Citation preview

Page 1: Efficient solution for secure firmware install and upgrade ... · • ST proposal • Allow Industries to develop their own Secure Boot / Root of Trust method • Propose a way to

X-CUBE-SBSFUExpansion software for STM32Cube Secure boot & secure firmware update

Page 3: Efficient solution for secure firmware install and upgrade ... · • ST proposal • Allow Industries to develop their own Secure Boot / Root of Trust method • Propose a way to

Today’s Connected World 3

65%

Operating system based solutions

20 Billion

Page 4: Efficient solution for secure firmware install and upgrade ... · • ST proposal • Allow Industries to develop their own Secure Boot / Root of Trust method • Propose a way to

Our concern for tomorrow 4

48 Billion

Embedded solutions

65%

Page 5: Efficient solution for secure firmware install and upgrade ... · • ST proposal • Allow Industries to develop their own Secure Boot / Root of Trust method • Propose a way to

What will embedded solutions protect ? 5

• Their ServicesWhat the end customer pays

• Their NetworksAvoid DoSProvide quality/reliability

• Their BrandWhat we sell every day !

Node Gateway Cloud

Page 6: Efficient solution for secure firmware install and upgrade ... · • ST proposal • Allow Industries to develop their own Secure Boot / Root of Trust method • Propose a way to

Secure BootR

oot of TrustCategories of attacks 6

• Logical attack From outside the box

• Board-level attack From inside the box

• Chip-level attack From inside the chip

Today 95 % IOT attacks

Cloningattacks

Logical• Local or remote• Open ports• SW Bugs• Debug I/Fs• Etc.

Cost and expertise of attack materials

Board-level• Memory probing• « Mod-chips »• Fault injection• Side-channels• Etc.

Chip-level• Probing• Laser• FIB• Reverse Eng.• Etc.

Page 7: Efficient solution for secure firmware install and upgrade ... · • ST proposal • Allow Industries to develop their own Secure Boot / Root of Trust method • Propose a way to

Secure Boot / Root of Trust Target• Immutable Secure Boot code

• Executed first at reset

• Verify the platform integrity• Clock settings• Register configurations • Memory Protection, ….

• Launch Root of Trust services• Authentication of code• Uses cryptographic keys and

encryption functions

7

Secure Boot

Code

Reset

Trusted

First stageLoader

Code Cert.

Second StageApplication

Code Cert.

Authenticates

Authenticates

Page 8: Efficient solution for secure firmware install and upgrade ... · • ST proposal • Allow Industries to develop their own Secure Boot / Root of Trust method • Propose a way to

Root of Trust General Process stored in the device• Performed at each RESET, using a Key

• It is a predictable process

8

Trusted

Code Authentication

Stored Certificate

MAC Function

Calculated Certificate

Compare

OK

NOK

Reload

Run Code

SBRoTReset

Appli Stage X

+

File

Code Image

Page 9: Efficient solution for secure firmware install and upgrade ... · • ST proposal • Allow Industries to develop their own Secure Boot / Root of Trust method • Propose a way to

Current Market approach• Not a single standardized Secure Boot / Root of Trust model

9

SBRoT 1

Reset

Stage Xapplication

SBRoT 2

Reset

Stage Xapplication

SBRoT n

Reset

Stage Xapplication

Industrial

LPWAN

NB IOT

SBRoT x

Reset

Stage Xapplication

SBRoT y

Reset

Stage Xapplication

SBRoT z

Reset

Stage Xapplication

Cloud

Metering

Page 10: Efficient solution for secure firmware install and upgrade ... · • ST proposal • Allow Industries to develop their own Secure Boot / Root of Trust method • Propose a way to

How to support such approach• Embedded ROMed code

• ST proposal• Allow Industries to develop their own Secure Boot / Root of Trust method• Propose a way to securely load it into the STM32• Propose a way to isolate and securely execute it within STM32

10

SB / RoT approach feasibility remarks

One code on all STM32 May not be market acceptable

Multiple code on STM32 Diversify productsIncrease development, qualification, certification, cost

Page 11: Efficient solution for secure firmware install and upgrade ... · • ST proposal • Allow Industries to develop their own Secure Boot / Root of Trust method • Propose a way to

Secure Firmware Update 11

Communication Device

Sensor

MCU

Server

Firmware

Firmware

Symmetric Key

Developer

Data File

Firmware

MCUServer Communication Encrypted File

Data FileData File

Cloud • Server sends FW update

• Device receives, stores new FW update and executes it

Data File

Page 12: Efficient solution for secure firmware install and upgrade ... · • ST proposal • Allow Industries to develop their own Secure Boot / Root of Trust method • Propose a way to

Secure Firmware Update

• Complete process performed in a secure way

• Prevent Unauthorized updates

• Access to secret code and key

• Access to confidential on-device data

• Developed in several software modules

12

Page 13: Efficient solution for secure firmware install and upgrade ... · • ST proposal • Allow Industries to develop their own Secure Boot / Root of Trust method • Propose a way to

SBSFU software package overview• Secure Boot (SB) module

• Execution with Root of trust service

• Application authentication and Integrity check before execution

• Secure Firmware Update (SFU) module• Detect new FW version to install

• From local download service• Pre-downloaded OTA via User application from previous execution…

• Manage FW version (check unauthorized updates or unauthorizedinstallation)

• Secure FW update:• FW Authentication and Integrity check• FW decryption• FW installation

• In case of any error occurring during new image installation,possibility to rollback to the previous valid version…

• Execute new installed FW (once Authenticated and integritychecked)

13

• Secure Engine (SE) module• Code isolated from main Firmware Secure

execution

• Dedicated to executing cryptographicalgorithms

• Manage secure key storage

Page 14: Efficient solution for secure firmware install and upgrade ... · • ST proposal • Allow Industries to develop their own Secure Boot / Root of Trust method • Propose a way to

Secure Firmware Update Process• Performed when a new firmware update is available by the using a

public key stored in the device

• Each new firmware update is authenticated before being installed

14

Code Authentication

Keyed-Hash Value

MAC

Calculated Value

Compare

OK

NOK

Reject

Install CodeClear TextDecryption

+

Data FileEncrypted File

Data File

Clear Text

Page 15: Efficient solution for secure firmware install and upgrade ... · • ST proposal • Allow Industries to develop their own Secure Boot / Root of Trust method • Propose a way to

Foundation of Trust

Security Layering• MCU Security Features

• Used to establish a robust platform on which trusted processes and associated cryptographic functions can be performed

• Cryptographic Functions• Preserve confidentiality, verify integrity, authenticity

• Secure Boot (SB) and Secure Firmware Update (SFU)

• Establishing a Root-of-Trust• Building a system that can evolve to counter new

threats, add new functionality, fix bugs in a controlled and secure way once the device is in the field

15

Application• Features / Services • Communication (TLS)

MCU Security FeaturesRDP WRP MPUPCROPFirewall

Cryptographic functions• Confidentiality, Integrity, Availability

Security Services• Secure Boot, Secure Firmware Update

Page 16: Efficient solution for secure firmware install and upgrade ... · • ST proposal • Allow Industries to develop their own Secure Boot / Root of Trust method • Propose a way to

Security

• Proprietary code Read Out Protection (PcROP)

• Readout Protection (RDP)• Level 0: no readout protection• Level 1: memory readout protection• Level 2: chip readout protection

• Specific configurable area• 1 each per Flash memory bank

• Write protection (WRP)• 1 each per Flash memory / SRAM

sector

Flash memory code and registers (+ SRAM2 in L4) cannot be dumped through JTAG/SWD or by the CPU itself booted from other memories than internal Flash

Flash memory code is only executable, cannot be read and dumped by the CPU

Flash memory code is protected from unwanted write/erase operations

16

STM32 Static Protections

Page 17: Efficient solution for secure firmware install and upgrade ... · • ST proposal • Allow Industries to develop their own Secure Boot / Root of Trust method • Propose a way to

SecuritySTM32 Dynamic Protections

• Firewall• Code or data protection in Flash memory

or SRAM

• MPU• Memory isolation• Hard-fault or core lock-up in case of

violation

• Backup domain and Anti-Tamper• Independent voltage• RTC, Backup SRAM• Tamper detection pin

Single call-gate interfaceTrusted execution regionIdeal to protect sensitive function and IPfrom the rest of the application

Detection of tamper eventReset of all backup registerTime stamp event

Read, Write, eXecute attribute per region Prevent stack overflows System protection against unintended modification

17

Page 18: Efficient solution for secure firmware install and upgrade ... · • ST proposal • Allow Industries to develop their own Secure Boot / Root of Trust method • Propose a way to

SBSFU-based product architecture overview 18

Page 19: Efficient solution for secure firmware install and upgrade ... · • ST proposal • Allow Industries to develop their own Secure Boot / Root of Trust method • Propose a way to

Security Mindset / Security • First, know what you want

• What do you want to protect ?• What do you want to protect it against ?

• Then look at how to protect it

• Examine the protection we justadded

• Is it fully protecting?• Is it adding some weakness• Does it requires additional elements to

protect

19

Look at allthe elementsof the system

Incrementalprocess

michael miller
Cross-Out
Page 20: Efficient solution for secure firmware install and upgrade ... · • ST proposal • Allow Industries to develop their own Secure Boot / Root of Trust method • Propose a way to

Protecting The Chain Of Trust 20

RDP–L2

• Disable external access• Protect boot options• Lock Option bytes

• WRP• PCROP

• Protect the code enabling the MPU/Firewall

• Protect the code considered trusted

• Protect part of the Flash memory

WRP PCROP

Trust

Firewall

• Protect RAM and Flash memory at runtime

Trust

TrustCrypto

• Verify the integrity and authenticity of the user application

MPU

• Execution allowedonly inside thechain of trust

Trust

SB / SFU

Trusted

Page 21: Efficient solution for secure firmware install and upgrade ... · • ST proposal • Allow Industries to develop their own Secure Boot / Root of Trust method • Propose a way to

SBSFU covered use cases• Industrial Firmware Update

• Usually performed by a human• Requires a physical connection between the updater tool and the MCU

• UART, SPI, USB, ….. Wired connection• Able to stop the application running during the update• In case of update error, retry is manually managed

• Over The Air Firmware Update (FOTA)• Stand alone update operation• Uses device connectivity to receive and manage the update

• Wi-Fi, LPWAN, BT/BLE, ….• Running application manages its own firmware update• Retry may be difficult to support

21

Page 22: Efficient solution for secure firmware install and upgrade ... · • ST proposal • Allow Industries to develop their own Secure Boot / Root of Trust method • Propose a way to

SBSFU : 2 implementations

• 1) Non isolated modules• Secure Boot and Secure Firmware Updates form a single immutable code protected

the same way• It includes cryptographic and SFU keys• Introduce Root of Trust protection mechanism into STM32

• 2) Isolated modules• Secure Boot module is immutable code• Secure Engine is isolated from rest of code• Secure Firmware Update includes Root of Trust verification runtime code

22

Page 23: Efficient solution for secure firmware install and upgrade ... · • ST proposal • Allow Industries to develop their own Secure Boot / Root of Trust method • Propose a way to

SBSFU roadmap on STM32

X-CUBE-SBSFUExpansion software for STM32Cube

F4 F7 H7 L0 L4/L4+

High-performance MCUs Ultra-low-power MCUsSecure Boot

Secure FW Update

Secure Engine

Availability Q4/2018 Q4/2018 Q4/2018 Q4/2018 Now

23

Page 24: Efficient solution for secure firmware install and upgrade ... · • ST proposal • Allow Industries to develop their own Secure Boot / Root of Trust method • Propose a way to

SBSFU package now available for STM32L4 series

• X-CUBE-SBSFU expansion software available from ST website• www.st.com/x-cube-sbsfu

24

Page 25: Efficient solution for secure firmware install and upgrade ... · • ST proposal • Allow Industries to develop their own Secure Boot / Root of Trust method • Propose a way to

Recommendations• Reduce risk

• Ensures products are strengthened against attacks throughout their entire lifetime

• Understand the value of your assets• Perform threat analysis• Confidentiality, availability and integrity are key

• Use good design practices to develop and maintain secureproducts

• Use security features and tools to achieve robust products• Work with trusted and experienced partners

25

Page 26: Efficient solution for secure firmware install and upgrade ... · • ST proposal • Allow Industries to develop their own Secure Boot / Root of Trust method • Propose a way to

Releasing Your Creativity 26

www.st.com/stm32l4/STM32 @ST_World ST community