idnits 2.17.1 draft-ietf-suit-architecture-06.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 (September 13, 2019) is 1686 days in the past. Is this intentional? Checking references for intended status: Informational ---------------------------------------------------------------------------- -- Looks like a reference, but probably isn't: '1' on line 1268 == Outdated reference: A later version (-13) exists of draft-ietf-suit-information-model-03 == Outdated reference: A later version (-19) exists of draft-ietf-teep-architecture-03 Summary: 0 errors (**), 0 flaws (~~), 5 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: March 16, 2020 Consultant 6 H. Tschofenig 7 Arm Limited 8 D. Brown 9 Linaro 10 September 13, 2019 12 A Firmware Update Architecture for Internet of Things Devices 13 draft-ietf-suit-architecture-06 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 March 16, 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 . . . . . . . . . . . 8 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 . . . . . . . . . . . . . . . . . . . . . 10 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 . . . . . . . . . . . . . . . . . . . . . 24 103 11. Security Considerations . . . . . . . . . . . . . . . . . . . 24 104 12. Mailing List Information . . . . . . . . . . . . . . . . . . 25 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 is a binary that may contain 154 the complete software of a device or a subset of it. The firmware 155 image may consist of multiple images, if the device contains more 156 than one microcontroller. The image may consist of a differential 157 update for performance reasons. Firmware is the more universal 158 term. Both terms are used in this document and are 159 interchangeable. 161 - Bootloader: A bootloader is a piece of software that is executed 162 once a microcontroller has been reset. It is responsible for 163 deciding whether to boot a firmware image that is present or 164 whether to obtain and verify a new firmware image. Since the 165 bootloader is a security critical component its functionality may 166 be split into separate stages. Such a multi-stage bootloader may 167 offer very basic functionality in the first stage and resides in 168 ROM whereas the second stage may implement more complex 169 functionality and resides in flash memory so that it can be 170 updated in the future (in case bugs have been found). The exact 171 split of components into the different stages, the number of 172 firmware images stored by an IoT device, and the detailed 173 functionality varies throughout different implementations. A more 174 detailed discussion is provided in Section 8. 176 - Microcontroller (MCU for microcontroller unit): An MCU is a 177 compact integrated circuit designed for use in embedded systems. 178 A typical microcontroller includes a processor, memory (RAM and 179 flash), input/output (I/O) ports and other features connected via 180 some bus on a single chip. The term 'system on chip (SoC)' is 181 often used for these types of devices. 183 - System on Chip (SoC): An SoC is an integrated circuit that 184 integrates all components of a computer, such as CPU, memory, 185 input/output ports, secondary storage, etc. 187 - Homogeneous Storage Architecture (HoSA): A device that stores all 188 firmware components in the same way, for example in a file system 189 or in flash memory. 191 - Heterogeneous Storage Architecture (HeSA): A device that stores at 192 least one firmware component differently from the rest, for 193 example a device with an external, updatable radio, or a device 194 with internal and external flash memory. 196 - Trusted Execution Environments (TEEs): An execution environment 197 that runs alongside of, but is isolated from, an REE. 199 - Rich Execution Environment (REE): An environment that is provided 200 and governed by a typical OS (e.g., Linux, Windows, Android, iOS), 201 potentially in conjunction with other supporting operating systems 202 and hypervisors; it is outside of the TEE. This environment and 203 applications running on it are considered un-trusted. 205 - Trusted applications (TAs): An application component that runs in 206 a TEE. 208 For more information about TEEs see [I-D.ietf-teep-architecture]. 210 The following entities are used: 212 - Author: The author is the entity that creates the firmware image. 213 There may be multiple authors in a system either when a device 214 consists of multiple micro-controllers or when the the final 215 firmware image consists of software components from multiple 216 companies. 218 - Firmware Consumer: The firmware consumer is the recipient of the 219 firmware image and the manifest. It is responsible for parsing 220 and verifying the received manifest and for storing the obtained 221 firmware image. The firmware consumer plays the role of the 222 update component on the IoT device typically running in the 223 application firmware. It interacts with the firmware server and 224 with the status tracker, if present. 226 - (IoT) Device: A device refers to the entire IoT product, which 227 consists of one or many MCUs, sensors and/or actuators. Many IoT 228 devices sold today contain multiple MCUs and therefore a single 229 device may need to obtain more than one firmware image and 230 manifest to succesfully perform an update. The terms device and 231 firmware consumer are used interchangably since the firmware 232 consumer is one software component running on an MCU on the 233 device. 235 - Status Tracker: The status tracker offers device management 236 functionality to retrieve information about the installed firmware 237 on a device and other device characteristics (including free 238 memory and hardware components), to obtain the state of the 239 firmware update cycle the device is currently in, and to trigger 240 the update process. The deployment of status trackers is flexible 241 and they may be used as cloud-based servers, on-premise servers, 242 embedded in edge computing device (such as Internet access 243 gateways or protocol translation gateways), or even in smart 244 phones and tablets. While the IoT device itself runs the client- 245 side of the status tracker it will most likely not run a status 246 tracker itself unless it acts as a proxy for other IoT devices in 247 a protocol translation or edge computing device node. How much 248 functionality a status tracker includes depends on the selected 249 configuration of the device management functionality and the 250 communication environment it is used in. In a generic networking 251 environment the protocol used between the client and the server- 252 side of the status tracker need to deal with Internet 253 communication challenges involving firewall and NAT traversal. In 254 other cases, the communication interaction may be rather simple. 255 This architecture document does not impose requirements on the 256 status tracker. 258 - Firmware Server: The firmware server stores firmware images and 259 manifests and distributes them to IoT devices. Some deployments 260 may require a store-and-forward concept, which requires storing 261 the firmware images/manifests on more than one entity before 262 they reach the device. There is typically some interaction 263 between the firmware server and the status tracker but those 264 entities are often physically separated on different devices for 265 scalability reasons. 267 - Device Operator: The actor responsible for the day-to-day 268 operation of a fleet of IoT devices. 270 - Network Operator: The actor responsible for the operation of a 271 network to which IoT devices connect. 273 In addition to the entities in the list above there is an orthogonal 274 infrastructure with a Trust Provisioning Authority (TPA) distributing 275 trust anchors and authorization permissions to various entities in 276 the system. The TPA may also delegate rights to install, update, 277 enhance, or delete trust anchors and authorization permissions to 278 other parties in the system. This infrastructure overlaps the 279 communication architecture and different deployments may empower 280 certain entities while other deployments may not. For example, in 281 some cases, the Original Design Manufacturer (ODM), which is a 282 company that designs and manufactures a product, may act as a TPA and 283 may decide to remain in full control over the firmware update process 284 of their products. 286 The terms 'trust anchor' and 'trust anchor store' are defined in 287 [RFC6024]: 289 - "A trust anchor represents an authoritative entity via a public 290 key and associated data. The public key is used to verify digital 291 signatures, and the associated data is used to constrain the types 292 of information for which the trust anchor is authoritative." 294 - "A trust anchor store is a set of one or more trust anchors stored 295 in a device. A device may have more than one trust anchor store, 296 each of which may be used by one or more applications." A trust 297 anchor store must resist modification against unauthorized 298 insertion, deletion, and modification. 300 3. Requirements 302 The firmware update mechanism described in this specification was 303 designed with the following requirements in mind: 305 - Agnostic to how firmware images are distributed 307 - Friendly to broadcast delivery 309 - Use state-of-the-art security mechanisms 311 - Rollback attacks must be prevented 313 - High reliability 315 - Operate with a small bootloader 317 - Small Parsers 319 - Minimal impact on existing firmware formats 321 - Robust permissions 323 - Diverse modes of operation 325 - Suitability to software and personalization data 327 3.1. Agnostic to how firmware images are distributed 329 Firmware images can be conveyed to devices in a variety of ways, 330 including USB, UART, WiFi, BLE, low-power WAN technologies, etc. and 331 use different protocols (e.g., CoAP, HTTP). The specified mechanism 332 needs to be agnostic to the distribution of the firmware images and 333 manifests. 335 3.2. Friendly to broadcast delivery 337 This architecture does not specify any specific broadcast protocol. 338 However, given that broadcast may be desirable for some networks, 339 updates must cause the least disruption possible both in metadata and 340 payload transmission. 342 For an update to be broadcast friendly, it cannot rely on link layer, 343 network layer, or transport layer security. In addition, the same 344 message must be deliverable to many devices, both those to which it 345 applies and those to which it does not, without a chance that the 346 wrong device will accept the update. Considerations that apply to 347 network broadcasts apply equally to the use of third-party content 348 distribution networks for payload distribution. 350 3.3. Use state-of-the-art security mechanisms 352 End-to-end security between the author and the device, as shown in 353 Section 5, is used to ensure that the device can verify firmware 354 images and manifests produced by authorized authors. 356 The use of post-quantum secure signature mechanisms, such as hash- 357 based signatures, should be explored. A migration to post-quantum 358 secure signatures would require significant effort, therefore, 359 mandatory-to-implement support for post-quantum secure signatures is 360 a goal. 362 A mandatory-to-implement set of algorithms has to be defined offering 363 a key length of 112-bit symmetric key or security or more, as 364 outlined in Section 20 of RFC 7925 [RFC7925]. This corresponds to a 365 233 bit ECC key or a 2048 bit RSA key. 367 If the firmware image is to be encrypted, it must be done in such a 368 way that every intended recipient can decrypt it. The information 369 that is encrypted individually for each device must be an absolute 370 minimum, for example AES Key Wrap [RFC5649], in order to maintain 371 friendliness to Content Distribution Networks, bulk storage, and 372 broadcast protocols. 374 3.4. Rollback attacks must be prevented 376 A device presented with an old, but valid manifest and firmware must 377 not be tricked into installing such firmware since a vulnerability in 378 the old firmware image may allow an attacker to gain control of the 379 device. 381 3.5. High reliability 383 A power failure at any time must not cause a failure of the device. 384 A failure to validate any part of an update must not cause a failure 385 of the device. One way to achieve this functionality is to provide a 386 minimum of two storage locations for firmware and one bootable 387 location for firmware. An alternative approach is to use a 2nd stage 388 bootloader with build-in full featured firmware update functionality 389 such that it is possible to return to the update process after power 390 down. 392 Note: This is an implementation requirement rather than a requirement 393 on the manifest format. 395 3.6. Operate with a small bootloader 397 Throughout this document we assume that the bootloader itself is 398 distinct from the role of the fw consumer and therefore does not 399 manage the firmware update process. This may give the impression 400 that the bootloader itself is a completely separate component, which 401 is mainly responsible for selecting a firmware image to boot. 403 The overlap between the firmware update process and the bootloader 404 functionality comes in two forms, namely 406 - First, a bootloader must verify the firmware image it boots as 407 part of the secure boot process. Doing so requires meta-data to 408 be stored alongside the firmware image so that the bootloader can 409 cryptographically verify the firmware image before booting it to 410 ensure it has not been tampered with or replaced. This meta-data 411 used by the bootloader may well be the same manifest obtained with 412 the firmware image during the update process (with the severable 413 fields stripped off). 415 - Second, an IoT device needs a recovery strategy in case the 416 firmware update / boot process fails. The recovery strategy may 417 include storing two or more firmware images on the device or 418 offering the ability to have a second stage bootloader perform the 419 firmware update process again using firmware updates over serial, 420 USB or even wireless connectivity like a limited version of 421 Bluetooth Smart. In the latter case the fw consumer functionality 422 is contained in the second stage bootloader and requires the 423 necessary functionality for executing the firmware update process, 424 including manifest parsing. 426 In general, it is assumed that the bootloader itself, or a minimal 427 part of it, will not be updated since a failed update of the 428 bootloader poses a risk in reliability. 430 All information necessary for a device to make a decision about the 431 installation of a firmware update must fit into the available RAM of 432 a constrained IoT device. This prevents flash write exhaustion. 433 This is typically not a difficult requirement to accomplish because 434 there are not other task/processing running while the bootloader is 435 active (unlike it may be the case when running the application 436 firmware). 438 Note: This is an implementation requirement. 440 3.7. Small Parsers 442 Since parsers are known sources of bugs they must be minimal. 443 Additionally, it must be easy to parse only those fields that are 444 required to validate at least one signature or MAC with minimal 445 exposure. 447 3.8. Minimal impact on existing firmware formats 449 The design of the firmware update mechanism must not require changes 450 to existing firmware formats. 452 3.9. Robust permissions 454 When a device obtains a monolithic firmware image from a single 455 author without any additional approval steps then the authorization 456 flow is relatively simple. There are, however, other cases where 457 more complex policy decisions need to be made before updating a 458 device. 460 In this architecture the authorization policy is separated from the 461 underlying communication architecture. This is accomplished by 462 separating the entities from their permissions. For example, an 463 author may not have the authority to install a firmware image on a 464 device in critical infrastructure without the authorization of a 465 device operator. In this case, the device may be programmed to 466 reject firmware updates unless they are signed both by the firmware 467 author and by the device operator. 469 Alternatively, a device may trust precisely one entity, which does 470 all permission management and coordination. This entity allows the 471 device to offload complex permissions calculations for the device. 473 3.10. Operating modes 475 There are three broad classifications of update operating modes. 477 - Client-initiated Update 478 - Server-initiated Update 480 - Hybrid Update 482 Client-initiated updates take the form of a firmware consumer on a 483 device proactively checking (polling) for new firmware images. 485 Server-initiated updates are important to consider because timing of 486 updates may need to be tightly controlled in some high- reliability 487 environments. In this case the status tracker determines what 488 devices qualify for a firmware update. Once those devices have been 489 selected the firmware server distributes updates to the firmware 490 consumers. 492 Note: This assumes that the status tracker is able to reach the 493 device, which may require devices to keep reachability information at 494 the status tracker up-to-date. This may also require keeping state 495 at NATs and stateful packet filtering firewalls alive. 497 Hybrid updates are those that require an interaction between the 498 firmware consumer and the status tracker. The status tracker pushes 499 notifications of availability of an update to the firmware consumer, 500 and it then downloads the image from a firmware server as soon as 501 possible. 503 An alternative view to the operating modes is to consider the steps a 504 device has to go through in the course of an update: 506 - Notification 508 - Pre-authorisation 510 - Dependency resolution 512 - Download 514 - Installation 516 The notification step consists of the status tracker informing the 517 firmware consumer that an update is available. This can be 518 accomplished via polling (client-initiated), push notifications 519 (server-initiated), or more complex mechanisms. 521 The pre-authorisation step involves verifying whether the entity 522 signing the manifest is indeed authorized to perform an update. The 523 firmware consumer must also determine whether it should fetch and 524 process a firmware image, which is referenced in a manifest. 526 A dependency resolution phase is needed when more than one component 527 can be updated or when a differential update is used. The necessary 528 dependencies must be available prior to installation. 530 The download step is the process of acquiring a local copy of the 531 firmware image. When the download is client-initiated, this means 532 that the firmware consumer chooses when a download occurs and 533 initiates the download process. When a download is server-initiated, 534 this means that the status tracker tells the device when to download 535 or that it initiates the transfer directly to the firmware consumer. 536 For example, a download from an HTTP-based firmware server is client- 537 initiated. Pushing a manifest and firmware image to the transfer to 538 the Package resource of the LwM2M Firmware Update object [LwM2M] is 539 server-initiated. 541 If the firmware consumer has downloaded a new firmware image and is 542 ready to install it, it may need to wait for a trigger from the 543 status tracker to initiate the installation, may trigger the update 544 automatically, or may go through a more complex decision making 545 process to determine the appropriate timing for an update (such as 546 delaying the update process to a later time when end users are less 547 impacted by the update process). 549 Installation is the act of processing the payload into a format that 550 the IoT device can recognise and the bootloader is responsible for 551 then booting from the newly installed firmware image. 553 Each of these steps may require different permissions. 555 3.11. Suitability to software and personalization data 557 The work on a standardized manifest format initially focused on the 558 most constrained IoT devices and those devices contain code put 559 together by a single author (although that author may obtain code 560 from other developers, some of it only in binary form). 562 Later it turns out that other use cases may benefit from a 563 standardized manifest format also for conveying software and even 564 personalization data alongside software. Trusted Execution 565 Environments (TEEs), for example, greatly benefit from a protocol for 566 managing the lifecycle of trusted applications (TAs) running inside a 567 TEE. TEEs may obtain TAs from different authors and those TAs may 568 require personalization data, such as payment information, to be 569 securely be conveyed to the TEE. 571 To support this wider range of use cases the manifest format should 572 therefore be extensible to convey other forms of payloads as well. 574 4. Claims 576 Claims in the manifest offer a way to convey instructions to a device 577 that impact the firmware update process. To have any value the 578 manifest containing those claims must be authenticated and integrity 579 protected. The credential used to must be directly or indirectly 580 related to the trust anchor installed at the device by the Trust 581 Provisioning Authority. 583 The baseline claims for all manifests are described in 584 [I-D.ietf-suit-information-model]. For example, there are: 586 - Do not install firmware with earlier metadata than the current 587 metadata. 589 - Only install firmware with a matching vendor, model, hardware 590 revision, software version, etc. 592 - Only install firmware that is before its best-before timestamp. 594 - Only allow a firmware installation if dependencies have been met. 596 - Choose the mechanism to install the firmware, based on the type of 597 firmware it is. 599 5. Communication Architecture 601 Figure 1 shows the communication architecture where a firmware image 602 is created by an author, and uploaded to a firmware server. The 603 firmware image/manifest is distributed to the device either in a push 604 or pull manner using the firmware consumer residing on the device. 605 The device operator keeps track of the process using the status 606 tracker. This allows the device operator to know and control what 607 devices have received an update and which of them are still pending 608 an update. 610 Firmware + +----------+ Firmware + +-----------+ 611 Manifest | |-+ Manifest | |-+ 612 +--------->| Firmware | |<---------------| | | 613 | | Server | | | Author | | 614 | | | | | | | 615 | +----------+ | +-----------+ | 616 | +----------+ +-----------+ 617 | 618 | 619 | 620 -+-- ------ 621 ---- | ---- ---- ---- 622 // | \\ // \\ 623 / | \ / \ 624 / | \ / \ 625 / | \ / \ 626 / | \ / \ 627 | v | | | 628 | +------------+ | 629 | | Firmware | | | | 630 | | Consumer | | Device | +--------+ | 631 | +------------+ | Management| | | | 632 | | |<------------------------->| Status | | 633 | | Device | | | | Tracker| | 634 | +------------+ | || | | | 635 | | || +--------+ | 636 | | | | 637 | | \ / 638 \ / \ / 639 \ / \ Device / 640 \ Network / \ Operator / 641 \ Operator / \\ // 642 \\ // ---- ---- 643 ---- ---- ------ 644 ----- 646 Figure 1: Architecture. 648 End-to-end security mechanisms are used to protect the firmware image 649 and the manifest although Figure 2 does not show the manifest itself 650 since it may be distributed independently. 652 +-----------+ 653 +--------+ | | +--------+ 654 | | Firmware Image | Firmware | Firmware Image | | 655 | Device |<-----------------| Server |<------------------| Author | 656 | | | | | | 657 +--------+ +-----------+ +--------+ 658 ^ * 659 * * 660 ************************************************************ 661 End-to-End Security 663 Figure 2: End-to-End Security. 665 Whether the firmware image and the manifest is pushed to the device 666 or fetched by the device is a deployment specific decision. 668 The following assumptions are made to allow the firmware consumer to 669 verify the received firmware image and manifest before updating 670 software: 672 - To accept an update, a device needs to verify the signature 673 covering the manifest. There may be one or multiple manifests 674 that need to be validated, potentially signed by different 675 parties. The device needs to be in possession of the trust 676 anchors to verify those signatures. Installing trust anchors to 677 devices via the Trust Provisioning Authority happens in an out-of- 678 band fashion prior to the firmware update process. 680 - Not all entities creating and signing manifests have the same 681 permissions. A device needs to determine whether the requested 682 action is indeed covered by the permission of the party that 683 signed the manifest. Informing the device about the permissions 684 of the different parties also happens in an out-of-band fashion 685 and is also a duty of the Trust Provisioning Authority. 687 - For confidentiality protection of firmware images the author needs 688 to be in possession of the certificate/public key or a pre-shared 689 key of a device. The use of confidentiality protection of 690 firmware images is deployment specific. 692 There are different types of delivery modes, which are illustrated 693 based on examples below. 695 There is an option for embedding a firmware image into a manifest. 696 This is a useful approach for deployments where devices are not 697 connected to the Internet and cannot contact a dedicated firmware 698 server for the firmware download. It is also applicable when the 699 firmware update happens via a USB stick or via Bluetooth Smart. 700 Figure 3 shows this delivery mode graphically. 702 /------------\ /------------\ 703 /Manifest with \ /Manifest with \ 704 |attached | |attached | 705 \firmware image/ \firmware image/ 706 \------------/ +-----------+ \------------/ 707 +--------+ | | +--------+ 708 | |<.................| Firmware |<................| | 709 | Device | | Server | | Author | 710 | | | | | | 711 +--------+ +-----------+ +--------+ 713 Figure 3: Manifest with attached firmware. 715 Figure 4 shows an option for remotely updating a device where the 716 device fetches the firmware image from some file server. The 717 manifest itself is delivered independently and provides information 718 about the firmware image(s) to download. 720 /--------\ /--------\ 721 / \ / \ 722 | Manifest | | Manifest | 723 \ / \ / 724 \--------/ \--------/ 725 +-----------+ 726 +--------+ | | +--------+ 727 | |<.................| Status |................>| | 728 | Device | | Tracker | -- | Author | 729 | |<- | | --- | | 730 +--------+ -- +-----------+ --- +--------+ 731 -- --- 732 --- --- 733 -- +-----------+ -- 734 -- | | -- 735 /------------\ -- | Firmware |<- /------------\ 736 / \ -- | Server | / \ 737 | Firmware | | | | Firmware | 738 \ / +-----------+ \ / 739 \------------/ \------------/ 741 Figure 4: Independent retrieval of the firmware image. 743 This architecture does not mandate a specific delivery mode but a 744 solution must support both types. 746 6. Manifest 748 In order for a device to apply an update, it has to make several 749 decisions about the update: 751 - Does it trust the author of the update? 753 - Has the firmware been corrupted? 755 - Does the firmware update apply to this device? 757 - Is the update older than the active firmware? 759 - When should the device apply the update? 761 - How should the device apply the update? 763 - What kind of firmware binary is it? 765 - Where should the update be obtained? 767 - Where should the firmware be stored? 769 The manifest encodes the information that devices need in order to 770 make these decisions. It is a data structure that contains the 771 following information: 773 - information about the device(s) the firmware image is intended to 774 be applied to, 776 - information about when the firmware update has to be applied, 778 - information about when the manifest was created, 780 - dependencies on other manifests, 782 - pointers to the firmware image and information about the format, 784 - information about where to store the firmware image, 786 - cryptographic information, such as digital signatures or message 787 authentication codes (MACs). 789 The manifest information model is described in 790 [I-D.ietf-suit-information-model]. 792 7. Device Firmware Update Examples 794 Although these documents attempt to define a firmware update 795 architecture that is applicable to both existing systems, as well as 796 yet-to-be-conceived systems; it is still helpful to consider existing 797 architectures. 799 7.1. Single CPU SoC 801 The simplest, and currently most common, architecture consists of a 802 single MCU along with its own peripherals. These SoCs generally 803 contain some amount of flash memory for code and fixed data, as well 804 as RAM for working storage. These systems either have a single 805 firmware image, or an immutable bootloader that runs a single image. 806 A notable characteristic of these SoCs is that the primary code is 807 generally execute in place (XIP). Combined with the non-relocatable 808 nature of the code, firmware updates need to be done in place. 810 7.2. Single CPU with Secure - Normal Mode Partitioning 812 Another configuration consists of a similar architecture to the 813 previous, with a single CPU. However, this CPU supports a security 814 partitioning scheme that allows memory (in addition to other things) 815 to be divided into secure and normal mode. There will generally be 816 two images, one for secure mode, and one for normal mode. In this 817 configuration, firmware upgrades will generally be done by the CPU in 818 secure mode, which is able to write to both areas of the flash 819 device. In addition, there are requirements to be able to update 820 either image independently, as well as to update them together 821 atomically, as specified in the associated manifests. 823 7.3. Dual CPU, shared memory 825 This configuration has two or more CPUs in a single SoC that share 826 memory (flash and RAM). Generally, they will be a protection 827 mechanism to prevent one CPU from accessing the other's memory. 828 Upgrades in this case will typically be done by one of the CPUs, and 829 is similar to the single CPU with secure mode. 831 7.4. Dual CPU, other bus 833 This configuration has two or more CPUs, each having their own 834 memory. There will be a communication channel between them, but it 835 will be used as a peripheral, not via shared memory. In this case, 836 each CPU will have to be responsible for its own firmware upgrade. 837 It is likely that one of the CPUs will be considered a master, and 838 will direct the other CPU to do the upgrade. This configuration is 839 commonly used to offload specific work to other CPUs. Firmware 840 dependencies are similar to the other solutions above, sometimes 841 allowing only one image to be upgraded, other times requiring several 842 to be upgraded atomically. Because the updates are happening on 843 multiple CPUs, upgrading the two images atomically is challenging. 845 8. Bootloader 847 More devices today than ever before are being connected to the 848 Internet, which drives the need for firmware updates to be provided 849 over the Internet rather than through traditional interfaces, such as 850 USB or RS232. Updating a device over the Internet requires the 851 device to fetch not only the firmware image but also the manifest. 852 Hence, the following building blocks are necessary for a firmware 853 update solution: 855 - the Internet protocol stack for (possibly large) firmware 856 downloads, 858 - the capability to write the received firmware image to persistent 859 storage (most likely flash memory) prior to performing the update, 861 - the ability to unpack, decompress or otherwise process the 862 received firmware image, 864 - the features to verify an image and a manifest, including digital 865 signature verification or checking a message authentication code, 867 - a manifest parsing library, and 869 - integration of the device into a device management server to 870 perform automatic firmware updates and to track their progress. 872 All these features are most likely offered by the application, i.e. 873 firmware consumer, running on the device (except for basic security 874 algorithms that may run either on a trusted execution environment or 875 on a separate hardware security MCU/module) rather than by the 876 bootloader itself. 878 Once manifests have been processed and firmware images successfully 879 downloaded and verified the device needs to hand control over to the 880 bootloader. In most cases this requires the MCU to restart. Once 881 the MCU has initiated a restart, the bootloader takes over control 882 and determines whether the newly downloaded firmware image should be 883 executed. 885 The boot process is security sensitive because the firmware images 886 may, for example, be stored in off-chip flash memory giving attackers 887 easy access to the image for reverse engineering and potentially also 888 for modifying the binary. The bootloader will therefore have to 889 perform security checks on the firmware image before it can be 890 booted. These security checks by the bootloader happen in addition 891 to the security checks that happened when the firmware image and the 892 manifest were downloaded. 894 The manifest may have been stored alongside the firmware image to 895 allow re-verification of the firmware image during every boot 896 attempt. Alternatively, secure boot-specific meta-data may have been 897 created by the application after a successful firmware download and 898 verification process. Whether to re-use the standardized manifest 899 format that was used during the initial firmware retrieval process or 900 whether it is better to use a different format for the secure boot- 901 specific meta-data depends on the system design. The manifest format 902 does, however, have the capability to serve also as a building block 903 for secure boot with its severable elements that allow shrinking the 904 size of the manifest by stripping elements that are no longer needed. 906 If the application image contains the firmware consumer 907 functionality, as described above, then it is necessary that a 908 working image is left on the device to ensure that the bootloader can 909 roll back to a working firmware image to re-do the firmware download 910 since the bootloader itself does not have enough functionality to 911 fetch a firmware image plus manifest from a firmware server over the 912 Internet. A multi-stage bootloader may soften this requirement at 913 the expense of a more sophisticated boot process. 915 For a bootloader to offer a secure boot mechanism it needs to provide 916 the following features: 918 - ability to access security algorithms, such as SHA-256 to compute 919 a fingerprint over the firmware image and a digital signature 920 algorithm. 922 - access keying material directly or indirectly to utilize the 923 digital signature. The device needs to have a trust anchor store. 925 - ability to expose boot process-related data to the application 926 firmware (such as to the device management software). This allows 927 a device management server to determine whether the firmware 928 update has been successful and, if not, what errors occurred. 930 - to (optionally) offer attestation information (such as 931 measurements). 933 While the software architecture of the bootloader and its security 934 mechanisms are implementation-specific, the manifest can be used to 935 control the firmware download from the Internet in addition to 936 augmenting secure boot process. These building blocks are highly 937 relevant for the design of the manifest. 939 9. Example 941 Figure 5 illustrates an example message flow for distributing a 942 firmware image to a device starting with an author uploading the new 943 firmware to firmware server and creating a manifest. The firmware 944 and manifest are stored on the same firmware server. This setup does 945 not use a status tracker and the firmware consumer component is 946 therefore responsible for periodically checking whether a new 947 firmware image is available for download. 949 +--------+ +-----------------+ +------------+ +----------+ 950 | Author | | Firmware Server | |FW Consumer | |Bootloader| 951 +--------+ +-----------------+ +------------+ +----------+ 952 | | | + 953 | Create Firmware | | | 954 |--------------+ | | | 955 | | | | | 956 |<-------------+ | | | 957 | | | | 958 | Upload Firmware | | | 959 |------------------>| | | 960 | | | | 961 | Create Manifest | | | 962 |---------------+ | | | 963 | | | | | 964 |<--------------+ | | | 965 | | | | 966 | Sign Manifest | | | 967 |-------------+ | | | 968 | | | | | 969 |<------------+ | | | 970 | | | | 971 | Upload Manifest | | | 972 |------------------>| | | 973 | | | | 974 | | Query Manifest | | 975 | |<--------------------| | 976 | | | | 977 | | Send Manifest | | 978 | |-------------------->| | 979 | | | Validate | 980 | | | Manifest | 981 | | |---------+ | 982 | | | | | 983 | | |<--------+ | 984 | | | | 985 | | Request Firmware | | 986 | |<--------------------| | 987 | | | | 988 | | Send Firmware | | 989 | |-------------------->| | 990 | | | Verify | 991 | | | Firmware | 992 | | |--------------+ | 993 | | | | | 994 | | |<-------------+ | 995 | | | | 996 | | | Store | 997 | | | Firmware | 998 | | |-------------+ | 999 | | | | | 1000 | | |<------------+ | 1001 | | | | 1002 | | | | 1003 | | | Trigger Reboot | 1004 | | |--------------->| 1005 | | | | 1006 | | | | 1007 | | +---+----------------+--+ 1008 | | S| | | | 1009 | | E| | Verify | | 1010 | | C| | Firmware | | 1011 | | U| | +--------------| | 1012 | | R| | | | | 1013 | | E| | +------------->| | 1014 | | | | | | 1015 | | B| | Activate new | | 1016 | | O| | Firmware | | 1017 | | O| | +--------------| | 1018 | | T| | | | | 1019 | | | | +------------->| | 1020 | | P| | | | 1021 | | R| | Boot new | | 1022 | | O| | Firmware | | 1023 | | C| | +--------------| | 1024 | | E| | | | | 1025 | | S| | +------------->| | 1026 | | S| | | | 1027 | | +---+----------------+--+ 1028 | | | | 1030 Figure 5: First Example Flow for a Firmware Upate. 1032 Figure 6 shows an example follow with the device using a status 1033 tracker. For editorial reasons the author publishing the manifest at 1034 the status tracker and the firmware image at the firmware server is 1035 not shown. Also omitted is the secure boot process following the 1036 successful firmware update process. 1038 The exchange starts with the device interacting with the status 1039 tracker; the details of such exchange will vary with the different 1040 device management systems being used. In any case, the status 1041 tracker learns about the firmware version of the devices it manages. 1042 In our example, the device under management is using firmware version 1043 A.B.C. At a later point in time the author uploads a new firmware 1044 along with the manifest to the firmware server and the status 1045 tracker, respectively. While there is no need to store the manifest 1046 and the firmware on different servers this example shows a common 1047 pattern used in the industry. The status tracker may then 1048 automatically, based on human intervention or based on a more complex 1049 policy decide to inform the device about the newly available firmware 1050 image. In our example, it does so by pushing the manifest to the FW 1051 consumer. The firmware consumer downloads the firmware image with 1052 the newer version X.Y.Z after successful validation of the manifest. 1053 Subsequently, a reboot is initiated and the secure boot process 1054 starts. 1056 +---------+ +-----------------+ |-----------------------------. 1057 | Status | | Firmware Server | | +------------+ +----------+ | 1058 | Tracker | | | | |FW Consumer | |Bootloader| | 1059 +---------+ +-----------------+ | +------------+ +----------+ | 1060 | | | | IoT Device | | 1061 | | `'''''''''''''''''''''''''''' 1062 | | | | 1063 | Query Firmware Version | | 1064 |------------------------------------->| | 1065 | Firmware Version A.B.C | | 1066 |<-------------------------------------| | 1067 | | | | 1068 | <> | | 1069 | | | | 1070 _,...._ _,...._ | | 1071 ,' `. ,' `. | | 1072 | New | | New | | | 1073 \ Manifest / \ Firmware / | | 1074 `.._ _,,' `.._ _,,' | | 1075 `'' `'' | | 1076 | Push manifest | | 1077 |----------------+-------------------->| | 1078 | | | | 1079 | ' | ' 1080 | | | Validate | 1081 | | | Manifest | 1082 | | |---------+ | 1083 | | | | | 1084 | | |<--------+ | 1085 | | Request firmware | | 1086 | | X.Y.Z | | 1087 | |<--------------------| | 1088 | | | | 1089 | | Firmware X.Y.Z | | 1090 | |-------------------->| | 1091 | | | | 1092 | | | Verify | 1093 | | | Firmware | 1094 | | |--------------+ | 1095 | | | | | 1096 | | |<-------------+ | 1097 | | | | 1098 | | | Store | 1099 | | | Firmware | 1100 | | |-------------+ | 1101 | | | | | 1102 | | |<------------+ | 1103 | | | | 1104 | | | | 1105 | | | Trigger Reboot | 1106 | | |--------------->| 1107 | | | | 1108 | | | | 1109 | | | __..-------..._' 1110 | | ,-' `-. 1111 | | | Secure Boot | 1112 | | `-. _/ 1113 | | |`--..._____,,.,-' 1114 | | | | 1116 Figure 6: Second Example Flow for a Firmware Upate. 1118 10. IANA Considerations 1120 This document does not require any actions by IANA. 1122 11. Security Considerations 1124 Firmware updates fix security vulnerabilities and are considered to 1125 be an important building block in securing IoT devices. Due to the 1126 importance of firmware updates for IoT devices the Internet 1127 Architecture Board (IAB) organized a 'Workshop on Internet of Things 1128 (IoT) Software Update (IOTSU)', which took place at Trinity College 1129 Dublin, Ireland on the 13th and 14th of June, 2016 to take a look at 1130 the big picture. A report about this workshop can be found at 1131 [RFC8240]. A standardized firmware manifest format providing end-to- 1132 end security from the author to the device will be specified in a 1133 separate document. 1135 There are, however, many other considerations raised during the 1136 workshop. Many of them are outside the scope of standardization 1137 organizations since they fall into the realm of product engineering, 1138 regulatory frameworks, and business models. The following 1139 considerations are outside the scope of this document, namely 1141 - installing firmware updates in a robust fashion so that the update 1142 does not break the device functionality of the environment this 1143 device operates in. 1145 - installing firmware updates in a timely fashion considering the 1146 complexity of the decision making process of updating devices, 1147 potential re-certification requirements, and the need for user 1148 consent to install updates. 1150 - the distribution of the actual firmware update, potentially in an 1151 efficient manner to a large number of devices without human 1152 involvement. 1154 - energy efficiency and battery lifetime considerations. 1156 - key management required for verifying the digital signature 1157 protecting the manifest. 1159 - incentives for manufacturers to offer a firmware update mechanism 1160 as part of their IoT products. 1162 12. Mailing List Information 1164 The discussion list for this document is located at the e-mail 1165 address suit@ietf.org [1]. Information on the group and information 1166 on how to subscribe to the list is at 1167 https://www1.ietf.org/mailman/listinfo/suit 1169 Archives of the list can be found at: https://www.ietf.org/mail- 1170 archive/web/suit/current/index.html 1172 13. Acknowledgements 1174 We would like to thank the following persons for their feedback: 1176 - Geraint Luff 1178 - Amyas Phillips 1180 - Dan Ros 1182 - Thomas Eichinger 1184 - Michael Richardson 1186 - Emmanuel Baccelli 1188 - Ned Smith 1190 - Jim Schaad 1192 - Carsten Bormann 1194 - Cullen Jennings 1196 - Olaf Bergmann 1198 - Suhas Nandakumar 1200 - Phillip Hallam-Baker 1202 - Marti Bolivar 1204 - Andrzej Puzdrowski 1206 - Markus Gueller 1208 - Henk Birkholz 1210 - Jintao Zhu 1212 - Takeshi Takahashi 1214 - Jacob Beningo 1216 We would also like to thank the WG chairs, Russ Housley, David 1217 Waltermire, Dave Thaler for their support and their reviews. 1219 14. References 1221 14.1. Normative References 1223 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1224 Requirement Levels", BCP 14, RFC 2119, March 1997. 1226 [RFC7925] Tschofenig, H., Ed. and T. Fossati, "Transport Layer 1227 Security (TLS) / Datagram Transport Layer Security (DTLS) 1228 Profiles for the Internet of Things", RFC 7925, DOI 1229 10.17487/RFC7925, July 2016, . 1232 14.2. Informative References 1234 [I-D.ietf-suit-information-model] 1235 Moran, B., Tschofenig, H., and H. Birkholz, "Firmware 1236 Updates for Internet of Things Devices - An Information 1237 Model for Manifests", draft-ietf-suit-information-model-03 1238 (work in progress), July 2019. 1240 [I-D.ietf-teep-architecture] 1241 Pei, M., Tschofenig, H., Wheeler, D., Atyeo, A., and D. 1242 Liu, "Trusted Execution Environment Provisioning (TEEP) 1243 Architecture", draft-ietf-teep-architecture-03 (work in 1244 progress), July 2019. 1246 [LwM2M] OMA, ., "Lightweight Machine to Machine Technical 1247 Specification, Version 1.0.2", February 2018, 1248 . 1252 [RFC5649] Housley, R. and M. Dworkin, "Advanced Encryption Standard 1253 (AES) Key Wrap with Padding Algorithm", RFC 5649, DOI 1254 10.17487/RFC5649, September 2009, . 1257 [RFC6024] Reddy, R. and C. Wallace, "Trust Anchor Management 1258 Requirements", RFC 6024, DOI 10.17487/RFC6024, October 1259 2010, . 1261 [RFC8240] Tschofenig, H. and S. Farrell, "Report from the Internet 1262 of Things Software Update (IoTSU) Workshop 2016", RFC 1263 8240, DOI 10.17487/RFC8240, September 2017, 1264 . 1266 14.3. URIs 1268 [1] mailto:suit@ietf.org 1270 Authors' Addresses 1272 Brendan Moran 1273 Arm Limited 1275 EMail: Brendan.Moran@arm.com 1277 Milosch Meriac 1278 Consultant 1280 EMail: milosch@meriac.com 1282 Hannes Tschofenig 1283 Arm Limited 1285 EMail: hannes.tschofenig@arm.com 1287 David Brown 1288 Linaro 1290 EMail: david.brown@linaro.org