SUIT B. Moran Internet-Draft H. Tschofenig Intended status: Informational Arm Limited Expires:April 24,July 22, 2021 D. Brown Linaro M. Meriac ConsultantOctober 21, 2020January 18, 2021 A Firmware Update Architecture for Internet of Thingsdraft-ietf-suit-architecture-14draft-ietf-suit-architecture-15 Abstract Vulnerabilitiesinwith Internet of Things (IoT) devices have raised the need for areliablesolid and secure firmware update mechanism that is also suitable fordevices with resource constraints.constrained devices. Incorporating suchanupdate mechanismis a fundamental requirement for fixing vulnerabilities but it also enables other important capabilities such as updatingto fix vulnerabilities, to update configuration settings as well as adding newfunctionality. In addition to the definition of terminologyfunctionality is recommended by security experts. This document lists requirements and describes an architecturethis document motivates the standardization of a manifest format asfor atransport-agnostic meansfirmware update mechanism suitable fordescribing and protectingIoT devices. The architecture is agnostic to the transport of the firmwareupdates.images and associated meta-data. Status of This Memo This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79. Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet- Drafts is at https://datatracker.ietf.org/drafts/current/. Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress." This Internet-Draft will expire onApril 24,July 22, 2021. Copyright Notice Copyright (c)20202021 IETF Trust and the persons identified as the document authors. All rights reserved. This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License. Table of Contents 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 2. Conventions and Terminology . . . . . . . . . . . . . . . . .5 2.1. Terms3 3. Requirements . . . . . . . . . . . . . . . . . . . . . . . . 7 3.1. Agnostic to how firmware images are distributed . .5 2.2. Stakeholders. . . 7 3.2. Friendly to broadcast delivery . . . . . . . . . . . . . 7 3.3. Use state-of-the-art security mechanisms . . . . . .6 2.3. Functions. . 8 3.4. Rollback attacks must be prevented . . . . . . . . . . . 8 3.5. High reliability . . . . . . . . . . .7 3. Architecture. . . . . . . . . 8 3.6. Operate with a small bootloader . . . . . . . . . . . . . 9 3.7. Small Parsers . . . . . . . . . . . . . .8 4. Invoking the Firmware. . . . . . . . 10 3.8. Minimal impact on existing firmware formats . . . . . . . 10 3.9. Robust permissions . . . . . . . . . . . . . . . . . . . 10 3.10. Operating modes . . . . . . . . . . . . . . . . . . . . . 10 3.11. Suitability to software and personalization data . . . . 124.1. The Bootloader4. Claims . . . . . . . . . . . . . . . . . . . . . . . . . .14. 13 5.Types of IoT DevicesCommunication Architecture . . . . . . . . . . . . . . . . . 13 6. Manifest . . .15 5.1. Single MCU. . . . . . . . . . . . . . . . . . . . . . .15 5.2. Single CPU with Secure - Normal Mode Partitioning17 7. Device Firmware Update Examples . . . .16 5.3. Symmetric Multiple CPUs. . . . . . . . . . . 18 7.1. Single CPU SoC . . . . . .16 5.4. Dual CPU, shared memory. . . . . . . . . . . . . . . 18 7.2. Single CPU with Secure - Normal Mode Partitioning . .16 5.5. Dual CPU, other bus. . 18 7.3. Dual CPU, shared memory . . . . . . . . . . . . . . . . .17 6. Manifests18 7.4. Dual CPU, other bus . . . . . . . . . . . . . . . . . . . 18 8. Bootloader . . . . . . .17 7. Securing Firmware Updates. . . . . . . . . . . . . . . . . . 198.9. Example . . . . . . . . . . . . . . . . . . . . . . . . . . .20 9.21 10. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 2510.11. Security Considerations . . . . . . . . . . . . . . . . . . . 2511.12. Acknowledgements . . . . . . . . . . . . . . . . . . . . . .25 12.26 13. Informative References . . . . . . . . . . . . . . . . . . .2627 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . .2728 1. IntroductionFirmware updates can help to fix security vulnerabilities and are considered to be an important building block in securing IoT devices. Due to rising concerns about insecure IoT devices the Internet Architecture Board (IAB) organized a 'Workshop onWhen developing Internet of Things (IoT)Software Update (IOTSU)', which took place at Trinity College Dublin, Ireland on the 13th and 14thdevices, one ofJune, 2016 to take a look atthebigger picture. A report about this workshop can be found at [RFC8240]. The workshop revealed a number of challenges for developers and ledmost difficult problems tothe formation of the IETF Software Updates for Internet of Things (SUIT) working group. Developing secure Internet of Things (IoT) devicessolve isnot an easy task and supporting a firmwarehow to updatesolution requires skillful engineers.firmware on the device. Oncedevices arethe device is deployed, firmware updates play a critical part intheir lifecycle management,its lifetime, particularly when devices have a long lifetime,orare deployed in remote or inaccessible areas where manual intervention is cost prohibitive or otherwise difficult.Firmware updates for IoT devices are expectedUpdates towork automatically, i.e. without user involvement. Conversely,the firmware of an IoTdevices are expected to account for user preferences and consent when scheduling updates. Automatic updates that do not require human intervention are key to a scalable solution for fixing software vulnerabilities. Firmware updatesdevice arenot onlydone to fixbugs, but they can alsobugs in software, to add new functionality, and to re-configure the device to work in new environments or to behave differently in an already deployed context. The firmware updateprocessprocess, among other goals, has to ensure that - The firmware image is authenticated and integrity protected. Attempts to flash amaliciouslymodified firmware image or an image from anunknown, untrustedunknown sourcemust beare 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 attempts by an adversary to recover the plaintext binary can bemitigated or at least made more difficult.prevented. Obtaining the firmware is often one of the first steps to mount an attack since it gives the adversary valuable insights intotheused softwarelibraries used,libraries, configuration settings and genericfunctionality. Evenfunctionality (even though reverse engineering the binary can be a tediousprocess modern reverse engineering frameworks have made this taskprocess). This version of the document assumes asymmetric cryptography and a public key infrastructure. Future versions may also describe alot easier.symmetric key approach for very constrained devices. While the standardization work has been informed by andoptimizedoptimised for firmware update use cases of Class 1 devices (according to the device class definitions in RFC 7228[RFC7228]) devices,[RFC7228]), there is nothing in the architecture that restricts its use to only these constrained IoT devices.Moreover, this architecture is not limited to managing firmwareSoftware update andsoftware updates, but can also be applied to managing thedelivery of arbitrary data, such as configuration information andkeys. 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 used and the sandbox in which the software is executed. While the IETF standardization work has been focused on the manifest format, a fully interoperable solution needs more than a standardized manifest. For example, protocols for transferring firmware images and manifests to the device need tokeys, can equally beavailable as well as the status tracker functionality. Devices also require a mechanism to discover the status tracker(s) and/or firmware servers, for example using pre-configured hostnames or [RFC6763] DNS-SD. These building blocks have been developedmanaged byvarious 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 ofmanifests. More details about theIETF and other standards organizations but need to be considered by firmware authors, as well as device and network operators. Heresecurity goals aresome of them, as highlighted during the IOTSU workshop: - Installing firmware updatesdiscussed ina 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 device because a firmware update, particularly radio communication and writing the firmware image to flash, is an energy-intensive 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 bootloaderSection 5 andhow it integrates with the firmware update mechanism. Subsequently, we offer a categorization of IoT devicesrequirements are described interms 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.Section 3. 2. Conventions and Terminology2.1. TermsThis document uses the following terms: - Manifest: The manifest contains meta-data about the firmware 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 contain the complete software of a device or a subset of it. The firmware image may consist of multiple images, if the device contains more than one microcontroller. Often it is also a compressed archive that contains code, configuration data, and even the entire file system. The image may consist of a differential update for performance reasons. Firmware is the more universal term. The terms, firmware image, firmware, and image, are used in this document and are interchangeable.We use the term application firmware image- Software: The terms "software" and "firmware" are used interchangeably. - Bootloader: A bootloader is a piece of software that is executed once a microcontroller has been reset. It is responsible for deciding whether todifferentiate it fromboot a firmware image thatcontains the bootloader. An applicationis present or whether to obtain and verify a new firmwareimage, asimage. Since thename indicates, containsbootloader is a security critical component its functionality may be split into separate stages. Such a multi-stage bootloader may offer very basic functionality in theapplication program often including allfirst stage and resides in ROM whereas thenecessary code to run it (such as protocol stacks,second stage may implement more complex functionality andembedded operating system). - Manifest:resides in flash memory so that it can be updated in the future (in case bugs have been found). Themanifest contains meta-data aboutexact split of components into the different stages, the number of firmwareimage. The manifest is protected against modificationimages stored by an IoT device, andprovides information abouttheauthor.detailed functionality varies throughout different implementations. A more detailed discussion is provided in Section 8. - Microcontroller (MCU for microcontroller unit): An MCU is a compact integrated circuit designed for use in embedded systems. A typical microcontroller includes a processor, memory (RAM and flash), input/output (I/O) ports and other features connected via some bus on a single chip. The term 'system on chip (SoC)' is often usedinterchangeablyfor these types of devices. - 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 withMCU,an external, updatable radio, or a device with internal and external flash memory. - Trusted Execution Environments (TEEs): An execution environment that runs alongside of, butMCU tends to imply more limited peripheral functions.is isolated from, an REE. - Rich Execution Environment (REE): An environment that is provided and governed by a typical OS (e.g., Linux, Windows, Android, iOS), potentially in conjunction with other supporting operating systems and hypervisors; it is outside of the TEE. This environment and applications running on it are considered un-trusted. -Software: Similar to firmware, but typically dynamically loaded by an Operating System. Used interchangeably with firmware in this document. - 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. -TrustedApplicationsapplications (TAs): An application component that runs in a TEE.- Trusted Execution Environments (TEEs): An execution environment that runs alongside of, but is isolated from, an REE.For more information about TEEs see [I-D.ietf-teep-architecture].2.2. StakeholdersThe followingstakeholdersentities areused in this document:used: - Author: The author is the entity that creates the firmware image. There may be multiple authorsinvolvedinproducing firmware running on an IoT device. Section 5 talks about those IoTa system either when a devicedeployment cases.consists of multiple micro-controllers or when the the final firmware image consists of software components from multiple companies. -Device Operator:Firmware Consumer: Thedevice operatorfirmware consumer isresponsible fortheday- to-day operation of a fleet of IoT devices. Customersrecipient ofIoT devices, astheowners of IoT devices - such as enterprise customers or end users, interact with their IoT devices indirectly throughfirmware image and thedevice operator via web or smart phone apps. - Network Operator: The network operatormanifest. It is responsible forthe operation of a network to which IoT devices connect. - Trust Provisioning Authority (TPA): The TPA distributes trust anchorsparsing andauthorization policies to devicesverifying the received manifest andvarious stakeholders.for storing the obtained firmware image. TheTPA may also delegate rights to stakeholders. Typically,firmware consumer plays theOriginal Equipment Manufacturer (OEM) or Original Design Manufacturer (ODM) will act as a TPA, however complex supply chains may require a different design. In some cases,role of theTPA may decide to remainupdate component on the IoT device typically running infull control overthe application firmware. It interacts with the firmwareupdate process of their products. - User: The end-user of a device. The user may interactserver and withdevices via web or smart phone apps, as well as through direct user interfaces. 2.3. Functionsthe status tracker, if present. - (IoT) Device: A device refers to the entire IoT product, which consists of one or many MCUs, sensors and/or actuators. Many IoT devices sold today contain multiple MCUs and therefore a single device may need to obtain more than one firmware image and manifest tosuccessfullysuccesfully perform an update.- Status Tracker:Thestatus tracker has a client and a server componentterms device andperforms three tasks: 1) It communicates the availability of a newfirmwareversion. This information will flow from the server toconsumer are used interchangably since theclient. 2) It conveys information aboutfirmware consumer is one softwareand hardware characteristics ofcomponent running on an MCU on the device. - Status Tracker: Theinformation flow is from the client to the server. 3) It can remotely trigger the firmware update process. The information flow is from the server to the client. For example, astatus tracker offers deviceoperator may wantmanagement functionality toreadretrieve information about the installed firmwareversion number runningonthea device andinformation about available flash memory. Once an update has been triggered, theother deviceoperator may wantcharacteristics (including free memory and hardware components), to obtaininformation aboutthe state of the firmwareupdate. If errors occurred,update cycle the deviceoperator may wantis currently in, and totroubleshoot problems by first obtaining diagnostic information (typically using a device management protocol). We make no assumptions about wheretrigger theserver-side component is deployed.update process. The deployment of status trackers is flexible and they may befound atused as cloud-based servers, on-premise servers,or may beembedded in edge computingdevices. A status tracker server component maydevice (such as Internet access gateways or protocol translation gateways), or evenbe deployed on an IoT device. For example, ifin smart phones and tablets. While the IoT devicecontains multiple MCUs, thenitself runs themain MCU may act asclient- side of the status tracker it will most likely not run a status trackertowards theitself unless it acts as a proxy for otherMCUs. Such deployment is useful when updates have to be synchronized across MCUs. TheIoT devices in a protocol translation or edge computing device node. How much functionality a status trackermay be operated by any suitable stakeholder; typically the Author, Device Operator, or Network Operator. - Firmware Consumer: The firmware consumer isincludes depends on therecipientselected configuration of thefirmware imagedevice management functionality and themanifest. Itcommunication environment it isresponsible for parsing and verifyingused in. In a generic networking environment thereceived manifest and for storingprotocol used between theobtained firmware image. The firmware consumer playsclient and theroleserver- side of theupdate component on the IoT device typically running in the application firmware. It interactsstatus tracker need to deal withthe firmware serverInternet communication challenges involving firewall andwithNAT traversal. In other cases, the communication interaction may be rather simple. This architecture document does not impose requirements on the statustracker client (locally).tracker. - Firmware Server: The firmware server stores firmware images and manifests and distributes them to IoT devices. Some deployments may require a store-and-forward concept, which requires storing the firmware images/manifests on more than one entity before they reach the device. There is typically some interaction between the firmware server and the status trackerand these twobut those entities are often physically separated on different devices for scalability reasons. -Bootloader: A bootloader is a piece of software that is executed once a microcontroller has been reset. It isDevice Operator: The actor responsible fordeciding what code to execute. 3. Architecture 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. Sending updates overtheInternet requires the device to fetch the new firmware image as well as the manifest. Hence, the following components are necessary on a device forday-to-day operation of afirmware update solution: - 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 forfleet of IoTdevices 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.devices. - Network Operator: The actor responsible for thecapability to write the received firmware image to persistent storage (most likely flash memory). - a manifest parser with code to verify a digital signature oroperation of amessage authentication code. - the ability to unpack,network todecompress and/orwhich IoT devices connect. In addition todecrypt the received firmware image. - a status tracker. The features listed above are most likely offered by code intheapplication 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 thanentities in thesame context with the application code. Figure 1 shows the architecture where a firmware imagelist above there iscreated byanauthor, and made available toorthogonal infrastructure with afirmware server. For security reasons, the author will not have theTrust Provisioning Authority (TPA) distributing trust anchors and authorization permissions toupload firmware images tovarious entities in thefirmware server andsystem. The TPA may also delegate rights toinitiate an update him-install, update, enhance, orherself. Instead, authors will make firmware images available to the device operators. Note that there may be a longer supply chain involveddelete trust anchors and authorization permissions topass software updates fromother parties in theauthor allsystem. This infrastructure overlaps theway tocommunication architecture and different deployments may empower certain entities while other deployments may not. For example, in some cases, thepartyOriginal Design Manufacturer (ODM), which is a company thatcan then finally makedesigns and manufactures adecision to deploy it with IoT devices. Asproduct, may act as afirst stepTPA and may decide to remain in full control over the firmware updateprocess, the status tracker client needs to be made aware of the availabilityprocess ofa new firmware update by the status tracker server. This can be accomplishedtheir products. The terms 'trust anchor' and 'trust anchor store' are defined in [RFC6024]: - "A trust anchor represents an authoritative entity viapolling (client-initiated), push notifications (server-initiated), or more complex mechanisms (such asahybrid approach): - Client-initiated updates takepublic key and associated data. The public key is used to verify digital signatures, and theform of a status tracker client proactively checking (polling) for updates. - With Server-initiated updatesassociated data is used to constrain theserver-side componenttypes of information for which thestatus tracker learns abouttrust anchor is authoritative." - "A trust anchor store is anew firmware version and determines which devices qualify forset of one or more trust anchors stored in afirmware update. Once the relevant devicesdevice. A device may havebeen selected, the status tracker informs these devicesmore 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 The firmware update mechanism described in this specification was designed with the following requirements in mind: - Agnostic to how firmwareconsumers obtain thoseimagesand manifests. Server-initiated updatesareimportant because they allow a quick response time. Note that the client-side status tracker needsdistributed - Friendly to broadcast delivery - Use state-of-the-art security mechanisms - Rollback attacks must bereachable 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.prevented -UsingHigh reliability - Operate with ahybrid approach the server-side of the status tracker pushes notifications of availabilitysmall bootloader - Small Parsers - Minimal impact on existing firmware formats - Robust permissions - Diverse modes ofan updateoperation - Suitability tothe client sidesoftware andrequests the firmware consumerpersonalization data 3.1. Agnostic topull the manifest and the firmware image from thehow firmwareserver. 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 themimages arestill pending an update.distributed Firmware images can be conveyed to devices in a variety of ways, including USB, UART, WiFi, BLE, low-power WAN technologies,mesh networksetc. andmany more. At the application layer a variety ofuse different protocolsare also available: MQTT,(e.g., CoAP,and HTTP areHTTP). The specified mechanism needs to be agnostic to themost popular application layer protocols used by IoT devices. This architecture does not make assumptions about howdistribution of the firmware imagesare distributed to the devicesandtherefore aims to support all these technologies. In some cases it may be desirablemanifests. 3.2. Friendly todistribute firmware images using a multicast orbroadcastprotocol.delivery This architecture does notmake recommendations forspecify anysuchspecific 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, network layer, or transport layer security. A solution has to rely on security protection applied to the manifest and firmware image instead. In addition, the same manifest must be deliverable to many 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. Considerations that apply to network broadcasts apply equally to the use of third-party content distribution networks for payload distribution.+----------+ | | | Author | | | +----------+ Firmware + Manifest | +----------------------------------+ | Firmware + | | | Manifest | ---+------- | | ---- | --|- | //+----------+ | \\ -+-- // | | | \ ----/ | ---- |/ | Firmware |<-+ | \ // | \\ | | Server | | | \ / | \ / | | + + \ / | \ / +----------+ \ / | / +--------+--------+ \ / | | / | v | \ / v | | | +------------+ | | | +----------------+ | | | | Firmware | | | Device | | | | | Consumer | | | | | Management | | | | +------------+ | | | | | | | | +------------+ | | | | +--------+ | | | | | Status |<-+--------------------+-> | | | | | | | Tracker | | | | | | Status | | | | | | Client | | | | | | Tracker| | | | | +------------+ | | | | | Server | | | | | Device | | | | +--------+ | | | +-----------------+ | \ | | / \ / \ +----------------+ / \ Network / \ / \ Operator / \ Device Operator / \\ // \ \ // ---- ---- ---- ---- ----- ----------- Figure 1: Architecture. Firmware3.3. Use state-of-the-art security mechanisms End-to-end security between the author and the device is shown in Section 5. Authentication ensures that the device can cryptographically identify the author(s) creating firmware images andmanifestsmanifests. Authenticated identities may beconveyedused asa bundleinput to the authorization process. Integrity protection ensures that no third party can modify the manifest ordetached.the firmware image. For confidentiality protection of the firmware image, it must be done in such a way that every intended recipient can decrypt it. The information that is encrypted individually for each device must maintain friendliness to Content Distribution Networks, bulk storage, and broadcast protocols. A manifest specification must supportboth approaches. For distributiondifferent cryptographic algorithms and algorithm extensibility. Due of the nature of unchangeable code in ROM for use with bootloaders the use of post- quantum secure signature mechanisms, such as hash-based signatures [RFC8778], are attractive. These algorithms maintain security in presence of quantum computers. A mandatory-to-implement set of algorithms will be specified in the manifest specification [I-D.ietf-suit-manifest]}. 3.4. Rollback attacks must be prevented A device presented with an old, but valid manifest and firmware must not be tricked into installing such firmware since abundle,vulnerability in 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. A failure to validate any part of an update must not cause a failure of the device. One way to achieve this functionality isembedded intoto 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 themanifest.update process after power down. Note: This is an implementation requirement rather than auseful approach for deployments where devices arerequirement 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 notconnectedmanage 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 theInternetfirmware update process andcannot contactthe bootloader functionality comes in two forms, namely - First, adedicatedbootloader must verify the firmwareserver forimage it boots as part of the secure boot process. Doing so requires meta-data to be stored alongside the firmwaredownload. It is also applicable whenimage 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 updatehappens viaprocess (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, USBsticksorshort range radio technologies (such aseven wireless connectivity like a limited version of BluetoothSmart). Alternatively,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 isdistributed detachedassumed 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 they 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 firmwareimage. Usingimage on a device in critical infrastructure without the authorization of a device operator. In thisapproach,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 ispresented withable to reach themanifest firstdevice, which may require devices to keep reachability information at the status tracker up-to-date. This may also require keeping state at NATs andthen needsstateful 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 toobtain one or morethe firmwareimagesconsumer, and it then downloads the image from a firmware server as soon asdictatedpossible. An alternative view to the operating modes is to consider the steps a device has to go through in themanifest.course of an update: - Notification - Pre-authorisation - Dependency resolution - Download - Installation The notification step consists of the status tracker informing the firmware consumer that an update is available. This can be accomplished via polling (client-initiated), push notifications (server-initiated), or more complex mechanisms. The pre-authorisation step involves verifying whether the entity signing the manifest is indeed authorized to perform an update. The firmware consumer must also determine whether it should fetch and process a firmware image, which is referenced in a manifest. A dependency resolution phase is needed when more than one component can be updated or when a differential update is used. The necessary dependencies must be available prior to installation. The download step is the process of acquiring a local copy of the firmware image. When the download is client-initiated, this means that the firmware consumer chooses when a download occurs and initiates the download process. When a download is server-initiated, this means that the status tracker tells the device when to download or that it initiates the transfer directly to the firmware consumer. For example, a download from anHTTP/1.1-basedHTTP-based firmware server isclient-initiated.client- initiated. Pushing a manifest and firmware image to the transfer to the Package resource of the LwM2M Firmware Update object [LwM2M] isserver-initiated update.server-initiated. If the firmware consumer has downloaded a new firmware image and is ready to install it,to initiate the installation,it may- eitherneed to wait for a trigger from the statustracker, - ortracker to initiate the installation, may trigger the update automatically,-or may go through a more complex decision making process to determine the appropriate timing for anupdate. Sometimes the final decision may require confirmation ofupdate (such as delaying theuser ofupdate process to a later time when end users are less impacted by thedevice for safety reasons.update process). Installation is the act of processing the payload into a format that the IoT device canrecognizerecognise and the bootloader is responsible for then booting from the newly installed firmware image.This process isEach of these steps may require differentwhen a bootloader is not involved. For example, when an application is updated inpermissions. 3.11. Suitability to software and personalization data The work on afull-featured operating system,standardized manifest format initially focused on theupdater may haltmost constrained IoT devices andrestart the applicationthose devices contain code put together by a single author (although that author may obtain code from other developers, some of it only inisolation. Devices must not fail whenbinary form). Later it turns out that other use cases may benefit from adisruption occurs during the update process. Forstandardized manifest format also for conveying software and even personalization data alongside software. Trusted Execution Environments (TEEs), for example, greatly benefit from apower failure or network disruption duringprotocol for managing theupdate process must not causelifecycle 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 thedeviceTEE. To support this wider range of use cases the manifest format should therefore be extensible tofail.convey other forms of payloads as well. 4.Invoking the Firmware Section 3 describesClaims Claims in thesteps for gettingmanifest offer a way to convey instructions to a device that impact the firmwareimage andupdate process. To have any value the manifestfrom the authorcontaining those claims must be authenticated and integrity protected. The credential used must be directly or indirectly related to thefirmware consumer ontrust anchor installed at theIoT device. Oncedevice by the Trust Provisioning Authority. The baseline claims for all manifests are described in [I-D.ietf-suit-information-model]. For example, there are: - Do not install firmwareconsumer has retrieved and successfully processed the manifest andwith earlier metadata than the current metadata. - Only install firmwareimage it needs to invoke the newwith a matching vendor, model, hardware revision, software version, etc. - Only install firmwareimage. Thisthat ismanaged in many different ways, dependingbefore its best-before timestamp. - Only allow a firmware installation if dependencies have been met. - Choose the mechanism to install the firmware, based on the type ofdevice, butfirmware ittypically involves halting the current version ofis. 5. Communication Architecture Figure 1 shows thefirmware, handing control over to a firmware withcommunication architecture where ahigher privilege/trust level (thefirmwareverifier) verifying the new firmware's authenticity & integrity, and then invoking it. In an execute-in-place microcontroller, thisimage isoften donecreated byrebooting into a bootloader (simultaneously halting the application & handing overan author, and uploaded tothe higher privilege level) then executingasecure boot process (verifying and invokingfirmware server. The firmware image/manifest is distributed to thenew image). Indevice either in arich OS, this may be done by halting onepush ormore processes, then invoking new applications. In some OSs, this implicitly involves the kernel verifyingpull manner using thecode signaturesfirmware consumer residing on thenew applications.device. Theinvocationdevice operator keeps track of the processis security sensitive. An attacker will typically try to retrieve a firmware image fromusing thedevice for reverse engineering or will try to getstatus tracker. This allows thefirmware verifierdevice operator toexecute an attacker-modified firmware image. The firmware verifier will thereforeknow and control what devices haveto performreceived 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 securitychecks onmechanisms are used to protect the firmware imagebefore it can be invoked. These security checks byand thefirmware verifier happen in addition tomanifest although Figure 2 does not show thesecurity checks that took place whenmanifest 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 manifestwere downloadedis pushed to the device or fetched by thefirmware consumer.device is a deployment specific decision. Theoverlap betweenfollowing assumptions are made to allow the firmware consumerand the firmware verifier functionality comes in two forms, namely - A firmware verifier must verify the firmware image it boots as part of the secure boot process. Doing so requires meta-datatobe stored alongside the firmware image so that the firmware verifier can cryptographicallyverify the received firmware imagebefore booting it to ensure it has not been tampered with or replaced. This meta-data used by the firmware verifier may well be the sameand manifestobtained with the firmware image during the update process.before updating software: -An IoTTo accept an update, a device needsa recovery strategy in caseto verify thefirmware update / invocation process fails. The recovery strategysignature covering the manifest. There mayinclude storing twobe one ormore application firmware images on themultiple manifests that need to be validated, potentially signed by different parties. The deviceor offeringneeds to be in possession of theabilitytrust anchors toinvoke a recovery imageverify those signatures. Installing trust anchors to devices via the Trust Provisioning Authority happens in an out-of- band fashion prior toperformthe firmware updateprocess again using firmware updates over serial, USB or even wireless connectivity like Bluetooth Smart. Inprocess. - Not all entities creating and signing manifests have thelatter casesame permissions. A device needs to determine whether thefirmware consumer functionalityrequested action iscontained in the recovery image and requiresindeed covered by thenecessary functionality for executingpermission of thefirmware update process, including manifest parsing. While this document assumesparty that signed thefirmware verifier itself is distinct frommanifest. Informing theroledevice about the permissions of thefirmware consumerdifferent parties also happens in an out-of-band fashion andtherefore does not manage the firmware update process, thisisnot a requirement and these roles may be combined in practice. Usingalso abootloader asduty of the Trust Provisioning Authority. - For confidentiality protection of firmwareverifier requires some special considerations, particularly when the bootloader implements the robustness requirements identified by the IOTSU workshop [RFC8240]. 4.1. The Bootloader In most casesimages theMCU must restart in order to hand over controlauthor needs to be in possession of thebootloader. Once the MCU has initiatedcertificate/public key or arestart, the bootloader determines whetherpre-shared key of anewly available firmware image should be executed. If the bootloader concludes that the newly availabledevice. The use of confidentiality protection of firmwareimage is invalid, a recovery strategyimages isnecessary.deployment specific. There areonly two approaches for 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 architecturedifferent types ofthe update system. Assuming the first approach, theredelivery modes, which are(at least) three firmware images availableillustrated based onthe device: - First, the bootloaderexamples below. There isalso firmware. Ifan option for embedding abootloader is updatable then itsfirmware image into a manifest. This istreated like any other application firmware image. - Second, the firmware image that hasa useful approach for deployments where devices are not connected tobe replaced is still available onthedevice asInternet and cannot contact abackup in case the freshly downloadeddedicated firmwareimage does not boot or operate correctly. - Third, there isserver for thenewly downloadedfirmwareimage. Therefore,download. It is also applicable when the firmwareconsumer must know where to store the new firmware. In some cases,update happens via a USB stick or via Bluetooth Smart. Figure 3 shows thismay be implicit,delivery mode graphically. /------------\ /------------\ /Manifest with \ /Manifest with \ |attached | |attached | \firmware image/ \firmware image/ \------------/ +-----------+ \------------/ +--------+ | | +--------+ | |<.................| Firmware |<................| | | Device | | Server | | Author | | | | | | | +--------+ +-----------+ +--------+ Figure 3: Manifest with attached firmware. Figure 4 shows an option forexample replacingremotely updating a device where the device fetches theleast-recently-usedfirmwareimage. In other cases,image from some file server. The manifest itself is delivered independently and provides information about thestorage locationfirmware image(s) to download. /--------\ /--------\ / \ / \ | Manifest | | Manifest | \ / \ / \--------/ \--------/ +-----------+ +--------+ | | +--------+ | |<.................| Status |................>| | | Device | | Tracker | -- | Author | | |<- | | --- | | +--------+ -- +-----------+ --- +--------+ -- --- --- --- -- +-----------+ -- -- | | -- /------------\ -- | Firmware |<- /------------\ / \ -- | Server | / \ | Firmware | | | | Firmware | \ / +-----------+ \ / \------------/ \------------/ Figure 4: Independent retrieval of thenewfirmware image. This architecture does not mandate a specific delivery mode but a solution mustbe explicit,support both types. 6. Manifest In order forexample whena devicehas one or more application firmware images and a recovery image with limited functionality, sufficient onlytoperformapply anupdate. Since many low end IoT devices do not use position-independent code, either the bootloader needsupdate, it has tocopymake several decisions about thenewly downloaded application firmware image intoupdate: - Does it trust thelocationauthor of theold applicationupdate? - Has the firmwareimage and vice versa or multiple versions ofbeen corrupted? - Does the firmwareneedupdate apply tobe prepared for different locations. In general, it is assumed thatthis device? - Is thebootloader itself, or a minimal part of it, will not be updated since a failedupdateofolder than thebootloader poses a reliability risk. For a bootloader to offer a secure boot functionality it needs to implementactive firmware? - When should thefollowing functionality:device apply the update? -The bootloader needs to fetchHow should themanifest (or manifest-alike headers) from nonvolatile storage and parse its contents for subsequent cryptographic verification.device apply the update? -Cryptographic libraries with hash functions, digital signatures (for asymmetric crypto), message authentication codes (for symmetric crypto) need toWhat kind of firmware binary is it? - Where should the update beaccessible.obtained? - Where should the firmware be stored? Thedevice needs to have a trust anchor store to verifymanifest encodes thedigital signature. (Alternatively, accessinformation that devices need in order to make these decisions. It is akey store for use withdata structure that contains themessage authentication code.)following information: -Ability to expose boot process-related data toinformation about the device(s) theapplicationfirmware(such asimage is intended to be applied to, - information about when thestatus tracker). This allowsfirmware update has tosharebe applied, - information about when the manifest was created, - dependencies on other manifests, - pointers to thecurrentfirmwareversion,image and information about thestatus offormat, - information about where to store the firmwareupdate process and whether errors have occurred.image, -Produce boot measurementscryptographic information, such aspart of an attestation solution. See [I-D.ietf-rats-architecture] for more information. (optional) - Ability to decrypt firmware images, in case confidentiality protection was applied. This requires a solution for key management. (optional) 5. Types of IoT Devices There are billions of MCUs used in devices today produced by a large number of silicon manufacturers. While MCUs can vary significantlydigital signatures or message authentication codes (MACs). The manifest information model is described intheir characteristics, there are a number of similiaries allowing us[I-D.ietf-suit-information-model]. 7. Device Firmware Update Examples Although these documents attempt tocategorize in groups. Thedefine a firmware updatearchitecture, and the manifest format in particular, needsarchitecture that is applicable tooffer enough flexibilityboth existing systems, as well as yet-to-be-conceived systems; it is still helpful tocover these common deployment cases. 5.1.consider existing architectures. 7.1. SingleMCUCPU SoC The simplest, and currently most common, architecture consists of a single MCU along with its own peripherals. These SoCs generally contain some amount of flash memory for code and fixed data, as well as RAM for working storage. These systems either have a single firmware image, or an immutable bootloader that runs a single image. A notable characteristic of these SoCs is that the primary code is generally execute in place (XIP).Due toCombined with the non-relocatable nature of the code,thefirmwareimage needsupdates need to beplaced in a specific location in flash since the code cannot be executed from an arbitrary locationdone inflash. Hence, when the firmware image is updated it is necessary to swap the old and the new image. 5.2.place. 7.2. Single CPU with Secure - Normal Mode Partitioning Another configuration consists of a similar architecture to the previous, with a single CPU. However, this CPU supports a security partitioning scheme that allows memory (in addition to other things) 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 configuration, firmware upgrades will generally be done by the CPU in secure mode, which is able to write to both areas of the flash device. In addition, there are requirements to be able to update either image independently, as well as to update them together atomically, as specified in the associated manifests.5.3. Symmetric Multiple CPUs In more complex SoCs with symmetric multi-processing support, advanced operating systems, such as Linux, are often used. These SoCs frequently use an external storage medium, such as raw NAND flash or eMMC. Due to the higher quantity of resources, these devices are often capable of storing multiple copies of their firmware images and selecting the most appropriate one to boot. Many SoCs also support bootloaders that are capable of updating the firmware image, however this is typically a last resort because it requires the device to be held in the bootloader while the new firmware is downloaded and installed, which results in down-time for the device. Firmware updates in this class of device are typically not done in-place. 5.4.7.3. Dual CPU, shared memory This configuration has two or moreheterogeneousCPUs in a single SoC that share memory (flash and RAM). Generally,therethey will be a protection mechanism to prevent one CPU fromunintentionallyaccessingmemory currently allocated totheother.other's memory. Upgrades in this case will typically be done by one of the CPUs, and is similar to the single CPU with secure mode.5.5.7.4. Dual CPU, other bus This configuration has two or moreheterogeneousCPUs, each having their own memory. There will be a communication channel between 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 upgrade. It is likely that one of the CPUs will be consideredthe primary CPU,a master, and will direct the other CPU to do the upgrade. This configuration is commonly used to offload specific work to other CPUs. Firmware dependencies are similar to the other solutions above, sometimes allowing only one image to be upgraded, other times requiring several to be upgraded atomically. Because the updates are happening on multiple CPUs, upgrading the two images atomically is challenging.6. Manifests In order for a firmware consumer to apply an update, it has8. Bootloader More devices today than ever before are being connected tomake 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 consulttheinformation model specification [I-D.ietf-suit-information-model],Internet, whichoffers justifications for each element, anddrives themanifest, see [I-D.ietf-suit-manifest],need fordetails about how this information is included in the manifest. Table 1 provides examples of decisionsfirmware updates to bemade. +----------------------------+--------------------------------------+ | Decision | Information Elements | +----------------------------+--------------------------------------+ | Should I trustprovided over theauthor | Trust anchors and authorization | | ofInternet rather than through traditional interfaces, such as USB or RS232. Updating a device over thefirmware? | policies onInternet requires the device| | | | | Has the firmware been | Digital signature and MAC covering | | corrupted? |to fetch not only the firmware image| | | | | Doesbut also thefirmware update | Conditions with Vendor ID, Class ID | | apply to this device? | and Device ID | | | | | Ismanifest. Hence, the following building blocks are necessary for a firmware updateolder than | Sequence number in the manifest (1) | |solution: - theactive firmware? | | | | | | When shouldInternet protocol stack for firmware downloads (*), - thedevice | Wait directive | | applycapability to write theupdate? | | | | | | How shouldreceived firmware image to persistent storage (most likely flash memory) prior to performing thedevice | Manifest commands | | applyupdate, - theupdate? | | | | | | What kind of firmware | Unpack algorithmsability tointerpret a | | binary is it? | format. | | | | | Where shouldunpack, decompress or otherwise process theupdate be | Dependencies on other manifests and | | obtained? |received firmwareimage URI in Manifest | | | | | Where shouldimage, - thefirmware | Storage Location and Component | | be stored? | Identifier | +----------------------------+--------------------------------------+ Table 1: Firmware Update Decisions. (1): A device presented withfeatures to verify anold, but validimage and a manifest, including digital signature verification or checking a message authentication code, - a manifest parsing library, andfirmware must not be tricked- integration of the device intoinstalling such firmware sinceavulnerability in the olddevice management server to perform automatic firmwareimage may allow an attackerupdates and togain control of the device. Keeping the codetrack their progress. (*) Because firmware images are often multiple kilobytes, sometimes exceeding one hundred kilobytes, in size for low end IoT devices andcomplexity of a manifest parsers small is importanteven several megabytes large forconstrainedIoTdevices. Sincedevices running full-fledged operating systems like Linux, themanifest parsing code may also be usedprotocol 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. All these features are most likely offered by thebootloader it is part ofapplication, i.e. firmware consumer, running on thetrusted computing base. A manifestdevice (except for basic security algorithms that maynot only be used to protect firmware images but also configuration data such as network credentialsrun either on a trusted execution environment orpersonalization data related toon a separate hardware security MCU/module) rather than by the bootloader itself. Once manifests have been processed and firmwareor software. Personalization data demonstratesimages successfully downloaded and verified theneed for confidentialitydevice needs tobe maintained between two or more stakeholders that both deliver imageshand control over to thesame device. Personalization data is used with Trusted Execution Environments (TEEs), which benefit from a protocol for managingbootloader. In most cases this requires thelifecycle of trusted applications (TAs) running insideMCU to restart. Once the MCU has initiated aTEE. TEEs may obtain TAs from different authorsrestart, the bootloader takes over control andthose TAs may require personalization data, such as payment information, to be securely conveyed todetermines whether theTEE.newly downloaded firmware image should be executed. TheTA's author does not want to exposeboot process is security sensitive because theTA's codefirmware images may, for example, be stored in off-chip flash memory giving attackers easy access toany other stakeholder or third party.the image for reverse engineering and potentially also for modifying the binary. Theuser does not wantbootloader will therefore have toexposeperform security checks on thepayment information to any other stakeholder or third party. 7. Securing Firmware Updates Usingfirmwareupdates to fix vulnerabilities in devices is important but securing this update mechanism is equally important sinceimage before it can be booted. These securityproblems are exacerbatedchecks by theupdate mechanism: update is essentially authorized remote code execution, so any security problemsbootloader happen inthe update process expose that remote code execution system. Failureaddition tosecurethefirmware update process will help attackers to take control over devices. End-to-endsecuritymechanisms are used to protectchecks that happened when the firmware image and themanifest.manifest were downloaded. Thefollowing assumptions are made to allowmanifest may have been stored alongside the firmwareconsumerimage toverifyallow re-verification of thereceivedfirmware imageand manifest before updating software: - Authentication ensures that the device can cryptographically identifyduring every boot attempt. Alternatively, secure boot-specific meta-data may have been created by theauthor(s) creatingapplication after a successful firmwareimagesdownload andmanifests. Authenticated identities may be used as input to the authorizationverification process.Not all entities creating and signing manifests have the same permissions. A device needsWhether todetermine whetherre-use therequested action is indeed covered by the permission of the partystandardized manifest format thatsignedwas used during themanifest. Informinginitial firmware retrieval process or whether it is better to use a different format for thedevice aboutsecure boot- specific meta-data depends on thepermissions ofsystem design. The manifest format does, however, have thedifferent parties also happens in an out-of- band fashion and iscapability to serve also as adutybuilding block for secure boot with its severable elements that allow shrinking the size of theTrust Provisioning Authority. - Integrity protection ensuresmanifest by stripping elements that are nothird party can modifylonger needed. If themanifest orapplication image contains the firmwareimage. To accept an update,consumer functionality, as described above, then it is necessary that adevice needs to verify the signature coveringworking image is left on themanifest. There may be one or multiple manifests that need to be validated, potentially signed by different parties. The device needs to be in possession ofdevice. This allows thetrust anchors to verify those signatures. Installing trust anchorsbootloader todevices via the Trust Provisioning Authority happens in an out-of-band fashion priorroll back tothe firmware update process. - For confidentiality protection of the firmware image, it must be done in suchaway that the intendedworking firmwareconsumer(s), other authorized parties, and no one else can decrypt it. The information that is encrypted individually for each device/ recipient must maintain friendlinessimage toContent Distribution Networks, bulk storage, and broadcast protocols. For confidentiality protection ofexecute a firmwareimagesdownload if theauthor needsbootloader itself does not have enough functionality tobe in possession of the certificate/public key orfetch apre-shared key offirmware image plus manifest from adevice. The use of confidentiality protection offirmwareimages is optional.server over the Internet. Amanifest specification must support different cryptographic algorithms and algorithm extensibility. Moreover, since RSA- and ECC-based signature schemesmulti-stage bootloader maybecome vulnerable to quantum- accelerated key extraction insoften this requirement at thefuture, unchangeableexpense of a more sophisticated boot process. For a bootloadercode in ROM is recommendedtouse post-quantumoffer a securesignature schemesboot mechanism it needs to provide the following features: - ability to access security algorithms, such ashash-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 horizonSHA-256 tokey extraction with quantum acceleration is approximately 2030, based on current research [quantum-factorization]. When a device obtainscompute amonolithicfingerprint over the firmware imagefromand asingle author without any additional approval steps thendigital signature algorithm. - access keying material directly or indirectly to utilize theauthorization flow is relatively simple. There are, however, other cases where more complex policy decisions needdigital signature. The device needs tobe made before updatinghave adevice. In this architecturetrust anchor store. - ability to expose boot process-related data to theauthorization policy is separated fromapplication firmware (such as to theunderlying communication architecture.device management software). Thisis accomplished by separating the entities from their permissions. For example, an author may not have the authority to install a firmware image onallows a devicein critical infrastructure withoutmanagement server to determine whether theauthorizationfirmware update has been successful and, if not, what errors occurred. - to (optionally) offer attestation information (such as measurements). While the software architecture ofa device operator. In this case,thedevice maybootloader and its security mechanisms are implementation-specific, the manifest can beprogrammedused toreject firmware updates unless they are signed both bycontrol the firmwareauthor and by the device operator. Alternatively, a device may trust precisely one entity, which does all permission management and coordination. This entity allowsdownload from thedeviceInternet in addition tooffload complex permissions calculationsaugmenting secure boot process. These building blocks are highly relevant for thedevice. 8.design of the manifest. 9. Example Figure25 illustrates an example message flow for distributing a firmware image to adevice.device starting with an author uploading the new firmware to firmware server and creating a manifest. The firmware and manifest are stored on the same firmwareserverserver. This setup does not use a status tracker anddistributed inthe firmware consumer component is therefore responsible for periodically checking whether adetached manner.new firmware image is available for download. +--------+ +-----------------++-----------------------------+ | | | Firmware Server | | IoT Device | | Author | | Status Tracker | |+------------+ +----------+ |+--------+|Server| | | Firmware ||Bootloader| | | +-----------------+| |Consumer || Author | | Firmware Server | | Consumer | |Bootloader| +--------+ +-----------------+ +------------+ +----------+ | | || | | | | | | +-----------------------+ |+ | Create Firmware | | |Status Tracker Client | ||--------------+ | |+-----------------------+| | | |`'''''''''''''''''''''''''''' |<-------------+| | |<-------------+ | | | | | | | | Upload Firmware | | |||------------------>| | | | | | | || |Create Manifest | | |||---------------+ | | | | | | | || ||<--------------+ | | | | | | | || |Sign Manifest | | |||-------------+ | | | | | | | || ||<------------+ | | | | | | | || |Upload Manifest | | |||------------------>|Notification of | | | | | new firmware image | | | | |----------------------------->| | | | | | | | | |Initiate| | | | | Update | | | | |<-------|| | | | | | | | Query Manifest | | |||<--------------------|.| | | |.| | | Send Manifest |.| | |-------------------->|.| | | | Validate | | | | Manifest | | ||--------+|---------+ | | | | | | | ||<-------+|<--------+ | | | |.| | | Request Firmware |.| | |<--------------------|.| | | |.| | | Send Firmware |.| | |-------------------->|.| | | | Verify.| | | | Firmware | | ||--------+|--------------+ | | | | | | | ||<-------+|<-------------+ | | | |.| | | | Store.| | | | Firmware | | ||--------+ | | | | | | | | |<-------+ | | | | . | | | | . | | | | . | | | | | | | | | Update | ||-------------+ | ||Complete|| | ||------->|| | | |<------------+ | | | |Firmware Update Completed| | ||<-----------------------------| | || | | | | Trigger Reboot | | ||----------------------------->| | | | | | | | | | | | | | |Reboot | | | | |------>| ||--------------->| | | | | | | |.| | | +---+----------------+--+ | | S| | | | | | E| | Verify | | | | C| | Firmware | | | | U| | +--------------| | | | R| | | | | | | E| | +------------->| | | | | | | | | | B| | Activate new | | | | O| | Firmware | | | | O| | +--------------| | | | T| | | | | | | | | +------------->| | | | P| | | | | | R| | Boot new | | | | O| | Firmware | | | | C| | +--------------| | | | E| | | | | | | S| | +------------->| | | | S| | | | | | +---+----------------+--+ | | |. | | | | | | | | . | | | | Device running new firmware | | | |<-----------------------------| | | | . | | | | || Figure2:5: First Example Flow for a FirmwareUpdate.Upate. Figure36 shows an example follow with the device using a status tracker. For editorial reasons the author publishing the manifest at the status tracker and the firmware image at the firmware server is not shown. Also omitted is the secure boot process following the successful firmware update process. The exchangethatstarts with the device interacting with the statustracker queryingtracker; the details of such exchange will vary with the different devicefor its current firmware version. Later, a newmanagement systems being used. In any case, the status tracker learns about the firmware versionbecomes available and since thisof the devices it manages. In our example, the device under management isrunning an olderusing firmware version A.B.C. At a later point in time thestatus tracker server interactsauthor uploads a new firmware along with thedevicemanifest toinitiate an update. Thethe firmware server and the status tracker, respectively. While there is no need to store the manifest and the firmwareare storedon different serversinthisexample. Whenexample 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 deviceprocessesabout themanifestnewly available firmware image. In our example, itlearns wheredoes so by pushing the manifest todownloadthenewfirmwareversion.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.Finally, the device reports the successful boot of the new firmware version.+---------+ +-----------------+ +-----------------------------+ | Status | |Firmware Server| | +------------+ +----------+ | | Tracker | |Status TrackerFirmware Server | | | Firmware | |Bootloader| | |Server| |Server| | | Consumer | | | | +---------+ +-----------------+ || +Status | +----------+ | | | | | Tracker | | | | | | | Client | | | | | |+------------+|+----------+ | | | | | IoT Device | | | | `'''''''''''''''''''''''''''' | | | | | Query Firmware Version | | |------------------------------------->| | | Firmware Version A.B.C | | |<-------------------------------------| | | | | | | <<some time later>> | | | | | | _,...._ _,...._ | | ,' `. ,' `. | | | New | | New | | | \ Manifest / \ Firmware / | | `.._ _,,' `.._ _,,' | | `'' `'' | | | Push manifest | | |----------------+-------------------->| | | | | | | ' | ' | | | Validate | | | | Manifest | | | |---------+ | | | | | | | | |<--------+ | | | Request firmware | | | | X.Y.Z | | | |<--------------------| | | | | | | | Firmware X.Y.Z | | | |-------------------->| | | | | | | | | Verify | | | | Firmware | | | |--------------+ | | | | | | | | |<-------------+ | | | | | | | | Store | | | | Firmware | | | |-------------+ | | | | | | | | |<------------+ | | | | | | | | | | | | Trigger Reboot | | | |--------------->| | | | | | | | | | | | __..-------..._' | | ,-' `-. | | | Secure Boot | | | `-. _/ | | |`--..._____,,.,-' | | | || Device running firmware X.Y.Z | | |<-------------------------------------| | | | | | | | | |Figure3:6: Second Example Flow for a FirmwareUpdate. 9.Upate. 10. IANA Considerations This document does not require any actions by IANA.10.11. Security ConsiderationsThis document describes terminology, requirementsFirmware updates fix security vulnerabilities and are considered to be anarchitecture for firmware updates ofimportant building block in securing IoT devices.The contentDue to the importance of firmware updates for IoT devices thedocument is thereby focusedInternet Architecture Board (IAB) organized a 'Workshop on Internet of Things (IoT) Software Update (IOTSU)', which took place at Trinity College Dublin, Ireland onimprovingthe 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 ofIoT devices viathem 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 updatemechanisms and informsdoes not break thestandardizationdevice functionality of the environment this device operates in. - installing firmware updates in amanifest format. An in-depth examinationtimely fashion considering the complexity of thesecurity considerationsdecision making process of updating devices, potential re-certification requirements, and thearchitecture is presentedneed for user consent to install updates. - the distribution of the actual firmware update, potentially in[I-D.ietf-suit-information-model]. 11.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 protecting the manifest. - incentives for manufacturers to offer a firmware update mechanism as part of their IoT products. 12. Acknowledgements We would like to thank the following persons for their feedback: - Geraint Luff - Amyas Phillips - Dan Ros - Thomas Eichinger - Michael Richardson - Emmanuel Baccelli - Ned Smith - Jim Schaad - Carsten Bormann - Cullen Jennings - Olaf Bergmann - Suhas Nandakumar - Phillip Hallam-Baker - Marti Bolivar - Andrzej Puzdrowski - Markus Gueller - Henk Birkholz - Jintao Zhu - Takeshi Takahashi - Jacob Beningo - Kathleen Moriarty- Bob Briscoe - Roman Danyliw - Brian Carpenter - Theresa Enghardt - Rich Salz - Mohit SethiWe would also like to thank the WG chairs, Russ Housley, David Waltermire, Dave Thaler for their support and their reviews.12.13. 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] Moran, B., Tschofenig, H., and H. Birkholz, "An Information Model for Firmware Updates in IoT Devices",draft-ietf-suit-information-model-07draft-ietf-suit-information-model-08 (work in progress),JuneOctober 2020. [I-D.ietf-suit-manifest] Moran, B., Tschofenig, H., Birkholz, H., and K. Zandberg, "A Concise Binary Object Representation (CBOR)-based Serialization Format for the Software Updates for Internet of Things (SUIT) Manifest",draft-ietf-suit-manifest-09draft-ietf-suit-manifest-11 (work in progress),JulyDecember 2020. [I-D.ietf-teep-architecture] Pei, M., Tschofenig, H., Thaler, D., and D. Wheeler, "Trusted Execution Environment Provisioning (TEEP) Architecture",draft-ietf-teep-architecture-12draft-ietf-teep-architecture-13 (work in progress),JulyNovember 2020. [LwM2M] OMA, ., "Lightweight Machine to Machine Technical Specification, Version 1.0.2", February 2018, <http://www.openmobilealliance.org/release/LightweightM2M/V1_0_2-20180209-A/OMA-TS-LightweightM2M- V1_0_2-20180209-A.pdf>. [quantum-factorization] Jiang, S., Britt, K., McCaskey, A., Humble, T., and S. Kais, "Quantum Annealing for Prime Factorization", December 2018, <https://www.nature.com/articles/s41598-018-36058-z>.V1_0_2-20180209-A/ OMA-TS-LightweightM2M-V1_0_2-20180209-A.pdf>. [RFC6024] Reddy, R. and C. Wallace, "Trust Anchor Management Requirements", RFC 6024, DOI 10.17487/RFC6024, October 2010, <https://www.rfc-editor.org/info/rfc6024>.[RFC6763] Cheshire, S. and M. Krochmal, "DNS-Based Service Discovery", RFC 6763, DOI 10.17487/RFC6763, February 2013, <https://www.rfc-editor.org/info/rfc6763>.[RFC7228] Bormann, C., Ersue, M., and A. Keranen, "Terminology for Constrained-Node Networks", RFC 7228, DOI 10.17487/RFC7228, May 2014, <https://www.rfc-editor.org/info/rfc7228>. [RFC8240] Tschofenig, H. and S. Farrell, "Report from the Internet of Things Software Update (IoTSU) Workshop 2016", RFC 8240, DOI 10.17487/RFC8240, September 2017, <https://www.rfc-editor.org/info/rfc8240>. [RFC8778] Housley, R., "Use of the HSS/LMS Hash-Based Signature Algorithm with CBOR Object Signing and Encryption (COSE)", RFC 8778, DOI 10.17487/RFC8778, April 2020, <https://www.rfc-editor.org/info/rfc8778>. Authors' Addresses Brendan Moran Arm Limited EMail: Brendan.Moran@arm.com Hannes Tschofenig Arm Limited EMail: hannes.tschofenig@arm.com David Brown Linaro EMail: david.brown@linaro.org Milosch Meriac Consultant EMail: milosch@meriac.com