SUIT B. Moran Internet-Draft H. Tschofenig Intended status: Informational Arm Limited Expires:March 21,April 19, 2021 D. Brown Linaro M. Meriac ConsultantSeptember 17,October 16, 2020 A Firmware Update Architecture for Internet of Thingsdraft-ietf-suit-architecture-12draft-ietf-suit-architecture-13 Abstract Vulnerabilities with Internet of Things (IoT) devices have raised the need for asolidreliable and secure firmware update mechanismthat is alsosuitable forconstrained devices.devices with resource constraints. Incorporating such an update mechanismto fix vulnerabilities, to updateis a fundamental requirement for fixing vulnerabilities but it also enables other important capabilities such as updating configuration settings as well as adding newfunctionality is recommended by security experts. This document lists requirementsfunctionality. In addition to the definition of terminology anddescribesan architecturefor a firmware update mechanism suitable for IoT devices. The architecture is agnostic tothis document motivates thetransportstandardization ofthe firmware imagesa manifest format as a transport-agnostic means for describing andassociated meta-data.protecting firmware updates. 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 onMarch 21,April 19, 2021. Copyright Notice Copyright (c) 2020 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 . . . . . . . . . . . . . . . . .3 3. Requirements . . . . . . . . . . . . . . . . . . . . . . . . 7 3.1. Agnostic to how firmware images are distributed . . . . . 7 3.2. Friendly to broadcast delivery . . . . . . . . . . . . . 8 3.3. Use state-of-the-art security mechanisms . . . . . . . . 8 3.4. Rollback attacks must be prevented . . . . . . . . . . . 9 3.5. High reliability . . . . . . . . . .5 2.1. Terms . . . . . . . . . .9 3.6. Operate with a small bootloader. . . . . . . . . . . . .9 3.7. Small Parsers. . . 5 2.2. Stakeholders . . . . . . . . . . . . . . . . . . .10 3.8. Minimal impact on existing firmware formats. . . 6 2.3. Functions . . . .10 3.9. Robust permissions. . . . . . . . . . . . . . . . . . .10 3.10. Operating modes. 7 3. Architecture . . . . . . . . . . . . . . . . . . . .11 3.11. Suitability to software and personalization data. . . .138 4.Claims .Invoking the Firmware . . . . . . . . . . . . . . . . . . . . 12 4.1. The Bootloader . . . . . .13 5. Communication Architecture. . . . . . . . . . . . . . . 14 5. Types of IoT Devices . .14 6. Manifest. . . . . . . . . . . . . . . . . . 15 5.1. Single MCU . . . . . . . .18 7. Device Firmware Update Examples. . . . . . . . . . . . . . .19 7.1.15 5.2. Single CPUSoC . . . .with Secure - Normal Mode Partitioning . . . . 16 5.3. Symmetric Multiple CPUs . . . . . . . . . . . . .19 7.2. Single CPU with Secure - Normal Mode Partitioning. . . .19 7.3. Symmetric Multiple CPUs16 5.4. Dual CPU, shared memory . . . . . . . . . . . . . . . . .19 7.4.16 5.5. Dual CPU,shared memoryother bus . . . . . . . . . . . . . . . . .20 7.5. Dual CPU, other bus. . 17 6. Manifests . . . . . . . . . . . . . . . . .20 8. Bootloader. . . . . . . . . 17 7. Securing Firmware Updates . . . . . . . . . . . . . . . .20 9.. . 19 8. Example . . . . . . . . . . . . . . . . . . . . . . . . . . .22 10.20 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . .26 11.25 10. Security Considerations . . . . . . . . . . . . . . . . . . .26 12.25 11. Acknowledgements . . . . . . . . . . . . . . . . . . . . . .27 13.25 12. Informative References . . . . . . . . . . . . . . . . . . .2826 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . .2928 1. IntroductionWhen developingFirmware 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 on Internet of Things (IoT)devices, one ofSoftware Update (IOTSU)', which took place at Trinity College Dublin, Ireland on themost difficult problems13th and 14th of June, 2016 tosolve is howtake a look at the bigger picture. A report about this workshop can be found at [RFC8240]. The workshop revealed a number of challenges for developers and led toupdate firmware onthedevice. Onceformation of thedeviceIETF 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 inits lifetime,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.Updates to the firmware of anFirmware updates for IoTdevicedevices 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 fixbugs in software, tobugs, but they can also add new functionality, andtore-configure the device to work in new environments or to behave differently in an already deployed context. The firmware updateprocess, among other goals,process has to ensure that - The firmware image is authenticated and integrity protected. Attempts to flash a maliciously modified firmware image or an image from anunknownunknown, untrusted sourcearemust 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 attempts by an adversary to recover the plaintext binary can beprevented.mitigated or at least made more difficult. Obtaining the firmware is often one of the first steps to mount an attack since it gives the adversary valuable insights intousedthe softwarelibraries,libraries used, configuration settings and genericfunctionality (evenfunctionality. Even though reverse engineering the binary can be a tediousprocess). This version of the document assumes asymmetric cryptography and a public key infrastructure. Future versions may also describeprocess modern reverse engineering frameworks have made this task asymmetric key approach for very constrained devices.lot easier. While the standardization work has been informed by andoptimisedoptimized for firmware update use cases of Class 1 devices (according to the device class definitions in RFC 7228 [RFC7228]) devices, there is nothing in the architecture that restricts its use to only these constrained IoT devices. Moreover, this architecture is not limited to managing software updates, but can also be applied to managing the delivery of arbitrary data, such as configuration information and keys.MoreUnlike 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 detailsaboutfor how to obtain those application layer software binaries then depends heavily on thesecurity goalsplatform, programming language uses and the sandbox the software is executed in. 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 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 arediscussedsome of them, as highlighted during the IOTSU workshop: - Installing firmware updates inSection 5a robust fashion so that the update does not break the device functionality of the environment this device operates in. This requires proper testing andrequirements are describedoffering recovery strategies when a firmware update is unsuccessful. - Making firmware updates available inSection 3.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.1. Terms This 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.- 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 whetherWe use the term application firmware image tobootdifferentiate it from a firmware image thatis present or whether to obtain and verify a newcontains the bootloader. An application firmwareimage. Sinceimage, as thebootloader is a security critical component its functionality may be split into separate stages. Such a multi-stage bootloader may offer very basic functionality inname indicates, contains thefirst stage and resides in ROM whereasapplication program often including all thesecond stage may implement more complex functionality and resides in flash memory so thatnecessary code to run itcan be updated in the future (in case bugs have been found).(such as protocol stacks, and embedded operating system). - Manifest: Theexact split of components into the different stages,manifest contains meta-data about thenumber offirmwareimages stored by an IoT device,image. The manifest is protected against modification and provides information about thedetailed functionality varies throughout different implementations. A more detailed discussion is provided in Section 8.author. - 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 usedfor 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 with an external, updatable radio, or a deviceinterchangeably withinternal and external flash memory. - Trusted Execution Environments (TEEs): An execution environment that runs alongside of,MCU, butis isolated from, an REE.MCU tends to imply more limited peripheral functions. - 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. - 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].TEEP requires the use of SUIT for delivering TAs.2.2. Stakeholders The followingentitiesstakeholders areused:used in this document: - Author: The author is the entity that creates the firmware image. There may be multiple authors involved ina system either when a device consists of multiple micro-controllers or when the the finalproducing firmwareimage consists of software components from multiple companies.running on an IoT device. Section 5 talks about those IoT device deployment cases. -Firmware Consumer:Device Operator: Thefirmware consumerdevice operator is responsible for therecipientday- to-day operation of a fleet of IoT devices. Customers of IoT devices, as thefirmware image andowners of IoT devices - such as enterprise customers or end users, interact with their IoT devices indirectly through themanifest. Itdevice operator via web or smart phone apps. - Network Operator: The network operator is responsible forparsing and verifying the received manifest and for storingtheobtained firmware image. The firmware consumer plays the roleoperation ofthe update component on thea network to which IoTdevice typically runningdevices 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, theapplication firmware. It interacts with the firmware serverOriginal Design Manufacturer (ODM), which is a company that designs andwithmanufactures a product, may act as a TPA and may decide to remain in full control over thestatus tracker, if present.firmware update process of their products. 2.3. Functions - (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 tosuccesfullysuccessfully perform an update. - Status Tracker: Theterms devicestatus tracker has a client andfirmware consumer are used interchangably sincea server component and performs three tasks: 1) It communicates the availability of a new firmwareconsumer is oneversion. This information will flow from the server to the client. 2) It conveys information about softwarecomponent running on an MCU onand hardware characteristics of the device.- Status Tracker:Thestatus tracker offers device management functionalityinformation flow is from the client toretrievethe server. 3) It can remotely trigger the firmware update process. The informationaboutflow is from the server to the client. For example, a device operator may want to read the installed firmware version number running onathe device andotherinformation about available flash memory. Once an update has been triggered, the devicecharacteristics (including free memory and hardware components),operator may want to obtain information about the state of the firmwareupdate cycleupdate. If errors occurred, the deviceis currently in, andoperator may want totriggertroubleshoot problems by first obtaining diagnostic information (typically using a device management protocol). We make no assumptions about where theupdate process.server-side component is deployed. The deployment of status trackers is flexible andtheymay beused asfound at cloud-based servers, on-premise servers,embedded in edge computing device (such as Internet access gateways or protocol translation gateways),oreven in smart phones and tablets. IoT devices that self-initiate updatesmayrun a status tracker. Similarly, IoT devices that act as a proxy for other IoT devicesbe embedded ina protocol translation oredge computingdevice node may also run adevice. A statustracker. However,tracker server component may even be deployed on an IoT device. For example, if the IoT device contains multiple MCUs, then the main MCU may act as alimitedstatus tracker towards the otherMCUs ifMCUs. Such deployment is useful when updatesarehave to be synchronized across MCUs.How much functionality aThe status trackerincludes depends onmay be operated by any suitable stakeholder; typically theselected configurationAuthor, Device Operator, or Network Operator. - Firmware Consumer: The firmware consumer is the recipient of thedevice management functionalityfirmware image and thecommunication environment itmanifest. It isused in. In a generic networking environment the protocol used betweenresponsible for parsing and verifying theclientreceived manifest and for storing theserver-sideobtained firmware image. The firmware consumer plays the role of thestatus tracker need to dealupdate component on the IoT device typically running in the application firmware. It interacts withInternet communication challenges involving firewall and NAT traversal. In other cases,thecommunication interaction may be rather simple. This architecture document does not impose requirements onfirmware server and with the statustracker.tracker client (locally). - 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 trackerbut thoseand these two entities are often physically separated on different devices for scalability reasons. -Device Operator: The actor responsible for the day-to-day operation ofBootloader: A bootloader is afleetpiece ofIoT devices. - Network Operator: The actorsoftware that is executed once a microcontroller has been reset. It is responsible forthe operation of a networkdeciding 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. Updating updates over the Internet requires the device to fetch the new firmware image as well as the manifest. Hence, the following components are necessary on a device for a firmware 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 devicesconnect.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. - the capability to write the received firmware image to persistent storage (most likely flash memory). -Claim: A piece of information asserted aboutarecipientmanifest parser with code to verify a digital signature orpayload. In additiona message authentication code. - the ability to unpack, to decompress and/or to decrypt theentitiesreceived firmware image. - (optionally) a status tracker. The features listed above are most likely offered by code in thelist above there is an orthogonal infrastructureapplication 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. Figure 1 shows the architecture where aTrust Provisioning Authority (TPA) distributing trust anchorsfirmware image is created by an author, andauthorizationmade available to a firmware server. For security reasons, the author will not have the permissions tovarious entities inupload firmware images to thesystem. The TPA may also delegate rightsfirmware server and toinstall, update, enhance,initiate an update him- ordelete trust anchors and authorization permissionsherself. Instead, authors will make firmware images available toother parties in the system. This infrastructure overlapsthecommunication architecture and different deployments may empower certain entities while other deploymentsdevice operators. Note that there maynot. For example, in some cases, the Original Design Manufacturer (ODM), which isbe acompanylonger supply chain involved to pass software updates from the author all the way to the party thatdesigns and manufactures a product, may act ascan then finally make aTPA and may decidedecision toremaindeploy it with IoT devices. As a first step infull control overthe firmware updateprocess 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, andprocess, theassociated data is usedstatus tracker client need toconstrain the typesbe made aware ofinformation for whichthetrust anchor is authoritative." - "A trust anchor store is a setavailability ofone or more trust anchors stored inadevice. A device may have more than one trust anchor store, each of which may be usednew firmware update byonethe status tracker server. This can be accomplished via polling (client-initiated), push notifications (server-initiated), or moreapplications." A trust anchor store must resist modification against unauthorized insertion, deletion,complex mechanisms (such as a hybrid approach): - Client-initiated updates take the form of a status tracker client proactively checking (polling) for updates. - With Server-initiated updates the server-side component of the status tracker learns about a new firmware version andmodification. 3. Requirements Thedetermines what devices qualify for a firmwareupdate mechanism described in this specification was designed withupdate. Once the relevant devices have been selected, the status tracker informs these devices and thefollowing requirements in mind: - Agnostic to howfirmware consumers obtain those images and manifests. Server-initiated updates aredistributed - Friendlyimportant because they allow a quick response time. Note that the client-side status tracker needs tobroadcast delivery - Use state-of-the-art security mechanisms - Rollback attacks mustbeprevented - High reliability - Operate with a small bootloader - Small Parsers - Minimal impactreachable by the server-side component. This may require devices to keep reachability information onexisting firmware formats - Robust permissionsthe server-side up-to-date and state at NATs and stateful packet filtering firewalls alive. -Diverse modesUsing a hybrid approach the server-side ofoperation - Suitabilitythe status tracker pushes notifications of availability of an update tosoftwarethe client side andpersonalization data 3.1. Agnosticrequests the firmware consumer tohowpull the manifest and the firmwareimagesimage from the firmware server. 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 aredistributedstill pending an update. Firmware images can be conveyed to devices in a variety of ways, including USB, UART, WiFi, BLE, low-power WAN technologies,etc.mesh networks anduse differentmany more. At the application layer a variety of protocols(e.g.,are also available: MQTT, CoAP,HTTP). The specified mechanism needs to be agnostic toand HTTP are thedistribution ofmost popular application layer protocols used by IoT devices. This architecture does not make assumptions about how the firmware images are distributed to the devices andmanifests. 3.2. Friendlytherefore aims to support all these technologies. In some cases it may be desirable to distribute firmware images using a multicast or broadcastdeliveryprotocol. This architecture does notspecifymake recommendations for anyspecific broadcastsuch 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.3.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+----------+ | | | 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. Firmware images andmanifests. Authenticated identitiesmanifests may beusedconveyed asinput to the authorization process. 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 in suchaway that every intended recipient can decrypt it.bundle or detached. Theinformation that is encrypted individually for each device must maintain friendliness to Content Distribution Networks, bulk storage, and broadcast protocols. Amanifestspecificationmust supportdifferent 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, suchboth approaches. For distribution ashash-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 sinceavulnerability inbundle, theoldfirmware imagemay 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 itispossible 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 manageembedded into thefirmware update process.manifest. Thismay give the impression that the bootloader itselfis acompletely separate component, which is mainly responsibleuseful approach forselecting a firmware imagedeployments where devices are not connected toboot. The overlap betweenthefirmware update processInternet andthe bootloader functionality comes in two forms, namely - First,cannot contact abootloader 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 thededicated firmwareimage 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 withserver for the firmwareimage during the update process (with the severable fields stripped off). - Second, an IoT device needs a recovery strategy in casedownload. It is also applicable when 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 havehappens via asecond stage bootloader perform the firmware update process again using firmware updates over serial,USB sticks oreven wireless connectivity like a limited version ofshort range radio technologies (such as BluetoothSmart. 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 processSmart). Alternatively, the manifestmust 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. Thisisaccomplished by separating the entitiesdistributed detached fromtheir permissions. For example, an author may not havetheauthority to install afirmwareimage on a device in critical infrastructure without the authorization of a device operator. Inimage. Using thiscase, the device may be programmed to reject firmware updates unless they are signed both byapproach, the firmwareauthor 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 firmwareconsumeron 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 trackerisable 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 topresented with thefirmware consumer,manifest first anditthendownloads the image from aneeds to obtain one or more firmwareserver 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 systemimages asa whole, all operating modes can be represented. The steps performeddictated in thecourse of an update by the system containing an updatable device are: - Notification - Pre-authorisation - Dependency resolution - Download - Installation This is a coarse-grained high level view of steps required to install a new firmware. By considering where in the system each of these steps is performed, each operating mode can be represented. Each of these steps is broken down into smaller constituent parts. Section 5 defines the steps taken from the perspective of the communication between actors in the system. Section 8 describes some additional 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 firmware consumer that an update is available. This can be accomplished via polling (client-initiated), push notifications (server-initiated), or more complex mechanisms.manifest. 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-basedHTTP/1.1-based firmware server isclient- initiated.client-initiated. Pushing a manifest and firmware image to thetransfer to thePackage resource of the LwM2M Firmware Update object [LwM2M] isserver-initiated.server-initiated update. If the firmware consumer has downloaded a new firmware image and is ready to install it, to initiate the installation, it may - either need to wait for a trigger from the statustracker to initiate the installation, maytracker, - or trigger the update automatically, - ormaygo through a more complex decision making process to determine the appropriate timing for anupdate (such as delayingupdate. Sometimes theupdate process to a later time when end users are less impacted byfinal decision may require confirmation of theupdate process).user of the device for safety reasons. Installation is the act of processing the payload into a format that the IoT device canrecogniserecognize and the bootloader is responsible for then booting from the newly installed firmware image.Each of these steps may requireThis process is differentpermissions. 3.11. Suitability to software and personalization data The work on a standardized manifest format initially focused on the most constrained IoT devices and those devices contain code put together bywhen asingle author (although that author may obtain code from other developers, some of it onlybootloader is not involved. For example, when an application is updated inbinary form). Later it turns out that other use cases may benefit fromastandardized manifest format also for conveying softwarefull-featured operating system, the updater may halt andeven personalization data alongside software. Trusted Execution Environments (TEEs), for example, greatly benefit fromrestart the application in isolation. Devices must not fail when aprotocol for managingdisruption occurs during thelifecycle of trusted applications (TAs) running insideupdate process. For example, aTEE. TEEs may obtain TAs from different authors and those TAs may require personalization data, such as payment information, to be securely conveyed topower failure or network disruption during theTEE. To support this wider range of use casesupdate process must not cause themanifest format should therefore be extensibledevice toconvey other forms of payloads as well.fail. 4.Claims The information conveyed from an Author to aInvoking the FirmwareConsumer can be considered to be Claims as described in [RFC7519] and [RFC8392]. The same security considerations apply toSection 3 describes theClaims expressed insteps for getting themanifest. The chief difference between manifest Claimsfirmware image andCWT or JWT claims is that a manifest has multiple subjects. The manifest contains: 1. Claims abouttheFirmware, including its dependencies 2. Claims about the Firmware Consumer's physical or software properties 3. Claims about the Author, ormanifest from theAuthor's delegate The credential used to authenticate these Claims must be directly or indirectly relatedauthor to thetrust anchor installed atfirmware consumer on thedevice byIoT device. Once theTrust Provisioning Authority. The baseline claims for all manifests are described in [I-D.ietf-suit-information-model]. 5. Communication Architecture Figure 1 showsfirmware consumer has retrieved and successfully processed the manifest and thecommunication architecture where afirmware image it needs to invoke the new firmware image. This iscreated by an author, and uploadedmanaged in many different ways, depending on the type of device, but it typically involves halting the current version of the firmware, handing control over to a firmwareserver. Thewith a higher privilege/trust level (the firmwareimage/manifestverifier) verifying the new firmware's authenticity & integrity, and then invoking it. In an execute-in-place microcontroller, this isdistributedoften done by rebooting into a bootloader (simultaneously halting the application & handing over to thedevice either inhigher privilege level) then executing apushsecure boot process (verifying and invoking the new image). In a rich OS, this may be done by halting one orpull manner usingmore processes, then invoking new applications. In some OSs, this implicitly involves thefirmware consumer residingkernel verifying the code signatures on thedevice.new applications. Thedevice operator keeps track of theinvocation processusing the status tracker. This allowsis security sensitive. An attacker will typically try to retrieve a firmware image from the deviceoperatorfor reverse engineering or will try toknow and control what devices have received an update and which of them are still pendingget the firmware verifier to execute anupdate. 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 usedattacker-modified firmware image. The firmware verifier will therefore have toprotectperform security checks on the firmware imageand the manifest although Figure 2 does not show the manifest itself sincebefore itmaycan bedistributed independently. +-----------+ +--------+ | | +--------+ | | Firmware Image | Firmware | Firmware Image | | | Device |<-----------------| Server |<------------------| Author | | | | | | | +--------+ +-----------+ +--------+ ^ * * * ************************************************************ End-to-End Security Figure 2: End-to-End Security. Whetherinvoked. These security checks by the firmware verifier happen in addition to the security checks that took place when the firmware image and the manifestis pushed to the device or fetchedwere downloaded by thedevice is a deployment specific decision.firmware consumer. Thefollowing assumptions are made to allowoverlap between the firmware consumerto verifyand thereceivedfirmwareimage and manifest before updating software:verifier functionality comes in two forms, namely -To accept an update, a device needs toA firmware verifier must verify thesignature coveringfirmware image it boots as part of themanifest. There may be one or multiple manifests that need to be validated, potentially signed by different parties. The device needssecure boot process. Doing so requires meta-data to bein possession ofstored alongside thetrust anchors tofirmware image so that the firmware verifier can cryptographically verifythose signatures. Installing trust anchors to devices viatheTrust Provisioning Authority happens in an out-of- band fashion priorfirmware 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. -Not all entities creating and signing manifests have the same permissions. AAn 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 todetermine whetherinvoke a recovery image to perform therequested actionfirmware update process again using firmware updates over serial, USB or even wireless connectivity like Bluetooth Smart. In the latter case the firmware consumer functionality isindeed covered bycontained in thepermission ofrecovery image and requires theparty that signednecessary functionality for executing themanifest. Informingfirmware update process, including manifest parsing. While this document assumes that thedevice aboutfirmware verifier itself is distinct from thepermissionsrole of thedifferent parties also happens in an out-of-band fashionfirmware consumer and therefore does not manage the firmware update process, this isalsonot aduty ofrequirement and these roles may be combined in practice. Using a bootloader as theTrust Provisioning Authority. - For confidentiality protection offirmwareimagesverifier requires some special considerations, particularly when theauthor needs to bebootloader implements the robustness requirements identified by the IOTSU workshop [RFC8240]. 4.1. The Bootloader In most cases the MCU must restart inpossession oforder to hand over control to thecertificate/public key orbootloader. Once the MCU has initiated apre-shared key ofrestart, the bootloader determines whether adevice. The use of confidentiality protection ofnewly available firmwareimagesimage should be executed. If the bootloader concludes that the newly available firmware image isdeployment specific.invalid, a recovery strategy is necessary. There aredifferent typesonly 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 ofdelivery modes, whichthese approaches have implications for the architecture of the update system. Assuming the first approach, there areillustrated based(at least) three firmware images available onexamples below. Therethe device: - First, the bootloader isan option for embeddingalso firmware. If a bootloader is updatable then its firmware imageinto a manifest. Thisisa useful approach for deployments where devices are not connected to the Internet and cannot contact a dedicatedtreated like any other application firmwareserver forimage. - Second, the firmwaredownload. Itimage that has to be replaced isalso applicable when the firmware update happens via a USB stick or via Bluetooth Smart. Figure 3 shows this 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 for remotely updating a device wherestill available on the devicefetchesas a backup in case the freshly downloaded firmware imagefrom some file server. The manifest itselfdoes not boot or operate correctly. - Third, there isdelivered independently and provides information aboutthe newly downloaded firmwareimage(s)image. Therefore, the firmware consumer must know where todownload. /--------\ /--------\ / \ / \ | Manifest | | Manifest | \ / \ / \--------/ \--------/ +-----------+ +--------+ | | +--------+ | |<.................| Status |................>| | | Device | | Tracker | -- | Author | | |<- | | --- | | +--------+ -- +-----------+ --- +--------+ -- --- --- --- -- +-----------+ -- -- | | -- /------------\ -- | Firmware |<- /------------\ / \ -- | Server | / \ | Firmware | | | | Firmware | \ / +-----------+ \ / \------------/ \------------/ Figure 4: Independent retrieval ofstore the new firmware. In some cases, this may be implicit, for example replacing the least-recently-used firmware image.This architecture does not mandate a specific delivery mode but a solution must support both types. 6. ManifestInorderother 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 toapplyperform anupdate, it hasupdate. Since many low end IoT devices use non-relocatable code, either the bootloader needs tomake several decisions aboutcopy theupdate: - Does it trustnewly downloaded application firmware image into theauthorlocation of theupdate? - Has theold application firmwarebeen corrupted? - Doesimage and vice versa or multiple versions of the firmwareupdate applyneed tothis device? - Isbe prepared for different locations. In general, it is assumed that the bootloader itself, or a minimal part of it, will not be updated since a failed updateolder than the active firmware? - When shouldof thedevice applybootloader poses a reliability risk. For a bootloader to offer a secure boot functionality it needs to implement theupdate?following functionality: -How should the device applyThe bootloader needs to fetch theupdate? - What kind of firmware binary is it?manifest (or manifest-alike headers) from nonvolatile storage and parse its contents for subsequent cryptographic verification. -Where should the updateCryptographic libraries with hash functions, digital signatures (for asymmetric crypto), keyed message digests (for symmetric crypto) need to beobtained?accessible. -Where should the firmware be stored?Themanifest encodesdevice needs to have a trust anchor store to verify theinformation that devices need in orderdigital signature. (Alternatively, access tomake these decisions. It isadata structure that containskey store for use with thefollowing information:keyed message digest.) -information about the device(s)Ability to expose boot process-related data to the application firmwareimage is intended(such as tobe applied to, - information about whenthefirmware update hasstatus tracker). This allows tobe applied, -share information aboutwhen the manifest was created, - dependencies on other manifests, - pointers tothe current firmwareimageversion, andinformation abouttheformat, - information about where to storestatus of the firmwareimage,update process and whether errors have occurred. -cryptographic information, suchProduce boot measurements asdigital signatures or message authentication codes (MACs). The manifest information model is described in [I-D.ietf-suit-information-model]. 7. Device Firmware Update Examples Although these documents attemptpart of an attestation solution. See [I-D.ietf-rats-architecture] for more information. (optional) - Ability todefinedecrypt 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 significantly in their characteristics, there are a number of similiaries allowing us to categorize in groups. The firmware updatearchitecture that is applicablearchitecture, and the manifest format in particular, needs toboth existing systems, as well as yet-to-be-conceived systems; it is still helpfuloffer enough flexibility toconsider existing architectures. 7.1.cover these common deployment cases. 5.1. SingleCPU SoCMCU 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).Combined withDue to the non-relocatable nature of the code, the firmwareupdates needimage needs to bedoneplaced in a specific location inplace. 7.2.flash since the code cannot be 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. 5.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.7.3.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 storagemediummedium, 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.7.4.5.4. Dual CPU, shared memory This configuration has two or more heterogeneous CPUs in a single SoC that share memory (flash and RAM). Generally,theythere will be aprotectionmechanism to prevent one CPU from unintentionally accessing memory currently allocated to theother's memory.other. Upgrades in this case will typically be done by one of the CPUs, and is similar to the single CPU with secure mode.7.5.5.5. Dual CPU, other bus This configuration has two or more heterogeneous CPUs, 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 considered the primary CPU, 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.8. Bootloader More devices today than ever before are being connected6. Manifests In order for a firmware consumer to apply an update, it has to make several decisions using manifest-provided information and data available on theInternet,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], whichdrivesoffers justifications for each element, and theneedmanifest, see [I-D.ietf-suit-manifest], forfirmware updatesdetails about how this information is included in the manifest. Table 1 provides examples of decisions to beprovided overmade. +----------------------------+--------------------------------------+ | Decision | Information Elements | +----------------------------+--------------------------------------+ | Should I trust theInternet rather than through traditional interfaces, such as USB or RS232. Updating a device overauthor | Trust anchors and authorization | | of theInternet requiresfirmware? | policies on the deviceto fetch not only| | | | | Has the firmwareimage but alsobeen | Digital signature and MAC covering | | corrupted? | themanifest. Hence,firmware image | | | | | Does thefollowing building blocks are necessary for afirmware updatesolution: -| Conditions with Vendor ID, Class ID | | apply to this device? | and Device ID | | | | | Is theInternet protocol stack for firmware downloads (*), -update older than | Sequence number in thecapability to writemanifest (1) | | thereceived firmware image to persistent storage (most likely flash memory) prior to performingactive firmware? | | | | | | When should theupdate, -device | Wait directive | | apply theability to unpack, decompress or otherwise processupdate? | | | | | | How should thereceived firmware image, -device | Manifest commands | | apply thefeaturesupdate? | | | | | | What kind of firmware | Unpack algorithms toverify an image andinterpret amanifest, including digital signature verification or checking a message authentication code, - a manifest parsing library,| | binary is it? | format. | | | | | Where should the update be | Dependencies on other manifests and- integration of| | obtained? | firmware image URI in Manifest | | | | | Where should the firmware | Storage Location and Component | | be stored? | Identifier | +----------------------------+--------------------------------------+ Table 1: Firmware Update Decisions. (1): A device presented with an old, but valid manifest and firmware must not be tricked into installing such firmware since adevice management server to perform automaticvulnerability in the old firmwareupdates andimage may allow an attacker totrack their progress. (*) Because firmware images are often multiple kilobytes, sometimes exceeding one hundred kilobytes, ingain control of the device. Keeping the code sizefor low end IoT devicesandeven several megabytes largecomplexity of a manifest parsers small is important for constrained IoTdevices running full-fledged operating systems like Linux,devices. Since theprotocol 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 offeredmanifest parsing code may also be used by theapplication, i.e.bootloader it is part of the trusted computing base. A manifest may not only be used to protect firmwareconsumer, running onimages but also configuration data such as network credentials or personalization data related to firmware or software. Personalization data demonstrates thedevice (exceptneed forbasic security algorithms that may run either on a trusted execution environmentmutually-distrustful delivery of two oronmore images into aseparate hardware security MCU/module) rather than bydevice. Personalization data is used with Trusted Execution Environments (TEEs), which benefit from a protocol for managing thebootloader itself. Once manifests have been processed and firmware images successfully downloadedlifecycle of trusted applications (TAs) running inside a TEE. TEEs may obtain TAs from different authors andverified the device needsthose TAs may require personalization data, such as payment information, tohand control overbe securely conveyed to thebootloader. In most cases this requires the MCUTEE. The TA's author does not want torestart. Onceexpose theMCU has initiated a restart,TA to thebootloader takes over controluser, anddetermines whether the newly downloaded firmware image should be executed. The boot process is security sensitive becausethefirmware images may, for example, be stored in off-chip flash memory giving attackers easy accessuser does not want to expose theimage for reverse engineering and potentially also for modifying the binary. The bootloader will therefore havepayment information toperform security checks onthe TA's author. 7. Securing Firmware Updates Using firmwareimage before it can be booted. Theseupdates to fix vulnerabilities in devices is important but securing this update mechanism is equally important since securitychecksproblems are exacerbated by thebootloader happenupdate mechanism: update is essentially authorized remote code execution, so any security problems inadditionthe update process expose that remote code execution system. Failure to secure the firmware update process will help attackers to take control over devices. End-to-end securitychecks that happened whenmechanisms are used to protect the firmware image and themanifest were downloaded.manifest. Themanifest may have been stored alongsidefollowing assumptions are made to allow the firmwareimageconsumer toallow re-verification ofverify the received firmware imageduring every boot attempt. Alternatively, secure boot-specific meta-data may have been created byand manifest before updating software: - Authentication ensures that theapplication after a successfuldevice can cryptographically identify the author(s) creating firmwaredownloadimages andverification process. Whethermanifests. Authenticated identities may be used as input tore-usethestandardized manifest format that was used duringauthorization process. Not all entities creating and signing manifests have theinitial firmware retrieval process orsame permissions. A device needs to determine whetheritthe requested action isbetter to use a different format forindeed covered by thesecure boot- specific meta-data depends onpermission of thesystem design. The manifest format does, however, haveparty that signed thecapability to servemanifest. Informing the device about the permissions of the different parties also happens in an out-of- band fashion and is alsoasabuilding block for secure boot with its severable elements that allow shrinking the sizeduty of themanifest by stripping elementsTrust Provisioning Authority. - Integrity protection ensures thatarenolonger needed. In orderthird party can modify the manifest or the firmware image. To accept an update, a device needs tosatisfyverify thereliability requirements defined in Section 3.5, devices must alwayssignature covering the manifest. There may beableone or multiple manifests that need toreturnbe validated, potentially signed by different parties. The device needs toa working firmware image. This has implications for the designbe in possession of thebootloader: Iftrust anchors to verify those signatures. Installing trust anchors to devices via thefirmware image containsTrust Provisioning Authority happens in an out-of-band fashion prior to the firmwareconsumer functionality, as described above, thenupdate process. - For confidentiality protection of thebootloaderfirmware image, it must beable to roll back todone in such aworkingway that the intended firmwareimage. Alternatively,consumer(s), other 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 thebootloader may have enough functionalityauthor needs tofetchbe in possession of the certificate/public key or afirmware image plus manifest frompre-shared key of a device. The use of confidentiality protection of firmwareserver over the Internet.images is optional. Amulti- stage bootloadermanifest specification must support different cryptographic algorithms and algorithm extensibility. Moreover, since RSA- and ECC-based signature schemes maysoften this requirement atbecome vulnerable to quantum- accelerated key extraction in theexpense of a more sophisticated boot process. For afuture, unchangeable bootloader code in ROM is recommended tooffer ause post-quantum secureboot mechanism it needs to provide the following features: - ability to access security algorithms,signature schemes such asSHA-256hash-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 tocomputekey extraction with quantum acceleration is approximately 2030, based on current research [quantum-factorization]. When afingerprint over thedevice obtains a monolithic firmware imageandfrom adigital signature algorithm. - access keying material directly or indirectly to utilizesingle author without any additional approval steps then thedigital signature. The device needsauthorization flow is relatively simple. There are, however, other cases where more complex policy decisions need tohavebe made before updating atrust anchor store. - ability to expose boot process-related data todevice. In this architecture theapplication firmware (such as toauthorization policy is separated from thedevice management software).underlying communication architecture. Thisallows a device management server to determine whetheris accomplished by separating thefirmware update has been successful and, if not, what errors occurred. -entities from their permissions. For example, an author may not have the authority to(optionally) offer attestation information (such as measurements). Whileinstall a firmware image on a device in critical infrastructure without thesoftware architectureauthorization of a device operator. In this case, thebootloader and its security mechanisms are implementation-specific, the manifest candevice may beusedprogrammed tocontrolreject firmware updates unless they are signed both by the firmwaredownload fromauthor and by theInternet in additiondevice operator. Alternatively, a device may trust precisely one entity, which does all permission management and coordination. This entity allows the device toaugmenting secure boot process. These building blocks are highly relevantoffload complex permissions calculations for thedesign of the manifest. 9.device. 8. Example Figure52 illustrates an example message flow for distributing a firmware image to adevice starting with an author uploading the new firmware to firmware server and creating a manifest.device. The firmware and manifest are stored on the same firmwareserver. This setup does not use a status trackerserver andthe firmware consumer component is therefore responsible for periodically checking whetherdistributed in anew firmware image is available for download.detached manner. +--------+ +-----------------++------------+ +----------+ | |+-----------------------------+ | | | Firmware Server | | IoT Device | | Author | |FirmwareStatus Tracker | | +------------+ +----------+ | +--------+ | Server | |Consumer| Firmware | |Bootloader|+--------+| | +-----------------+ | | Consumer | | | | | | | +------------+ +----------+ | | |+| | | | | | | +-----------------------+ | | 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 | | | |<-----------------------------| | | | | | | |TriggerReboot | | ||--------------->||----------------------------->| | | | | | | | | | | | | | |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 | | | |<-----------------------------| | | | . | | | | | | Figure5:2: First Example Flow for a FirmwareUpate.Update. Figure63 shows anexample 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. Theexchange that starts with thedevice interacting with the status tracker; the details of such exchange will vary with the different device management systems being used. In any case, thestatus trackerlearns about the firmware version of the devices it manages. In our example,querying the deviceunder management is usingfor its current firmwareversion A.B.C. At a later point in time the author uploadsversion. Later, a new firmwarealong with the manifest to the firmware serverversion becomes available and since this device is running an older version the statustracker, respectively. While there is no need to storetracker server interacts with the device to initiate an update. The manifest and the firmware are stored on different serversthis example shows a common pattern usedinthe industry. The status tracker may then automatically, based on human intervention or based on a more complex policy decide to informthis example. When the deviceabout the newly available firmware image. In our example, it does so by pushingprocesses the manifest it learns where to download the new firmwareconsumer.version. 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 | |Firmware ServerStatus Tracker | | | 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 | | |<-------------------------------------| | | | | | | | | | Figure6:3: Second Example Flow for a FirmwareUpate. 10.Update. 9. IANA Considerations This document does not require any actions by IANA.11.10. Security ConsiderationsFirmware updates fix security vulnerabilitiesThis document describes terminology, requirements andare considered to beanimportant building block in securing IoT devices. Due to the importance ofarchitecture for firmware updatesfor IoT devices the Internet Architecture Board (IAB) organized a 'Workshop on InternetofThings (IoT) Software Update (IOTSU)', which took place at Trinity College Dublin, Ireland on the 13th and 14thIoT devices. The content ofJune, 2016 to take a look atthebig picture. A report about this workshop can be found at [RFC8240]. A standardized firmware manifest format providing end-to- enddocument is thereby focused on improving securityfrom 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 scopeofthis document, namely - installingIoT devices via firmwareupdates in a robust fashion so that theupdatedoes not breakmechanisms and informs thedevice functionalitystandardization ofthe environment this device operates in. - installing firmware updates inatimely fashion considering the complexitymanifest format. An in-depth examination of thedecision making process of updating devices, potential re-certification requirements, and the need for user consent to install updates. - the distributionsecurity considerations of theactual firmware update, potentiallyarchitecture is presented inan 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.[I-D.ietf-suit-information-model]. 11. 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 We would also like to thank the WG chairs, Russ Housley, David Waltermire, Dave Thaler for their support and their reviews.13.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] Moran, B., Tschofenig, H., and H. Birkholz, "An Information Model for Firmware Updates in IoT Devices", draft-ietf-suit-information-model-07 (work in progress), June 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-09 (work in progress), July 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-12 (work in progress), July 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] 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 Requirements", RFC 6024, DOI 10.17487/RFC6024, October 2010, <https://www.rfc-editor.org/info/rfc6024>. [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>. [RFC7519] Jones, M., Bradley, J., and N. Sakimura, "JSON Web Token (JWT)", RFC 7519, DOI 10.17487/RFC7519, May 2015, <https://www.rfc-editor.org/info/rfc7519>. [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>. [RFC8392] Jones, M., Wahlstroem, E., Erdtman, S., and H. Tschofenig, "CBOR Web Token (CWT)", RFC 8392, DOI 10.17487/RFC8392, May 2018, <https://www.rfc-editor.org/info/rfc8392>. [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