idnits 2.17.1 draft-ietf-suit-architecture-02.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 (January 16, 2019) is 1927 days in the past. Is this intentional? Checking references for intended status: Informational ---------------------------------------------------------------------------- -- Looks like a reference, but probably isn't: '1' on line 990 -- Looks like a reference, but probably isn't: '2' on line 992 -- Looks like a reference, but probably isn't: '3' on line 994 == Outdated reference: A later version (-13) exists of draft-ietf-suit-information-model-01 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: July 20, 2019 Consultant 6 H. Tschofenig 7 Arm Limited 8 D. Brown 9 Linaro 10 January 16, 2019 12 A Firmware Update Architecture for Internet of Things Devices 13 draft-ietf-suit-architecture-02 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 July 20, 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 . . . . . 6 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 . . . . . . . . . . . 7 85 3.5. High reliability . . . . . . . . . . . . . . . . . . . . 8 86 3.6. Operate with a small bootloader . . . . . . . . . . . . . 8 87 3.7. Small Parsers . . . . . . . . . . . . . . . . . . . . . . 8 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 . . . . . . . . . . . . . . . . . 11 93 6. Manifest . . . . . . . . . . . . . . . . . . . . . . . . . . 15 94 7. Device Firmware Update Examples . . . . . . . . . . . . . . . 16 95 7.1. Single CPU SoC . . . . . . . . . . . . . . . . . . . . . 16 96 7.2. Single CPU with Secure - Normal Mode Partitioning . . . . 16 97 7.3. Dual CPU, shared memory . . . . . . . . . . . . . . . . . 16 98 7.4. Dual CPU, other bus . . . . . . . . . . . . . . . . . . . 16 99 8. Example Flow . . . . . . . . . . . . . . . . . . . . . . . . 17 100 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 18 101 10. Security Considerations . . . . . . . . . . . . . . . . . . . 19 102 11. Mailing List Information . . . . . . . . . . . . . . . . . . 19 103 12. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 20 104 13. References . . . . . . . . . . . . . . . . . . . . . . . . . 21 105 13.1. Normative References . . . . . . . . . . . . . . . . . . 21 106 13.2. Informative References . . . . . . . . . . . . . . . . . 21 107 13.3. URIs . . . . . . . . . . . . . . . . . . . . . . . . . . 22 108 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 22 110 1. Introduction 112 When developing IoT devices, one of the most difficult problems to 113 solve is how to update the firmware on the device. Once the device 114 is deployed, firmware updates play a critical part in its lifetime, 115 particularly when devices have a long lifetime, are deployed in 116 remote or inaccessible areas where manual intervention is cost 117 prohibitive or otherwise difficult. Updates to the firmware of an 118 IoT device are done to fix bugs in software, to add new 119 functionality, and to re-configure the device to work in new 120 environments or to behave differently in an already deployed context. 122 The firmware update process, among other goals, has to ensure that 124 - The firmware image is authenticated and integrity protected. 125 Attempts to flash a modified firmware image or an image from an 126 unknown source are prevented. 128 - The firmware image can be confidentiality protected so that 129 attempts by an adversary to recover the plaintext binary can be 130 prevented. Obtaining the firmware is often one of the first steps 131 to mount an attack since it gives the adversary valuable insights 132 into used software libraries, configuration settings and generic 133 functionality (even though reverse engineering the binary can be a 134 tedious process). 136 More details about the security goals are discussed in Section 5 and 137 requirements are described in Section 3. 139 2. Conventions and Terminology 141 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 142 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 143 "OPTIONAL" in this document are to be interpreted as described in RFC 144 2119 [RFC2119]. 146 This document uses the following terms: 148 - Manifest: The manifest contains meta-data about the firmware 149 image. The manifest is protected against modification and 150 provides information about the author. 152 - Firmware Image: The firmware image is a binary that may contain 153 the complete software of a device or a subset of it. The firmware 154 image may consist of multiple images, if the device contains more 155 than one microcontroller. The image may consist of a differential 156 update for performance reasons. Firmware is the more universal 157 term. Both terms are used in this document and are 158 interchangeable. 160 - Bootloader: A bootloader is a piece of software that is executed 161 once a microcontroller has been reset. It is responsible for 162 deciding whether to boot a firmware image that is present or 163 whether to obtain and verify a new firmware image. Since the 164 bootloader is a security critical component its functionality may 165 be split into separate stages. Such a multi-stage bootloader may 166 offer very basic functionality in the first stage and resides in 167 ROM whereas the second stage may implement more complex 168 functionality and resides in flash memory so that it can be 169 updated in the future (in case bugs have been found). The exact 170 split of components into the different stages, the number of 171 firmware images stored by an IoT device, and the detailed 172 functionality varies throughout different implementations. 174 - Microcontroller (MCU for microcontroller unit): An MCU is a 175 compact integrated circuit designed for use in embedded systems. 176 A typical microcontroller includes a processor, memory (RAM and 177 flash), input/output (I/O) ports and other features connected via 178 some bus on a single chip. The term 'system on chip (SoC)' is 179 often used for these types of devices. 181 - System on Chip (SoC): An SoC is an integrated circuit that 182 integrates all components of a computer, such as CPU, memory, 183 input/output ports, secondary storage, etc. 185 - Homogeneous Storage Architecture (HoSA): A device that stores all 186 firmware components in the same way, for example in a file system 187 or in flash memory. 189 - Heterogeneous Storage Architecture (HeSA): A device that stores at 190 least one firmware component differently from the rest, for 191 example a device with an external, updatable radio, or a device 192 with internal and external flash memory. 194 The following entities are used: 196 - Author: The author is the entity that creates the firmware image. 197 There may be multiple authors in a system either when a device 198 consists of multiple micro-controllers or when the the final 199 firmware image consists of software components from multiple 200 companies. 202 - Firmware Consumer: The firmware consumer is the recipient of the 203 firmware image and the manifest. 205 - Device: A device refers to the entire IoT product, which consists 206 of one or many MCUs, sensors and/or actuators. Many IoT devices 207 sold today contain multiple MCUs and therefore a single device may 208 need to obtain more than one firmware image and manifest to 209 succesfully perform an update. The terms device and firmware 210 consumer are used interchangably since the firmware consumer is 211 one software component running on an MCU on the device. 213 - Status Tracker: The status tracker offers device management 214 functionality that includes keep track of the firmware update 215 process. This includes fine-grained monitoring of changes at the 216 device, for example, what state of the firmware update cycle the 217 device is currently in. 219 - Firmware Server: The firmware server stores firmware images and 220 manifests and distributes them to IoT devices. Some deployments 221 may require a store-and-forward concept, which requires storing 222 the firmware images/manifests on more than one entity before 223 they reach the device. 225 - Device Operator: The actor responsible for the day-to-day 226 operation of a fleet of IoT devices. 228 - Network Operator: The actor responsible for the operation of a 229 network to which IoT devices connect. 231 In addition to the entities in the list above there is an orthogonal 232 infrastructure with a Trust Provisioning Authority (TPA) distributing 233 trust anchors and authorization permissions to various entities in 234 the system. The TPA may also delegate rights to install, update, 235 enhance, or delete trust anchors and authorization permissions to 236 other parties in the system. This infrastructure overlaps the 237 communication architecture and different deployments may empower 238 certain entities while other deployments may not. For example, in 239 some cases, the Original Design Manufacturer (ODM), which is a 240 company that designs and manufactures a product, may act as a TPA and 241 may decide to remain in full control over the firmware update process 242 of their products. 244 The terms 'trust anchor' and 'trust anchor store' are defined in 245 [RFC6024]: 247 - "A trust anchor represents an authoritative entity via a public 248 key and associated data. The public key is used to verify digital 249 signatures, and the associated data is used to constrain the types 250 of information for which the trust anchor is authoritative." 252 - "A trust anchor store is a set of one or more trust anchors stored 253 in a device. A device may have more than one trust anchor store, 254 each of which may be used by one or more applications." 256 3. Requirements 258 The firmware update mechanism described in this specification was 259 designed with the following requirements in mind: 261 - Agnostic to how firmware images are distributed 263 - Friendly to broadcast delivery 265 - Use state-of-the-art security mechanisms 267 - Rollback attacks must be prevented 269 - High reliability 271 - Operate with a small bootloader 273 - Small Parsers 275 - Minimal impact on existing firmware formats 277 - Robust permissions 279 - Diverse modes of operation 281 3.1. Agnostic to how firmware images are distributed 283 Firmware images can be conveyed to devices in a variety of ways, 284 including USB, UART, WiFi, BLE, low-power WAN technologies, etc. and 285 use different protocols (e.g., CoAP, HTTP). The specified mechanism 286 needs to be agnostic to the distribution of the firmware images and 287 manifests. 289 3.2. Friendly to broadcast delivery 291 This architecture does not specify any specific broadcast protocol. 292 However, given that broadcast may be desirable for some networks, 293 updates must cause the least disruption possible both in metadata and 294 payload transmission. 296 For an update to be broadcast friendly, it cannot rely on link layer, 297 network layer, or transport layer security. In addition, the same 298 message must be deliverable to many devices, both those to which it 299 applies and those to which it does not, without a chance that the 300 wrong device will accept the update. Considerations that apply to 301 network broadcasts apply equally to the use of third-party content 302 distribution networks for payload distribution. 304 3.3. Use state-of-the-art security mechanisms 306 End-to-end security between the author and the device, as shown in 307 Section 5, is used to ensure that the device can verify firmware 308 images and manifests produced by authorized authors. 310 The use of post-quantum secure signature mechanisms, such as hash- 311 based signatures, should be explored. A migration to post-quantum 312 secure signatures would require significant effort, therefore, 313 mandatory-to-implement support for post-quantum secure signatures is 314 a goal. 316 A mandatory-to-implement set of algorithms has to be defined offering 317 a key length of 112-bit symmetric key or security or more, as 318 outlined in Section 20 of RFC 7925 [RFC7925]. This corresponds to a 319 233 bit ECC key or a 2048 bit RSA key. 321 If the firmware image is to be encrypted, it must be done in such a 322 way that every intended recipient can decrypt it. The information 323 that is encrypted individually for each device must be an absolute 324 minimum, for example AES Key Wrap [RFC5649], in order to maintain 325 friendliness to Content Distribution Networks, bulk storage, and 326 broadcast protocols. 328 3.4. Rollback attacks must be prevented 330 A device presented with an old, but valid manifest and firmware must 331 not be tricked into installing such firmware since a vulnerability in 332 the old firmware image may allow an attacker to gain control of the 333 device. 335 3.5. High reliability 337 A power failure at any time must not cause a failure of the device. 338 A failure to validate any part of an update must not cause a failure 339 of the device. One way to achieve this functionality is to provide a 340 minimum of two storage locations for firmware and one bootable 341 location for firmware. An alternative approach is to use a 2nd stage 342 bootloader with build-in full featured firmware update functionality 343 such that it is possible to return to the update process after power 344 down. 346 Note: This is an implementation requirement rather than a requirement 347 on the manifest format. 349 3.6. Operate with a small bootloader 351 The bootloader must be minimal, containing only flash support, 352 cryptographic primitives and optionally a recovery mechanism. The 353 recovery mechanism is used in case the update process failed and may 354 include support for firmware updates over serial, USB or even a 355 limited version of wireless connectivity standard like a limited 356 Bluetooth Smart. Such a recovery mechanism must provide security at 357 least at the same level as the full featured firmware update 358 functionalities. 360 The bootloader needs to verify the received manifest and to install 361 the bootable firmware image. The bootloader should not require 362 updating since a failed update poses a risk in reliability. If more 363 functionality is required in the bootloader, it must use a two-stage 364 bootloader, with the first stage comprising the functionality defined 365 above. 367 All information necessary for a device to make a decision about the 368 installation of a firmware update must fit into the available RAM of 369 a constrained IoT device. This prevents flash write exhaustion. 371 Note: This is an implementation requirement. 373 3.7. Small Parsers 375 Since parsers are known sources of bugs they must be minimal. 376 Additionally, it must be easy to parse only those fields that are 377 required to validate at least one signature or MAC with minimal 378 exposure. 380 3.8. Minimal impact on existing firmware formats 382 The design of the firmware update mechanism must not require changes 383 to existing firmware formats. 385 3.9. Robust permissions 387 When a device obtains a monolithic firmware image from a single 388 author without any additional approval steps then the authorization 389 flow is relatively simple. There are, however, other cases where 390 more complex policy decisions need to be made before updating a 391 device. 393 In this architecture the authorization policy is separated from the 394 underlying communication architecture. This is accomplished by 395 separating the entities from their permissions. For example, an 396 author may not have the authority to install a firmware image on a 397 device in critical infrastructure without the authorization of a 398 device operator. In this case, the device may be programmed to 399 reject firmware updates unless they are signed both by the firmware 400 author and by the device operator. 402 Alternatively, a device may trust precisely one entity, which does 403 all permission management and coordination. This entity allows the 404 device to offload complex permissions calculations for the device. 406 3.10. Operating modes 408 There are three broad classifications of update operating modes. 410 - Client-initiated Update 412 - Server-initiated Update 414 - Hybrid Update 416 Client-initiated updates take the form of a firmware consumer on a 417 device proactively checking (polling) for new firmware images. 419 Server-initiated updates are important to consider because timing of 420 updates may need to be tightly controlled in some high- reliability 421 environments. In this case the status tracker determines what 422 devices qualify for a firmware update. Once those devices have been 423 selected the firmware server distributes updates to the firmware 424 consumers. 426 Note: This assumes that the status tracker is able to reach the 427 device, which may require devices to keep reachability information at 428 the status tracker up-to-date. This may also require keeping state 429 at NATs and stateful packet filtering firewalls alive. 431 Hybrid updates are those that require an interaction between the 432 firmware consumer and the status tracker. The status tracker pushes 433 notifications of availability of an update to the firmware consumer, 434 and it then downloads the image from a firmware server as soon as 435 possible. 437 An alternative view to the operating modes is to consider the steps a 438 device has to go through in the course of an update: 440 - Notification 442 - Pre-authorisation 444 - Dependency resolution 446 - Download 448 - Installation 450 The notification step consists of the status tracker informing the 451 firmware consumer that an update is available. This can be 452 accomplished via polling (client-initiated), push notifications 453 (server-initiated), or more complex mechanisms. 455 The pre-authorisation step involves verifying whether the entity 456 signing the manifest is indeed authorized to perform an update. The 457 firmware consumer must also determine whether it should fetch and 458 process a firmware image, which is referenced in a manifest. 460 A dependency resolution phase is needed when more than one component 461 can be updated or when a differential update is used. The necessary 462 dependencies must be available prior to installation. 464 The download step is the process of acquiring a local copy of the 465 firmware image. When the download is client-initiated, this means 466 that the firmware consumer chooses when a download occurs and 467 initiates the download process. When a download is server-initiated, 468 this means that the status tracker tells the device when to download 469 or that it initiates the transfer directly to the firmware consumer. 470 For example, a download from an HTTP-based firmware server is client- 471 initiated. Pushing a manifest and firmware image to the transfer to 472 the Package resource of the LwM2M Firmware Update object [LwM2M] is 473 server-initiated. 475 If the firmware consumer has downloaded a new firmware image and is 476 ready to install it, it may need to wait for a trigger from the 477 status tracker to initiate the installation, may trigger the update 478 automatically, or may go through a more complex decision making 479 process to determine the appropriate timing for an update (such as 480 delaying the update process to a later time when end users are less 481 impacted by the update process). 483 Installation is the act of processing the payload into a format that 484 the IoT device can recognise and the bootloader is responsible for 485 then booting from the newly installed firmware image. 487 Each of these steps may require different permissions. 489 4. Claims 491 Claims in the manifest offer a way to convey instructions to a device 492 that impact the firmware update process. To have any value the 493 manifest containing those claims must be authenticated and integrity 494 protected. The credential used to must be directly or indirectly 495 related to the trust anchor installed at the device by the Trust 496 Provisioning Authority. 498 The baseline claims for all manifests are described in 499 [I-D.ietf-suit-information-model]. For example, there are: 501 - Do not install firmware with earlier metadata than the current 502 metadata. 504 - Only install firmware with a matching vendor, model, hardware 505 revision, software version, etc. 507 - Only install firmware that is before its best-before timestamp. 509 - Only allow a firmware installation if dependencies have been met. 511 - Choose the mechanism to install the firmware, based on the type of 512 firmware it is. 514 5. Communication Architecture 516 Figure 1 shows the communication architecture where a firmware image 517 is created by an author, and uploaded to a firmware server. The 518 firmware image/manifest is distributed to the device either in a push 519 or pull manner using the firmware consumer residing on the device. 520 The device operator keeps track of the process using the status 521 tracker. This allows the device operator to know and control what 522 devices have received an update and which of them are still pending 523 an update. 525 Firmware + +----------+ Firmware + +-----------+ 526 Manifest | |-+ Manifest | |-+ 527 +--------->| Firmware | |<---------------| | | 528 | | Server | | | Author | | 529 | | | | | | | 530 | +----------+ | +-----------+ | 531 | +----------+ +-----------+ 532 | 533 | 534 | 535 -+-- ------ 536 ---- | ---- ---- ---- 537 // | \\ // \\ 538 / | \ / \ 539 / | \ / \ 540 / | \ / \ 541 / | \ / \ 542 | v | | | 543 | +------------+ | 544 | | Firmware | | | | 545 | | Consumer | | Device | +--------+ | 546 | +------------+ | Management| | | | 547 | | |<------------------------->| Status | | 548 | | Device | | | | Tracker| | 549 | +------------+ | || | | | 550 | | || +--------+ | 551 | | | | 552 | | \ / 553 \ / \ / 554 \ / \ Device / 555 \ Network / \ Operator / 556 \ Operator / \\ // 557 \\ // ---- ---- 558 ---- ---- ------ 559 ----- 561 Figure 1: Architecture. 563 End-to-end security mechanisms are used to protect the firmware image 564 and the manifest although Figure 2 does not show the manifest itself 565 since it may be distributed independently. 567 +-----------+ 568 +--------+ | | +--------+ 569 | | Firmware Image | Firmware | Firmware Image | | 570 | Device |<-----------------| Server |<------------------| Author | 571 | | | | | | 572 +--------+ +-----------+ +--------+ 573 ^ * 574 * * 575 ************************************************************ 576 End-to-End Security 578 Figure 2: End-to-End Security. 580 Whether the firmware image and the manifest is pushed to the device 581 or fetched by the device is a deployment specific decision. 583 The following assumptions are made to allow the firmware consumer to 584 verify the received firmware image and manifest before updating 585 software: 587 - To accept an update, a device needs to verify the signature 588 covering the manifest. There may be one or multiple manifests 589 that need to be validated, potentially signed by different 590 parties. The device needs to be in possession of the trust 591 anchors to verify those signatures. Installing trust anchors to 592 devices via the Trust Provisioning Authority happens in an out-of- 593 band fashion prior to the firmware update process. 595 - Not all entities creating and signing manifests have the same 596 permissions. A device needs to determine whether the requested 597 action is indeed covered by the permission of the party that 598 signed the manifest. Informing the device about the permissions 599 of the different parties also happens in an out-of-band fashion 600 and is also a duty of the Trust Provisioning Authority. 602 - For confidentiality protection of firmware images the author needs 603 to be in possession of the certificate/public key or a pre-shared 604 key of a device. The use of confidentiality protection of 605 firmware images is deployment specific. 607 There are different types of delivery modes, which are illustrated 608 based on examples below. 610 There is an option for embedding a firmware image into a manifest. 611 This is a useful approach for deployments where devices are not 612 connected to the Internet and cannot contact a dedicated firmware 613 server for the firmware download. It is also applicable when the 614 firmware update happens via a USB stick or via Bluetooth Smart. 615 Figure 3 shows this delivery mode graphically. 617 /------------\ /------------\ 618 /Manifest with \ /Manifest with \ 619 |attached | |attached | 620 \firmware image/ \firmware image/ 621 \------------/ +-----------+ \------------/ 622 +--------+ | | +--------+ 623 | |<.................| Firmware |<................| | 624 | Device | | Server | | Author | 625 | | | | | | 626 +--------+ +-----------+ +--------+ 628 Figure 3: Manifest with attached firmware. 630 Figure 4 shows an option for remotely updating a device where the 631 device fetches the firmware image from some file server. The 632 manifest itself is delivered independently and provides information 633 about the firmware image(s) to download. 635 /------------\ 636 / \ 637 | Manifest | 638 \ / 639 +--------+ \------------/ +--------+ 640 | |<..............................................>| | 641 | Device | -- | Author | 642 | |<- --- | | 643 +--------+ -- --- +--------+ 644 -- --- 645 --- --- 646 -- +-----------+ -- 647 -- | | -- 648 /------------\ -- | Firmware |<- /------------\ 649 / \ -- | Server | / \ 650 | Firmware | | | | Firmware | 651 \ / +-----------+ \ / 652 \------------/ \------------/ 654 Figure 4: Independent retrieval of the firmware image. 656 This architecture does not mandate a specific delivery mode but a 657 solution must support both types. 659 6. Manifest 661 In order for a device to apply an update, it has to make several 662 decisions about the update: 664 - Does it trust the author of the update? 666 - Has the firmware been corrupted? 668 - Does the firmware update apply to this device? 670 - Is the update older than the active firmware? 672 - When should the device apply the update? 674 - How should the device apply the update? 676 - What kind of firmware binary is it? 678 - Where should the update be obtained? 680 - Where should the firmware be stored? 682 The manifest encodes the information that devices need in order to 683 make these decisions. It is a data structure that contains the 684 following information: 686 - information about the device(s) the firmware image is intended to 687 be applied to, 689 - information about when the firmware update has to be applied, 691 - information about when the manifest was created, 693 - dependencies on other manifests, 695 - pointers to the firmware image and information about the format, 697 - information about where to store the firmware image, 699 - cryptographic information, such as digital signatures or message 700 authentication codes (MACs). 702 The manifest information model is described in 703 [I-D.ietf-suit-information-model]. 705 7. Device Firmware Update Examples 707 Although these documents attempt to define a firmware update 708 architecture that is applicable to both existing systems, as well as 709 yet-to-be-conceived systems; it is still helpful to consider existing 710 architectures. 712 7.1. Single CPU SoC 714 The simplest, and currently most common, architecture consists of a 715 single MCU along with its own peripherals. These SoCs generally 716 contain some amount of flash memory for code and fixed data, as well 717 as RAM for working storage. These systems either have a single 718 firmware image, or an immutable bootloader that runs a single image. 719 A notable characteristic of these SoCs is that the primary code is 720 generally execute in place (XIP). Combined with the non-relocatable 721 nature of the code, firmware updates need to be done in place. 723 7.2. Single CPU with Secure - Normal Mode Partitioning 725 Another configuration consists of a similar architecture to the 726 previous, with a single CPU. However, this CPU supports a security 727 partitioning scheme that allows memory (in addition to other things) 728 to be divided into secure and normal mode. There will generally be 729 two images, one for secure mode, and one for normal mode. In this 730 configuration, firmware upgrades will generally be done by the CPU in 731 secure mode, which is able to write to both areas of the flash 732 device. In addition, there are requirements to be able to update 733 either image independently, as well as to update them together 734 atomically, as specified in the associated manifests. 736 7.3. Dual CPU, shared memory 738 This configuration has two or more CPUs in a single SoC that share 739 memory (flash and RAM). Generally, they will be a protection 740 mechanism to prevent one CPU from accessing the other's memory. 741 Upgrades in this case will typically be done by one of the CPUs, and 742 is similar to the single CPU with secure mode. 744 7.4. Dual CPU, other bus 746 This configuration has two or more CPUs, each having their own 747 memory. There will be a communication channel between them, but it 748 will be used as a peripheral, not via shared memory. In this case, 749 each CPU will have to be responsible for its own firmware upgrade. 750 It is likely that one of the CPUs will be considered a master, and 751 will direct the other CPU to do the upgrade. This configuration is 752 commonly used to offload specific work to other CPUs. Firmware 753 dependencies are similar to the other solutions above, sometimes 754 allowing only one image to be upgraded, other times requiring several 755 to be upgraded atomically. Because the updates are happening on 756 multiple CPUs, upgrading the two images atomically is challenging. 758 8. Example Flow 760 The following example message flow illustrates the interaction for 761 distributing a firmware image to a device starting with an author 762 uploading the new firmware to firmware server and creating a 763 manifest. The firmware and manifest are stored on the same firmware 764 server. 766 +--------+ +-----------------+ +------------+ +----------+ 767 | Author | | Firmware Server | |FW Consuumer| |Bootloader| 768 +--------+ +-----------------+ +------------+ +----------+ 769 | | | + 770 | Create Firmware | | | 771 |--------------- | | | 772 | | | | | 773 |<-------------- | | | 774 | | | | 775 | Upload Firmware | | | 776 |------------------>| | | 777 | | | | 778 | Create Manifest | | | 779 |---------------- | | | 780 | | | | | 781 |<--------------- | | | 782 | | | | 783 | Sign Manifest | | | 784 |-------------- | | | 785 | | | | | 786 |<------------- | | | 787 | | | | 788 | Upload Manifest | | | 789 |------------------>| | | 790 | | | | 791 | | Query Manifest | | 792 | |<--------------------| | 793 | | | | 794 | | Send Manifest | | 795 | |-------------------->| | 796 | | | Validate | 797 | | | Manifest | 798 | | |---------+ | 799 | | | | | 800 | | |<--------+ | 801 | | | | 802 | | Request Firmware | | 803 | |<--------------------| | 804 | | | | 805 | | Send Firmware | | 806 | |-------------------->| | 807 | | | Verify | 808 | | | Firmware | 809 | | |--------------- | 810 | | | | | 811 | | |<-------------- | 812 | | | | 813 | | | Store | 814 | | | Firmware | 815 | | |-------------- | 816 | | | | | 817 | | |<------------- | 818 | | | | 819 | | | | 820 | | | Reboot | 821 | | |--------------->| 822 | | | | 823 | | | Validate | 824 | | | Firmware | 825 | | | ---------------| 826 | | | | | 827 | | | -------------->| 828 | | | | 829 | | | Activate new | 830 | | | Firmware | 831 | | | ---------------| 832 | | | | | 833 | | | -------------->| 834 | | | | 835 | | | Boot new | 836 | | | Firmware | 837 | | | ---------------| 838 | | | | | 839 | | | -------------->| 840 | | | | 842 Figure 5: Example Flow for a Firmware Upate. 844 9. IANA Considerations 846 This document does not require any actions by IANA. 848 10. Security Considerations 850 Firmware updates fix security vulnerabilities and are considered to 851 be an important building block in securing IoT devices. Due to the 852 importance of firmware updates for IoT devices the Internet 853 Architecture Board (IAB) organized a 'Workshop on Internet of Things 854 (IoT) Software Update (IOTSU)', which took place at Trinity College 855 Dublin, Ireland on the 13th and 14th of June, 2016 to take a look at 856 the big picture. A report about this workshop can be found at 857 [RFC8240]. A standardized firmware manifest format providing end-to- 858 end security from the author to the device will be specified in a 859 separate document. 861 There are, however, many other considerations raised during the 862 workshop. Many of them are outside the scope of standardization 863 organizations since they fall into the realm of product engineering, 864 regulatory frameworks, and business models. The following 865 considerations are outside the scope of this document, namely 867 - installing firmware updates in a robust fashion so that the update 868 does not break the device functionality of the environment this 869 device operates in. 871 - installing firmware updates in a timely fashion considering the 872 complexity of the decision making process of updating devices, 873 potential re-certification requirements, and the need for user 874 consent to install updates. 876 - the distribution of the actual firmware update, potentially in an 877 efficient manner to a large number of devices without human 878 involvement. 880 - energy efficiency and battery lifetime considerations. 882 - key management required for verifying the digital signature 883 protecting the manifest. 885 - incentives for manufacturers to offer a firmware update mechanism 886 as part of their IoT products. 888 11. Mailing List Information 890 The discussion list for this document is located at the e-mail 891 address suit@ietf.org [1]. Information on the group and information 892 on how to subscribe to the list is at 893 https://www1.ietf.org/mailman/listinfo/suit [2] 894 Archives of the list can be found at: https://www.ietf.org/mail- 895 archive/web/suit/current/index.html [3] 897 12. Acknowledgements 899 We would like to thank the following persons for their feedback: 901 - Geraint Luff 903 - Amyas Phillips 905 - Dan Ros 907 - Thomas Eichinger 909 - Michael Richardson 911 - Emmanuel Baccelli 913 - Ned Smith 915 - Jim Schaad 917 - Carsten Bormann 919 - Cullen Jennings 921 - Olaf Bergmann 923 - Suhas Nandakumar 925 - Phillip Hallam-Baker 927 - Marti Bolivar 929 - Andrzej Puzdrowski 931 - Markus Gueller 933 - Henk Birkholz 935 - Jintao Zhu 937 - Takeshi Takahashi 939 We would also like to thank the WG chairs, Russ Housley, David 940 Waltermire, Dave Thaler for their support and their reviews. 942 Kathleen Moriarty was the responsible security area director when 943 this work was started. 945 13. References 947 13.1. Normative References 949 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 950 Requirement Levels", BCP 14, RFC 2119, 951 DOI 10.17487/RFC2119, March 1997, 952 . 954 [RFC7925] Tschofenig, H., Ed. and T. Fossati, "Transport Layer 955 Security (TLS) / Datagram Transport Layer Security (DTLS) 956 Profiles for the Internet of Things", RFC 7925, 957 DOI 10.17487/RFC7925, July 2016, 958 . 960 13.2. Informative References 962 [I-D.ietf-suit-information-model] 963 Moran, B., Tschofenig, H., and H. Birkholz, "Firmware 964 Updates for Internet of Things Devices - An Information 965 Model for Manifests", draft-ietf-suit-information-model-01 966 (work in progress), July 2018. 968 [LwM2M] OMA, ., "Lightweight Machine to Machine Technical 969 Specification, Version 1.0.2", February 2018, 970 . 974 [RFC5649] Housley, R. and M. Dworkin, "Advanced Encryption Standard 975 (AES) Key Wrap with Padding Algorithm", RFC 5649, 976 DOI 10.17487/RFC5649, September 2009, 977 . 979 [RFC6024] Reddy, R. and C. Wallace, "Trust Anchor Management 980 Requirements", RFC 6024, DOI 10.17487/RFC6024, October 981 2010, . 983 [RFC8240] Tschofenig, H. and S. Farrell, "Report from the Internet 984 of Things Software Update (IoTSU) Workshop 2016", 985 RFC 8240, DOI 10.17487/RFC8240, September 2017, 986 . 988 13.3. URIs 990 [1] mailto:suit@ietf.org 992 [2] https://www1.ietf.org/mailman/listinfo/suit 994 [3] https://www.ietf.org/mail-archive/web/suit/current/index.html 996 Authors' Addresses 998 Brendan Moran 999 Arm Limited 1001 EMail: Brendan.Moran@arm.com 1003 Milosch Meriac 1004 Consultant 1006 EMail: milosch@meriac.com 1008 Hannes Tschofenig 1009 Arm Limited 1011 EMail: hannes.tschofenig@gmx.net 1013 David Brown 1014 Linaro 1016 EMail: david.brown@linaro.org