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