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