idnits 2.17.00 (12 Aug 2021) /tmp/idnits31659/draft-ietf-suit-architecture-01.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 (July 02, 2018) is 1418 days in the past. Is this intentional? Checking references for intended status: Informational ---------------------------------------------------------------------------- -- Looks like a reference, but probably isn't: '1' on line 980 == Outdated reference: draft-ietf-suit-information-model has been published as RFC 9124 Summary: 0 errors (**), 0 flaws (~~), 4 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: January 3, 2019 Consultant 6 H. Tschofenig 7 Arm Limited 8 D. Brown 9 Linaro 10 July 02, 2018 12 A Firmware Update Architecture for Internet of Things Devices 13 draft-ietf-suit-architecture-01 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 January 3, 2019. 49 Copyright Notice 51 Copyright (c) 2018 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 . . . . . . . . . . . . . . . . . . . . . . . . 6 81 3.1. Agnostic to how firmware images are distributed . . . . . 6 82 3.2. Friendly to broadcast delivery . . . . . . . . . . . . . 6 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 . . . . . . . . . . . . . . . . . . . . 7 86 3.6. Operate with a small bootloader . . . . . . . . . . . . . 8 87 3.7. Small Parsers . . . . . . . . . . . . . . . . . . . . . . 8 88 3.8. Minimal impact on existing firmware formats . . . . . . . 8 89 3.9. Robust permissions . . . . . . . . . . . . . . . . . . . 8 90 3.10. Operating modes . . . . . . . . . . . . . . . . . . . . . 9 91 4. Claims . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 92 5. Communication Architecture . . . . . . . . . . . . . . . . . 11 93 6. Manifest . . . . . . . . . . . . . . . . . . . . . . . . . . 14 94 7. Device Firmware Update Examples . . . . . . . . . . . . . . . 15 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 . . . . . . . . . . . . . . . . . . . 18 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 . . . . . . . . . . . . . . . . . . . . . . . . . . 21 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 or where manual intervention is cost 117 prohibitive or otherwise difficult. The need for a firmware update 118 may be to fix bugs in software, to add new functionality, or to re- 119 configure the device. 121 The firmware update process, among other goals, has to ensure that 123 - The firmware image is authenticated and attempts to flash a 124 malicious firmware image are prevented. 126 - The firmware image can be confidentiality protected so that 127 attempts by an adversary to recover the plaintext binary can be 128 prevented. Obtaining the plaintext binary is often one of the 129 first steps for an attack to mount an attack. 131 2. Conventions and Terminology 133 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 134 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 135 "OPTIONAL" in this document are to be interpreted as described in RFC 136 2119 [RFC2119]. 138 This document uses the following terms: 140 - Manifest: The manifest contains meta-data about the firmware 141 image. The manifest is protected against modification and 142 provides information about the author. 144 - Firmware Image: The firmware image is a binary that may contain 145 the complete software of a device or a subset of it. The firmware 146 image may consist of multiple images, if the device contains more 147 than one microcontroller. The image may consist of a differential 148 update for performance reasons. Firmware is the more universal 149 term. Both terms are used in this document and are 150 interchangeable. 152 - Bootloader: A bootloader is a piece of software that is executed 153 once a microcontroller has been reset. It is responsible for 154 deciding whether to boot a firmware image that is present or 155 whether to obtain and verify a new firmware image. Since the 156 bootloader is a security critical component its functionality may 157 be split into separate stages. Such a multi-stage bootloader may 158 offer very basic functionality in the first stage and resides in 159 ROM whereas the second stage may implement more complex 160 functionality and resides in flash memory so that it can be 161 updated in the future (in case bugs have been found). The exact 162 split of components into the different stages, the number of 163 firmware images stored by an IoT device, and the detailed 164 functionality varies throughout different implementations. 166 The following entities are used: 168 - Author: The author is the entity that creates the firmware image. 169 There may be multiple authors in a system either when a device 170 consists of multiple micro-controllers or when the the final 171 firmware image consists of software components from multiple 172 companies. 174 - Device: The device is the recipient of the firmware image and the 175 manifest. The goal is to update the firmware of the device. A 176 single device may need to obtain more than one firmware image and 177 manifest to succesfully perform an update. 179 - Communicator: The communicator component of the device interacts 180 with the firmware update server. It receives firmware images and 181 triggers an update, if needed. The communicator either polls a 182 firmware update server for the most recent manifest/firmware or 183 manifests/firmware images are pushed to it. Note that the 184 firmware update process may involve multiple stages since one or 185 multiple manifests may need to be downloaded before the 186 communicator can fetch one or multiple firmware images/software 187 components. 189 - Status Tracker: The status tracker offers device management 190 functionality that includes keep track of the firmware update 191 process. This includes fine-grained monitoring of changes at the 192 device, for example, what state of the firmware update cycle the 193 device is currently in. 195 - Firmware Server: Entity that stores firmware images and manifests. 196 Some deployments may require storage of the firmware images/ 197 manifests on more than one entities before they reach the device. 199 - Device Operator: The actor responsible for the day-to-day 200 operation of a fleet of IoT devices. 202 - Network Operator: The actor responsible for the operation of a 203 network to which IoT devices connect. 205 In addition to the entities in the list above there is an orthogonal 206 infrastructure with a Trust Provisioning Authority (TPA) distributing 207 trust anchors and authorization permissions to various entities in 208 the system. The TPA may also delegate rights to install, update, 209 enhance, or delete trust anchors and authorization permissions to 210 other parties in the system. This infrastructure overlaps the 211 communication architecture and different deployments may empower 212 certain entities while other deployments may not. For example, in 213 some cases, the Original Design Manufacturer (ODM), which is a 214 company that designs and manufactures a product, may act as a TPA and 215 may decide to remain in full control over the firmware update process 216 of their products. 218 The terms 'trust anchor' and 'trust anchor store' are defined in 219 [RFC6024]: 221 - "A trust anchor represents an authoritative entity via a public 222 key and associated data. The public key is used to verify digital 223 signatures, and the associated data is used to constrain the types 224 of information for which the trust anchor is authoritative." 226 - "A trust anchor store is a set of one or more trust anchors stored 227 in a device. A device may have more than one trust anchor store, 228 each of which may be used by one or more applications." 230 Furthermore, the following abbreviations are used in this document: 232 - Microcontroller (MCU for microcontroller unit) is a small computer 233 on a single integrated circuit, which is often used for mass 234 volumne IoT devices. 236 - System on Chip (SoC) is an integrated circuit that integrates all 237 components of a computer, such as CPU, memory, input/output ports, 238 secondary storage, etc. 240 - Homogeneous Storage Architecture (HoSA): A device that stores all 241 firmware components in the same way, for example in a file system 242 or in flash memory. 244 - Heterogeneous Storage Architecture (HeSA): A device that stores at 245 least one firmware component differently from the rest, for 246 example a device with an external, updatable radio, or a device 247 with internal and external flash memory. 249 3. Requirements 251 The firmware update mechanism described in this specification was 252 designed with the following requirements in mind: 254 - Agnostic to how firmware images are distributed 256 - Friendly to broadcast delivery 258 - Use state-of-the-art security mechanisms 260 - Rollback attacks must be prevented 262 - High reliability 264 - Operate with a small bootloader 266 - Small Parsers 268 - Minimal impact on existing firmware formats 270 - Robust permissions 272 - Diverse modes of operation 274 3.1. Agnostic to how firmware images are distributed 276 Firmware images can be conveyed to devices in a variety of ways, 277 including USB, UART, WiFi, BLE, low-power WAN technologies, etc. and 278 use different protocols (e.g., CoAP, HTTP). The specified mechanism 279 needs to be agnostic to the distribution of the firmware images and 280 manifests. 282 3.2. Friendly to broadcast delivery 284 This architecture does not specify any specific broadcast protocol 285 however, given that broadcast may be desirable for some networks, 286 updates must cause the least disruption possible both in metadata and 287 payload transmission. 289 For an update to be broadcast friendly, it cannot rely on link layer, 290 network layer, or transport layer security. In addition, the same 291 message must be deliverable to many devices, both those to which it 292 applies and those to which it does not, without a chance that the 293 wrong device will accept the update. Considerations that apply to 294 network broadcasts apply equally to the use of third-party content 295 distribution networks for payload distribution. 297 3.3. Use state-of-the-art security mechanisms 299 End-to-end security between the author and the device, as shown in 300 Section 5, is used to ensure that the device can verify firmware 301 images and manifests produced by authorized authors. 303 The use of post-quantum secure signature mechanisms, such as hash- 304 based signatures, should be explored. A migration to post-quantum 305 secure signatures would require significant effort, therefore, 306 mandatory-to-implement support for post-quantum secure signatures is 307 a goal. 309 A mandatory-to-implement set of algorithms has to be defined offering 310 a key length of 112-bit symmetric key or security or more, as 311 outlined in Section 20 of RFC 7925 [RFC7925]. This corresponds to a 312 233 bit ECC key or a 2048 bit RSA key. 314 If the firmware image is to be encrypted, it must be done in such a 315 way that every intended recipient can decrypt it. The information 316 that is encrypted individually for each device must be an absolute 317 minimum, for example AES Key Wrap [RFC5649], in order to maintain 318 friendliness to Content Distribution Networks, bulk storage, and 319 broadcast protocols. 321 3.4. Rollback attacks must be prevented 323 A device presented with an old, but valid manifest and firmware must 324 not be tricked into installing such firmware since a vulnerability in 325 the old firmware image may allow an attacker to gain control of the 326 device. 328 3.5. High reliability 330 A power failure at any time must not cause a failure of the device. 331 A failure to validate any part of an update must not cause a failure 332 of the device. One way to achieve this functionality is to provide a 333 minimum of two storage locations for firmware and one bootable 334 location for firmware. An alternative approach is to use a 2nd stage 335 bootloader with build-in full featured firmware update functionality 336 such that it is possible to return to the update process after power 337 down. 339 Note: This is an implementation requirement rather than a requirement 340 on the manifest format. 342 3.6. Operate with a small bootloader 344 The bootloader must be minimal, containing only flash support, 345 cryptographic primitives and optionally a recovery mechanism. The 346 recovery mechanism is used in case the update process failed and may 347 include support for firmware updates over serial, USB or even a 348 limited version of wireless connectivity standard like a limited 349 Bluetooth Smart. Such a recovery mechanism must provide security at 350 least at the same level as the full featured firmware update 351 functionalities. 353 The bootloader needs to verify the received manifest and to install 354 the bootable firmware image. The bootloader should not require 355 updating since a failed update poses a risk in reliability. If more 356 functionality is required in the bootloader, it must use a two-stage 357 bootloader, with the first stage comprising the functionality defined 358 above. 360 All information necessary for a device to make a decision about the 361 installation of a firmware update must fit into the available RAM of 362 a constrained IoT device. This prevents flash write exhaustion. 364 Note: This is an implementation requirement. 366 3.7. Small Parsers 368 Since parsers are known sources of bugs they must be minimal. 369 Additionally, it must be easy to parse only those fields that are 370 required to validate at least one signature or MAC with minimal 371 exposure. 373 3.8. Minimal impact on existing firmware formats 375 The design of the firmware update mechanism must not require changes 376 to existing firmware formats. 378 3.9. Robust permissions 380 When a device obtains a monolithic firmware image from a single 381 author without any additional approval steps then the authorization 382 flow is relatively simple. There are, however, other cases where 383 more complex policy decisions need to be made before updating a 384 device. 386 In this architecture the authorization policy is separated from the 387 underlying communication architecture. This is accomplished by 388 separating the entities from their permissions. For example, an 389 author may not have the authority to install a firmware image on a 390 device in critical infrastructure without the authorization of a 391 device operator. In this case, the device may be programmed to 392 reject firmware updates unless they are signed both by the firmware 393 author and by the device operator. 395 Alternatively, a device may trust precisely one entity, which does 396 all permission management and coordination. This entity allows the 397 device to offload complex permissions calculations for the device. 399 3.10. Operating modes 401 There are three broad classifications of update operating modes. 403 - Client-initiated Update 405 - Server-initiated Update 407 - Hybrid Update 409 Client-initiated updates take the form of a communicator on a device 410 proactively checking for new firmware imagines provided by firmware 411 servers. 413 Server-initiated updates are important to consider because timing of 414 updates may need to be tightly controlled in some high- reliability 415 environments. In this case the communicator, potentially in 416 coordination with the status tracker, determines what devices qualify 417 for a firmware update. Once those devices have been selected the 418 firmware server distributes updates to those devices. 420 Note: This assumes that the firmware server is able to reach the 421 device, which may require devices to keep reachability information at 422 the communicator and / or at the firmware server up-to-date. This 423 may also require keeping state at NATs and stateful packet filtering 424 firewalls alive. 426 Hybrid updates are those that require an interaction between the 427 device and the firmware server / communicator. The communicator 428 pushes notifications of availability of an update to the device, and 429 the device then downloads the image from the firmware server when it 430 wants. 432 An alternative approach is to consider the steps a device has to go 433 through in the course of an update: 435 - Notification 437 - Pre-authorisation 439 - Dependency resolution 441 - Download 443 - Installation 445 The notification step consists of the communicator informing the 446 device that an update is available. This can be accomplished via 447 polling (client-initiated), push notifications (server-initiated), or 448 more complex mechanisms. 450 The pre-authorisation step involves verifying whether the entity 451 signing the manifest is indeed authorized to perform an update. The 452 device must also determine whether it should fetching and processing 453 of the firmware image (unless it has been attached already to the 454 manifest itself). 456 A dependency resolution phase is needed when more than one component 457 can be updated or when a differential update is used. The necessary 458 dependencies must be available prior to installation. 460 The download step is the process of acquiring a local copy of the 461 firmware image. When the download is client-initiated, this means 462 that the device chooses when a download occurs and initiates the 463 download process. When a download is server-party initiated, this 464 means that either the communicator / firmware server tells the device 465 when to download or that it initiates the transfer directly to the 466 device. For example, a download from an HTTP-based firmware server 467 is client-initiated. A transfer to a LwM2M Firmware Update resource 468 [LwM2M] is server-initiated. 470 If the Device has downloaded a new firmware image and is ready to 471 install it it may need to wait for a trigger from a Communicator to 472 install the firmware update, may trigger the update automatically, or 473 may go through a more complex decision making process to determine 474 the appropriate timing for an update (such as delaying the update 475 process to a later time when end users are less impacted by the 476 update process). 478 Installation is the act of processing the payload into a format that 479 the IoT device can recognise and the bootloader is responsible for 480 then booting from the newly installed firmware image. 482 Each of these steps may require different permissions. 484 4. Claims 486 Claims in the manifest offer a way to convey instructions to a device 487 that impact the firmware update process. To have any value the 488 manifest containing those claims must be authenticated and integrity 489 protected. The credential used to must be directly or indirectly 490 related to the trust anchor installed at the device by the Trust 491 Provisioning Authority. 493 The baseline claims for all manifests are described in 494 [I-D.ietf-suit-information-model]. For example, there are: 496 - Do not install firmware with earlier metadata than the current 497 metadata. 499 - Only install firmware with a matching vendor, model, hardware 500 revision, software version, etc. 502 - Only install firmware that is before its best-before timestamp. 504 - Only allow a firmware installation if dependencies have been met. 506 - Choose the mechanism to install the firmware, based on the type of 507 firmware it is. 509 5. Communication Architecture 511 Figure 1 shows the communication architecture where a firmware image 512 is created by an author, and uploaded to a firmware server. The 513 firmware image/manifest is distributed to the device either in a push 514 or pull manner using the communicator residing on the device. The 515 device operator keeps track of the process using the status tracker. 516 This allows the device operator to know and control what devices have 517 received an update and which of them are still pending an update. 519 Firmware + +----------+ Firmware + +-----------+ 520 Manifest | |-+ Manifest | |-+ 521 +--------->| Firmware | |<---------------| | | 522 | | Server | | | Author | | 523 | | | | | | | 524 | +----------+ | +-----------+ | 525 | +----------+ +-----------+ 526 | 527 | 528 | 529 -+-- ------ 530 ---- | ---- ---- ---- 531 // | \\ // \\ 532 / | \ / \ 533 / | \ / \ 534 / | \ / \ 535 / | \ / \ 536 | v | | | 537 | +------------+ | 538 | |Communicator| | | | 539 | +--------+---+ | Device | +--------+ | 540 | | | | Management| | | | 541 | | Device |<----------------------------->| Status | | 542 | | | | | | Tracker| | 543 | +--------+ | || | | | 544 | | || +--------+ | 545 | | | | 546 | | \ / 547 \ / \ / 548 \ / \ Device / 549 \ Network / \ Operator / 550 \ Operator / \\ // 551 \\ // ---- ---- 552 ---- ---- ------ 553 ----- 555 Figure 1: Architecture. 557 End-to-end security mechanisms are used to protect the firmware image 558 and the manifest although Figure 2 does not show the manifest itself 559 since it may be distributed independently. 561 +-----------+ 562 +--------+ | | +--------+ 563 | | Firmware Image | Firmware | Firmware Image | | 564 | Device |<-----------------| Server |<------------------| Author | 565 | | | | | | 566 +--------+ +-----------+ +--------+ 567 ^ * 568 * * 569 ************************************************************ 570 End-to-End Security 572 Figure 2: End-to-End Security. 574 Whether the firmware image and the manifest is pushed to the device 575 or fetched by the device is a deployment specific decision. 577 The following assumptions are made to allow the device to verify the 578 received firmware image and manifest before updating software: 580 - To accept an update, a device needs to verify the signature 581 covering the manifest. There may be one or multiple manifests 582 that need to be validated, potentially signed by different 583 parties. The device needs to be in possession of the trust 584 anchors to verify those signatures. Installing trust anchors to 585 devices via the Trust Provisioning Authority happens in an out-of- 586 band fashion prior to the firmware update process. 588 - Not all entities creating and signing manifests have the same 589 permissions. A device needs to determine whether the requested 590 action is indeed covered by the permission of the party that 591 signed the manifest. Informing the device about the permissions 592 of the different parties also happens in an out-of-band fashion 593 and is also a duty of the Trust Provisioning Authority. 595 - For confidentiality protection of firmware images the author needs 596 to be in possession of the certificate/public key or a pre-shared 597 key of a device. The use of confidentiality protection of 598 firmware images is deployment specific. 600 There are different types of delivery modes, which are illustrated 601 based on examples below. 603 There is an option for embedding a firmware image into a manifest. 604 This is a useful approach for deployments where devices are not 605 connected to the Internet and cannot contact a dedicated server for 606 download of the firmware. It is also applicable when the firmware 607 update happens via a USB stick or via Bluetooth Smart. Figure 3 608 shows this delivery mode graphically. 610 /------------\ /------------\ 611 /Manifest with \ /Manifest with \ 612 |attached | |attached | 613 \firmware image/ \firmware image/ 614 \------------/ +-----------+ \------------/ 615 +--------+ | | +--------+ 616 | |<.................| Firmware |<................| | 617 | Device | | Server | | Author | 618 | | | | | | 619 +--------+ +-----------+ +--------+ 621 Figure 3: Manifest with attached firmware. 623 Figure 4 shows an option for remotely updating a device where the 624 device fetches the firmware image from some file server. The 625 manifest itself is delivered independently and provides information 626 about the firmware image(s) to download. 628 /------------\ 629 / \ 630 | Manifest | 631 \ / 632 +--------+ \------------/ +--------+ 633 | |<..............................................>| | 634 | Device | -- | Author | 635 | |<- --- | | 636 +--------+ -- --- +--------+ 637 -- --- 638 --- --- 639 -- +-----------+ -- 640 -- | | -- 641 /------------\ -- | Firmware |<- /------------\ 642 / \ -- | Server | / \ 643 | Firmware | | | | Firmware | 644 \ / +-----------+ \ / 645 \------------/ \------------/ 647 Figure 4: Independent retrieval of the firmware image. 649 This architecture does not mandate a specific delivery mode but a 650 solution must support both types. 652 6. Manifest 654 In order for a device to apply an update, it has to make several 655 decisions about the update: 657 - Does it trust the author of the update? 658 - Has the firmware been corrupted? 660 - Does the firmware update apply to this device? 662 - Is the update older than the active firmware? 664 - When should the device apply the update? 666 - How should the device apply the update? 668 - What kind of firmware binary is it? 670 - Where should the update be obtained? 672 - Where should the firmware be stored? 674 The manifest encodes the information that devices need in order to 675 make these decisions. It is a data structure that contains the 676 following information: 678 - information about the device(s) the firmware image is intended to 679 be applied to, 681 - information about when the firmware update has to be applied, 683 - information about when the manifest was created, 685 - dependencies on other manifests, 687 - pointers to the firmware image and information about the format, 689 - information about where to store the firmware image, 691 - cryptographic information, such as digital signatures or message 692 authentication codes (MACs). 694 The manifest information model is described in 695 [I-D.ietf-suit-information-model]. 697 7. Device Firmware Update Examples 699 Although these documents attempt to define a firmware update 700 architecture that is applicable to both existing systems, as well as 701 yet-to-be-conceived systems; it is still helpful to consider existing 702 architectures. 704 7.1. Single CPU SoC 706 The simplest, and currently most common, architecture consists of a 707 single MCU along with its own peripherals. These SoCs generally 708 contain some amount of flash memory for code and fixed data, as well 709 as RAM for working storage. These systems either have a single 710 firmware image, or an immutable bootloader that runs a single image. 711 A notable characteristic of these SoCs is that the primary code is 712 generally execute in place (XIP). Combined with the non-relocatable 713 nature of the code, firmware updates need to be done in place. 715 7.2. Single CPU with Secure - Normal Mode Partitioning 717 Another configuration consists of a similar architecture to the 718 previous, with a single CPU. However, this CPU supports a security 719 partitioning scheme that allows memory (in addition to other things) 720 to be divided into secure and normal mode. There will generally be 721 two images, one for secure mode, and one for normal mode. In this 722 configuration, firmware upgrades will generally be done by the CPU in 723 secure mode, which is able to write to both areas of the flash 724 device. In addition, there are requirements to be able to update 725 either image independently, as well as to update them together 726 atomically, as specified in the associated manifests. 728 7.3. Dual CPU, shared memory 730 This configuration has two or more CPUs in a single SoC that share 731 memory (flash and RAM). Generally, they will be a protection 732 mechanism to prevent one CPU from accessing the other's memory. 733 Upgrades in this case will typically be done by one of the CPUs, and 734 is similar to the single CPU with secure mode. 736 7.4. Dual CPU, other bus 738 This configuration has two or more CPUs, each having their own 739 memory. There will be a communication channel between them, but it 740 will be used as a peripheral, not via shared memory. In this case, 741 each CPU will have to be responsible for its own firmware upgrade. 742 It is likely that one of the CPUs will be considered a master, and 743 will direct the other CPU to do the upgrade. This configuration is 744 commonly used to offload specific work to other CPUs. Firmware 745 dependencies are similar to the other solutions above, sometimes 746 allowing only one image to be upgraded, other times requiring several 747 to be upgraded atomically. Because the updates are happening on 748 multiple CPUs, upgrading the two images atomically is challenging. 750 8. Example Flow 752 The following example message flow illustrates the interaction for 753 distributing a firmware image to a device starting with an author 754 uploading the new firmware to Firmware Server and creating a 755 manifest. The firmware and manifest are stored on the same Firmware 756 Server. 758 +--------+ +-----------------+ +------------+ +----------+ 759 | Author | | Firmware Server | |Communicator| |Bootloader| 760 +--------+ +-----------------+ +------------+ +----------+ 761 | | | + 762 | Create Firmware | | | 763 |--------------- | | | 764 | | | | | 765 |<-------------- | | | 766 | | | | 767 | Upload Firmware | | | 768 |------------------>| | | 769 | | | | 770 | Create Manifest | | | 771 |---------------- | | | 772 | | | | | 773 |<--------------- | | | 774 | | | | 775 | Sign Manifest | | | 776 |-------------- | | | 777 | | | | | 778 |<------------- | | | 779 | | | | 780 | Upload Manifest | | | 781 |------------------>| | | 782 | | | | 783 | | Query Manifest | | 784 | |<--------------------| | 785 | | | | 786 | | Send Manifest | | 787 | |-------------------->| | 788 | | | Validate | 789 | | | Manifest | 790 | | |---------+ | 791 | | | | | 792 | | |<--------+ | 793 | | | | 794 | | Request Firmware | | 795 | |<--------------------| | 796 | | | | 797 | | Send Firmware | | 798 | |-------------------->| | 799 | | | Verify | 800 | | | Firmware | 801 | | |--------------- | 802 | | | | | 803 | | |<-------------- | 804 | | | | 805 | | | Store | 806 | | | Firmware | 807 | | |-------------- | 808 | | | | | 809 | | |<------------- | 810 | | | | 811 | | | | 812 | | | Reboot | 813 | | |--------------->| 814 | | | | 815 | | | Validate | 816 | | | Firmware | 817 | | | ---------------| 818 | | | | | 819 | | | -------------->| 820 | | | | 821 | | | Activate new | 822 | | | Firmware | 823 | | | ---------------| 824 | | | | | 825 | | | -------------->| 826 | | | | 827 | | | Boot new | 828 | | | Firmware | 829 | | | ---------------| 830 | | | | | 831 | | | -------------->| 832 | | | | 834 Figure 5: Example Flow for a Firmware Upate. 836 9. IANA Considerations 838 This document does not require any actions by IANA. 840 10. Security Considerations 842 Firmware updates fix security vulnerabilities and are considered to 843 be an important building block in securing IoT devices. Due to the 844 importance of firmware updates for IoT devices the Internet 845 Architecture Board (IAB) organized a 'Workshop on Internet of Things 846 (IoT) Software Update (IOTSU)', which took place at Trinity College 847 Dublin, Ireland on the 13th and 14th of June, 2016 to take a look at 848 the big picture. A report about this workshop can be found at 849 [RFC8240]. A standardized firmware manifest format providing end-to- 850 end security from the author to the device will be specified in a 851 separate document. 853 There are, however, many other considerations raised during the 854 workshop. Many of them are outside the scope of standardization 855 organizations since they fall into the realm of product engineering, 856 regulatory frameworks, and business models. The following 857 considerations are outside the scope of this document, namely 859 - installing firmware updates in a robust fashion so that the update 860 does not break the device functionality of the environment this 861 device operates in. 863 - installing firmware updates in a timely fashion considering the 864 complexity of the decision making process of updating devices, 865 potential re-certification requirements, and the need for user 866 consent to install updates. 868 - the distribution of the actual firmware update, potentially in an 869 efficient manner to a large number of devices without human 870 involvement. 872 - energy efficiency and battery lifetime considerations. 874 - key management required for verifying the digital signature 875 protecting the manifest. 877 - incentives for manufacturers to offer a firmware update mechanism 878 as part of their IoT products. 880 11. Mailing List Information 882 The discussion list for this document is located at the e-mail 883 address suit@ietf.org [1]. Information on the group and information 884 on how to subscribe to the list is at 885 https://www1.ietf.org/mailman/listinfo/suit 887 Archives of the list can be found at: https://www.ietf.org/mail- 888 archive/web/suit/current/index.html 890 12. Acknowledgements 892 We would like to thank the following persons for their feedback: 894 - Geraint Luff 896 - Amyas Phillips 898 - Dan Ros 900 - Thomas Eichinger 902 - Michael Richardson 904 - Emmanuel Baccelli 906 - Ned Smith 908 - Jim Schaad 910 - Carsten Bormann 912 - Cullen Jennings 914 - Olaf Bergmann 916 - Suhas Nandakumar 918 - Phillip Hallam-Baker 920 - Marti Bolivar 922 - Andrzej Puzdrowski 924 - Markus Gueller 926 - Henk Birkholz 928 - Jintao Zhu 930 We would also like to thank the WG chairs, Russ Housley, David 931 Waltermire, Dave Thaler for their support and their reviews. 932 Kathleen Moriarty was the responsible security area director when 933 this work was started. 935 13. References 937 13.1. Normative References 939 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 940 Requirement Levels", BCP 14, RFC 2119, 941 DOI 10.17487/RFC2119, March 1997, . 944 [RFC7925] Tschofenig, H., Ed. and T. Fossati, "Transport Layer 945 Security (TLS) / Datagram Transport Layer Security (DTLS) 946 Profiles for the Internet of Things", RFC 7925, 947 DOI 10.17487/RFC7925, July 2016, . 950 13.2. Informative References 952 [I-D.ietf-suit-information-model] 953 Moran, B., Tschofenig, H., Birkholz, H., and J. Jimenez, 954 "Firmware Updates for Internet of Things Devices - An 955 Information Model for Manifests", draft-ietf-suit- 956 information-model-00 (work in progress), June 2018. 958 [LwM2M] OMA, ., "Lightweight Machine to Machine Technical 959 Specification, Version 1.0.2", February 2018, 960 . 964 [RFC5649] Housley, R. and M. Dworkin, "Advanced Encryption Standard 965 (AES) Key Wrap with Padding Algorithm", RFC 5649, 966 DOI 10.17487/RFC5649, September 2009, . 969 [RFC6024] Reddy, R. and C. Wallace, "Trust Anchor Management 970 Requirements", RFC 6024, DOI 10.17487/RFC6024, October 971 2010, . 973 [RFC8240] Tschofenig, H. and S. Farrell, "Report from the Internet 974 of Things Software Update (IoTSU) Workshop 2016", 975 RFC 8240, DOI 10.17487/RFC8240, September 2017, 976 . 978 13.3. URIs 980 [1] mailto:suit@ietf.org 982 Authors' Addresses 984 Brendan Moran 985 Arm Limited 987 EMail: Brendan.Moran@arm.com 989 Milosch Meriac 990 Consultant 992 EMail: milosch@meriac.com 994 Hannes Tschofenig 995 Arm Limited 997 EMail: hannes.tschofenig@gmx.net 999 David Brown 1000 Linaro 1002 EMail: david.brown@linaro.org