idnits 2.17.00 (12 Aug 2021) /tmp/idnits32443/draft-ietf-suit-architecture-07.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == The document doesn't use any RFC 2119 keywords, yet seems to have RFC 2119 boilerplate text. == The document seems to contain a disclaimer for pre-RFC5378 work, but was first submitted on or after 10 November 2008. The disclaimer is usually necessary only for documents that revise or obsolete older RFCs, and that take significant amounts of text from those RFCs. If you can contact all authors of the source material and they are willing to grant the BCP78 rights to the IETF Trust, you can and should remove the disclaimer. Otherwise, the disclaimer is needed and you can ignore this comment. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (October 20, 2019) is 943 days in the past. Is this intentional? Checking references for intended status: Informational ---------------------------------------------------------------------------- -- Looks like a reference, but probably isn't: '1' on line 1295 == Unused Reference: 'RFC5649' is defined on line 1279, but no explicit reference was found in the text == Outdated reference: draft-ietf-cose-hash-sig has been published as RFC 8778 == Outdated reference: draft-ietf-suit-information-model has been published as RFC 9124 == Outdated reference: A later version (-17) exists of draft-ietf-teep-architecture-03 Summary: 0 errors (**), 0 flaws (~~), 7 warnings (==), 2 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 SUIT B. Moran 3 Internet-Draft Arm Limited 4 Intended status: Informational M. Meriac 5 Expires: April 22, 2020 Consultant 6 H. Tschofenig 7 Arm Limited 8 D. Brown 9 Linaro 10 October 20, 2019 12 A Firmware Update Architecture for Internet of Things Devices 13 draft-ietf-suit-architecture-07 15 Abstract 17 Vulnerabilities with Internet of Things (IoT) devices have raised the 18 need for a solid and secure firmware update mechanism that is also 19 suitable for constrained devices. Incorporating such update 20 mechanism to fix vulnerabilities, to update configuration settings as 21 well as adding new functionality is recommended by security experts. 23 This document lists requirements and describes an architecture for a 24 firmware update mechanism suitable for IoT devices. The architecture 25 is agnostic to the transport of the firmware images and associated 26 meta-data. 28 This version of the document assumes asymmetric cryptography and a 29 public key infrastructure. Future versions may also describe a 30 symmetric key approach for very constrained devices. 32 Status of This Memo 34 This Internet-Draft is submitted in full conformance with the 35 provisions of BCP 78 and BCP 79. 37 Internet-Drafts are working documents of the Internet Engineering 38 Task Force (IETF). Note that other groups may also distribute 39 working documents as Internet-Drafts. The list of current Internet- 40 Drafts is at http://datatracker.ietf.org/drafts/current/. 42 Internet-Drafts are draft documents valid for a maximum of six months 43 and may be updated, replaced, or obsoleted by other documents at any 44 time. It is inappropriate to use Internet-Drafts as reference 45 material or to cite them other than as "work in progress." 47 This Internet-Draft will expire on April 22, 2020. 49 Copyright Notice 51 Copyright (c) 2019 IETF Trust and the persons identified as the 52 document authors. All rights reserved. 54 This document is subject to BCP 78 and the IETF Trust's Legal 55 Provisions Relating to IETF Documents 56 (http://trustee.ietf.org/license-info) in effect on the date of 57 publication of this document. Please review these documents 58 carefully, as they describe your rights and restrictions with respect 59 to this document. Code Components extracted from this document must 60 include Simplified BSD License text as described in Section 4.e of 61 the Trust Legal Provisions and are provided without warranty as 62 described in the Simplified BSD License. 64 This document may contain material from IETF Documents or IETF 65 Contributions published or made publicly available before November 66 10, 2008. The person(s) controlling the copyright in some of this 67 material may not have granted the IETF Trust the right to allow 68 modifications of such material outside the IETF Standards Process. 69 Without obtaining an adequate license from the person(s) controlling 70 the copyright in such materials, this document may not be modified 71 outside the IETF Standards Process, and derivative works of it may 72 not be created outside the IETF Standards Process, except to format 73 it for publication as an RFC or to translate it into languages other 74 than English. 76 Table of Contents 78 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 79 2. Conventions and Terminology . . . . . . . . . . . . . . . . . 3 80 3. Requirements . . . . . . . . . . . . . . . . . . . . . . . . 7 81 3.1. Agnostic to how firmware images are distributed . . . . . 7 82 3.2. Friendly to broadcast delivery . . . . . . . . . . . . . 8 83 3.3. Use state-of-the-art security mechanisms . . . . . . . . 8 84 3.4. Rollback attacks must be prevented . . . . . . . . . . . 9 85 3.5. High reliability . . . . . . . . . . . . . . . . . . . . 9 86 3.6. Operate with a small bootloader . . . . . . . . . . . . . 9 87 3.7. Small Parsers . . . . . . . . . . . . . . . . . . . . . . 10 88 3.8. Minimal impact on existing firmware formats . . . . . . . 10 89 3.9. Robust permissions . . . . . . . . . . . . . . . . . . . 10 90 3.10. Operating modes . . . . . . . . . . . . . . . . . . . . . 11 91 3.11. Suitability to software and personalization data . . . . 12 92 4. Claims . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 93 5. Communication Architecture . . . . . . . . . . . . . . . . . 13 94 6. Manifest . . . . . . . . . . . . . . . . . . . . . . . . . . 17 95 7. Device Firmware Update Examples . . . . . . . . . . . . . . . 18 96 7.1. Single CPU SoC . . . . . . . . . . . . . . . . . . . . . 18 97 7.2. Single CPU with Secure - Normal Mode Partitioning . . . . 18 98 7.3. Dual CPU, shared memory . . . . . . . . . . . . . . . . . 18 99 7.4. Dual CPU, other bus . . . . . . . . . . . . . . . . . . . 18 100 8. Bootloader . . . . . . . . . . . . . . . . . . . . . . . . . 19 101 9. Example . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 102 10. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 25 103 11. Security Considerations . . . . . . . . . . . . . . . . . . . 25 104 12. Mailing List Information . . . . . . . . . . . . . . . . . . 26 105 13. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 26 106 14. References . . . . . . . . . . . . . . . . . . . . . . . . . 27 107 14.1. Normative References . . . . . . . . . . . . . . . . . . 27 108 14.2. Informative References . . . . . . . . . . . . . . . . . 27 109 14.3. URIs . . . . . . . . . . . . . . . . . . . . . . . . . . 28 111 1. Introduction 113 When developing IoT devices, one of the most difficult problems to 114 solve is how to update the firmware on the device. Once the device 115 is deployed, firmware updates play a critical part in its lifetime, 116 particularly when devices have a long lifetime, are deployed in 117 remote or inaccessible areas where manual intervention is cost 118 prohibitive or otherwise difficult. Updates to the firmware of an 119 IoT device are done to fix bugs in software, to add new 120 functionality, and to re-configure the device to work in new 121 environments or to behave differently in an already deployed context. 123 The firmware update process, among other goals, has to ensure that 125 - The firmware image is authenticated and integrity protected. 126 Attempts to flash a modified firmware image or an image from an 127 unknown source are prevented. 129 - The firmware image can be confidentiality protected so that 130 attempts by an adversary to recover the plaintext binary can be 131 prevented. Obtaining the firmware is often one of the first steps 132 to mount an attack since it gives the adversary valuable insights 133 into used software libraries, configuration settings and generic 134 functionality (even though reverse engineering the binary can be a 135 tedious process). 137 More details about the security goals are discussed in Section 5 and 138 requirements are described in Section 3. 140 2. Conventions and Terminology 142 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 143 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 144 "OPTIONAL" in this document are to be interpreted as described in RFC 145 2119 [RFC2119]. 147 This document uses the following terms: 149 - Manifest: The manifest contains meta-data about the firmware 150 image. The manifest is protected against modification and 151 provides information about the author. 153 - Firmware Image: The firmware image, or image, is a binary that may 154 contain the complete software of a device or a subset of it. The 155 firmware image may consist of multiple images, if the device 156 contains more than one microcontroller. Often it is also a 157 compressed archive that contains code, configuration data, and 158 even the entire file system. The image may consist of a 159 differential update for performance reasons. Firmware is the more 160 universal term. The terms, firmware image, firmware, and image, 161 are used in this document and are interchangeable. 163 - Bootloader: A bootloader is a piece of software that is executed 164 once a microcontroller has been reset. It is responsible for 165 deciding whether to boot a firmware image that is present or 166 whether to obtain and verify a new firmware image. Since the 167 bootloader is a security critical component its functionality may 168 be split into separate stages. Such a multi-stage bootloader may 169 offer very basic functionality in the first stage and resides in 170 ROM whereas the second stage may implement more complex 171 functionality and resides in flash memory so that it can be 172 updated in the future (in case bugs have been found). The exact 173 split of components into the different stages, the number of 174 firmware images stored by an IoT device, and the detailed 175 functionality varies throughout different implementations. A more 176 detailed discussion is provided in Section 8. 178 - Microcontroller (MCU for microcontroller unit): An MCU is a 179 compact integrated circuit designed for use in embedded systems. 180 A typical microcontroller includes a processor, memory (RAM and 181 flash), input/output (I/O) ports and other features connected via 182 some bus on a single chip. The term 'system on chip (SoC)' is 183 often used for these types of devices. 185 - System on Chip (SoC): An SoC is an integrated circuit that 186 integrates all components of a computer, such as CPU, memory, 187 input/output ports, secondary storage, etc. 189 - Homogeneous Storage Architecture (HoSA): A device that stores all 190 firmware components in the same way, for example in a file system 191 or in flash memory. 193 - Heterogeneous Storage Architecture (HeSA): A device that stores at 194 least one firmware component differently from the rest, for 195 example a device with an external, updatable radio, or a device 196 with internal and external flash memory. 198 - Trusted Execution Environments (TEEs): An execution environment 199 that runs alongside of, but is isolated from, an REE. 201 - Rich Execution Environment (REE): An environment that is provided 202 and governed by a typical OS (e.g., Linux, Windows, Android, iOS), 203 potentially in conjunction with other supporting operating systems 204 and hypervisors; it is outside of the TEE. This environment and 205 applications running on it are considered un-trusted. 207 - Trusted applications (TAs): An application component that runs in 208 a TEE. 210 For more information about TEEs see [I-D.ietf-teep-architecture]. 212 The following entities are used: 214 - Author: The author is the entity that creates the firmware image. 215 There may be multiple authors in a system either when a device 216 consists of multiple micro-controllers or when the the final 217 firmware image consists of software components from multiple 218 companies. 220 - Firmware Consumer: The firmware consumer is the recipient of the 221 firmware image and the manifest. It is responsible for parsing 222 and verifying the received manifest and for storing the obtained 223 firmware image. The firmware consumer plays the role of the 224 update component on the IoT device typically running in the 225 application firmware. It interacts with the firmware server and 226 with the status tracker, if present. 228 - (IoT) Device: A device refers to the entire IoT product, which 229 consists of one or many MCUs, sensors and/or actuators. Many IoT 230 devices sold today contain multiple MCUs and therefore a single 231 device may need to obtain more than one firmware image and 232 manifest to succesfully perform an update. The terms device and 233 firmware consumer are used interchangably since the firmware 234 consumer is one software component running on an MCU on the 235 device. 237 - Status Tracker: The status tracker offers device management 238 functionality to retrieve information about the installed firmware 239 on a device and other device characteristics (including free 240 memory and hardware components), to obtain the state of the 241 firmware update cycle the device is currently in, and to trigger 242 the update process. The deployment of status trackers is flexible 243 and they may be used as cloud-based servers, on-premise servers, 244 embedded in edge computing device (such as Internet access 245 gateways or protocol translation gateways), or even in smart 246 phones and tablets. While the IoT device itself runs the client- 247 side of the status tracker it will most likely not run a status 248 tracker itself unless it acts as a proxy for other IoT devices in 249 a protocol translation or edge computing device node. How much 250 functionality a status tracker includes depends on the selected 251 configuration of the device management functionality and the 252 communication environment it is used in. In a generic networking 253 environment the protocol used between the client and the server- 254 side of the status tracker need to deal with Internet 255 communication challenges involving firewall and NAT traversal. In 256 other cases, the communication interaction may be rather simple. 257 This architecture document does not impose requirements on the 258 status tracker. 260 - Firmware Server: The firmware server stores firmware images and 261 manifests and distributes them to IoT devices. Some deployments 262 may require a store-and-forward concept, which requires storing 263 the firmware images/manifests on more than one entity before 264 they reach the device. There is typically some interaction 265 between the firmware server and the status tracker but those 266 entities are often physically separated on different devices for 267 scalability reasons. 269 - Device Operator: The actor responsible for the day-to-day 270 operation of a fleet of IoT devices. 272 - Network Operator: The actor responsible for the operation of a 273 network to which IoT devices connect. 275 In addition to the entities in the list above there is an orthogonal 276 infrastructure with a Trust Provisioning Authority (TPA) distributing 277 trust anchors and authorization permissions to various entities in 278 the system. The TPA may also delegate rights to install, update, 279 enhance, or delete trust anchors and authorization permissions to 280 other parties in the system. This infrastructure overlaps the 281 communication architecture and different deployments may empower 282 certain entities while other deployments may not. For example, in 283 some cases, the Original Design Manufacturer (ODM), which is a 284 company that designs and manufactures a product, may act as a TPA and 285 may decide to remain in full control over the firmware update process 286 of their products. 288 The terms 'trust anchor' and 'trust anchor store' are defined in 289 [RFC6024]: 291 - "A trust anchor represents an authoritative entity via a public 292 key and associated data. The public key is used to verify digital 293 signatures, and the associated data is used to constrain the types 294 of information for which the trust anchor is authoritative." 296 - "A trust anchor store is a set of one or more trust anchors stored 297 in a device. A device may have more than one trust anchor store, 298 each of which may be used by one or more applications." A trust 299 anchor store must resist modification against unauthorized 300 insertion, deletion, and modification. 302 3. Requirements 304 The firmware update mechanism described in this specification was 305 designed with the following requirements in mind: 307 - Agnostic to how firmware images are distributed 309 - Friendly to broadcast delivery 311 - Use state-of-the-art security mechanisms 313 - Rollback attacks must be prevented 315 - High reliability 317 - Operate with a small bootloader 319 - Small Parsers 321 - Minimal impact on existing firmware formats 323 - Robust permissions 325 - Diverse modes of operation 327 - Suitability to software and personalization data 329 3.1. Agnostic to how firmware images are distributed 331 Firmware images can be conveyed to devices in a variety of ways, 332 including USB, UART, WiFi, BLE, low-power WAN technologies, etc. and 333 use different protocols (e.g., CoAP, HTTP). The specified mechanism 334 needs to be agnostic to the distribution of the firmware images and 335 manifests. 337 3.2. Friendly to broadcast delivery 339 This architecture does not specify any specific broadcast protocol. 340 However, given that broadcast may be desirable for some networks, 341 updates must cause the least disruption possible both in metadata and 342 firmware transmission. 344 For an update to be broadcast friendly, it cannot rely on link layer, 345 network layer, or transport layer security. A solution has to rely 346 on security protection applied to the manifest and firmware image 347 instead. In addition, the same manifest must be deliverable to many 348 devices, both those to which it applies and those to which it does 349 not, without a chance that the wrong device will accept the update. 350 Considerations that apply to network broadcasts apply equally to the 351 use of third-party content distribution networks for payload 352 distribution. 354 3.3. Use state-of-the-art security mechanisms 356 End-to-end security between the author and the device is shown in 357 Section 5. 359 Authentication ensures that the device can cryptographically identify 360 the author(s) creating firmware images and manifests. Authenticated 361 identities may be used as input to the authorization process. 363 Integrity protection ensures that no third party can modify the 364 manifest or the firmware image. 366 For confidentiality protection of the firmware image, it must be done 367 in such a way that every intended recipient can decrypt it. The 368 information that is encrypted individually for each device must 369 maintain friendliness to Content Distribution Networks, bulk storage, 370 and broadcast protocols. 372 A manifest specification must support different cryptographic 373 algorithms and algorithm extensibility. Because of the nature of 374 unchangeable code in ROM for use with bootloaders the use of post- 375 quantum secure signature mechanisms, such as hash-based signatures 376 [I-D.ietf-cose-hash-sig], are attractive because they maintain 377 security in presence of quantum computers. 379 A mandatory-to-implement set of algorithms has to be defined offering 380 a key length of 112-bit symmetric key or security or more, as 381 outlined in Section 20 of RFC 7925 [RFC7925]. This corresponds to a 382 233 bit ECC key or a 2048 bit RSA key. 384 3.4. Rollback attacks must be prevented 386 A device presented with an old, but valid manifest and firmware must 387 not be tricked into installing such firmware since a vulnerability in 388 the old firmware image may allow an attacker to gain control of the 389 device. 391 3.5. High reliability 393 A power failure at any time must not cause a failure of the device. 394 A failure to validate any part of an update must not cause a failure 395 of the device. One way to achieve this functionality is to provide a 396 minimum of two storage locations for firmware and one bootable 397 location for firmware. An alternative approach is to use a 2nd stage 398 bootloader with build-in full featured firmware update functionality 399 such that it is possible to return to the update process after power 400 down. 402 Note: This is an implementation requirement rather than a requirement 403 on the manifest format. 405 3.6. Operate with a small bootloader 407 Throughout this document we assume that the bootloader itself is 408 distinct from the role of the firmware consumer and therefore does 409 not manage the firmware update process. This may give the impression 410 that the bootloader itself is a completely separate component, which 411 is mainly responsible for selecting a firmware image to boot. 413 The overlap between the firmware update process and the bootloader 414 functionality comes in two forms, namely 416 - First, a bootloader must verify the firmware image it boots as 417 part of the secure boot process. Doing so requires meta-data to 418 be stored alongside the firmware image so that the bootloader can 419 cryptographically verify the firmware image before booting it to 420 ensure it has not been tampered with or replaced. This meta-data 421 used by the bootloader may well be the same manifest obtained with 422 the firmware image during the update process (with the severable 423 fields stripped off). 425 - Second, an IoT device needs a recovery strategy in case the 426 firmware update / boot process fails. The recovery strategy may 427 include storing two or more firmware images on the device or 428 offering the ability to have a second stage bootloader perform the 429 firmware update process again using firmware updates over serial, 430 USB or even wireless connectivity like a limited version of 431 Bluetooth Smart. In the latter case the firmware consumer 432 functionality is contained in the second stage bootloader and 433 requires the necessary functionality for executing the firmware 434 update process, including manifest parsing. 436 In general, it is assumed that the bootloader itself, or a minimal 437 part of it, will not be updated since a failed update of the 438 bootloader poses a risk in reliability. 440 All information necessary for a device to make a decision about the 441 installation of a firmware update must fit into the available RAM of 442 a constrained IoT device. This prevents flash write exhaustion. 443 This is typically not a difficult requirement to accomplish because 444 there are not other task/processing running while the bootloader is 445 active (unlike it may be the case when running the application 446 firmware). 448 Note: This is an implementation requirement. 450 3.7. Small Parsers 452 Since parsers are known sources of bugs they must be minimal. 453 Additionally, it must be easy to parse only those fields that are 454 required to validate at least one signature or MAC with minimal 455 exposure. 457 3.8. Minimal impact on existing firmware formats 459 The design of the firmware update mechanism must not require changes 460 to existing firmware formats. 462 3.9. Robust permissions 464 When a device obtains a monolithic firmware image from a single 465 author without any additional approval steps then the authorization 466 flow is relatively simple. There are, however, other cases where 467 more complex policy decisions need to be made before updating a 468 device. 470 In this architecture the authorization policy is separated from the 471 underlying communication architecture. This is accomplished by 472 separating the entities from their permissions. For example, an 473 author may not have the authority to install a firmware image on a 474 device in critical infrastructure without the authorization of a 475 device operator. In this case, the device may be programmed to 476 reject firmware updates unless they are signed both by the firmware 477 author and by the device operator. 479 Alternatively, a device may trust precisely one entity, which does 480 all permission management and coordination. This entity allows the 481 device to offload complex permissions calculations for the device. 483 3.10. Operating modes 485 There are three broad classifications of update operating modes. 487 - Client-initiated Update 489 - Server-initiated Update 491 - Hybrid Update 493 Client-initiated updates take the form of a firmware consumer on a 494 device proactively checking (polling) for new firmware images. 496 Server-initiated updates are important to consider because timing of 497 updates may need to be tightly controlled in some high- reliability 498 environments. In this case the status tracker determines what 499 devices qualify for a firmware update. Once those devices have been 500 selected the firmware server distributes updates to the firmware 501 consumers. 503 Note: This assumes that the status tracker is able to reach the 504 device, which may require devices to keep reachability information at 505 the status tracker up-to-date. This may also require keeping state 506 at NATs and stateful packet filtering firewalls alive. 508 Hybrid updates are those that require an interaction between the 509 firmware consumer and the status tracker. The status tracker pushes 510 notifications of availability of an update to the firmware consumer, 511 and it then downloads the image from a firmware server as soon as 512 possible. 514 An alternative view to the operating modes is to consider the steps a 515 device has to go through in the course of an update: 517 - Notification 519 - Pre-authorisation 521 - Dependency resolution 523 - Download 525 - Installation 526 The notification step consists of the status tracker informing the 527 firmware consumer that an update is available. This can be 528 accomplished via polling (client-initiated), push notifications 529 (server-initiated), or more complex mechanisms. 531 The pre-authorisation step involves verifying whether the entity 532 signing the manifest is indeed authorized to perform an update. The 533 firmware consumer must also determine whether it should fetch and 534 process a firmware image, which is referenced in a manifest. 536 A dependency resolution phase is needed when more than one component 537 can be updated or when a differential update is used. The necessary 538 dependencies must be available prior to installation. 540 The download step is the process of acquiring a local copy of the 541 firmware image. When the download is client-initiated, this means 542 that the firmware consumer chooses when a download occurs and 543 initiates the download process. When a download is server-initiated, 544 this means that the status tracker tells the device when to download 545 or that it initiates the transfer directly to the firmware consumer. 546 For example, a download from an HTTP-based firmware server is client- 547 initiated. Pushing a manifest and firmware image to the transfer to 548 the Package resource of the LwM2M Firmware Update object [LwM2M] is 549 server-initiated. 551 If the firmware consumer has downloaded a new firmware image and is 552 ready to install it, it may need to wait for a trigger from the 553 status tracker to initiate the installation, may trigger the update 554 automatically, or may go through a more complex decision making 555 process to determine the appropriate timing for an update (such as 556 delaying the update process to a later time when end users are less 557 impacted by the update process). 559 Installation is the act of processing the payload into a format that 560 the IoT device can recognise and the bootloader is responsible for 561 then booting from the newly installed firmware image. 563 Each of these steps may require different permissions. 565 3.11. Suitability to software and personalization data 567 The work on a standardized manifest format initially focused on the 568 most constrained IoT devices and those devices contain code put 569 together by a single author (although that author may obtain code 570 from other developers, some of it only in binary form). 572 Later it turns out that other use cases may benefit from a 573 standardized manifest format also for conveying software and even 574 personalization data alongside software. Trusted Execution 575 Environments (TEEs), for example, greatly benefit from a protocol for 576 managing the lifecycle of trusted applications (TAs) running inside a 577 TEE. TEEs may obtain TAs from different authors and those TAs may 578 require personalization data, such as payment information, to be 579 securely conveyed to the TEE. 581 To support this wider range of use cases the manifest format should 582 therefore be extensible to convey other forms of payloads as well. 584 4. Claims 586 Claims in the manifest offer a way to convey instructions to a device 587 that impact the firmware update process. To have any value the 588 manifest containing those claims must be authenticated and integrity 589 protected. The credential used must be directly or indirectly 590 related to the trust anchor installed at the device by the Trust 591 Provisioning Authority. 593 The baseline claims for all manifests are described in 594 [I-D.ietf-suit-information-model]. For example, there are: 596 - Do not install firmware with earlier metadata than the current 597 metadata. 599 - Only install firmware with a matching vendor, model, hardware 600 revision, software version, etc. 602 - Only install firmware that is before its best-before timestamp. 604 - Only allow a firmware installation if dependencies have been met. 606 - Choose the mechanism to install the firmware, based on the type of 607 firmware it is. 609 5. Communication Architecture 611 Figure 1 shows the communication architecture where a firmware image 612 is created by an author, and uploaded to a firmware server. The 613 firmware image/manifest is distributed to the device either in a push 614 or pull manner using the firmware consumer residing on the device. 615 The device operator keeps track of the process using the status 616 tracker. This allows the device operator to know and control what 617 devices have received an update and which of them are still pending 618 an update. 620 Firmware + +----------+ Firmware + +-----------+ 621 Manifest | |-+ Manifest | |-+ 622 +--------->| Firmware | |<---------------| | | 623 | | Server | | | Author | | 624 | | | | | | | 625 | +----------+ | +-----------+ | 626 | +----------+ +-----------+ 627 | 628 | 629 | 630 -+-- ------ 631 ---- | ---- ---- ---- 632 // | \\ // \\ 633 / | \ / \ 634 / | \ / \ 635 / | \ / \ 636 / | \ / \ 637 | v | | | 638 | +------------+ | 639 | | Firmware | | | | 640 | | Consumer | | Device | +--------+ | 641 | +------------+ | Management| | | | 642 | | |<------------------------->| Status | | 643 | | Device | | | | Tracker| | 644 | +------------+ | || | | | 645 | | || +--------+ | 646 | | | | 647 | | \ / 648 \ / \ / 649 \ / \ Device / 650 \ Network / \ Operator / 651 \ Operator / \\ // 652 \\ // ---- ---- 653 ---- ---- ------ 654 ----- 656 Figure 1: Architecture. 658 End-to-end security mechanisms are used to protect the firmware image 659 and the manifest although Figure 2 does not show the manifest itself 660 since it may be distributed independently. 662 +-----------+ 663 +--------+ | | +--------+ 664 | | Firmware Image | Firmware | Firmware Image | | 665 | Device |<-----------------| Server |<------------------| Author | 666 | | | | | | 667 +--------+ +-----------+ +--------+ 668 ^ * 669 * * 670 ************************************************************ 671 End-to-End Security 673 Figure 2: End-to-End Security. 675 Whether the firmware image and the manifest is pushed to the device 676 or fetched by the device is a deployment specific decision. 678 The following assumptions are made to allow the firmware consumer to 679 verify the received firmware image and manifest before updating 680 software: 682 - To accept an update, a device needs to verify the signature 683 covering the manifest. There may be one or multiple manifests 684 that need to be validated, potentially signed by different 685 parties. The device needs to be in possession of the trust 686 anchors to verify those signatures. Installing trust anchors to 687 devices via the Trust Provisioning Authority happens in an out-of- 688 band fashion prior to the firmware update process. 690 - Not all entities creating and signing manifests have the same 691 permissions. A device needs to determine whether the requested 692 action is indeed covered by the permission of the party that 693 signed the manifest. Informing the device about the permissions 694 of the different parties also happens in an out-of-band fashion 695 and is also a duty of the Trust Provisioning Authority. 697 - For confidentiality protection of firmware images the author needs 698 to be in possession of the certificate/public key or a pre-shared 699 key of a device. The use of confidentiality protection of 700 firmware images is deployment specific. 702 There are different types of delivery modes, which are illustrated 703 based on examples below. 705 There is an option for embedding a firmware image into a manifest. 706 This is a useful approach for deployments where devices are not 707 connected to the Internet and cannot contact a dedicated firmware 708 server for the firmware download. It is also applicable when the 709 firmware update happens via a USB stick or via Bluetooth Smart. 710 Figure 3 shows this delivery mode graphically. 712 /------------\ /------------\ 713 /Manifest with \ /Manifest with \ 714 |attached | |attached | 715 \firmware image/ \firmware image/ 716 \------------/ +-----------+ \------------/ 717 +--------+ | | +--------+ 718 | |<.................| Firmware |<................| | 719 | Device | | Server | | Author | 720 | | | | | | 721 +--------+ +-----------+ +--------+ 723 Figure 3: Manifest with attached firmware. 725 Figure 4 shows an option for remotely updating a device where the 726 device fetches the firmware image from some file server. The 727 manifest itself is delivered independently and provides information 728 about the firmware image(s) to download. 730 /--------\ /--------\ 731 / \ / \ 732 | Manifest | | Manifest | 733 \ / \ / 734 \--------/ \--------/ 735 +-----------+ 736 +--------+ | | +--------+ 737 | |<.................| Status |................>| | 738 | Device | | Tracker | -- | Author | 739 | |<- | | --- | | 740 +--------+ -- +-----------+ --- +--------+ 741 -- --- 742 --- --- 743 -- +-----------+ -- 744 -- | | -- 745 /------------\ -- | Firmware |<- /------------\ 746 / \ -- | Server | / \ 747 | Firmware | | | | Firmware | 748 \ / +-----------+ \ / 749 \------------/ \------------/ 751 Figure 4: Independent retrieval of the firmware image. 753 This architecture does not mandate a specific delivery mode but a 754 solution must support both types. 756 6. Manifest 758 In order for a device to apply an update, it has to make several 759 decisions about the update: 761 - Does it trust the author of the update? 763 - Has the firmware been corrupted? 765 - Does the firmware update apply to this device? 767 - Is the update older than the active firmware? 769 - When should the device apply the update? 771 - How should the device apply the update? 773 - What kind of firmware binary is it? 775 - Where should the update be obtained? 777 - Where should the firmware be stored? 779 The manifest encodes the information that devices need in order to 780 make these decisions. It is a data structure that contains the 781 following information: 783 - information about the device(s) the firmware image is intended to 784 be applied to, 786 - information about when the firmware update has to be applied, 788 - information about when the manifest was created, 790 - dependencies on other manifests, 792 - pointers to the firmware image and information about the format, 794 - information about where to store the firmware image, 796 - cryptographic information, such as digital signatures or message 797 authentication codes (MACs). 799 The manifest information model is described in 800 [I-D.ietf-suit-information-model]. 802 7. Device Firmware Update Examples 804 Although these documents attempt to define a firmware update 805 architecture that is applicable to both existing systems, as well as 806 yet-to-be-conceived systems; it is still helpful to consider existing 807 architectures. 809 7.1. Single CPU SoC 811 The simplest, and currently most common, architecture consists of a 812 single MCU along with its own peripherals. These SoCs generally 813 contain some amount of flash memory for code and fixed data, as well 814 as RAM for working storage. These systems either have a single 815 firmware image, or an immutable bootloader that runs a single image. 816 A notable characteristic of these SoCs is that the primary code is 817 generally execute in place (XIP). Combined with the non-relocatable 818 nature of the code, firmware updates need to be done in place. 820 7.2. Single CPU with Secure - Normal Mode Partitioning 822 Another configuration consists of a similar architecture to the 823 previous, with a single CPU. However, this CPU supports a security 824 partitioning scheme that allows memory (in addition to other things) 825 to be divided into secure and normal mode. There will generally be 826 two images, one for secure mode, and one for normal mode. In this 827 configuration, firmware upgrades will generally be done by the CPU in 828 secure mode, which is able to write to both areas of the flash 829 device. In addition, there are requirements to be able to update 830 either image independently, as well as to update them together 831 atomically, as specified in the associated manifests. 833 7.3. Dual CPU, shared memory 835 This configuration has two or more CPUs in a single SoC that share 836 memory (flash and RAM). Generally, they will be a protection 837 mechanism to prevent one CPU from accessing the other's memory. 838 Upgrades in this case will typically be done by one of the CPUs, and 839 is similar to the single CPU with secure mode. 841 7.4. Dual CPU, other bus 843 This configuration has two or more CPUs, each having their own 844 memory. There will be a communication channel between them, but it 845 will be used as a peripheral, not via shared memory. In this case, 846 each CPU will have to be responsible for its own firmware upgrade. 847 It is likely that one of the CPUs will be considered a master, and 848 will direct the other CPU to do the upgrade. This configuration is 849 commonly used to offload specific work to other CPUs. Firmware 850 dependencies are similar to the other solutions above, sometimes 851 allowing only one image to be upgraded, other times requiring several 852 to be upgraded atomically. Because the updates are happening on 853 multiple CPUs, upgrading the two images atomically is challenging. 855 8. Bootloader 857 More devices today than ever before are being connected to the 858 Internet, which drives the need for firmware updates to be provided 859 over the Internet rather than through traditional interfaces, such as 860 USB or RS232. Updating a device over the Internet requires the 861 device to fetch not only the firmware image but also the manifest. 862 Hence, the following building blocks are necessary for a firmware 863 update solution: 865 - the Internet protocol stack for firmware downloads (*), 867 - the capability to write the received firmware image to persistent 868 storage (most likely flash memory) prior to performing the update, 870 - the ability to unpack, decompress or otherwise process the 871 received firmware image, 873 - the features to verify an image and a manifest, including digital 874 signature verification or checking a message authentication code, 876 - a manifest parsing library, and 878 - integration of the device into a device management server to 879 perform automatic firmware updates and to track their progress. 881 (*) Because firmware images are often multiple kilobytes, sometimes 882 exceeding one hundred kilobytes, in size for low end IoT devices and 883 even several megabytes large for IoT devices running full-fletched 884 operating systems like Linux the protocol mechanism for retrieving 885 these images needs to offer features like congestion control, flow 886 control, fragmentation and reassembly, and mechanisms to resume 887 interrupted or corrupted transfers. 889 All these features are most likely offered by the application, i.e. 890 firmware consumer, running on the device (except for basic security 891 algorithms that may run either on a trusted execution environment or 892 on a separate hardware security MCU/module) rather than by the 893 bootloader itself. 895 Once manifests have been processed and firmware images successfully 896 downloaded and verified the device needs to hand control over to the 897 bootloader. In most cases this requires the MCU to restart. Once 898 the MCU has initiated a restart, the bootloader takes over control 899 and determines whether the newly downloaded firmware image should be 900 executed. 902 The boot process is security sensitive because the firmware images 903 may, for example, be stored in off-chip flash memory giving attackers 904 easy access to the image for reverse engineering and potentially also 905 for modifying the binary. The bootloader will therefore have to 906 perform security checks on the firmware image before it can be 907 booted. These security checks by the bootloader happen in addition 908 to the security checks that happened when the firmware image and the 909 manifest were downloaded. 911 The manifest may have been stored alongside the firmware image to 912 allow re-verification of the firmware image during every boot 913 attempt. Alternatively, secure boot-specific meta-data may have been 914 created by the application after a successful firmware download and 915 verification process. Whether to re-use the standardized manifest 916 format that was used during the initial firmware retrieval process or 917 whether it is better to use a different format for the secure boot- 918 specific meta-data depends on the system design. The manifest format 919 does, however, have the capability to serve also as a building block 920 for secure boot with its severable elements that allow shrinking the 921 size of the manifest by stripping elements that are no longer needed. 923 If the application image contains the firmware consumer 924 functionality, as described above, then it is necessary that a 925 working image is left on the device. This allows the bootloader to 926 roll back to a working firmware image to execute a firmware download 927 if the bootloader itself does not have enough functionality to fetch 928 a firmware image plus manifest from a firmware server over the 929 Internet. A multi-stage bootloader may soften this requirement at 930 the expense of a more sophisticated boot process. 932 For a bootloader to offer a secure boot mechanism it needs to provide 933 the following features: 935 - ability to access security algorithms, such as SHA-256 to compute 936 a fingerprint over the firmware image and a digital signature 937 algorithm. 939 - access keying material directly or indirectly to utilize the 940 digital signature. The device needs to have a trust anchor store. 942 - ability to expose boot process-related data to the application 943 firmware (such as to the device management software). This allows 944 a device management server to determine whether the firmware 945 update has been successful and, if not, what errors occurred. 947 - to (optionally) offer attestation information (such as 948 measurements). 950 While the software architecture of the bootloader and its security 951 mechanisms are implementation-specific, the manifest can be used to 952 control the firmware download from the Internet in addition to 953 augmenting secure boot process. These building blocks are highly 954 relevant for the design of the manifest. 956 9. Example 958 Figure 5 illustrates an example message flow for distributing a 959 firmware image to a device starting with an author uploading the new 960 firmware to firmware server and creating a manifest. The firmware 961 and manifest are stored on the same firmware server. This setup does 962 not use a status tracker and the firmware consumer component is 963 therefore responsible for periodically checking whether a new 964 firmware image is available for download. 966 +--------+ +-----------------+ +------------+ +----------+ 967 | | | | | Firmware | | | 968 | Author | | Firmware Server | | Consumer | |Bootloader| 969 +--------+ +-----------------+ +------------+ +----------+ 970 | | | + 971 | Create Firmware | | | 972 |--------------+ | | | 973 | | | | | 974 |<-------------+ | | | 975 | | | | 976 | Upload Firmware | | | 977 |------------------>| | | 978 | | | | 979 | Create Manifest | | | 980 |---------------+ | | | 981 | | | | | 982 |<--------------+ | | | 983 | | | | 984 | Sign Manifest | | | 985 |-------------+ | | | 986 | | | | | 987 |<------------+ | | | 988 | | | | 989 | Upload Manifest | | | 990 |------------------>| | | 991 | | | | 992 | | Query Manifest | | 993 | |<--------------------| | 994 | | | | 995 | | Send Manifest | | 996 | |-------------------->| | 997 | | | Validate | 998 | | | Manifest | 999 | | |---------+ | 1000 | | | | | 1001 | | |<--------+ | 1002 | | | | 1003 | | Request Firmware | | 1004 | |<--------------------| | 1005 | | | | 1006 | | Send Firmware | | 1007 | |-------------------->| | 1008 | | | Verify | 1009 | | | Firmware | 1010 | | |--------------+ | 1011 | | | | | 1012 | | |<-------------+ | 1013 | | | | 1014 | | | Store | 1015 | | | Firmware | 1016 | | |-------------+ | 1017 | | | | | 1018 | | |<------------+ | 1019 | | | | 1020 | | | | 1021 | | | Trigger Reboot | 1022 | | |--------------->| 1023 | | | | 1024 | | | | 1025 | | +---+----------------+--+ 1026 | | S| | | | 1027 | | E| | Verify | | 1028 | | C| | Firmware | | 1029 | | U| | +--------------| | 1030 | | R| | | | | 1031 | | E| | +------------->| | 1032 | | | | | | 1033 | | B| | Activate new | | 1034 | | O| | Firmware | | 1035 | | O| | +--------------| | 1036 | | T| | | | | 1037 | | | | +------------->| | 1038 | | P| | | | 1039 | | R| | Boot new | | 1040 | | O| | Firmware | | 1041 | | C| | +--------------| | 1042 | | E| | | | | 1043 | | S| | +------------->| | 1044 | | S| | | | 1045 | | +---+----------------+--+ 1046 | | | | 1048 Figure 5: First Example Flow for a Firmware Upate. 1050 Figure 6 shows an example follow with the device using a status 1051 tracker. For editorial reasons the author publishing the manifest at 1052 the status tracker and the firmware image at the firmware server is 1053 not shown. Also omitted is the secure boot process following the 1054 successful firmware update process. 1056 The exchange starts with the device interacting with the status 1057 tracker; the details of such exchange will vary with the different 1058 device management systems being used. In any case, the status 1059 tracker learns about the firmware version of the devices it manages. 1060 In our example, the device under management is using firmware version 1061 A.B.C. At a later point in time the author uploads a new firmware 1062 along with the manifest to the firmware server and the status 1063 tracker, respectively. While there is no need to store the manifest 1064 and the firmware on different servers this example shows a common 1065 pattern used in the industry. The status tracker may then 1066 automatically, based on human intervention or based on a more complex 1067 policy decide to inform the device about the newly available firmware 1068 image. In our example, it does so by pushing the manifest to the 1069 firmware consumer. The firmware consumer downloads the firmware 1070 image with the newer version X.Y.Z after successful validation of the 1071 manifest. Subsequently, a reboot is initiated and the secure boot 1072 process starts. 1074 +---------+ +-----------------+ +-----------------------------+ 1075 | Status | | | | +------------+ +----------+ | 1076 | Tracker | | Firmware Server | | | Firmware | |Bootloader| | 1077 | | | | | | Consumer | | | | 1078 +---------+ +-----------------+ | +------------+ +----------+ | 1079 | | | | IoT Device | | 1080 | | `'''''''''''''''''''''''''''' 1081 | | | | 1082 | Query Firmware Version | | 1083 |------------------------------------->| | 1084 | Firmware Version A.B.C | | 1085 |<-------------------------------------| | 1086 | | | | 1087 | <> | | 1088 | | | | 1089 _,...._ _,...._ | | 1090 ,' `. ,' `. | | 1092 | New | | New | | | 1093 \ Manifest / \ Firmware / | | 1094 `.._ _,,' `.._ _,,' | | 1095 `'' `'' | | 1096 | Push manifest | | 1097 |----------------+-------------------->| | 1098 | | | | 1099 | ' | ' 1100 | | | Validate | 1101 | | | Manifest | 1102 | | |---------+ | 1103 | | | | | 1104 | | |<--------+ | 1105 | | Request firmware | | 1106 | | X.Y.Z | | 1107 | |<--------------------| | 1108 | | | | 1109 | | Firmware X.Y.Z | | 1110 | |-------------------->| | 1111 | | | | 1112 | | | Verify | 1113 | | | Firmware | 1114 | | |--------------+ | 1115 | | | | | 1116 | | |<-------------+ | 1117 | | | | 1118 | | | Store | 1119 | | | Firmware | 1120 | | |-------------+ | 1121 | | | | | 1122 | | |<------------+ | 1123 | | | | 1124 | | | | 1125 | | | Trigger Reboot | 1126 | | |--------------->| 1127 | | | | 1128 | | | | 1129 | | | __..-------..._' 1130 | | ,-' `-. 1131 | | | Secure Boot | 1132 | | `-. _/ 1133 | | |`--..._____,,.,-' 1134 | | | | 1136 Figure 6: Second Example Flow for a Firmware Upate. 1138 10. IANA Considerations 1140 This document does not require any actions by IANA. 1142 11. Security Considerations 1144 Firmware updates fix security vulnerabilities and are considered to 1145 be an important building block in securing IoT devices. Due to the 1146 importance of firmware updates for IoT devices the Internet 1147 Architecture Board (IAB) organized a 'Workshop on Internet of Things 1148 (IoT) Software Update (IOTSU)', which took place at Trinity College 1149 Dublin, Ireland on the 13th and 14th of June, 2016 to take a look at 1150 the big picture. A report about this workshop can be found at 1151 [RFC8240]. A standardized firmware manifest format providing end-to- 1152 end security from the author to the device will be specified in a 1153 separate document. 1155 There are, however, many other considerations raised during the 1156 workshop. Many of them are outside the scope of standardization 1157 organizations since they fall into the realm of product engineering, 1158 regulatory frameworks, and business models. The following 1159 considerations are outside the scope of this document, namely 1161 - installing firmware updates in a robust fashion so that the update 1162 does not break the device functionality of the environment this 1163 device operates in. 1165 - installing firmware updates in a timely fashion considering the 1166 complexity of the decision making process of updating devices, 1167 potential re-certification requirements, and the need for user 1168 consent to install updates. 1170 - the distribution of the actual firmware update, potentially in an 1171 efficient manner to a large number of devices without human 1172 involvement. 1174 - energy efficiency and battery lifetime considerations. 1176 - key management required for verifying the digital signature 1177 protecting the manifest. 1179 - incentives for manufacturers to offer a firmware update mechanism 1180 as part of their IoT products. 1182 12. Mailing List Information 1184 The discussion list for this document is located at the e-mail 1185 address suit@ietf.org [1]. Information on the group and information 1186 on how to subscribe to the list is at 1187 https://www1.ietf.org/mailman/listinfo/suit 1189 Archives of the list can be found at: https://www.ietf.org/mail- 1190 archive/web/suit/current/index.html 1192 13. Acknowledgements 1194 We would like to thank the following persons for their feedback: 1196 - Geraint Luff 1198 - Amyas Phillips 1200 - Dan Ros 1202 - Thomas Eichinger 1204 - Michael Richardson 1206 - Emmanuel Baccelli 1208 - Ned Smith 1210 - Jim Schaad 1212 - Carsten Bormann 1214 - Cullen Jennings 1216 - Olaf Bergmann 1218 - Suhas Nandakumar 1220 - Phillip Hallam-Baker 1222 - Marti Bolivar 1224 - Andrzej Puzdrowski 1226 - Markus Gueller 1228 - Henk Birkholz 1229 - Jintao Zhu 1231 - Takeshi Takahashi 1233 - Jacob Beningo 1235 - Kathleen Moriarty 1237 We would also like to thank the WG chairs, Russ Housley, David 1238 Waltermire, Dave Thaler for their support and their reviews. 1240 14. References 1242 14.1. Normative References 1244 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1245 Requirement Levels", BCP 14, RFC 2119, March 1997. 1247 [RFC7925] Tschofenig, H., Ed. and T. Fossati, "Transport Layer 1248 Security (TLS) / Datagram Transport Layer Security (DTLS) 1249 Profiles for the Internet of Things", RFC 7925, DOI 1250 10.17487/RFC7925, July 2016, . 1253 14.2. Informative References 1255 [I-D.ietf-cose-hash-sig] 1256 Housley, R., "Use of the HSS/LMS Hash-based Signature 1257 Algorithm with CBOR Object Signing and Encryption (COSE)", 1258 draft-ietf-cose-hash-sig-04 (work in progress), October 1259 2019. 1261 [I-D.ietf-suit-information-model] 1262 Moran, B., Tschofenig, H., and H. Birkholz, "Firmware 1263 Updates for Internet of Things Devices - An Information 1264 Model for Manifests", draft-ietf-suit-information-model-03 1265 (work in progress), July 2019. 1267 [I-D.ietf-teep-architecture] 1268 Pei, M., Tschofenig, H., Wheeler, D., Atyeo, A., and D. 1269 Liu, "Trusted Execution Environment Provisioning (TEEP) 1270 Architecture", draft-ietf-teep-architecture-03 (work in 1271 progress), July 2019. 1273 [LwM2M] OMA, ., "Lightweight Machine to Machine Technical 1274 Specification, Version 1.0.2", February 2018, 1275 . 1279 [RFC5649] Housley, R. and M. Dworkin, "Advanced Encryption Standard 1280 (AES) Key Wrap with Padding Algorithm", RFC 5649, DOI 1281 10.17487/RFC5649, September 2009, . 1284 [RFC6024] Reddy, R. and C. Wallace, "Trust Anchor Management 1285 Requirements", RFC 6024, DOI 10.17487/RFC6024, October 1286 2010, . 1288 [RFC8240] Tschofenig, H. and S. Farrell, "Report from the Internet 1289 of Things Software Update (IoTSU) Workshop 2016", RFC 1290 8240, DOI 10.17487/RFC8240, September 2017, 1291 . 1293 14.3. URIs 1295 [1] mailto:suit@ietf.org 1297 Authors' Addresses 1299 Brendan Moran 1300 Arm Limited 1302 EMail: Brendan.Moran@arm.com 1304 Milosch Meriac 1305 Consultant 1307 EMail: milosch@meriac.com 1309 Hannes Tschofenig 1310 Arm Limited 1312 EMail: hannes.tschofenig@arm.com 1314 David Brown 1315 Linaro 1317 EMail: david.brown@linaro.org