idnits 2.17.1 draft-ietf-suit-architecture-03.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 (March 11, 2019) is 1873 days in the past. Is this intentional? Checking references for intended status: Informational ---------------------------------------------------------------------------- -- Looks like a reference, but probably isn't: '1' on line 1076 -- Looks like a reference, but probably isn't: '2' on line 1078 -- Looks like a reference, but probably isn't: '3' on line 1080 == Outdated reference: A later version (-13) exists of draft-ietf-suit-information-model-02 Summary: 0 errors (**), 0 flaws (~~), 4 warnings (==), 4 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: September 12, 2019 Consultant 6 H. Tschofenig 7 Arm Limited 8 D. Brown 9 Linaro 10 March 11, 2019 12 A Firmware Update Architecture for Internet of Things Devices 13 draft-ietf-suit-architecture-03 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 https://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 September 12, 2019. 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 (https://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 . . . . . . . . . . . . . . . . . . . . . . . . 6 81 3.1. Agnostic to how firmware images are distributed . . . . . 7 82 3.2. Friendly to broadcast delivery . . . . . . . . . . . . . 7 83 3.3. Use state-of-the-art security mechanisms . . . . . . . . 7 84 3.4. Rollback attacks must be prevented . . . . . . . . . . . 8 85 3.5. High reliability . . . . . . . . . . . . . . . . . . . . 8 86 3.6. Operate with a small bootloader . . . . . . . . . . . . . 8 87 3.7. Small Parsers . . . . . . . . . . . . . . . . . . . . . . 9 88 3.8. Minimal impact on existing firmware formats . . . . . . . 9 89 3.9. Robust permissions . . . . . . . . . . . . . . . . . . . 9 90 3.10. Operating modes . . . . . . . . . . . . . . . . . . . . . 9 91 4. Claims . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 92 5. Communication Architecture . . . . . . . . . . . . . . . . . 12 93 6. Manifest . . . . . . . . . . . . . . . . . . . . . . . . . . 16 94 7. Device Firmware Update Examples . . . . . . . . . . . . . . . 17 95 7.1. Single CPU SoC . . . . . . . . . . . . . . . . . . . . . 17 96 7.2. Single CPU with Secure - Normal Mode Partitioning . . . . 17 97 7.3. Dual CPU, shared memory . . . . . . . . . . . . . . . . . 17 98 7.4. Dual CPU, other bus . . . . . . . . . . . . . . . . . . . 17 99 8. Bootloader . . . . . . . . . . . . . . . . . . . . . . . . . 18 100 9. Example . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 101 10. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 21 102 11. Security Considerations . . . . . . . . . . . . . . . . . . . 21 103 12. Mailing List Information . . . . . . . . . . . . . . . . . . 22 104 13. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 22 105 14. References . . . . . . . . . . . . . . . . . . . . . . . . . 23 106 14.1. Normative References . . . . . . . . . . . . . . . . . . 23 107 14.2. Informative References . . . . . . . . . . . . . . . . . 24 108 14.3. URIs . . . . . . . . . . . . . . . . . . . . . . . . . . 24 109 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 24 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 The following entities are used: 198 - Author: The author is the entity that creates the firmware image. 199 There may be multiple authors in a system either when a device 200 consists of multiple micro-controllers or when the the final 201 firmware image consists of software components from multiple 202 companies. 204 - Firmware Consumer: The firmware consumer is the recipient of the 205 firmware image and the manifest. 207 - Device: A device refers to the entire IoT product, which consists 208 of one or many MCUs, sensors and/or actuators. Many IoT devices 209 sold today contain multiple MCUs and therefore a single device may 210 need to obtain more than one firmware image and manifest to 211 succesfully perform an update. The terms device and firmware 212 consumer are used interchangably since the firmware consumer is 213 one software component running on an MCU on the device. 215 - Status Tracker: The status tracker offers device management 216 functionality that includes keep track of the firmware update 217 process. This includes fine-grained monitoring of changes at the 218 device, for example, what state of the firmware update cycle the 219 device is currently in. 221 - Firmware Server: The firmware server stores firmware images and 222 manifests and distributes them to IoT devices. Some deployments 223 may require a store-and-forward concept, which requires storing 224 the firmware images/manifests on more than one entity before 225 they reach the device. 227 - Device Operator: The actor responsible for the day-to-day 228 operation of a fleet of IoT devices. 230 - Network Operator: The actor responsible for the operation of a 231 network to which IoT devices connect. 233 In addition to the entities in the list above there is an orthogonal 234 infrastructure with a Trust Provisioning Authority (TPA) distributing 235 trust anchors and authorization permissions to various entities in 236 the system. The TPA may also delegate rights to install, update, 237 enhance, or delete trust anchors and authorization permissions to 238 other parties in the system. This infrastructure overlaps the 239 communication architecture and different deployments may empower 240 certain entities while other deployments may not. For example, in 241 some cases, the Original Design Manufacturer (ODM), which is a 242 company that designs and manufactures a product, may act as a TPA and 243 may decide to remain in full control over the firmware update process 244 of their products. 246 The terms 'trust anchor' and 'trust anchor store' are defined in 247 [RFC6024]: 249 - "A trust anchor represents an authoritative entity via a public 250 key and associated data. The public key is used to verify digital 251 signatures, and the associated data is used to constrain the types 252 of information for which the trust anchor is authoritative." 254 - "A trust anchor store is a set of one or more trust anchors stored 255 in a device. A device may have more than one trust anchor store, 256 each of which may be used by one or more applications." 258 3. Requirements 260 The firmware update mechanism described in this specification was 261 designed with the following requirements in mind: 263 - Agnostic to how firmware images are distributed 265 - Friendly to broadcast delivery 267 - Use state-of-the-art security mechanisms 269 - Rollback attacks must be prevented 271 - High reliability 273 - Operate with a small bootloader 275 - Small Parsers 277 - Minimal impact on existing firmware formats 279 - Robust permissions 281 - Diverse modes of operation 283 3.1. Agnostic to how firmware images are distributed 285 Firmware images can be conveyed to devices in a variety of ways, 286 including USB, UART, WiFi, BLE, low-power WAN technologies, etc. and 287 use different protocols (e.g., CoAP, HTTP). The specified mechanism 288 needs to be agnostic to the distribution of the firmware images and 289 manifests. 291 3.2. Friendly to broadcast delivery 293 This architecture does not specify any specific broadcast protocol. 294 However, given that broadcast may be desirable for some networks, 295 updates must cause the least disruption possible both in metadata and 296 payload transmission. 298 For an update to be broadcast friendly, it cannot rely on link layer, 299 network layer, or transport layer security. In addition, the same 300 message must be deliverable to many devices, both those to which it 301 applies and those to which it does not, without a chance that the 302 wrong device will accept the update. Considerations that apply to 303 network broadcasts apply equally to the use of third-party content 304 distribution networks for payload distribution. 306 3.3. Use state-of-the-art security mechanisms 308 End-to-end security between the author and the device, as shown in 309 Section 5, is used to ensure that the device can verify firmware 310 images and manifests produced by authorized authors. 312 The use of post-quantum secure signature mechanisms, such as hash- 313 based signatures, should be explored. A migration to post-quantum 314 secure signatures would require significant effort, therefore, 315 mandatory-to-implement support for post-quantum secure signatures is 316 a goal. 318 A mandatory-to-implement set of algorithms has to be defined offering 319 a key length of 112-bit symmetric key or security or more, as 320 outlined in Section 20 of RFC 7925 [RFC7925]. This corresponds to a 321 233 bit ECC key or a 2048 bit RSA key. 323 If the firmware image is to be encrypted, it must be done in such a 324 way that every intended recipient can decrypt it. The information 325 that is encrypted individually for each device must be an absolute 326 minimum, for example AES Key Wrap [RFC5649], in order to maintain 327 friendliness to Content Distribution Networks, bulk storage, and 328 broadcast protocols. 330 3.4. Rollback attacks must be prevented 332 A device presented with an old, but valid manifest and firmware must 333 not be tricked into installing such firmware since a vulnerability in 334 the old firmware image may allow an attacker to gain control of the 335 device. 337 3.5. High reliability 339 A power failure at any time must not cause a failure of the device. 340 A failure to validate any part of an update must not cause a failure 341 of the device. One way to achieve this functionality is to provide a 342 minimum of two storage locations for firmware and one bootable 343 location for firmware. An alternative approach is to use a 2nd stage 344 bootloader with build-in full featured firmware update functionality 345 such that it is possible to return to the update process after power 346 down. 348 Note: This is an implementation requirement rather than a requirement 349 on the manifest format. 351 3.6. Operate with a small bootloader 353 The bootloader must be minimal, containing only flash support, 354 cryptographic primitives and optionally a recovery mechanism. The 355 recovery mechanism is used in case the update process failed and may 356 include support for firmware updates over serial, USB or even a 357 limited version of wireless connectivity standard like a limited 358 Bluetooth Smart. Such a recovery mechanism must provide security at 359 least at the same level as the full featured firmware update 360 functionalities. 362 The bootloader needs to verify the received manifest and to install 363 the bootable firmware image. The bootloader should not require 364 updating since a failed update poses a risk in reliability. If more 365 functionality is required in the bootloader, it must use a two-stage 366 bootloader, with the first stage comprising the functionality defined 367 above. 369 All information necessary for a device to make a decision about the 370 installation of a firmware update must fit into the available RAM of 371 a constrained IoT device. This prevents flash write exhaustion. 373 Note: This is an implementation requirement. 375 3.7. Small Parsers 377 Since parsers are known sources of bugs they must be minimal. 378 Additionally, it must be easy to parse only those fields that are 379 required to validate at least one signature or MAC with minimal 380 exposure. 382 3.8. Minimal impact on existing firmware formats 384 The design of the firmware update mechanism must not require changes 385 to existing firmware formats. 387 3.9. Robust permissions 389 When a device obtains a monolithic firmware image from a single 390 author without any additional approval steps then the authorization 391 flow is relatively simple. There are, however, other cases where 392 more complex policy decisions need to be made before updating a 393 device. 395 In this architecture the authorization policy is separated from the 396 underlying communication architecture. This is accomplished by 397 separating the entities from their permissions. For example, an 398 author may not have the authority to install a firmware image on a 399 device in critical infrastructure without the authorization of a 400 device operator. In this case, the device may be programmed to 401 reject firmware updates unless they are signed both by the firmware 402 author and by the device operator. 404 Alternatively, a device may trust precisely one entity, which does 405 all permission management and coordination. This entity allows the 406 device to offload complex permissions calculations for the device. 408 3.10. Operating modes 410 There are three broad classifications of update operating modes. 412 - Client-initiated Update 414 - Server-initiated Update 416 - Hybrid Update 418 Client-initiated updates take the form of a firmware consumer on a 419 device proactively checking (polling) for new firmware images. 421 Server-initiated updates are important to consider because timing of 422 updates may need to be tightly controlled in some high- reliability 423 environments. In this case the status tracker determines what 424 devices qualify for a firmware update. Once those devices have been 425 selected the firmware server distributes updates to the firmware 426 consumers. 428 Note: This assumes that the status tracker is able to reach the 429 device, which may require devices to keep reachability information at 430 the status tracker up-to-date. This may also require keeping state 431 at NATs and stateful packet filtering firewalls alive. 433 Hybrid updates are those that require an interaction between the 434 firmware consumer and the status tracker. The status tracker pushes 435 notifications of availability of an update to the firmware consumer, 436 and it then downloads the image from a firmware server as soon as 437 possible. 439 An alternative view to the operating modes is to consider the steps a 440 device has to go through in the course of an update: 442 - Notification 444 - Pre-authorisation 446 - Dependency resolution 448 - Download 450 - Installation 452 The notification step consists of the status tracker informing the 453 firmware consumer that an update is available. This can be 454 accomplished via polling (client-initiated), push notifications 455 (server-initiated), or more complex mechanisms. 457 The pre-authorisation step involves verifying whether the entity 458 signing the manifest is indeed authorized to perform an update. The 459 firmware consumer must also determine whether it should fetch and 460 process a firmware image, which is referenced in a manifest. 462 A dependency resolution phase is needed when more than one component 463 can be updated or when a differential update is used. The necessary 464 dependencies must be available prior to installation. 466 The download step is the process of acquiring a local copy of the 467 firmware image. When the download is client-initiated, this means 468 that the firmware consumer chooses when a download occurs and 469 initiates the download process. When a download is server-initiated, 470 this means that the status tracker tells the device when to download 471 or that it initiates the transfer directly to the firmware consumer. 472 For example, a download from an HTTP-based firmware server is client- 473 initiated. Pushing a manifest and firmware image to the transfer to 474 the Package resource of the LwM2M Firmware Update object [LwM2M] is 475 server-initiated. 477 If the firmware consumer has downloaded a new firmware image and is 478 ready to install it, it may need to wait for a trigger from the 479 status tracker to initiate the installation, may trigger the update 480 automatically, or may go through a more complex decision making 481 process to determine the appropriate timing for an update (such as 482 delaying the update process to a later time when end users are less 483 impacted by the update process). 485 Installation is the act of processing the payload into a format that 486 the IoT device can recognise and the bootloader is responsible for 487 then booting from the newly installed firmware image. 489 Each of these steps may require different permissions. 491 4. Claims 493 Claims in the manifest offer a way to convey instructions to a device 494 that impact the firmware update process. To have any value the 495 manifest containing those claims must be authenticated and integrity 496 protected. The credential used to must be directly or indirectly 497 related to the trust anchor installed at the device by the Trust 498 Provisioning Authority. 500 The baseline claims for all manifests are described in 501 [I-D.ietf-suit-information-model]. For example, there are: 503 - Do not install firmware with earlier metadata than the current 504 metadata. 506 - Only install firmware with a matching vendor, model, hardware 507 revision, software version, etc. 509 - Only install firmware that is before its best-before timestamp. 511 - Only allow a firmware installation if dependencies have been met. 513 - Choose the mechanism to install the firmware, based on the type of 514 firmware it is. 516 5. Communication Architecture 518 Figure 1 shows the communication architecture where a firmware image 519 is created by an author, and uploaded to a firmware server. The 520 firmware image/manifest is distributed to the device either in a push 521 or pull manner using the firmware consumer residing on the device. 522 The device operator keeps track of the process using the status 523 tracker. This allows the device operator to know and control what 524 devices have received an update and which of them are still pending 525 an update. 527 Firmware + +----------+ Firmware + +-----------+ 528 Manifest | |-+ Manifest | |-+ 529 +--------->| Firmware | |<---------------| | | 530 | | Server | | | Author | | 531 | | | | | | | 532 | +----------+ | +-----------+ | 533 | +----------+ +-----------+ 534 | 535 | 536 | 537 -+-- ------ 538 ---- | ---- ---- ---- 539 // | \\ // \\ 540 / | \ / \ 541 / | \ / \ 542 / | \ / \ 543 / | \ / \ 544 | v | | | 545 | +------------+ | 546 | | Firmware | | | | 547 | | Consumer | | Device | +--------+ | 548 | +------------+ | Management| | | | 549 | | |<------------------------->| Status | | 550 | | Device | | | | Tracker| | 551 | +------------+ | || | | | 552 | | || +--------+ | 553 | | | | 554 | | \ / 555 \ / \ / 556 \ / \ Device / 557 \ Network / \ Operator / 558 \ Operator / \\ // 559 \\ // ---- ---- 560 ---- ---- ------ 561 ----- 563 Figure 1: Architecture. 565 End-to-end security mechanisms are used to protect the firmware image 566 and the manifest although Figure 2 does not show the manifest itself 567 since it may be distributed independently. 569 +-----------+ 570 +--------+ | | +--------+ 571 | | Firmware Image | Firmware | Firmware Image | | 572 | Device |<-----------------| Server |<------------------| Author | 573 | | | | | | 574 +--------+ +-----------+ +--------+ 575 ^ * 576 * * 577 ************************************************************ 578 End-to-End Security 580 Figure 2: End-to-End Security. 582 Whether the firmware image and the manifest is pushed to the device 583 or fetched by the device is a deployment specific decision. 585 The following assumptions are made to allow the firmware consumer to 586 verify the received firmware image and manifest before updating 587 software: 589 - To accept an update, a device needs to verify the signature 590 covering the manifest. There may be one or multiple manifests 591 that need to be validated, potentially signed by different 592 parties. The device needs to be in possession of the trust 593 anchors to verify those signatures. Installing trust anchors to 594 devices via the Trust Provisioning Authority happens in an out-of- 595 band fashion prior to the firmware update process. 597 - Not all entities creating and signing manifests have the same 598 permissions. A device needs to determine whether the requested 599 action is indeed covered by the permission of the party that 600 signed the manifest. Informing the device about the permissions 601 of the different parties also happens in an out-of-band fashion 602 and is also a duty of the Trust Provisioning Authority. 604 - For confidentiality protection of firmware images the author needs 605 to be in possession of the certificate/public key or a pre-shared 606 key of a device. The use of confidentiality protection of 607 firmware images is deployment specific. 609 There are different types of delivery modes, which are illustrated 610 based on examples below. 612 There is an option for embedding a firmware image into a manifest. 613 This is a useful approach for deployments where devices are not 614 connected to the Internet and cannot contact a dedicated firmware 615 server for the firmware download. It is also applicable when the 616 firmware update happens via a USB stick or via Bluetooth Smart. 617 Figure 3 shows this delivery mode graphically. 619 /------------\ /------------\ 620 /Manifest with \ /Manifest with \ 621 |attached | |attached | 622 \firmware image/ \firmware image/ 623 \------------/ +-----------+ \------------/ 624 +--------+ | | +--------+ 625 | |<.................| Firmware |<................| | 626 | Device | | Server | | Author | 627 | | | | | | 628 +--------+ +-----------+ +--------+ 630 Figure 3: Manifest with attached firmware. 632 Figure 4 shows an option for remotely updating a device where the 633 device fetches the firmware image from some file server. The 634 manifest itself is delivered independently and provides information 635 about the firmware image(s) to download. 637 /------------\ 638 / \ 639 | Manifest | 640 \ / 641 +--------+ \------------/ +--------+ 642 | |<..............................................>| | 643 | Device | -- | Author | 644 | |<- --- | | 645 +--------+ -- --- +--------+ 646 -- --- 647 --- --- 648 -- +-----------+ -- 649 -- | | -- 650 /------------\ -- | Firmware |<- /------------\ 651 / \ -- | Server | / \ 652 | Firmware | | | | Firmware | 653 \ / +-----------+ \ / 654 \------------/ \------------/ 656 Figure 4: Independent retrieval of the firmware image. 658 This architecture does not mandate a specific delivery mode but a 659 solution must support both types. 661 6. Manifest 663 In order for a device to apply an update, it has to make several 664 decisions about the update: 666 - Does it trust the author of the update? 668 - Has the firmware been corrupted? 670 - Does the firmware update apply to this device? 672 - Is the update older than the active firmware? 674 - When should the device apply the update? 676 - How should the device apply the update? 678 - What kind of firmware binary is it? 680 - Where should the update be obtained? 682 - Where should the firmware be stored? 684 The manifest encodes the information that devices need in order to 685 make these decisions. It is a data structure that contains the 686 following information: 688 - information about the device(s) the firmware image is intended to 689 be applied to, 691 - information about when the firmware update has to be applied, 693 - information about when the manifest was created, 695 - dependencies on other manifests, 697 - pointers to the firmware image and information about the format, 699 - information about where to store the firmware image, 701 - cryptographic information, such as digital signatures or message 702 authentication codes (MACs). 704 The manifest information model is described in 705 [I-D.ietf-suit-information-model]. 707 7. Device Firmware Update Examples 709 Although these documents attempt to define a firmware update 710 architecture that is applicable to both existing systems, as well as 711 yet-to-be-conceived systems; it is still helpful to consider existing 712 architectures. 714 7.1. Single CPU SoC 716 The simplest, and currently most common, architecture consists of a 717 single MCU along with its own peripherals. These SoCs generally 718 contain some amount of flash memory for code and fixed data, as well 719 as RAM for working storage. These systems either have a single 720 firmware image, or an immutable bootloader that runs a single image. 721 A notable characteristic of these SoCs is that the primary code is 722 generally execute in place (XIP). Combined with the non-relocatable 723 nature of the code, firmware updates need to be done in place. 725 7.2. Single CPU with Secure - Normal Mode Partitioning 727 Another configuration consists of a similar architecture to the 728 previous, with a single CPU. However, this CPU supports a security 729 partitioning scheme that allows memory (in addition to other things) 730 to be divided into secure and normal mode. There will generally be 731 two images, one for secure mode, and one for normal mode. In this 732 configuration, firmware upgrades will generally be done by the CPU in 733 secure mode, which is able to write to both areas of the flash 734 device. In addition, there are requirements to be able to update 735 either image independently, as well as to update them together 736 atomically, as specified in the associated manifests. 738 7.3. Dual CPU, shared memory 740 This configuration has two or more CPUs in a single SoC that share 741 memory (flash and RAM). Generally, they will be a protection 742 mechanism to prevent one CPU from accessing the other's memory. 743 Upgrades in this case will typically be done by one of the CPUs, and 744 is similar to the single CPU with secure mode. 746 7.4. Dual CPU, other bus 748 This configuration has two or more CPUs, each having their own 749 memory. There will be a communication channel between them, but it 750 will be used as a peripheral, not via shared memory. In this case, 751 each CPU will have to be responsible for its own firmware upgrade. 752 It is likely that one of the CPUs will be considered a master, and 753 will direct the other CPU to do the upgrade. This configuration is 754 commonly used to offload specific work to other CPUs. Firmware 755 dependencies are similar to the other solutions above, sometimes 756 allowing only one image to be upgraded, other times requiring several 757 to be upgraded atomically. Because the updates are happening on 758 multiple CPUs, upgrading the two images atomically is challenging. 760 8. Bootloader 762 Today, firmware updates for an Internet-connected device are expected 763 to be delivered over the Internet. Firmware updates over serial 764 interfaces, such as USB or RS232, are most likely the exception 765 rather than the norm. In order to fetch a manifest plus the firmware 766 image a fair amount of code is required since the firmware consumer 767 needs to implement 769 - the Internet protocol stack for large file downloads, 771 - the capability to write the received firmware image to some 772 persistent storage (most likely flash memory). It may even be 773 necessary to unpack, decompress or otherwise process the received 774 firmware image. 776 - security protocol features for communication security, 778 - manifest parsing, 780 - security functionality for manifest verification, and 782 - functionality for remote management by a device management server. 784 All these features are most likely offered by the application running 785 on the device (except for basic security algorithms that may run 786 either on a trusted execution environment or on a separate hardware 787 security MCU/module). 789 Once manifests have been processed and firmware images successfully 790 downloaded and verified the device needs to hand control over to the 791 bootloader. In most cases this requires the MCU to restart. The 792 bootloader then determines whether the newly downloaded firmware 793 image should be started. The boot process is security sensitive 794 since the firmware images may, for example, be stored in off-chip 795 flash memory given attackers easy access to the firmware image. The 796 bootloader will have to perform additional security checks on the 797 firmware image before it can be booted. 799 The manifest may have been stored alongside the firmware image to 800 allow re-verification of the firmware image during every boot 801 attempt. Alternatively, secure boot-specific meta-data may have been 802 created by the firmware consumer after a successful firmware download 803 and verification process. Whether to re-use the standardized 804 manifest format that was used during the initial firmware retrieval 805 process or whether it is better to use a different format for the 806 secure boot-specific meta-data depends on the system design. The 807 manifest format does, however, have the capability to serve also as a 808 building block for secure boot with its severable elements that allow 809 shrinking the size of the manifest by stripping elements that are no 810 longer needed. 812 If the application image contains the firmware consumer 813 functionality, as described above, then it is necessary that a 814 working image is left on the device to ensure that the bootloader can 815 roll back to a working firmware image to re-do the firmware download 816 since the bootloader itself does not have enough functionality to 817 fetch a firmware image plus manifest from a firmware server over the 818 Internet. A multi-stage bootloader may soften this requirement at 819 the expense of a more sophisticated boot process. 821 For a bootloader to offer a secure boot mechanism it needs to provide 822 the following features: 824 - ability to access security algorithms, such as SHA-256 to compute 825 a fingerprint over the firmware image and a digital signature 826 algorithm. 828 - access keying material directly or indirectly to utilize the 829 digital signature. The device needs to have a trust anchor store. 831 - ability to expose boot process-related data to the application 832 firmware (such as to the device management software). This allows 833 a device management server to determine whether the firmware 834 update has been successful and, if not, what errors occurred. 836 - to (optionally) offer attestation information (such as 837 measurements). 839 While the software architecture of the bootloader and also its 840 security mechanism are implemention-specific the use of the manifest 841 for controlling the download of the firmware over the Internet as 842 well as for the secure boot process is relevant for the design of the 843 manifest. 845 9. Example 847 The following example message flow illustrates a possible interaction 848 for distributing a firmware image to a device starting with an author 849 uploading the new firmware to firmware server and creating a 850 manifest. The firmware and manifest are stored on the same firmware 851 server. 853 +--------+ +-----------------+ +------------+ +----------+ 854 | Author | | Firmware Server | |FW Consumer | |Bootloader| 855 +--------+ +-----------------+ +------------+ +----------+ 856 | | | + 857 | Create Firmware | | | 858 |--------------- | | | 859 | | | | | 860 |<-------------- | | | 861 | | | | 862 | Upload Firmware | | | 863 |------------------>| | | 864 | | | | 865 | Create Manifest | | | 866 |---------------- | | | 867 | | | | | 868 |<--------------- | | | 869 | | | | 870 | Sign Manifest | | | 871 |-------------- | | | 872 | | | | | 873 |<------------- | | | 874 | | | | 875 | Upload Manifest | | | 876 |------------------>| | | 877 | | | | 878 | | Query Manifest | | 879 | |<--------------------| | 880 | | | | 881 | | Send Manifest | | 882 | |-------------------->| | 883 | | | Validate | 884 | | | Manifest | 885 | | |---------+ | 886 | | | | | 887 | | |<--------+ | 888 | | | | 889 | | Request Firmware | | 890 | |<--------------------| | 891 | | | | 892 | | Send Firmware | | 893 | |-------------------->| | 894 | | | Verify | 895 | | | Firmware | 896 | | |--------------- | 897 | | | | | 898 | | |<-------------- | 899 | | | | 900 | | | Store | 901 | | | Firmware | 902 | | |-------------- | 903 | | | | | 904 | | |<------------- | 905 | | | | 906 | | | | 907 | | | Reboot | 908 | | |--------------->| 909 | | | | 910 | | | Verify | 911 | | | Firmware | 912 | | | ---------------| 913 | | | | | 914 | | | -------------->| 915 | | | | 916 | | | Activate new | 917 | | | Firmware | 918 | | | ---------------| 919 | | | | | 920 | | | -------------->| 921 | | | | 922 | | | Boot new | 923 | | | Firmware | 924 | | | ---------------| 925 | | | | | 926 | | | -------------->| 927 | | | | 929 Figure 5: Example Flow for a Firmware Upate. 931 10. IANA Considerations 933 This document does not require any actions by IANA. 935 11. Security Considerations 937 Firmware updates fix security vulnerabilities and are considered to 938 be an important building block in securing IoT devices. Due to the 939 importance of firmware updates for IoT devices the Internet 940 Architecture Board (IAB) organized a 'Workshop on Internet of Things 941 (IoT) Software Update (IOTSU)', which took place at Trinity College 942 Dublin, Ireland on the 13th and 14th of June, 2016 to take a look at 943 the big picture. A report about this workshop can be found at 944 [RFC8240]. A standardized firmware manifest format providing end-to- 945 end security from the author to the device will be specified in a 946 separate document. 948 There are, however, many other considerations raised during the 949 workshop. Many of them are outside the scope of standardization 950 organizations since they fall into the realm of product engineering, 951 regulatory frameworks, and business models. The following 952 considerations are outside the scope of this document, namely 954 - installing firmware updates in a robust fashion so that the update 955 does not break the device functionality of the environment this 956 device operates in. 958 - installing firmware updates in a timely fashion considering the 959 complexity of the decision making process of updating devices, 960 potential re-certification requirements, and the need for user 961 consent to install updates. 963 - the distribution of the actual firmware update, potentially in an 964 efficient manner to a large number of devices without human 965 involvement. 967 - energy efficiency and battery lifetime considerations. 969 - key management required for verifying the digital signature 970 protecting the manifest. 972 - incentives for manufacturers to offer a firmware update mechanism 973 as part of their IoT products. 975 12. Mailing List Information 977 The discussion list for this document is located at the e-mail 978 address suit@ietf.org [1]. Information on the group and information 979 on how to subscribe to the list is at 980 https://www1.ietf.org/mailman/listinfo/suit [2] 982 Archives of the list can be found at: https://www.ietf.org/mail- 983 archive/web/suit/current/index.html [3] 985 13. Acknowledgements 987 We would like to thank the following persons for their feedback: 989 - Geraint Luff 991 - Amyas Phillips 992 - Dan Ros 994 - Thomas Eichinger 996 - Michael Richardson 998 - Emmanuel Baccelli 1000 - Ned Smith 1002 - Jim Schaad 1004 - Carsten Bormann 1006 - Cullen Jennings 1008 - Olaf Bergmann 1010 - Suhas Nandakumar 1012 - Phillip Hallam-Baker 1014 - Marti Bolivar 1016 - Andrzej Puzdrowski 1018 - Markus Gueller 1020 - Henk Birkholz 1022 - Jintao Zhu 1024 - Takeshi Takahashi 1026 We would also like to thank the WG chairs, Russ Housley, David 1027 Waltermire, Dave Thaler for their support and their reviews. 1028 Kathleen Moriarty was the responsible security area director when 1029 this work was started. 1031 14. References 1033 14.1. Normative References 1035 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1036 Requirement Levels", BCP 14, RFC 2119, 1037 DOI 10.17487/RFC2119, March 1997, 1038 . 1040 [RFC7925] Tschofenig, H., Ed. and T. Fossati, "Transport Layer 1041 Security (TLS) / Datagram Transport Layer Security (DTLS) 1042 Profiles for the Internet of Things", RFC 7925, 1043 DOI 10.17487/RFC7925, July 2016, 1044 . 1046 14.2. Informative References 1048 [I-D.ietf-suit-information-model] 1049 Moran, B., Tschofenig, H., and H. Birkholz, "Firmware 1050 Updates for Internet of Things Devices - An Information 1051 Model for Manifests", draft-ietf-suit-information-model-02 1052 (work in progress), January 2019. 1054 [LwM2M] OMA, ., "Lightweight Machine to Machine Technical 1055 Specification, Version 1.0.2", February 2018, 1056 . 1060 [RFC5649] Housley, R. and M. Dworkin, "Advanced Encryption Standard 1061 (AES) Key Wrap with Padding Algorithm", RFC 5649, 1062 DOI 10.17487/RFC5649, September 2009, 1063 . 1065 [RFC6024] Reddy, R. and C. Wallace, "Trust Anchor Management 1066 Requirements", RFC 6024, DOI 10.17487/RFC6024, October 1067 2010, . 1069 [RFC8240] Tschofenig, H. and S. Farrell, "Report from the Internet 1070 of Things Software Update (IoTSU) Workshop 2016", 1071 RFC 8240, DOI 10.17487/RFC8240, September 2017, 1072 . 1074 14.3. URIs 1076 [1] mailto:suit@ietf.org 1078 [2] https://www1.ietf.org/mailman/listinfo/suit 1080 [3] https://www.ietf.org/mail-archive/web/suit/current/index.html 1082 Authors' Addresses 1084 Brendan Moran 1085 Arm Limited 1087 EMail: Brendan.Moran@arm.com 1088 Milosch Meriac 1089 Consultant 1091 EMail: milosch@meriac.com 1093 Hannes Tschofenig 1094 Arm Limited 1096 EMail: hannes.tschofenig@gmx.net 1098 David Brown 1099 Linaro 1101 EMail: david.brown@linaro.org