| < draft-ietf-suit-architecture-12.txt | draft-ietf-suit-architecture-13.txt > | |||
|---|---|---|---|---|
| SUIT B. Moran | SUIT B. Moran | |||
| Internet-Draft H. Tschofenig | Internet-Draft H. Tschofenig | |||
| Intended status: Informational Arm Limited | Intended status: Informational Arm Limited | |||
| Expires: March 21, 2021 D. Brown | Expires: April 19, 2021 D. Brown | |||
| Linaro | Linaro | |||
| M. Meriac | M. Meriac | |||
| Consultant | Consultant | |||
| September 17, 2020 | October 16, 2020 | |||
| A Firmware Update Architecture for Internet of Things | A Firmware Update Architecture for Internet of Things | |||
| draft-ietf-suit-architecture-12 | draft-ietf-suit-architecture-13 | |||
| Abstract | Abstract | |||
| Vulnerabilities with Internet of Things (IoT) devices have raised the | Vulnerabilities with Internet of Things (IoT) devices have raised the | |||
| need for a solid and secure firmware update mechanism that is also | need for a reliable and secure firmware update mechanism suitable for | |||
| suitable for constrained devices. Incorporating such update | devices with resource constraints. Incorporating such an update | |||
| mechanism to fix vulnerabilities, to update configuration settings as | mechanism is a fundamental requirement for fixing vulnerabilities but | |||
| well as adding new functionality is recommended by security experts. | it also enables other important capabilities such as updating | |||
| configuration settings as well as adding new functionality. | ||||
| This document lists requirements and describes an architecture for a | In addition to the definition of terminology and an architecture this | |||
| firmware update mechanism suitable for IoT devices. The architecture | document motivates the standardization of a manifest format as a | |||
| is agnostic to the transport of the firmware images and associated | transport-agnostic means for describing and protecting firmware | |||
| meta-data. | updates. | |||
| Status of This Memo | Status of This Memo | |||
| This Internet-Draft is submitted in full conformance with the | This Internet-Draft is submitted in full conformance with the | |||
| provisions of BCP 78 and BCP 79. | provisions of BCP 78 and BCP 79. | |||
| Internet-Drafts are working documents of the Internet Engineering | Internet-Drafts are working documents of the Internet Engineering | |||
| Task Force (IETF). Note that other groups may also distribute | Task Force (IETF). Note that other groups may also distribute | |||
| working documents as Internet-Drafts. The list of current Internet- | working documents as Internet-Drafts. The list of current Internet- | |||
| Drafts is at https://datatracker.ietf.org/drafts/current/. | Drafts is at https://datatracker.ietf.org/drafts/current/. | |||
| Internet-Drafts are draft documents valid for a maximum of six months | Internet-Drafts are draft documents valid for a maximum of six months | |||
| and may be updated, replaced, or obsoleted by other documents at any | and may be updated, replaced, or obsoleted by other documents at any | |||
| time. It is inappropriate to use Internet-Drafts as reference | time. It is inappropriate to use Internet-Drafts as reference | |||
| material or to cite them other than as "work in progress." | material or to cite them other than as "work in progress." | |||
| This Internet-Draft will expire on March 21, 2021. | This Internet-Draft will expire on April 19, 2021. | |||
| Copyright Notice | Copyright Notice | |||
| Copyright (c) 2020 IETF Trust and the persons identified as the | Copyright (c) 2020 IETF Trust and the persons identified as the | |||
| document authors. All rights reserved. | document authors. All rights reserved. | |||
| This document is subject to BCP 78 and the IETF Trust's Legal | This document is subject to BCP 78 and the IETF Trust's Legal | |||
| Provisions Relating to IETF Documents | Provisions Relating to IETF Documents | |||
| (https://trustee.ietf.org/license-info) in effect on the date of | (https://trustee.ietf.org/license-info) in effect on the date of | |||
| publication of this document. Please review these documents | publication of this document. Please review these documents | |||
| carefully, as they describe your rights and restrictions with respect | carefully, as they describe your rights and restrictions with respect | |||
| to this document. Code Components extracted from this document must | to this document. Code Components extracted from this document must | |||
| include Simplified BSD License text as described in Section 4.e of | include Simplified BSD License text as described in Section 4.e of | |||
| the Trust Legal Provisions and are provided without warranty as | the Trust Legal Provisions and are provided without warranty as | |||
| described in the Simplified BSD License. | described in the Simplified BSD License. | |||
| Table of Contents | Table of Contents | |||
| 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 | 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 | |||
| 2. Conventions and Terminology . . . . . . . . . . . . . . . . . 3 | 2. Conventions and Terminology . . . . . . . . . . . . . . . . . 5 | |||
| 3. Requirements . . . . . . . . . . . . . . . . . . . . . . . . 7 | 2.1. Terms . . . . . . . . . . . . . . . . . . . . . . . . . . 5 | |||
| 3.1. Agnostic to how firmware images are distributed . . . . . 7 | 2.2. Stakeholders . . . . . . . . . . . . . . . . . . . . . . 6 | |||
| 3.2. Friendly to broadcast delivery . . . . . . . . . . . . . 8 | 2.3. Functions . . . . . . . . . . . . . . . . . . . . . . . . 7 | |||
| 3.3. Use state-of-the-art security mechanisms . . . . . . . . 8 | 3. Architecture . . . . . . . . . . . . . . . . . . . . . . . . 8 | |||
| 3.4. Rollback attacks must be prevented . . . . . . . . . . . 9 | 4. Invoking the Firmware . . . . . . . . . . . . . . . . . . . . 12 | |||
| 3.5. High reliability . . . . . . . . . . . . . . . . . . . . 9 | 4.1. The Bootloader . . . . . . . . . . . . . . . . . . . . . 14 | |||
| 3.6. Operate with a small bootloader . . . . . . . . . . . . . 9 | 5. Types of IoT Devices . . . . . . . . . . . . . . . . . . . . 15 | |||
| 3.7. Small Parsers . . . . . . . . . . . . . . . . . . . . . . 10 | 5.1. Single MCU . . . . . . . . . . . . . . . . . . . . . . . 15 | |||
| 3.8. Minimal impact on existing firmware formats . . . . . . . 10 | 5.2. Single CPU with Secure - Normal Mode Partitioning . . . . 16 | |||
| 3.9. Robust permissions . . . . . . . . . . . . . . . . . . . 10 | 5.3. Symmetric Multiple CPUs . . . . . . . . . . . . . . . . . 16 | |||
| 3.10. Operating modes . . . . . . . . . . . . . . . . . . . . . 11 | 5.4. Dual CPU, shared memory . . . . . . . . . . . . . . . . . 16 | |||
| 3.11. Suitability to software and personalization data . . . . 13 | 5.5. Dual CPU, other bus . . . . . . . . . . . . . . . . . . . 17 | |||
| 4. Claims . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 | 6. Manifests . . . . . . . . . . . . . . . . . . . . . . . . . . 17 | |||
| 5. Communication Architecture . . . . . . . . . . . . . . . . . 14 | 7. Securing Firmware Updates . . . . . . . . . . . . . . . . . . 19 | |||
| 6. Manifest . . . . . . . . . . . . . . . . . . . . . . . . . . 18 | 8. Example . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 | |||
| 7. Device Firmware Update Examples . . . . . . . . . . . . . . . 19 | 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 25 | |||
| 7.1. Single CPU SoC . . . . . . . . . . . . . . . . . . . . . 19 | 10. Security Considerations . . . . . . . . . . . . . . . . . . . 25 | |||
| 7.2. Single CPU with Secure - Normal Mode Partitioning . . . . 19 | 11. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 25 | |||
| 7.3. Symmetric Multiple CPUs . . . . . . . . . . . . . . . . . 19 | 12. Informative References . . . . . . . . . . . . . . . . . . . 26 | |||
| 7.4. Dual CPU, shared memory . . . . . . . . . . . . . . . . . 20 | Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 28 | |||
| 7.5. Dual CPU, other bus . . . . . . . . . . . . . . . . . . . 20 | ||||
| 8. Bootloader . . . . . . . . . . . . . . . . . . . . . . . . . 20 | ||||
| 9. Example . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 | ||||
| 10. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 26 | ||||
| 11. Security Considerations . . . . . . . . . . . . . . . . . . . 26 | ||||
| 12. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 27 | ||||
| 13. Informative References . . . . . . . . . . . . . . . . . . . 28 | ||||
| Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 29 | ||||
| 1. Introduction | 1. Introduction | |||
| When developing Internet of Things (IoT) devices, one of the most | Firmware updates can help to fix security vulnerabilities and are | |||
| difficult problems to solve is how to update firmware on the device. | considered to be an important building block in securing IoT devices. | |||
| Once the device is deployed, firmware updates play a critical part in | Due to rising concerns about insecure IoT devices the Internet | |||
| its lifetime, particularly when devices have a long lifetime, are | Architecture Board (IAB) organized a 'Workshop on Internet of Things | |||
| deployed in remote or inaccessible areas where manual intervention is | (IoT) Software Update (IOTSU)', which took place at Trinity College | |||
| cost prohibitive or otherwise difficult. Updates to the firmware of | Dublin, Ireland on the 13th and 14th of June, 2016 to take a look at | |||
| an IoT device are done to fix bugs in software, to add new | the bigger picture. A report about this workshop can be found at | |||
| functionality, and to re-configure the device to work in new | [RFC8240]. The workshop revealed a number of challenges for | |||
| developers and led to the formation of the IETF Software Updates for | ||||
| Internet of Things (SUIT) working group. | ||||
| Developing secure Internet of Things (IoT) devices is not an easy | ||||
| task and supporting a firmware update solution requires skillful | ||||
| engineers. Once devices are deployed, firmware updates play a | ||||
| critical part in their lifecycle management, particularly when | ||||
| devices have a long lifetime, or are deployed in remote or | ||||
| inaccessible areas where manual intervention is cost prohibitive or | ||||
| otherwise difficult. Firmware updates | ||||
| for IoT devices are expected to work automatically, i.e. without user | ||||
| involvement. Automatic updates that do not require human | ||||
| intervention are key to a scalable solution for fixing software | ||||
| vulnerabilities. | ||||
| Firmware updates are not only done to fix bugs, but they can also add | ||||
| new functionality, and re-configure the device to work in new | ||||
| environments or to behave differently in an already deployed context. | environments or to behave differently in an already deployed context. | |||
| The firmware update process, among other goals, has to ensure that | The firmware update process has to ensure that | |||
| - The firmware image is authenticated and integrity protected. | - The firmware image is authenticated and integrity protected. | |||
| Attempts to flash a modified firmware image or an image from an | Attempts to flash a maliciously modified firmware image or an | |||
| unknown source are prevented. | image from an unknown, untrusted source must be prevented. In | |||
| examples this document uses asymmetric cryptography because it is | ||||
| the preferred approach by many IoT deployments. The use of | ||||
| symmetric credentials is also supported and can be used by very | ||||
| constrained IoT devices. | ||||
| - The firmware image can be confidentiality protected so that | - The firmware image can be confidentiality protected so that | |||
| attempts by an adversary to recover the plaintext binary can be | attempts by an adversary to recover the plaintext binary can be | |||
| prevented. Obtaining the firmware is often one of the first steps | mitigated or at least made more difficult. Obtaining the firmware | |||
| to mount an attack since it gives the adversary valuable insights | is often one of the first steps to mount an attack since it gives | |||
| into used software libraries, configuration settings and generic | the adversary valuable insights into the software libraries used, | |||
| functionality (even though reverse engineering the binary can be a | configuration settings and generic functionality. Even though | |||
| tedious process). | reverse engineering the binary can be a tedious process modern | |||
| reverse engineering frameworks have made this task a lot easier. | ||||
| This version of the document assumes asymmetric cryptography and a | ||||
| public key infrastructure. Future versions may also describe a | ||||
| symmetric key approach for very constrained devices. | ||||
| While the standardization work has been informed by and optimised for | While the standardization work has been informed by and optimized for | |||
| firmware update use cases of Class 1 devices (according to the device | firmware update use cases of Class 1 devices (according to the device | |||
| class definitions in RFC 7228 [RFC7228]) devices, there is nothing in | class definitions in RFC 7228 [RFC7228]) devices, there is nothing in | |||
| the architecture that restricts its use to only these constrained IoT | the architecture that restricts its use to only these constrained IoT | |||
| devices. Moreover, this architecture is not limited to managing | devices. Moreover, this architecture is not limited to managing | |||
| software updates, but can also be applied to managing the delivery of | software updates, but can also be applied to managing the delivery of | |||
| arbitrary data, such as configuration information and keys. | arbitrary data, such as configuration information and keys. Unlike | |||
| higher end devices, like laptops and desktop PCs, many IoT devices do | ||||
| not have user interfaces and support for unattended updates is, | ||||
| therefore, essential for the design of a practical solution. | ||||
| Constrained IoT devices often use a software engineering model where | ||||
| a developer is responsible for creating and compiling all software | ||||
| running on the device into a single, monolithic firmware image. On | ||||
| higher end devices application software is, on the other hand, often | ||||
| downloaded separately and even obtained from developers different to | ||||
| the developers of the lower level software. The details for how to | ||||
| obtain those application layer software binaries then depends heavily | ||||
| on the platform, programming language uses and the sandbox the | ||||
| software is executed in. | ||||
| More details about the security goals are discussed in Section 5 and | While the IETF standardization work has been focused on the manifest | |||
| requirements are described in Section 3. | format, a fully interoperable solution needs more than a standardized | |||
| manifest. For example, protocols for transferring firmware images | ||||
| and manifests to the device need to be available as well as the | ||||
| status tracker functionality. Devices also require a mechanism to | ||||
| discover the status tracker(s) and/or firmware servers. These | ||||
| building blocks have been developed by various organizations under | ||||
| the umbrella of an IoT device management solution. The LwM2M | ||||
| protocol is one IoT device management protocol. | ||||
| There are, however, several areas that (partially) fall outside the | ||||
| scope of the IETF and other standards organizations but need to be | ||||
| considered by firmware authors, as well as device and network | ||||
| operators. Here are some of them, as highlighted during the IOTSU | ||||
| workshop: | ||||
| - Installing firmware updates in a robust fashion so that the update | ||||
| does not break the device functionality of the environment this | ||||
| device operates in. This requires proper testing and offering | ||||
| recovery strategies when a firmware update is unsuccessful. | ||||
| - Making firmware updates available in a timely fashion considering | ||||
| the complexity of the decision making process for updating | ||||
| devices, potential re-certification requirements, the length of a | ||||
| supply chain an update needs to go through before it reaches the | ||||
| end customer, and the need for user consent to install updates. | ||||
| - Ensuring an energy efficient design of a battery-powered IoT | ||||
| devices because a firmware update, particularly writing the | ||||
| firmware image to flash, is a heavy task for a device. | ||||
| - Creating incentives for device operators to use a firmware update | ||||
| mechanism and to demand the integration of it from IoT device | ||||
| vendors. | ||||
| - Ensuring that firmware updates addressing critical flaws can be | ||||
| obtained even after a product is discontinued or a vendor goes out | ||||
| of business. | ||||
| This document starts with a terminology followed by the description | ||||
| of the architecture. We then explain the bootloader and how it | ||||
| integrates with the firmware update mechanism. Subsequently, we | ||||
| offer a categorization of IoT devices in terms of their hardware | ||||
| capabilities relevant for firmware updates. Next, we talk about the | ||||
| manifest structure and how to use it to secure firmware updates. We | ||||
| conclude with a more detailed example. | ||||
| 2. Conventions and Terminology | 2. Conventions and Terminology | |||
| This document uses the following terms: | 2.1. Terms | |||
| - Manifest: The manifest contains meta-data about the firmware | This document uses the following terms: | |||
| image. The manifest is protected against modification and | ||||
| provides information about the author. | ||||
| - Firmware Image: The firmware image, or image, is a binary that may | - Firmware Image: The firmware image, or image, is a binary that may | |||
| contain the complete software of a device or a subset of it. The | contain the complete software of a device or a subset of it. The | |||
| firmware image may consist of multiple images, if the device | firmware image may consist of multiple images, if the device | |||
| contains more than one microcontroller. Often it is also a | contains more than one microcontroller. Often it is also a | |||
| compressed archive that contains code, configuration data, and | compressed archive that contains code, configuration data, and | |||
| even the entire file system. The image may consist of a | even the entire file system. The image may consist of a | |||
| differential update for performance reasons. Firmware is the more | differential update for performance reasons. | |||
| universal term. The terms, firmware image, firmware, and image, | ||||
| are used in this document and are interchangeable. | ||||
| - Software: The terms "software" and "firmware" are used | The terms, firmware image, firmware, and image, are used in this | |||
| interchangeably. | document and are interchangeable. We use the term application | |||
| firmware image to differentiate it from a firmware image that | ||||
| contains the bootloader. An application firmware image, as the | ||||
| name indicates, contains the application program often including | ||||
| all the necessary code to run it (such as protocol stacks, and | ||||
| embedded operating system). | ||||
| - Bootloader: A bootloader is a piece of software that is executed | - Manifest: The manifest contains meta-data about the firmware | |||
| once a microcontroller has been reset. It is responsible for | image. The manifest is protected against modification and | |||
| deciding whether to boot a firmware image that is present or | provides information about the author. | |||
| whether to obtain and verify a new firmware image. Since the | ||||
| bootloader is a security critical component its functionality may | ||||
| be split into separate stages. Such a multi-stage bootloader may | ||||
| offer very basic functionality in the first stage and resides in | ||||
| ROM whereas the second stage may implement more complex | ||||
| functionality and resides in flash memory so that it can be | ||||
| updated in the future (in case bugs have been found). The exact | ||||
| split of components into the different stages, the number of | ||||
| firmware images stored by an IoT device, and the detailed | ||||
| functionality varies throughout different implementations. A more | ||||
| detailed discussion is provided in Section 8. | ||||
| - Microcontroller (MCU for microcontroller unit): An MCU is a | - Microcontroller (MCU for microcontroller unit): An MCU is a | |||
| compact integrated circuit designed for use in embedded systems. | compact integrated circuit designed for use in embedded systems. | |||
| A typical microcontroller includes a processor, memory (RAM and | A typical microcontroller includes a processor, memory (RAM and | |||
| flash), input/output (I/O) ports and other features connected via | flash), input/output (I/O) ports and other features connected via | |||
| some bus on a single chip. The term 'system on chip (SoC)' is | some bus on a single chip. The term 'system on chip (SoC)' is | |||
| often used for these types of devices. | often used interchangeably with MCU, but MCU tends to imply more | |||
| limited peripheral functions. | ||||
| - System on Chip (SoC): An SoC is an integrated circuit that | ||||
| integrates all components of a computer, such as CPU, memory, | ||||
| input/output ports, secondary storage, etc. | ||||
| - Homogeneous Storage Architecture (HoSA): A device that stores all | ||||
| firmware components in the same way, for example in a file system | ||||
| or in flash memory. | ||||
| - Heterogeneous Storage Architecture (HeSA): A device that stores at | ||||
| least one firmware component differently from the rest, for | ||||
| example a device with an external, updatable radio, or a device | ||||
| with internal and external flash memory. | ||||
| - Trusted Execution Environments (TEEs): An execution environment | ||||
| that runs alongside of, but is isolated from, an REE. | ||||
| - Rich Execution Environment (REE): An environment that is provided | - Rich Execution Environment (REE): An environment that is provided | |||
| and governed by a typical OS (e.g., Linux, Windows, Android, iOS), | and governed by a typical OS (e.g., Linux, Windows, Android, iOS), | |||
| potentially in conjunction with other supporting operating systems | potentially in conjunction with other supporting operating systems | |||
| and hypervisors; it is outside of the TEE. This environment and | and hypervisors; it is outside of the TEE. This environment and | |||
| applications running on it are considered un-trusted. | applications running on it are considered un-trusted. | |||
| - Trusted applications (TAs): An application component that runs in | - System on Chip (SoC): An SoC is an integrated circuit that | |||
| contains all components of a computer, such as CPU, memory, input/ | ||||
| output ports, secondary storage, a bus to connect the components, | ||||
| and other hardware blocks of logic. | ||||
| - Trust Anchor: A trust anchor, as defined in [RFC6024], represents | ||||
| an authoritative entity via a public key and associated data. The | ||||
| public key is used to verify digital signatures, and the | ||||
| associated data is used to constrain the types of information for | ||||
| which the trust anchor is authoritative." | ||||
| - Trust Anchor Store: A trust anchor store, as defined in [RFC6024], | ||||
| is a set of one or more trust anchors stored in a device. A | ||||
| device may have more than one trust anchor store, each of which | ||||
| may be used by one or more applications. A trust anchor store | ||||
| must resist modification against unauthorized insertion, deletion, | ||||
| and modification. | ||||
| - Trusted Applications (TAs): An application component that runs in | ||||
| a TEE. | a TEE. | |||
| For more information about TEEs see [I-D.ietf-teep-architecture]. | - Trusted Execution Environments (TEEs): An execution environment | |||
| TEEP requires the use of SUIT for delivering TAs. | that runs alongside of, but is isolated from, an REE. For more | |||
| information about TEEs see [I-D.ietf-teep-architecture]. | ||||
| The following entities are used: | 2.2. Stakeholders | |||
| The following stakeholders are used in this document: | ||||
| - Author: The author is the entity that creates the firmware image. | - Author: The author is the entity that creates the firmware image. | |||
| There may be multiple authors in a system either when a device | There may be multiple authors involved in producing firmware | |||
| consists of multiple micro-controllers or when the the final | running on an IoT device. Section 5 talks about those IoT device | |||
| firmware image consists of software components from multiple | deployment cases. | |||
| companies. | ||||
| - Firmware Consumer: The firmware consumer is the recipient of the | - Device Operator: The device operator is responsible for the day- | |||
| firmware image and the manifest. It is responsible for parsing | to-day operation of a fleet of IoT devices. Customers of IoT | |||
| and verifying the received manifest and for storing the obtained | devices, as the owners of IoT devices - such as enterprise | |||
| firmware image. The firmware consumer plays the role of the | customers or end users, interact with their IoT devices indirectly | |||
| update component on the IoT device typically running in the | through the device operator via web or smart phone apps. | |||
| application firmware. It interacts with the firmware server and | ||||
| with the status tracker, if present. | - Network Operator: The network operator is responsible for the | |||
| operation of a network to which IoT devices connect. | ||||
| - Trust Provisioning Authority (TPA): The TPA distributes trust | ||||
| anchors and authorization policies to various stakeholders. The | ||||
| TPA may also delegate rights to stakeholders. For example, in | ||||
| some cases, the Original Design Manufacturer (ODM), which is a | ||||
| company that designs and manufactures a product, may act as a TPA | ||||
| and may decide to remain in full control over the firmware update | ||||
| process of their products. | ||||
| 2.3. Functions | ||||
| - (IoT) Device: A device refers to the entire IoT product, which | - (IoT) Device: A device refers to the entire IoT product, which | |||
| consists of one or many MCUs, sensors and/or actuators. Many IoT | consists of one or many MCUs, sensors and/or actuators. Many IoT | |||
| devices sold today contain multiple MCUs and therefore a single | devices sold today contain multiple MCUs and therefore a single | |||
| device may need to obtain more than one firmware image and | device may need to obtain more than one firmware image and | |||
| manifest to succesfully perform an update. The terms device and | manifest to successfully perform an update. | |||
| firmware consumer are used interchangably since the firmware | ||||
| consumer is one software component running on an MCU on the | ||||
| device. | ||||
| - Status Tracker: The status tracker offers device management | - Status Tracker: The status tracker has a client and a server | |||
| functionality to retrieve information about the installed firmware | component and performs three tasks: 1) It communicates the | |||
| on a device and other device characteristics (including free | availability of a new firmware version. This information will | |||
| memory and hardware components), to obtain the state of the | flow from the server to the client. | |||
| firmware update cycle the device is currently in, and to trigger | 2) It conveys information about software and hardware | |||
| the update process. The deployment of status trackers is flexible | characteristics of the device. The information flow is from the | |||
| and they may be used as cloud-based servers, on-premise servers, | client to the server. | |||
| embedded in edge computing device (such as Internet access | 3) It can remotely trigger the firmware update process. The | |||
| gateways or protocol translation gateways), or even in smart | information flow is from the server to the client. | |||
| phones and tablets. IoT devices that self-initiate updates may | ||||
| run a status tracker. Similarly, IoT devices that act as a proxy | For example, a device operator may want to read the installed | |||
| for other IoT devices in a protocol translation or edge computing | firmware version number running on the device and information | |||
| device node may also run a status tracker. However, if the device | about available flash memory. Once an update has been triggered, | |||
| contains multiple MCUs, the main MCU may act as a limited status | the device operator may want to obtain information about the state | |||
| tracker towards the other MCUs if updates are to be synchronized | of the firmware update. If errors occurred, the device operator | |||
| across MCUs. How much functionality a status tracker includes | may want to troubleshoot problems by first obtaining diagnostic | |||
| depends on the selected configuration of the device management | information (typically using a device management protocol). | |||
| functionality and the communication environment it is used in. In | ||||
| a generic networking environment the protocol used between the | We make no assumptions about where the server-side component is | |||
| client and the server-side of the status tracker need to deal with | deployed. The deployment of status trackers is flexible and may | |||
| Internet communication challenges involving firewall and NAT | be found at | |||
| traversal. In other cases, the communication interaction may be | cloud-based servers, on-premise servers, or may be embedded in | |||
| rather simple. This architecture document does not impose | edge computing device. A status tracker server component may even | |||
| requirements on the status tracker. | be deployed on an IoT device. For example, if the IoT device | |||
| contains multiple MCUs, then the main MCU may act as a status | ||||
| tracker towards the other MCUs. Such deployment is useful when | ||||
| updates have to be synchronized across MCUs. | ||||
| The status tracker may be operated by any suitable stakeholder; | ||||
| typically the Author, Device Operator, or Network Operator. | ||||
| - Firmware Consumer: The firmware consumer is the recipient of the | ||||
| firmware image and the manifest. It is responsible for parsing | ||||
| and verifying the received manifest and for storing the obtained | ||||
| firmware image. The firmware consumer plays the role of the | ||||
| update component on the IoT device typically running in the | ||||
| application firmware. It interacts with the firmware server and | ||||
| with the status tracker client (locally). | ||||
| - Firmware Server: The firmware server stores firmware images and | - Firmware Server: The firmware server stores firmware images and | |||
| manifests and distributes them to IoT devices. Some deployments | manifests and distributes them to IoT devices. Some deployments | |||
| may require a store-and-forward concept, which requires storing | may require a store-and-forward concept, which requires storing | |||
| the firmware images/manifests on more than one entity before | the firmware images/manifests on more than one entity before | |||
| they reach the device. There is typically some interaction | they reach the device. There is typically some interaction | |||
| between the firmware server and the status tracker but those | between the firmware server and the status tracker and these two | |||
| entities are often physically separated on different devices for | entities are often physically separated on different devices for | |||
| scalability reasons. | scalability reasons. | |||
| - Device Operator: The actor responsible for the day-to-day | - Bootloader: A bootloader is a piece of software that is executed | |||
| operation of a fleet of IoT devices. | once a microcontroller has been reset. It is responsible for | |||
| deciding what code to execute. | ||||
| - Network Operator: The actor responsible for the operation of a | ||||
| network to which IoT devices connect. | ||||
| - Claim: A piece of information asserted about a recipient or | ||||
| payload. | ||||
| In addition to the entities in the list above there is an orthogonal | ||||
| infrastructure with a Trust Provisioning Authority (TPA) distributing | ||||
| trust anchors and authorization permissions to various entities in | ||||
| the system. The TPA may also delegate rights to install, update, | ||||
| enhance, or delete trust anchors and authorization permissions to | ||||
| other parties in the system. This infrastructure overlaps the | ||||
| communication architecture and different deployments may empower | ||||
| certain entities while other deployments may not. For example, in | ||||
| some cases, the Original Design Manufacturer (ODM), which is a | ||||
| company that designs and manufactures a product, may act as a TPA and | ||||
| may decide to remain in full control over the firmware update process | ||||
| of their products. | ||||
| The terms 'trust anchor' and 'trust anchor store' are defined in | ||||
| [RFC6024]: | ||||
| - "A trust anchor represents an authoritative entity via a public | ||||
| key and associated data. The public key is used to verify digital | ||||
| signatures, and the associated data is used to constrain the types | ||||
| of information for which the trust anchor is authoritative." | ||||
| - "A trust anchor store is a set of one or more trust anchors stored | 3. Architecture | |||
| in a device. A device may have more than one trust anchor store, | ||||
| each of which may be used by one or more applications." A trust | ||||
| anchor store must resist modification against unauthorized | ||||
| insertion, deletion, and modification. | ||||
| 3. Requirements | More devices today than ever before are connected to the Internet, | |||
| which drives the need for firmware updates to be provided over the | ||||
| Internet rather than through traditional interfaces, such as USB or | ||||
| RS-232. Updating updates over the Internet requires the device to | ||||
| fetch the new firmware image as well as the manifest. | ||||
| The firmware update mechanism described in this specification was | Hence, the following components are necessary on a device for a | |||
| designed with the following requirements in mind: | firmware update solution: | |||
| - Agnostic to how firmware images are distributed | - the Internet protocol stack for firmware downloads. Because | |||
| firmware images are often multiple kilobytes, sometimes exceeding | ||||
| one hundred kilobytes, in size for low end IoT devices and even | ||||
| several megabytes large for IoT devices running full-fledged | ||||
| operating systems like Linux, the protocol mechanism for | ||||
| retrieving these images needs to offer features like congestion | ||||
| control, flow control, fragmentation and reassembly, and | ||||
| mechanisms to resume interrupted or corrupted transfers. | ||||
| - Friendly to broadcast delivery | - the capability to write the received firmware image to persistent | |||
| storage (most likely flash memory). | ||||
| - Use state-of-the-art security mechanisms | - a manifest parser with code to verify a digital signature or a | |||
| message authentication code. | ||||
| - Rollback attacks must be prevented | - the ability to unpack, to decompress and/or to decrypt the | |||
| received firmware image. | ||||
| - High reliability | - (optionally) a status tracker. | |||
| - Operate with a small bootloader | The features listed above are most likely offered by code in the | |||
| application firmware image running on the device rather than by the | ||||
| bootloader itself. Note that cryptographic algorithms will likely | ||||
| run in a trusted execution environment, on a separate MCU, in a | ||||
| hardware security module, or in a secure element rather than in the | ||||
| same context with the application code. | ||||
| - Small Parsers | Figure 1 shows the architecture where a firmware image is created by | |||
| an author, and made available to a firmware server. For security | ||||
| reasons, the author will not have the permissions to upload firmware | ||||
| images to the firmware server and to initiate an update him- or | ||||
| herself. Instead, authors will make firmware images available to the | ||||
| device operators. Note that there may be a longer supply chain | ||||
| involved to pass software updates from the author all the way to the | ||||
| party that can then finally make a decision to deploy it with IoT | ||||
| devices. | ||||
| - Minimal impact on existing firmware formats | As a first step in the firmware update process, the status tracker | |||
| client need to be made aware of the availability of a new firmware | ||||
| update by the status tracker server. This can be accomplished via | ||||
| polling (client-initiated), push notifications (server-initiated), or | ||||
| more complex mechanisms (such as a hybrid approach): | ||||
| - Robust permissions | - Client-initiated updates take the form of a status tracker client | |||
| proactively checking (polling) for updates. | ||||
| - Diverse modes of operation | - With Server-initiated updates the server-side component of the | |||
| status tracker learns about a new firmware version and determines | ||||
| what devices qualify for a firmware update. Once the relevant | ||||
| devices have been selected, the status tracker informs these | ||||
| devices and the firmware consumers obtain those images and | ||||
| manifests. Server-initiated updates are important because they | ||||
| allow a quick response time. Note that the client-side status | ||||
| tracker needs to be reachable by the server-side component. This | ||||
| may require devices to keep reachability information on the | ||||
| server-side up-to-date and state at NATs and stateful packet | ||||
| filtering firewalls alive. | ||||
| - Suitability to software and personalization data | - Using a hybrid approach the server-side of the status tracker | |||
| pushes notifications of availability of an update to the client | ||||
| side and requests the firmware consumer to pull the manifest and | ||||
| the firmware image from the firmware server. | ||||
| 3.1. Agnostic to how firmware images are distributed | Once the device operator triggers update via the status tracker, it | |||
| will keep track of the update process on the device. This allows the | ||||
| device operator to know what devices have received an update and | ||||
| which of them are still pending an update. | ||||
| Firmware images can be conveyed to devices in a variety of ways, | Firmware images can be conveyed to devices in a variety of ways, | |||
| including USB, UART, WiFi, BLE, low-power WAN technologies, etc. and | including USB, UART, WiFi, BLE, low-power WAN technologies, mesh | |||
| use different protocols (e.g., CoAP, HTTP). The specified mechanism | networks and many more. At the application layer a variety of | |||
| needs to be agnostic to the distribution of the firmware images and | protocols are also available: MQTT, CoAP, and HTTP are the most | |||
| manifests. | popular application layer protocols used by IoT devices. This | |||
| architecture does not make assumptions about how the firmware images | ||||
| 3.2. Friendly to broadcast delivery | are distributed to the devices and therefore aims to support all | |||
| these technologies. | ||||
| This architecture does not specify any specific broadcast protocol. | ||||
| However, given that broadcast may be desirable for some networks, | ||||
| updates must cause the least disruption possible both in metadata and | ||||
| firmware transmission. | ||||
| For an update to be broadcast friendly, it cannot rely on link layer, | In some cases it may be desirable to distribute firmware images using | |||
| a multicast or broadcast protocol. This architecture does not make | ||||
| recommendations for any such protocol. However, given that broadcast | ||||
| may be desirable for some networks, updates must cause the least | ||||
| disruption possible both in metadata and firmware transmission. For | ||||
| an update to be broadcast friendly, it cannot rely on link layer, | ||||
| network layer, or transport layer security. A solution has to rely | network layer, or transport layer security. A solution has to rely | |||
| on security protection applied to the manifest and firmware image | on security protection applied to the manifest and firmware image | |||
| instead. In addition, the same manifest must be deliverable to many | instead. In addition, the same manifest must be deliverable to many | |||
| devices, both those to which it applies and those to which it does | devices, both those to which it applies and those to which it does | |||
| not, without a chance that the wrong device will accept the update. | not, without a chance that the wrong device will accept the update. | |||
| Considerations that apply to network broadcasts apply equally to the | Considerations that apply to network broadcasts apply equally to the | |||
| use of third-party content distribution networks for payload | use of third-party content distribution networks for payload | |||
| distribution. | distribution. | |||
| 3.3. Use state-of-the-art security mechanisms | +----------+ | |||
| | | | ||||
| End-to-end security between the author and the device is shown in | | Author | | |||
| Section 5. | | | | |||
| +----------+ | ||||
| Authentication ensures that the device can cryptographically identify | Firmware + Manifest | | |||
| the author(s) creating firmware images and manifests. Authenticated | +----------------------------------+ | Firmware + | |||
| identities may be used as input to the authorization process. | | | | Manifest | |||
| | ---+------- | | ||||
| Integrity protection ensures that no third party can modify the | | ---- | --|- | |||
| manifest or the firmware image. | | //+----------+ | \\ | |||
| -+-- // | | | \ | ||||
| For confidentiality protection of the firmware image, it must be done | ----/ | ---- |/ | Firmware |<-+ | \ | |||
| in such a way that every intended recipient can decrypt it. The | // | \\ | | Server | | | \ | |||
| information that is encrypted individually for each device must | / | \ / | | + + \ | |||
| maintain friendliness to Content Distribution Networks, bulk storage, | / | \ / +----------+ \ / | | |||
| and broadcast protocols. | / +--------+--------+ \ / | | | |||
| / | v | \ / v | | ||||
| A manifest specification must support different cryptographic | | | +------------+ | | | +----------------+ | | |||
| algorithms and algorithm extensibility. Due of the nature of | | | | Firmware | | | Device | | | |||
| unchangeable code in ROM for use with bootloaders the use of post- | | | | Consumer | | | | | Management | | | |||
| quantum secure signature mechanisms, such as hash-based signatures | | | +------------+ | | | | | | | |||
| [RFC8778], are attractive. These algorithms maintain security in | | | +------------+ | | | | +--------+ | | | |||
| presence of quantum computers. | | | | Status |<-+--------------------+-> | | | | | |||
| | | | Tracker | | | | | | Status | | | | ||||
| A mandatory-to-implement set of algorithms will be specified in the | | | | Client | | | | | | Tracker| | | | |||
| manifest specification [I-D.ietf-suit-manifest]}. | | | +------------+ | | | | | Server | | | | |||
| | | Device | | | | +--------+ | | | ||||
| 3.4. Rollback attacks must be prevented | | +-----------------+ | \ | | / | |||
| \ / \ +----------------+ / | ||||
| A device presented with an old, but valid manifest and firmware must | \ Network / \ / | |||
| not be tricked into installing such firmware since a vulnerability in | \ Operator / \ Device Operator / | |||
| the old firmware image may allow an attacker to gain control of the | \\ // \ \ // | |||
| device. | ---- ---- ---- ---- | |||
| ----- ----------- | ||||
| 3.5. High reliability | ||||
| A power failure at any time must not cause a failure of the device. | ||||
| Equally, adverse network conditions during an update must not cause | ||||
| the failure of the device. A failure to validate any part of an | ||||
| update must not cause a failure of the device. One way to achieve | ||||
| this functionality is to provide a minimum of two storage locations | ||||
| for firmware and one bootable location for firmware. An alternative | ||||
| approach is to use a 2nd stage bootloader with build-in full featured | ||||
| firmware update functionality such that it is possible to return to | ||||
| the update process after power down. | ||||
| Note: This is an implementation requirement rather than a requirement | ||||
| on the manifest format. | ||||
| 3.6. Operate with a small bootloader | ||||
| Throughout this document we assume that the bootloader itself is | ||||
| distinct from the role of the firmware consumer and therefore does | ||||
| not manage the firmware update process. This may give the impression | ||||
| that the bootloader itself is a completely separate component, which | ||||
| is mainly responsible for selecting a firmware image to boot. | ||||
| The overlap between the firmware update process and the bootloader | ||||
| functionality comes in two forms, namely | ||||
| - First, a bootloader must verify the firmware image it boots as | ||||
| part of the secure boot process. Doing so requires meta-data to | ||||
| be stored alongside the firmware image so that the bootloader can | ||||
| cryptographically verify the firmware image before booting it to | ||||
| ensure it has not been tampered with or replaced. This meta-data | ||||
| used by the bootloader may well be the same manifest obtained with | ||||
| the firmware image during the update process (with the severable | ||||
| fields stripped off). | ||||
| - Second, an IoT device needs a recovery strategy in case the | ||||
| firmware update / boot process fails. The recovery strategy may | ||||
| include storing two or more firmware images on the device or | ||||
| offering the ability to have a second stage bootloader perform the | ||||
| firmware update process again using firmware updates over serial, | ||||
| USB or even wireless connectivity like a limited version of | ||||
| Bluetooth Smart. In the latter case the firmware consumer | ||||
| functionality is contained in the second stage bootloader and | ||||
| requires the necessary functionality for executing the firmware | ||||
| update process, including manifest parsing. | ||||
| In general, it is assumed that the bootloader itself, or a minimal | ||||
| part of it, will not be updated since a failed update of the | ||||
| bootloader poses a risk in reliability. | ||||
| All information necessary for a device to make a decision about the | ||||
| installation of a firmware update must fit into the available RAM of | ||||
| a constrained IoT device. This prevents flash write exhaustion. | ||||
| This is typically not a difficult requirement to accomplish because | ||||
| there are not other task/processing running while the bootloader is | ||||
| active (unlike it may be the case when running the application | ||||
| firmware). | ||||
| Note: This is an implementation requirement. | ||||
| 3.7. Small Parsers | ||||
| Since parsers are known sources of bugs, any parsers used to process | ||||
| the manifest must be minimal. Additionally, it must be easy to parse | ||||
| only those fields that are required to validate at least one | ||||
| signature or MAC with minimal exposure. | ||||
| 3.8. Minimal impact on existing firmware formats | ||||
| The design of the firmware update mechanism must not require changes | ||||
| to existing firmware formats. | ||||
| 3.9. Robust permissions | ||||
| When a device obtains a monolithic firmware image from a single | ||||
| author without any additional approval steps then the authorization | ||||
| flow is relatively simple. There are, however, other cases where | ||||
| more complex policy decisions need to be made before updating a | ||||
| device. | ||||
| In this architecture the authorization policy is separated from the | ||||
| underlying communication architecture. This is accomplished by | ||||
| separating the entities from their permissions. For example, an | ||||
| author may not have the authority to install a firmware image on a | ||||
| device in critical infrastructure without the authorization of a | ||||
| device operator. In this case, the device may be programmed to | ||||
| reject firmware updates unless they are signed both by the firmware | ||||
| author and by the device operator. | ||||
| Alternatively, a device may trust precisely one entity, which does | ||||
| all permission management and coordination. This entity allows the | ||||
| device to offload complex permissions calculations for the device. | ||||
| 3.10. Operating modes | ||||
| There are three broad classifications of update operating modes. | ||||
| - Client-initiated Update | ||||
| - Server-initiated Update | ||||
| - Hybrid Update | ||||
| Client-initiated updates take the form of a firmware consumer on a | ||||
| device proactively checking (polling) for new firmware images. | ||||
| Server-initiated updates are important to consider because timing of | ||||
| updates may need to be tightly controlled in some high- reliability | ||||
| environments. In this case the status tracker determines what | ||||
| devices qualify for a firmware update. Once those devices have been | ||||
| selected the firmware server distributes updates to the firmware | ||||
| consumers. | ||||
| Note: This assumes that the status tracker is able to reach the | ||||
| device, which may require devices to keep reachability information at | ||||
| the status tracker up-to-date. This may also require keeping state | ||||
| at NATs and stateful packet filtering firewalls alive. | ||||
| Hybrid updates are those that require an interaction between the | ||||
| firmware consumer and the status tracker. The status tracker pushes | ||||
| notifications of availability of an update to the firmware consumer, | ||||
| and it then downloads the image from a firmware server as soon as | ||||
| possible. | ||||
| While these broad classifications encompass the majority of operating | ||||
| modes, some may not be covered in these classifications. By | ||||
| reinterpreting these modes as a set of operations performed by the | ||||
| system as a whole, all operating modes can be represented. | ||||
| The steps performed in the course of an update by the system | ||||
| containing an updatable device are: | ||||
| - Notification | ||||
| - Pre-authorisation | ||||
| - Dependency resolution | Figure 1: Architecture. | |||
| - Download | ||||
| - Installation | Firmware images and manifests may be conveyed as a bundle or | |||
| detached. The manifest must support both approaches. | ||||
| This is a coarse-grained high level view of steps required to install | For distribution as a bundle, the firmware image is embedded into the | |||
| a new firmware. By considering where in the system each of these | manifest. This is a useful approach for deployments where devices | |||
| steps is performed, each operating mode can be represented. Each of | are not connected to the Internet and cannot contact a dedicated | |||
| these steps is broken down into smaller constituent parts. Section 5 | firmware server for the firmware download. It is also applicable | |||
| defines the steps taken from the perspective of the communication | when the firmware update happens via a USB sticks or short range | |||
| between actors in the system. Section 8 describes some additional | radio technologies (such as Bluetooth Smart). | |||
| steps that a bootloader takes in addition to those described here. | ||||
| Section 9 shows an example of the steps undertaken by each party in | ||||
| the course of an update. | ||||
| The notification step consists of the status tracker informing the | Alternatively, the manifest is distributed detached from the firmware | |||
| firmware consumer that an update is available. This can be | image. Using this approach, the firmware consumer is presented with | |||
| accomplished via polling (client-initiated), push notifications | the manifest first and then needs to obtain one or more firmware | |||
| (server-initiated), or more complex mechanisms. | images as dictated in the manifest. | |||
| The pre-authorisation step involves verifying whether the entity | The pre-authorisation step involves verifying whether the entity | |||
| signing the manifest is indeed authorized to perform an update. The | signing the manifest is indeed authorized to perform an update. The | |||
| firmware consumer must also determine whether it should fetch and | firmware consumer must also determine whether it should fetch and | |||
| process a firmware image, which is referenced in a manifest. | process a firmware image, which is referenced in a manifest. | |||
| A dependency resolution phase is needed when more than one component | A dependency resolution phase is needed when more than one component | |||
| can be updated or when a differential update is used. The necessary | can be updated or when a differential update is used. The necessary | |||
| dependencies must be available prior to installation. | dependencies must be available prior to installation. | |||
| The download step is the process of acquiring a local copy of the | The download step is the process of acquiring a local copy of the | |||
| firmware image. When the download is client-initiated, this means | firmware image. When the download is client-initiated, this means | |||
| that the firmware consumer chooses when a download occurs and | that the firmware consumer chooses when a download occurs and | |||
| initiates the download process. When a download is server-initiated, | initiates the download process. When a download is server-initiated, | |||
| this means that the status tracker tells the device when to download | this means that the status tracker tells the device when to download | |||
| or that it initiates the transfer directly to the firmware consumer. | or that it initiates the transfer directly to the firmware consumer. | |||
| For example, a download from an HTTP-based firmware server is client- | For example, a download from an HTTP/1.1-based firmware server is | |||
| initiated. Pushing a manifest and firmware image to the transfer to | client-initiated. Pushing a manifest and firmware image to the | |||
| the Package resource of the LwM2M Firmware Update object [LwM2M] is | Package resource of the LwM2M Firmware Update object [LwM2M] is | |||
| server-initiated. | server-initiated update. | |||
| If the firmware consumer has downloaded a new firmware image and is | If the firmware consumer has downloaded a new firmware image and is | |||
| ready to install it, it may need to wait for a trigger from the | ready to install it, to initiate the installation, it may - either | |||
| status tracker to initiate the installation, may trigger the update | need to wait for a trigger from the status tracker, - or trigger the | |||
| automatically, or may go through a more complex decision making | update automatically, - or go through a more complex decision making | |||
| process to determine the appropriate timing for an update (such as | process to determine the appropriate timing for an update. Sometimes | |||
| delaying the update process to a later time when end users are less | the final decision may require confirmation of the user of the device | |||
| impacted by the update process). | for safety reasons. | |||
| Installation is the act of processing the payload into a format that | Installation is the act of processing the payload into a format that | |||
| the IoT device can recognise and the bootloader is responsible for | the IoT device can recognize and the bootloader is responsible for | |||
| then booting from the newly installed firmware image. | then booting from the newly installed firmware image. This process | |||
| is different when a bootloader is not involved. For example, when an | ||||
| Each of these steps may require different permissions. | application is updated in a full-featured operating system, the | |||
| updater may halt and restart the application in isolation. Devices | ||||
| 3.11. Suitability to software and personalization data | must not fail when a disruption occurs during the update process. | |||
| For example, a power failure or network disruption during the update | ||||
| The work on a standardized manifest format initially focused on the | process must not cause the device to fail. | |||
| most constrained IoT devices and those devices contain code put | ||||
| together by a single author (although that author may obtain code | ||||
| from other developers, some of it only in binary form). | ||||
| Later it turns out that other use cases may benefit from a | ||||
| standardized manifest format also for conveying software and even | ||||
| personalization data alongside software. Trusted Execution | ||||
| Environments (TEEs), for example, greatly benefit from a protocol for | ||||
| managing the lifecycle of trusted applications (TAs) running inside a | ||||
| TEE. TEEs may obtain TAs from different authors and those TAs may | ||||
| require personalization data, such as payment information, to be | ||||
| securely conveyed to the TEE. | ||||
| To support this wider range of use cases the manifest format should | ||||
| therefore be extensible to convey other forms of payloads as well. | ||||
| 4. Claims | ||||
| The information conveyed from an Author to a Firmware Consumer can be | ||||
| considered to be Claims as described in [RFC7519] and [RFC8392]. The | ||||
| same security considerations apply to the Claims expressed in the | ||||
| manifest. The chief difference between manifest Claims and CWT or | ||||
| JWT claims is that a manifest has multiple subjects. The manifest | ||||
| contains: | ||||
| 1. Claims about the Firmware, including its dependencies | ||||
| 2. Claims about the Firmware Consumer's physical or software | ||||
| properties | ||||
| 3. Claims about the Author, or the Author's delegate | ||||
| The credential used to authenticate these Claims must be directly or | ||||
| indirectly related to the trust anchor installed at the device by the | ||||
| Trust Provisioning Authority. | ||||
| The baseline claims for all manifests are described in | ||||
| [I-D.ietf-suit-information-model]. | ||||
| 5. Communication Architecture | ||||
| Figure 1 shows the communication architecture where a firmware image | ||||
| is created by an author, and uploaded to a firmware server. The | ||||
| firmware image/manifest is distributed to the device either in a push | ||||
| or pull manner using the firmware consumer residing on the device. | ||||
| The device operator keeps track of the process using the status | ||||
| tracker. This allows the device operator to know and control what | ||||
| devices have received an update and which of them are still pending | ||||
| an update. | ||||
| Firmware + +----------+ Firmware + +-----------+ | ||||
| Manifest | |-+ Manifest | |-+ | ||||
| +--------->| Firmware | |<---------------| | | | ||||
| | | Server | | | Author | | | ||||
| | | | | | | | | ||||
| | +----------+ | +-----------+ | | ||||
| | +----------+ +-----------+ | ||||
| | | ||||
| | | ||||
| | | ||||
| -+-- ------ | ||||
| ---- | ---- ---- ---- | ||||
| // | \\ // \\ | ||||
| / | \ / \ | ||||
| / | \ / \ | ||||
| / | \ / \ | ||||
| / | \ / \ | ||||
| | v | | | | ||||
| | +------------+ | | ||||
| | | Firmware | | | | | ||||
| | | Consumer | | Device | +--------+ | | ||||
| | +------------+ | Management| | | | | ||||
| | | |<------------------------->| Status | | | ||||
| | | Device | | | | Tracker| | | ||||
| | +------------+ | || | | | | ||||
| | | || +--------+ | | ||||
| | | | | | ||||
| | | \ / | ||||
| \ / \ / | ||||
| \ / \ Device / | ||||
| \ Network / \ Operator / | ||||
| \ Operator / \\ // | ||||
| \\ // ---- ---- | ||||
| ---- ---- ------ | ||||
| ----- | ||||
| Figure 1: Architecture. | ||||
| End-to-end security mechanisms are used to protect the firmware image | ||||
| and the manifest although Figure 2 does not show the manifest itself | ||||
| since it may be distributed independently. | ||||
| +-----------+ | ||||
| +--------+ | | +--------+ | ||||
| | | Firmware Image | Firmware | Firmware Image | | | ||||
| | Device |<-----------------| Server |<------------------| Author | | ||||
| | | | | | | | ||||
| +--------+ +-----------+ +--------+ | ||||
| ^ * | ||||
| * * | ||||
| ************************************************************ | ||||
| End-to-End Security | ||||
| Figure 2: End-to-End Security. | ||||
| Whether the firmware image and the manifest is pushed to the device | ||||
| or fetched by the device is a deployment specific decision. | ||||
| The following assumptions are made to allow the firmware consumer to | ||||
| verify the received firmware image and manifest before updating | ||||
| software: | ||||
| - To accept an update, a device needs to verify the signature | ||||
| covering the manifest. There may be one or multiple manifests | ||||
| that need to be validated, potentially signed by different | ||||
| parties. The device needs to be in possession of the trust | ||||
| anchors to verify those signatures. Installing trust anchors to | ||||
| devices via the Trust Provisioning Authority happens in an out-of- | ||||
| band fashion prior to the firmware update process. | ||||
| - Not all entities creating and signing manifests have the same | ||||
| permissions. A device needs to determine whether the requested | ||||
| action is indeed covered by the permission of the party that | ||||
| signed the manifest. Informing the device about the permissions | ||||
| of the different parties also happens in an out-of-band fashion | ||||
| and is also a duty of the Trust Provisioning Authority. | ||||
| - For confidentiality protection of firmware images the author needs | ||||
| to be in possession of the certificate/public key or a pre-shared | ||||
| key of a device. The use of confidentiality protection of | ||||
| firmware images is deployment specific. | ||||
| There are different types of delivery modes, which are illustrated | ||||
| based on examples below. | ||||
| There is an option for embedding a firmware image into a manifest. | 4. Invoking the Firmware | |||
| This is a useful approach for deployments where devices are not | ||||
| connected to the Internet and cannot contact a dedicated firmware | ||||
| server for the firmware download. It is also applicable when the | ||||
| firmware update happens via a USB stick or via Bluetooth Smart. | ||||
| Figure 3 shows this delivery mode graphically. | ||||
| /------------\ /------------\ | Section 3 describes the steps for getting the firmware image and the | |||
| /Manifest with \ /Manifest with \ | manifest from the author to the firmware consumer on the IoT device. | |||
| |attached | |attached | | Once the firmware consumer has retrieved and successfully processed | |||
| \firmware image/ \firmware image/ | the manifest and the firmware image it needs to invoke the new | |||
| \------------/ +-----------+ \------------/ | firmware image. This is managed in many different ways, depending on | |||
| +--------+ | | +--------+ | the type of device, but it typically involves halting the current | |||
| | |<.................| Firmware |<................| | | version of the firmware, handing control over to a firmware with a | |||
| | Device | | Server | | Author | | higher privilege/trust level (the firmware verifier) verifying the | |||
| | | | | | | | new firmware's authenticity & integrity, and then invoking it. | |||
| +--------+ +-----------+ +--------+ | ||||
| Figure 3: Manifest with attached firmware. | In an execute-in-place microcontroller, this is often done by | |||
| rebooting into a bootloader (simultaneously halting the application & | ||||
| handing over to the higher privilege level) then executing a secure | ||||
| boot process (verifying and invoking the new image). | ||||
| Figure 4 shows an option for remotely updating a device where the | In a rich OS, this may be done by halting one or more processes, then | |||
| device fetches the firmware image from some file server. The | invoking new applications. In some OSs, this implicitly involves the | |||
| manifest itself is delivered independently and provides information | kernel verifying the code signatures on the new applications. | |||
| about the firmware image(s) to download. | ||||
| /--------\ /--------\ | The invocation process is security sensitive. An attacker will | |||
| / \ / \ | typically try to retrieve a firmware image from the device for | |||
| | Manifest | | Manifest | | reverse engineering or will try to get the firmware verifier to | |||
| \ / \ / | execute an attacker-modified firmware image. The firmware verifier | |||
| \--------/ \--------/ | will therefore have to perform security checks on the firmware image | |||
| +-----------+ | before it can be invoked. These security checks by the firmware | |||
| +--------+ | | +--------+ | verifier happen in addition to the security checks that took place | |||
| | |<.................| Status |................>| | | when the firmware image and the manifest were downloaded by the | |||
| | Device | | Tracker | -- | Author | | firmware consumer. | |||
| | |<- | | --- | | | ||||
| +--------+ -- +-----------+ --- +--------+ | ||||
| -- --- | ||||
| --- --- | ||||
| -- +-----------+ -- | ||||
| -- | | -- | ||||
| /------------\ -- | Firmware |<- /------------\ | ||||
| / \ -- | Server | / \ | ||||
| | Firmware | | | | Firmware | | ||||
| \ / +-----------+ \ / | ||||
| \------------/ \------------/ | ||||
| Figure 4: Independent retrieval of the firmware image. | The overlap between the firmware consumer and the firmware verifier | |||
| functionality comes in two forms, namely | ||||
| This architecture does not mandate a specific delivery mode but a | - A firmware verifier must verify the firmware image it boots as | |||
| solution must support both types. | part of the secure boot process. Doing so requires meta-data to | |||
| be stored alongside the firmware image so that the firmware | ||||
| verifier can cryptographically verify the firmware image before | ||||
| booting it to ensure it has not been tampered with or replaced. | ||||
| This meta-data used by the firmware verifier may well be the same | ||||
| manifest obtained with the firmware image during the update | ||||
| process. | ||||
| 6. Manifest | - An IoT device needs a recovery strategy in case the firmware | |||
| update / invocation process fails. The recovery strategy may | ||||
| include storing two or more application firmware images on the | ||||
| device or offering the ability to invoke a recovery image to | ||||
| perform the firmware update process again using firmware updates | ||||
| over serial, USB or even wireless connectivity like Bluetooth | ||||
| Smart. In the latter case the firmware consumer functionality is | ||||
| contained in the recovery image and requires the necessary | ||||
| functionality for executing the firmware update process, including | ||||
| manifest parsing. | ||||
| In order for a device to apply an update, it has to make several | While this document assumes that the firmware verifier itself is | |||
| decisions about the update: | distinct from the role of the firmware consumer and therefore does | |||
| not manage the firmware update process, this is not a requirement and | ||||
| these roles may be combined in practice. | ||||
| - Does it trust the author of the update? | Using a bootloader as the firmware verifier requires some special | |||
| considerations, particularly when the bootloader implements the | ||||
| robustness requirements identified by the IOTSU workshop [RFC8240]. | ||||
| - Has the firmware been corrupted? | 4.1. The Bootloader | |||
| - Does the firmware update apply to this device? | In most cases the MCU must restart in order to hand over control to | |||
| the bootloader. Once the MCU has initiated a restart, the bootloader | ||||
| determines whether a newly available firmware image should be | ||||
| executed. If the bootloader concludes that the newly available | ||||
| firmware image is invalid, a recovery strategy is necessary. There | ||||
| are only two approaches recovering from an invalid firmware: either | ||||
| the bootloader must be able to select a different, valid firmware, or | ||||
| it must be able to obtain a new, valid firmware. Both of these | ||||
| approaches have implications for the architecture of the update | ||||
| system. | ||||
| - Is the update older than the active firmware? | Assuming the first approach, there are (at least) three firmware | |||
| images available on the device: | ||||
| - When should the device apply the update? | - First, the bootloader is also firmware. If a bootloader is | |||
| updatable then its firmware image is treated like any other | ||||
| application firmware image. | ||||
| - How should the device apply the update? | - Second, the firmware image that has to be replaced is still | |||
| available on the device as a backup in case the freshly downloaded | ||||
| firmware image does not boot or operate correctly. | ||||
| - What kind of firmware binary is it? | - Third, there is the newly downloaded firmware image. | |||
| - Where should the update be obtained? | Therefore, the firmware consumer must know where to store the new | |||
| firmware. In some cases, this may be implicit, for example replacing | ||||
| the least-recently-used firmware image. In other cases, the storage | ||||
| location of the new firmware must be explicit, for example when a | ||||
| device has one or more application firmware images and a recovery | ||||
| image with limited functionality, sufficient only to perform an | ||||
| update. | ||||
| - Where should the firmware be stored? | Since many low end IoT devices use non-relocatable code, either the | |||
| bootloader needs to copy the newly downloaded application firmware | ||||
| image into the location of the old application firmware image and | ||||
| vice versa or multiple versions of the firmware need to be prepared | ||||
| for different locations. | ||||
| The manifest encodes the information that devices need in order to | In general, it is assumed that the bootloader itself, or a minimal | |||
| make these decisions. It is a data structure that contains the | part of it, will not be updated since a failed update of the | |||
| following information: | bootloader poses a reliability risk. | |||
| - information about the device(s) the firmware image is intended to | For a bootloader to offer a secure boot functionality it needs to | |||
| be applied to, | implement the following functionality: | |||
| - information about when the firmware update has to be applied, | - The bootloader needs to fetch the manifest (or manifest-alike | |||
| headers) from nonvolatile storage and parse its contents for | ||||
| subsequent cryptographic verification. | ||||
| - information about when the manifest was created, | - Cryptographic libraries with hash functions, digital signatures | |||
| (for asymmetric crypto), keyed message digests (for symmetric | ||||
| crypto) need to be accessible. | ||||
| - dependencies on other manifests, | - The device needs to have a trust anchor store to verify the | |||
| digital signature. (Alternatively, access to a key store for use | ||||
| with the keyed message digest.) | ||||
| - pointers to the firmware image and information about the format, | - Ability to expose boot process-related data to the application | |||
| firmware (such as to the status tracker). This allows to share | ||||
| information about the current firmware version, and the status of | ||||
| the firmware update process and whether errors have occurred. | ||||
| - information about where to store the firmware image, | - Produce boot measurements as part of an attestation solution. See | |||
| [I-D.ietf-rats-architecture] for more information. (optional) | ||||
| - cryptographic information, such as digital signatures or message | - Ability to decrypt firmware images, in case confidentiality | |||
| authentication codes (MACs). | protection was applied). This requires a solution for key | |||
| management. (optional) | ||||
| The manifest information model is described in | 5. Types of IoT Devices | |||
| [I-D.ietf-suit-information-model]. | ||||
| 7. Device Firmware Update Examples | There are billions of MCUs used in devices today produced by a large | |||
| number of silicon manufacturers. While MCUs can vary significantly | ||||
| in their characteristics, there are a number of similiaries allowing | ||||
| us to categorize in groups. | ||||
| Although these documents attempt to define a firmware update | The firmware update architecture, and the manifest format in | |||
| architecture that is applicable to both existing systems, as well as | particular, needs to offer enough flexibility to cover these common | |||
| yet-to-be-conceived systems; it is still helpful to consider existing | deployment cases. | |||
| architectures. | ||||
| 7.1. Single CPU SoC | 5.1. Single MCU | |||
| The simplest, and currently most common, architecture consists of a | The simplest, and currently most common, architecture consists of a | |||
| single MCU along with its own peripherals. These SoCs generally | single MCU along with its own peripherals. These SoCs generally | |||
| contain some amount of flash memory for code and fixed data, as well | contain some amount of flash memory for code and fixed data, as well | |||
| as RAM for working storage. These systems either have a single | as RAM for working storage. A notable characteristic of these SoCs | |||
| firmware image, or an immutable bootloader that runs a single image. | is that the primary code is generally execute in place (XIP). Due to | |||
| A notable characteristic of these SoCs is that the primary code is | the non-relocatable nature of the code, the firmware image needs to | |||
| generally execute in place (XIP). Combined with the non-relocatable | be placed in a specific location in flash since the code cannot be | |||
| nature of the code, firmware updates need to be done in place. | executed from an arbitrary location in flash. Hence, then the | |||
| firmware image is updated it is necessary to swap the old and the new | ||||
| image. | ||||
| 7.2. Single CPU with Secure - Normal Mode Partitioning | 5.2. Single CPU with Secure - Normal Mode Partitioning | |||
| Another configuration consists of a similar architecture to the | Another configuration consists of a similar architecture to the | |||
| previous, with a single CPU. However, this CPU supports a security | previous, with a single CPU. However, this CPU supports a security | |||
| partitioning scheme that allows memory (in addition to other things) | partitioning scheme that allows memory (in addition to other things) | |||
| to be divided into secure and normal mode. There will generally be | to be divided into secure and normal mode. There will generally be | |||
| two images, one for secure mode, and one for normal mode. In this | two images, one for secure mode, and one for normal mode. In this | |||
| configuration, firmware upgrades will generally be done by the CPU in | configuration, firmware upgrades will generally be done by the CPU in | |||
| secure mode, which is able to write to both areas of the flash | secure mode, which is able to write to both areas of the flash | |||
| device. In addition, there are requirements to be able to update | device. In addition, there are requirements to be able to update | |||
| either image independently, as well as to update them together | either image independently, as well as to update them together | |||
| atomically, as specified in the associated manifests. | atomically, as specified in the associated manifests. | |||
| 7.3. Symmetric Multiple CPUs | 5.3. Symmetric Multiple CPUs | |||
| In more complex SoCs with symmetric multi-processing support, | In more complex SoCs with symmetric multi-processing support, | |||
| advanced operating systems, such as Linux, are often used. These | advanced operating systems, such as Linux, are often used. These | |||
| SoCs frequently use an external storage medium such as raw NAND flash | SoCs frequently use an external storage medium, such as raw NAND | |||
| or eMMC. Due to the higher quantity of resources, these devices are | flash or eMMC. Due to the higher quantity of resources, these | |||
| often capable of storing multiple copies of their firmware images and | devices are often capable of storing multiple copies of their | |||
| selecting the most appropriate one to boot. Many SoCs also support | firmware images and selecting the most appropriate one to boot. Many | |||
| bootloaders that are capable of updating the firmware image, however | SoCs also support bootloaders that are capable of updating the | |||
| this is typically a last resort because it requires the device to be | firmware image, however this is typically a last resort because it | |||
| held in the bootloader while the new firmware is downloaded and | requires the device to be held in the bootloader while the new | |||
| installed, which results in down-time for the device. Firmware | firmware is downloaded and installed, which results in down-time for | |||
| updates in this class of device are typically not done in-place. | the device. Firmware updates in this class of device are typically | |||
| not done in-place. | ||||
| 7.4. Dual CPU, shared memory | 5.4. Dual CPU, shared memory | |||
| This configuration has two or more heterogeneous CPUs in a single SoC | This configuration has two or more heterogeneous CPUs in a single SoC | |||
| that share memory (flash and RAM). Generally, they will be a | that share memory (flash and RAM). Generally, there will be a | |||
| protection mechanism to prevent one CPU from accessing the other's | mechanism to prevent one CPU from unintentionally accessing memory | |||
| memory. Upgrades in this case will typically be done by one of the | currently allocated to the other. Upgrades in this case will | |||
| CPUs, and is similar to the single CPU with secure mode. | typically be done by one of the CPUs, and is similar to the single | |||
| CPU with secure mode. | ||||
| 7.5. Dual CPU, other bus | 5.5. Dual CPU, other bus | |||
| This configuration has two or more heterogeneous CPUs, each having | This configuration has two or more heterogeneous CPUs, each having | |||
| their own memory. There will be a communication channel between | their own memory. There will be a communication channel between | |||
| them, but it will be used as a peripheral, not via shared memory. In | them, but it will be used as a peripheral, not via shared memory. In | |||
| this case, each CPU will have to be responsible for its own firmware | this case, each CPU will have to be responsible for its own firmware | |||
| upgrade. It is likely that one of the CPUs will be considered the | upgrade. It is likely that one of the CPUs will be considered the | |||
| primary CPU, and will direct the other CPU to do the upgrade. This | primary CPU, and will direct the other CPU to do the upgrade. This | |||
| configuration is commonly used to offload specific work to other | configuration is commonly used to offload specific work to other | |||
| CPUs. Firmware dependencies are similar to the other solutions | CPUs. Firmware dependencies are similar to the other solutions | |||
| above, sometimes allowing only one image to be upgraded, other times | above, sometimes allowing only one image to be upgraded, other times | |||
| requiring several to be upgraded atomically. Because the updates are | requiring several to be upgraded atomically. Because the updates are | |||
| happening on multiple CPUs, upgrading the two images atomically is | happening on multiple CPUs, upgrading the two images atomically is | |||
| challenging. | challenging. | |||
| 8. Bootloader | 6. Manifests | |||
| More devices today than ever before are being connected to the | ||||
| Internet, which drives the need for firmware updates to be provided | ||||
| over the Internet rather than through traditional interfaces, such as | ||||
| USB or RS232. Updating a device over the Internet requires the | ||||
| device to fetch not only the firmware image but also the manifest. | ||||
| Hence, the following building blocks are necessary for a firmware | ||||
| update solution: | ||||
| - the Internet protocol stack for firmware downloads (*), | ||||
| - the capability to write the received firmware image to persistent | In order for a firmware consumer to apply an update, it has to make | |||
| storage (most likely flash memory) prior to performing the update, | several decisions using manifest-provided information and data | |||
| available on the device itself. For more detailed information and a | ||||
| longer list of information elements in the manifest consult the | ||||
| information model specification [I-D.ietf-suit-information-model], | ||||
| which offers justifications for each element, and the manifest, see | ||||
| [I-D.ietf-suit-manifest], for details about how this information is | ||||
| included in the manifest. | ||||
| - the ability to unpack, decompress or otherwise process the | Table 1 provides examples of decisions to be made. | |||
| received firmware image, | ||||
| - the features to verify an image and a manifest, including digital | +----------------------------+--------------------------------------+ | |||
| signature verification or checking a message authentication code, | | Decision | Information Elements | | |||
| +----------------------------+--------------------------------------+ | ||||
| | Should I trust the author | Trust anchors and authorization | | ||||
| | of the firmware? | policies on the device | | ||||
| | | | | ||||
| | Has the firmware been | Digital signature and MAC covering | | ||||
| | corrupted? | the firmware image | | ||||
| | | | | ||||
| | Does the firmware update | Conditions with Vendor ID, Class ID | | ||||
| | apply to this device? | and Device ID | | ||||
| | | | | ||||
| | Is the update older than | Sequence number in the manifest (1) | | ||||
| | the active firmware? | | | ||||
| | | | | ||||
| | When should the device | Wait directive | | ||||
| | apply the update? | | | ||||
| | | | | ||||
| | How should the device | Manifest commands | | ||||
| | apply the update? | | | ||||
| | | | | ||||
| | What kind of firmware | Unpack algorithms to interpret a | | ||||
| | binary is it? | format. | | ||||
| | | | | ||||
| | Where should the update be | Dependencies on other manifests and | | ||||
| | obtained? | firmware image URI in Manifest | | ||||
| | | | | ||||
| | Where should the firmware | Storage Location and Component | | ||||
| | be stored? | Identifier | | ||||
| +----------------------------+--------------------------------------+ | ||||
| - a manifest parsing library, and | Table 1: Firmware Update Decisions. | |||
| - integration of the device into a device management server to | (1): A device presented with an old, but valid manifest and firmware | |||
| perform automatic firmware updates and to track their progress. | must not be tricked into installing such firmware since a | |||
| vulnerability in the old firmware image may allow an attacker to gain | ||||
| control of the device. | ||||
| (*) Because firmware images are often multiple kilobytes, sometimes | Keeping the code size and complexity of a manifest parsers small is | |||
| exceeding one hundred kilobytes, in size for low end IoT devices and | important for constrained IoT devices. Since the manifest parsing | |||
| even several megabytes large for IoT devices running full-fledged | code may also be used by the bootloader it is part of the trusted | |||
| operating systems like Linux, the protocol mechanism for retrieving | computing base. | |||
| these images needs to offer features like congestion control, flow | ||||
| control, fragmentation and reassembly, and mechanisms to resume | ||||
| interrupted or corrupted transfers. | ||||
| All these features are most likely offered by the application, i.e. | A manifest may not only be used to protect firmware images but also | |||
| firmware consumer, running on the device (except for basic security | configuration data such as network credentials or personalization | |||
| algorithms that may run either on a trusted execution environment or | data related to firmware or software. Personalization data | |||
| on a separate hardware security MCU/module) rather than by the | demonstrates the need for mutually-distrustful delivery of two or | |||
| bootloader itself. | more images into a device. Personalization data is used with Trusted | |||
| Execution Environments (TEEs), which benefit from a protocol for | ||||
| managing the lifecycle of trusted applications (TAs) running inside a | ||||
| TEE. TEEs may obtain TAs from different authors and those TAs may | ||||
| require personalization data, such as payment information, to be | ||||
| securely conveyed to the TEE. The TA's author does not want to | ||||
| expose the TA to the user, and the user does not want to expose the | ||||
| payment information to the TA's author. | ||||
| Once manifests have been processed and firmware images successfully | 7. Securing Firmware Updates | |||
| downloaded and verified the device needs to hand control over to the | ||||
| bootloader. In most cases this requires the MCU to restart. Once | ||||
| the MCU has initiated a restart, the bootloader takes over control | ||||
| and determines whether the newly downloaded firmware image should be | ||||
| executed. | ||||
| The boot process is security sensitive because the firmware images | Using firmware updates to fix vulnerabilities in devices is important | |||
| may, for example, be stored in off-chip flash memory giving attackers | but securing this update mechanism is equally important since | |||
| easy access to the image for reverse engineering and potentially also | security problems are exacerbated by the update mechanism: update is | |||
| for modifying the binary. The bootloader will therefore have to | essentially authorized remote code execution, so any security | |||
| perform security checks on the firmware image before it can be | problems in the update process expose that remote code execution | |||
| booted. These security checks by the bootloader happen in addition | system. Failure to secure the firmware update process will help | |||
| to the security checks that happened when the firmware image and the | attackers to take control over devices. | |||
| manifest were downloaded. | ||||
| The manifest may have been stored alongside the firmware image to | End-to-end security mechanisms are used to protect the firmware image | |||
| allow re-verification of the firmware image during every boot | and the manifest. The following assumptions are made to allow the | |||
| attempt. Alternatively, secure boot-specific meta-data may have been | firmware consumer to verify the received firmware image and manifest | |||
| created by the application after a successful firmware download and | before updating software: | |||
| verification process. Whether to re-use the standardized manifest | ||||
| format that was used during the initial firmware retrieval process or | ||||
| whether it is better to use a different format for the secure boot- | ||||
| specific meta-data depends on the system design. The manifest format | ||||
| does, however, have the capability to serve also as a building block | ||||
| for secure boot with its severable elements that allow shrinking the | ||||
| size of the manifest by stripping elements that are no longer needed. | ||||
| In order to satisfy the reliability requirements defined in | - Authentication ensures that the device can cryptographically | |||
| Section 3.5, devices must always be able to return to a working | identify the author(s) creating firmware images and manifests. | |||
| firmware image. This has implications for the design of the | Authenticated identities may be used as input to the authorization | |||
| bootloader: If the firmware image contains the firmware consumer | process. Not all entities creating and signing manifests have the | |||
| functionality, as described above, then the bootloader must be able | same permissions. A device needs to determine whether the | |||
| to roll back to a working firmware image. Alternatively, the | requested action is indeed covered by the permission of the party | |||
| bootloader may have enough functionality to fetch a firmware image | that signed the manifest. Informing the device about the | |||
| plus manifest from a firmware server over the Internet. A multi- | permissions of the different parties also happens in an out-of- | |||
| stage bootloader may soften this requirement at the expense of a more | band fashion and is also a duty of the Trust Provisioning | |||
| sophisticated boot process. | Authority. | |||
| For a bootloader to offer a secure boot mechanism it needs to provide | - Integrity protection ensures that no third party can modify the | |||
| the following features: | manifest or the firmware image. To accept an update, a device | |||
| needs to verify the signature covering the manifest. There may be | ||||
| one or multiple manifests that need to be validated, potentially | ||||
| signed by different parties. The device needs to be in possession | ||||
| of the trust anchors to verify those signatures. Installing trust | ||||
| anchors to devices via the Trust Provisioning Authority happens in | ||||
| an out-of-band fashion prior to the firmware update process. | ||||
| - ability to access security algorithms, such as SHA-256 to compute | - For confidentiality protection of the firmware image, it must be | |||
| a fingerprint over the firmware image and a digital signature | done in such a way that the intended firmware consumer(s), other | |||
| algorithm. | authorized parties, and no one else can decrypt it. The | |||
| information that is encrypted individually for each device/ | ||||
| recipient must maintain friendliness to Content Distribution | ||||
| Networks, bulk storage, and broadcast protocols. For | ||||
| confidentiality protection of firmware images the author needs to | ||||
| be in possession of the certificate/public key or a pre-shared key | ||||
| of a device. The use of confidentiality protection of firmware | ||||
| images is optional. | ||||
| - access keying material directly or indirectly to utilize the | A manifest specification must support different cryptographic | |||
| digital signature. The device needs to have a trust anchor store. | algorithms and algorithm extensibility. Moreover, since RSA- and | |||
| ECC-based signature schemes may become vulnerable to quantum- | ||||
| accelerated key extraction in the future, unchangeable bootloader | ||||
| code in ROM is recommended to use post-quantum secure signature | ||||
| schemes such as hash-based signatures [RFC8778]. A bootloader author | ||||
| must carefully consider the service lifetime of their product and the | ||||
| time horizon for quantum-accelerated key extraction. The worst-case | ||||
| estimate, at time of writing, for the time horizon to key extraction | ||||
| with quantum acceleration is approximately 2030, based on current | ||||
| research [quantum-factorization]. | ||||
| - ability to expose boot process-related data to the application | When a device obtains a monolithic firmware image from a single | |||
| firmware (such as to the device management software). This allows | author without any additional approval steps then the authorization | |||
| a device management server to determine whether the firmware | flow is relatively simple. There are, however, other cases where | |||
| update has been successful and, if not, what errors occurred. | more complex policy decisions need to be made before updating a | |||
| device. | ||||
| - to (optionally) offer attestation information (such as | In this architecture the authorization policy is separated from the | |||
| measurements). | underlying communication architecture. This is accomplished by | |||
| separating the entities from their permissions. For example, an | ||||
| author may not have the authority to install a firmware image on a | ||||
| device in critical infrastructure without the authorization of a | ||||
| device operator. In this case, the device may be programmed to | ||||
| reject firmware updates unless they are signed both by the firmware | ||||
| author and by the device operator. | ||||
| While the software architecture of the bootloader and its security | Alternatively, a device may trust precisely one entity, which does | |||
| mechanisms are implementation-specific, the manifest can be used to | all permission management and coordination. This entity allows the | |||
| control the firmware download from the Internet in addition to | device to offload complex permissions calculations for the device. | |||
| augmenting secure boot process. These building blocks are highly | ||||
| relevant for the design of the manifest. | ||||
| 9. Example | 8. Example | |||
| Figure 5 illustrates an example message flow for distributing a | Figure 2 illustrates an example message flow for distributing a | |||
| firmware image to a device starting with an author uploading the new | firmware image to a device. The firmware and manifest are stored on | |||
| firmware to firmware server and creating a manifest. The firmware | the same firmware server and distributed in a detached manner. | |||
| and manifest are stored on the same firmware server. This setup does | ||||
| not use a status tracker and the firmware consumer component is | ||||
| therefore responsible for periodically checking whether a new | ||||
| firmware image is available for download. | ||||
| +--------+ +-----------------+ +------------+ +----------+ | +--------+ +-----------------+ +-----------------------------+ | |||
| | | | | | Firmware | | | | | | | Firmware Server | | IoT Device | | |||
| | Author | | Firmware Server | | Consumer | |Bootloader| | | Author | | Status Tracker | | +------------+ +----------+ | | |||
| +--------+ +-----------------+ +------------+ +----------+ | +--------+ | Server | | | Firmware | |Bootloader| | | |||
| | | | + | | +-----------------+ | | Consumer | | | | | |||
| | Create Firmware | | | | | | | +------------+ +----------+ | | |||
| |--------------+ | | | | | | | | | | | |||
| | | | | | | | | | +-----------------------+ | | |||
| |<-------------+ | | | | | Create Firmware | | | Status Tracker Client | | | |||
| | | | | | |--------------+ | | +-----------------------+ | | |||
| | Upload Firmware | | | | | | | `'''''''''''''''''''''''''''' | |||
| |------------------>| | | | |<-------------+ | | | | | |||
| | | | | | | | | | | | |||
| | Create Manifest | | | | | Upload Firmware | | | | | |||
| |---------------+ | | | | |------------------>| | | | | |||
| | | | | | | | | | | | | |||
| |<--------------+ | | | | | Create Manifest | | | | | |||
| | | | | | |---------------+ | | | | | |||
| | Sign Manifest | | | | | | | | | | | |||
| |-------------+ | | | | |<--------------+ | | | | | |||
| | | | | | | | | | | | | |||
| |<------------+ | | | | | Sign Manifest | | | | | |||
| | | | | | |-------------+ | | | | | |||
| | Upload Manifest | | | | | | | | | | | |||
| |------------------>| | | | |<------------+ | | | | | |||
| | | | | | | | | | | | |||
| | | Query Manifest | | | | Upload Manifest | | | | | |||
| | |<--------------------| | | |------------------>| Notification of | | | | |||
| | | | | | | | new firmware image | | | | |||
| | | Send Manifest | | | | |----------------------------->| | | |||
| | |-------------------->| | | | | | | | | |||
| | | |Initiate| | | ||||
| | | | Update | | | ||||
| | | |<-------| | | ||||
| | | | | | | ||||
| | | Query Manifest | | | | ||||
| | |<--------------------| . | | ||||
| | | | . | | ||||
| | | Send Manifest | . | | ||||
| | |-------------------->| . | | ||||
| | | | Validate | | | | | Validate | | |||
| | | | Manifest | | | | | Manifest | | |||
| | | |---------+ | | | | |--------+ | | |||
| | | | | | | | | | | | | |||
| | | |<--------+ | | | | |<-------+ | | |||
| | | | | | | | | . | | |||
| | | Request Firmware | | | | | Request Firmware | . | | |||
| | |<--------------------| | | | |<--------------------| . | | |||
| | | | | | | | | . | | |||
| | | Send Firmware | | | | | Send Firmware | . | | |||
| | |-------------------->| | | | |-------------------->| . | | |||
| | | | Verify | | | | | Verify . | | |||
| | | | Firmware | | | | | Firmware | | |||
| | | |--------------+ | | | | |--------+ | | |||
| | | | | | | | | | | | | |||
| | | |<-------------+ | | | | |<-------+ | | |||
| | | | | | | | | . | | |||
| | | | Store | | | | | Store . | | |||
| | | | Firmware | | | | | Firmware | | |||
| | | |-------------+ | | | | |--------+ | | |||
| | | | | | | | | | | | | |||
| | | |<------------+ | | | | |<-------+ | | |||
| | | | | | | | | . | | |||
| | | | | | | | | . | | |||
| | | | Trigger Reboot | | | | | . | | |||
| | | |--------------->| | | | | | | | |||
| | | | | | | | | Update | | | |||
| | | | | | | | |Complete| | | |||
| | | |------->| | | ||||
| | | | | | ||||
| | | Firmware Update Completed | | | ||||
| | |<-----------------------------| | | ||||
| | | | | | ||||
| | | Reboot | | | ||||
| | |----------------------------->| | | ||||
| | | | | | | ||||
| | | | | | | ||||
| | | |Reboot | | ||||
| | | | |------>| | ||||
| | | | | | | ||||
| | | | . | | ||||
| | | +---+----------------+--+ | | | +---+----------------+--+ | |||
| | | S| | | | | | | S| | | | | |||
| | | E| | Verify | | | | | E| | Verify | | | |||
| | | C| | Firmware | | | | | C| | Firmware | | | |||
| | | U| | +--------------| | | | | U| | +--------------| | | |||
| | | R| | | | | | | | R| | | | | | |||
| | | E| | +------------->| | | | | E| | +------------->| | | |||
| | | | | | | | | | | | | | | |||
| | | B| | Activate new | | | | | B| | Activate new | | | |||
| | | O| | Firmware | | | | | O| | Firmware | | | |||
| skipping to change at page 24, line 27 ¶ | skipping to change at page 23, line 5 ¶ | |||
| | | T| | | | | | | | T| | | | | | |||
| | | | | +------------->| | | | | | | +------------->| | | |||
| | | P| | | | | | | P| | | | | |||
| | | R| | Boot new | | | | | R| | Boot new | | | |||
| | | O| | Firmware | | | | | O| | Firmware | | | |||
| | | C| | +--------------| | | | | C| | +--------------| | | |||
| | | E| | | | | | | | E| | | | | | |||
| | | S| | +------------->| | | | | S| | +------------->| | | |||
| | | S| | | | | | | S| | | | | |||
| | | +---+----------------+--+ | | | +---+----------------+--+ | |||
| | | | | | | | | . | | |||
| | | | | | | ||||
| | | . | | | ||||
| | | Device running new firmware | | | ||||
| | |<-----------------------------| | | ||||
| | | . | | | ||||
| | | | | | ||||
| Figure 5: First Example Flow for a Firmware Upate. | Figure 2: First Example Flow for a Firmware Update. | |||
| Figure 6 shows an example follow with the device using a status | Figure 3 shows an exchange that starts with the status tracker | |||
| tracker. For editorial reasons the author publishing the manifest at | querying the device for its current firmware version. Later, a new | |||
| the status tracker and the firmware image at the firmware server is | firmware version becomes available and since this device is running | |||
| not shown. Also omitted is the secure boot process following the | an older version the status tracker server interacts with the device | |||
| successful firmware update process. | to initiate an update. | |||
| The exchange starts with the device interacting with the status | The manifest and the firmware are stored on different servers in this | |||
| tracker; the details of such exchange will vary with the different | example. When the device processes the manifest it learns where to | |||
| device management systems being used. In any case, the status | download the new firmware version. The firmware consumer downloads | |||
| tracker learns about the firmware version of the devices it manages. | the firmware image with the newer version X.Y.Z after successful | |||
| In our example, the device under management is using firmware version | validation of the manifest. Subsequently, a reboot is initiated and | |||
| A.B.C. At a later point in time the author uploads a new firmware | the secure boot process starts. Finally, the device reports the | |||
| along with the manifest to the firmware server and the status | successful boot of the new firmware version. | |||
| tracker, respectively. While there is no need to store the manifest | ||||
| and the firmware on different servers this example shows a common | ||||
| pattern used in the industry. The status tracker may then | ||||
| automatically, based on human intervention or based on a more complex | ||||
| policy decide to inform the device about the newly available firmware | ||||
| image. In our example, it does so by pushing the manifest to the | ||||
| firmware consumer. The firmware consumer downloads the firmware | ||||
| image with the newer version X.Y.Z after successful validation of the | ||||
| manifest. Subsequently, a reboot is initiated and the secure boot | ||||
| process starts. | ||||
| +---------+ +-----------------+ +-----------------------------+ | +---------+ +-----------------+ +-----------------------------+ | |||
| | Status | | | | +------------+ +----------+ | | | Status | | Firmware Server | | +------------+ +----------+ | | |||
| | Tracker | | Firmware Server | | | Firmware | |Bootloader| | | | Tracker | | Status Tracker | | | Firmware | |Bootloader| | | |||
| | | | | | | Consumer | | | | | | Server | | Server | | | Consumer | | | | | |||
| +---------+ +-----------------+ | +------------+ +----------+ | | +---------+ +-----------------+ | | +Status | +----------+ | | |||
| | | | | Tracker | | | | ||||
| | | | | Client | | | | ||||
| | | | +------------+ | | | ||||
| | | | | IoT Device | | | | | | | IoT Device | | | |||
| | | `'''''''''''''''''''''''''''' | | | `'''''''''''''''''''''''''''' | |||
| | | | | | | | | | | |||
| | Query Firmware Version | | | | Query Firmware Version | | | |||
| |------------------------------------->| | | |------------------------------------->| | | |||
| | Firmware Version A.B.C | | | | Firmware Version A.B.C | | | |||
| |<-------------------------------------| | | |<-------------------------------------| | | |||
| | | | | | | | | | | |||
| | <<some time later>> | | | | <<some time later>> | | | |||
| | | | | | | | | | | |||
| skipping to change at page 26, line 19 ¶ | skipping to change at page 24, line 44 ¶ | |||
| | | | Trigger Reboot | | | | | Trigger Reboot | | |||
| | | |--------------->| | | | |--------------->| | |||
| | | | | | | | | | | |||
| | | | | | | | | | | |||
| | | | __..-------..._' | | | | __..-------..._' | |||
| | | ,-' `-. | | | ,-' `-. | |||
| | | | Secure Boot | | | | | Secure Boot | | |||
| | | `-. _/ | | | `-. _/ | |||
| | | |`--..._____,,.,-' | | | |`--..._____,,.,-' | |||
| | | | | | | | | | | |||
| | Device running firmware X.Y.Z | | | ||||
| |<-------------------------------------| | | ||||
| | | | | | ||||
| | | | | | ||||
| Figure 6: Second Example Flow for a Firmware Upate. | Figure 3: Second Example Flow for a Firmware Update. | |||
| 10. IANA Considerations | 9. IANA Considerations | |||
| This document does not require any actions by IANA. | This document does not require any actions by IANA. | |||
| 11. Security Considerations | 10. Security Considerations | |||
| Firmware updates fix security vulnerabilities and are considered to | ||||
| be an important building block in securing IoT devices. Due to the | ||||
| importance of firmware updates for IoT devices the Internet | ||||
| Architecture Board (IAB) organized a 'Workshop on Internet of Things | ||||
| (IoT) Software Update (IOTSU)', which took place at Trinity College | ||||
| Dublin, Ireland on the 13th and 14th of June, 2016 to take a look at | ||||
| the big picture. A report about this workshop can be found at | ||||
| [RFC8240]. A standardized firmware manifest format providing end-to- | ||||
| end security from the author to the device will be specified in a | ||||
| separate document. | ||||
| There are, however, many other considerations raised during the | ||||
| workshop. Many of them are outside the scope of standardization | ||||
| organizations since they fall into the realm of product engineering, | ||||
| regulatory frameworks, and business models. The following | ||||
| considerations are outside the scope of this document, namely | ||||
| - installing firmware updates in a robust fashion so that the update | ||||
| does not break the device functionality of the environment this | ||||
| device operates in. | ||||
| - installing firmware updates in a timely fashion considering the | ||||
| complexity of the decision making process of updating devices, | ||||
| potential re-certification requirements, and the need for user | ||||
| consent to install updates. | ||||
| - the distribution of the actual firmware update, potentially in an | ||||
| efficient manner to a large number of devices without human | ||||
| involvement. | ||||
| - energy efficiency and battery lifetime considerations. | ||||
| - key management required for verifying the digital signature | This document describes terminology, requirements and an architecture | |||
| protecting the manifest. | for firmware updates of IoT devices. The content of the document is | |||
| thereby focused on improving security of IoT devices via firmware | ||||
| update mechanisms and informs the standardization of a manifest | ||||
| format. | ||||
| - incentives for manufacturers to offer a firmware update mechanism | An in-depth examination of the security considerations of the | |||
| as part of their IoT products. | architecture is presented in [I-D.ietf-suit-information-model]. | |||
| 12. Acknowledgements | 11. Acknowledgements | |||
| We would like to thank the following persons for their feedback: | We would like to thank the following persons for their feedback: | |||
| - Geraint Luff | - Geraint Luff | |||
| - Amyas Phillips | - Amyas Phillips | |||
| - Dan Ros | - Dan Ros | |||
| - Thomas Eichinger | - Thomas Eichinger | |||
| skipping to change at page 28, line 16 ¶ | skipping to change at page 26, line 16 ¶ | |||
| - Henk Birkholz | - Henk Birkholz | |||
| - Jintao Zhu | - Jintao Zhu | |||
| - Takeshi Takahashi | - Takeshi Takahashi | |||
| - Jacob Beningo | - Jacob Beningo | |||
| - Kathleen Moriarty | - Kathleen Moriarty | |||
| - Bob Briscoe | ||||
| - Roman Danyliw | ||||
| - Brian Carpenter | ||||
| - Theresa Enghardt | ||||
| - Rich Salz | ||||
| We would also like to thank the WG chairs, Russ Housley, David | We would also like to thank the WG chairs, Russ Housley, David | |||
| Waltermire, Dave Thaler for their support and their reviews. | Waltermire, Dave Thaler for their support and their reviews. | |||
| 13. Informative References | 12. Informative References | |||
| [I-D.ietf-rats-architecture] | ||||
| Birkholz, H., Thaler, D., Richardson, M., Smith, N., and | ||||
| W. Pan, "Remote Attestation Procedures Architecture", | ||||
| draft-ietf-rats-architecture-06 (work in progress), | ||||
| September 2020. | ||||
| [I-D.ietf-suit-information-model] | [I-D.ietf-suit-information-model] | |||
| Moran, B., Tschofenig, H., and H. Birkholz, "An | Moran, B., Tschofenig, H., and H. Birkholz, "An | |||
| Information Model for Firmware Updates in IoT Devices", | Information Model for Firmware Updates in IoT Devices", | |||
| draft-ietf-suit-information-model-07 (work in progress), | draft-ietf-suit-information-model-07 (work in progress), | |||
| June 2020. | June 2020. | |||
| [I-D.ietf-suit-manifest] | [I-D.ietf-suit-manifest] | |||
| Moran, B., Tschofenig, H., Birkholz, H., and K. Zandberg, | Moran, B., Tschofenig, H., Birkholz, H., and K. Zandberg, | |||
| "A Concise Binary Object Representation (CBOR)-based | "A Concise Binary Object Representation (CBOR)-based | |||
| skipping to change at page 28, line 46 ¶ | skipping to change at page 27, line 17 ¶ | |||
| "Trusted Execution Environment Provisioning (TEEP) | "Trusted Execution Environment Provisioning (TEEP) | |||
| Architecture", draft-ietf-teep-architecture-12 (work in | Architecture", draft-ietf-teep-architecture-12 (work in | |||
| progress), July 2020. | progress), July 2020. | |||
| [LwM2M] OMA, ., "Lightweight Machine to Machine Technical | [LwM2M] OMA, ., "Lightweight Machine to Machine Technical | |||
| Specification, Version 1.0.2", February 2018, | Specification, Version 1.0.2", February 2018, | |||
| <http://www.openmobilealliance.org/release/LightweightM2M/ | <http://www.openmobilealliance.org/release/LightweightM2M/ | |||
| V1_0_2-20180209-A/OMA-TS-LightweightM2M- | V1_0_2-20180209-A/OMA-TS-LightweightM2M- | |||
| V1_0_2-20180209-A.pdf>. | V1_0_2-20180209-A.pdf>. | |||
| [quantum-factorization] | ||||
| Department of Computer Science, Purdue University, ., | ||||
| Quantum Computing Institute, Oak Ridge National | ||||
| Laboratory, ., Quantum Computing Institute, Oak Ridge | ||||
| National Laboratory, ., Quantum Computing Institute, Oak | ||||
| Ridge National Laboratory, ., and . Department of | ||||
| Chemistry, Physics and Birck Nanotechnology Center, Purdue | ||||
| University, "Quantum Annealing for Prime Factorization", | ||||
| n.d., | ||||
| <https://www.nature.com/articles/s41598-018-36058-z>. | ||||
| [RFC6024] Reddy, R. and C. Wallace, "Trust Anchor Management | [RFC6024] Reddy, R. and C. Wallace, "Trust Anchor Management | |||
| Requirements", RFC 6024, DOI 10.17487/RFC6024, October | Requirements", RFC 6024, DOI 10.17487/RFC6024, October | |||
| 2010, <https://www.rfc-editor.org/info/rfc6024>. | 2010, <https://www.rfc-editor.org/info/rfc6024>. | |||
| [RFC7228] Bormann, C., Ersue, M., and A. Keranen, "Terminology for | [RFC7228] Bormann, C., Ersue, M., and A. Keranen, "Terminology for | |||
| Constrained-Node Networks", RFC 7228, | Constrained-Node Networks", RFC 7228, | |||
| DOI 10.17487/RFC7228, May 2014, | DOI 10.17487/RFC7228, May 2014, | |||
| <https://www.rfc-editor.org/info/rfc7228>. | <https://www.rfc-editor.org/info/rfc7228>. | |||
| [RFC7519] Jones, M., Bradley, J., and N. Sakimura, "JSON Web Token | [RFC7519] Jones, M., Bradley, J., and N. Sakimura, "JSON Web Token | |||
| End of changes. 130 change blocks. | ||||
| 863 lines changed or deleted | 801 lines changed or added | |||
This html diff was produced by rfcdiff 1.48. The latest version is available from http://tools.ietf.org/tools/rfcdiff/ | ||||