👹
Carlos's Tech Blog
  • 🧔ECUs
    • ZYNQ_Documents
      • [ZYNQ] 构建ZYNQ的BSP工程
      • [ZYNQ] 启动流程
      • [ZYNQ] Secure Boot Flow
      • [ZYNQ] Provisioning Guideline
      • [ZYNQ] Decrypting Partition by the Decrypt Agent Using PUF key
      • [ZYNQ] enabling the cryptsetup on ramdisk
      • [ZYNQ] Encrypt external files based on file system using PUF key
      • [ZYNQ] Loading an Encrypted Linux kernel at U-Boot with a KUP Key
      • [ZYNQ] cross-compile the cryptsetup on Xilinx ZYNQ aarch64 platform
      • [ZYNQ] Linux Linaro系统镜像制作SD卡启动
    • S32G_Documents
      • [S32G] Going through the s32g hard/soft platform
      • [S32G] S32g247's Secure Boot using HSE firmware
        • S32g2 HSE key config
        • How S32g verify secure boot image
        • S32g secure boot signature generation
        • How to download and build S32g Secure boot image
        • [S32G] OTA with Secure Boot
    • RT117x_Documents
      • [RT-117x]IMX RT1170 Provisioning Guideline
      • [RT-117x] Going through the MX-RT1170 hard/soft platform
      • [RT-117x] i.MX-RT1170's Secure Boot
        • [RT-117x]Signing image with the HSM (SignServer)
    • LS104x_Documents
      • [LS104x] bsp project
      • [LS104x] boot flow
      • [LS104x] secure boot
      • [LS104x] Application Note, Using the PKCS#11 in TCU platform
      • [LS104x] 使用ostree更新rootfs
      • [LS104x] ostree的移植
      • [LS104x] Starting with Yocto
      • [LS104x] 使用FIT的kernel格式和initramfs
    • IMX6/8_Documents
      • [IMX6] Defining A U-Boot Command
      • NXP IMX6 嵌入式板子一些笔记
      • NXP-imx6 initialization
    • Vehicle_Apps
      • [SecOC] Tree
        • [SecOC] SecOC Freshness and MAC Truncation
  • 😾TECH
    • Rust Arm OS
      • ARMv7m_Using_The_RUST_Cross_Compiler
    • ARM
      • ARM-v7-M
        • 01_ARMv7-M_处理器架构技术综述
        • 02_ARMv7-M_编程模型与模式
        • 03_ARMv7-M_存储系统结构
        • 04_ARMv7-M_异常处理及中断处理
      • ARM-v8-A
        • 02_ARMv8_基本概念
        • 03_ARMv8_指令集介绍_加载指令集和存储指令集
        • 04_ARMv8_指令集_运算指令集
        • 05_ARMv8_指令集_跳转_比较与返回指令
        • 06_ARMv8_指令集_一些重要的指令
        • 0X_ARMv8_指令集_基于汇编的UART驱动
        • 07_ARMv8_汇编器Using as
        • 08_ARMv8_链接器和链接脚本
        • 09_ARMv8_内嵌汇编(内联汇编)Inline assembly
        • 10_ARMv8_异常处理(一) - 入口与返回、栈选择、异常向量表
        • 11_ARMv8_异常处理(二)- Legacy 中断处理
        • 12_ARMv8_异常处理(三)- GICv1/v2中断处理
        • 13_ARMv8_内存管理(一)-内存管理要素
        • 14_ARMv8_内存管理(二)-ARM的MMU设计
        • 15_ARMv8_内存管理(三)-MMU恒等映射及Linux实现
        • 16_ARMv8_高速缓存(一)cache要素
        • 17_ARMv8_高速缓存(二)ARM cache设计
        • 18_ARMv8_高速缓存(三)多核与一致性要素
        • 19_ARMv8_TLB管理(Translation Lookaside buffer)
        • 20_ARMv8_barrier(一)流水线和一致性模型
        • 21_ARMv8_barrier(二)内存屏障案例
      • ARM Boot Flow
        • 01_Embedded_ARMv7/v8 non-secure Boot Flow
        • 02_Embedded_ARMv8 ATF Secure Boot Flow (BL1/BL2/BL31)
        • 03_Embedded_ARMv8 BL33 Uboot Booting Flow
      • ARM Compiler
        • Compiler optimization and the volatile keyword
      • ARM Development
        • 在MACBOOK上搭建ARMv8架构的ARM开发环境
        • Starting with JLink debugger or QEMU
    • Linux
      • Kernel
        • 0x01_LinuxKernel_内核的启动(一)之启动前准备
        • 0x02_LinuxKernel_内核的启动(二)SMP多核处理器启动过程分析
        • 0x21_LinuxKernel_内核活动(一)之系统调用
        • 0x22_LinuxKernel_内核活动(二)中断体系结构(中断上文)
        • 0x23_LinuxKernel_内核活动(三)中断体系结构(中断下文)
        • 0x24_LinuxKernel_进程(一)进程的管理(生命周期、进程表示)
        • 0x25_LinuxKernel_进程(二)进程的调度器的实现
        • 0x26_LinuxKernel_设备驱动(一)综述与文件系统关联
        • 0x27_LinuxKernel_设备驱动(二)字符设备操作
        • 0x28_LinuxKernel_设备驱动(三)块设备操作
        • 0x29_LinuxKernel_设备驱动(四)资源与总线系统
        • 0x30_LinuxKernel_设备驱动(五)模块
        • 0x31_LinuxKernel_内存管理(一)物理页面、伙伴系统和slab分配器
        • 0x32_LinuxKernel_内存管理(二)虚拟内存管理、缺页与调试工具
        • 0x33_LinuxKernel_同步管理_原子操作_内存屏障_锁机制等
        • 01_LinuxDebug_调试理论和基础综述
      • Userspace
        • Linux-用户空间-多线程与同步
        • Linux进程之间的通信-管道(上)
        • Linux进程之间的通信-管道(下)
        • Linux进程之间的通信-信号量(System V)
        • Linux进程之间的通信-内存共享(System V)
        • Linux进程之间的通信-消息队列(System V)
        • Linux应用调试(一)方法、技巧和工具 - 综述
        • Linux应用调试(二)工具之coredump
        • Linux应用调试(三)工具之Valgrind
        • Linux机制之内存池
        • Linux机制之对象管理和引用计数(kobject/ktype/kset)
        • Linux机制copy_{to, from}_user
        • Linux设备树 - DTS语法、节点、设备树解析等
        • Linux System : Managing Linux Services - inittab & init.d
        • Linux System : Managing Linux Services - initramfs
      • Kernel Examples
        • Linux Driver - GPIO键盘驱动开发记录_OMAPL138
        • 基于OMAPL138的Linux字符驱动_GPIO驱动AD9833(一)之miscdevice和ioctl
        • 基于OMAPL138的Linux字符驱动_GPIO驱动AD9833(二)之cdev与read、write
        • 基于OMAPL138的字符驱动_GPIO驱动AD9833(三)之中断申请IRQ
        • Linux内核调用SPI驱动_实现OLED显示功能
        • Linux内核调用I2C驱动_驱动嵌套驱动方法MPU6050
    • OPTEE
      • 01_OPTEE-OS_基础之(一)功能综述、简要介绍
      • 02_OPTEE-OS_基础之(二)TrustZone和ATF功能综述、简要介绍
      • 03_OPTEE-OS_系统集成之(一)编译、实例、在QEMU上执行
      • 05_OPTEE-OS_系统集成之(三)ATF启动过程
      • 06_OPTEE-OS_系统集成之(四)OPTEE镜像启动过程
      • 07_OPTEE-OS_系统集成之(五)REE侧上层软件
      • 08_OPTEE-OS_系统集成之(六)TEE的驱动
      • 09_OPTEE-OS_内核之(一)ARM核安全态和非安全态的切换
      • 10_OPTEE-OS_内核之(二)对安全监控模式的调用的处理
      • 11_OPTEE-OS_内核之(三)中断与异常的处理
      • 12_OPTEE-OS_内核之(四)对TA请求的处理
      • 13_OPTEE-OS_内核之(五)内存和cache管理
      • 14_OPTEE-OS_内核之(六)线程管理与并发
      • 15_OPTEE-OS_内核之(七)系统调用及IPC机制
      • 16_OPTEE-OS_应用之(一)TA镜像的签名和加载
      • 17_OPTEE-OS_应用之(二)密码学算法和安全存储
      • 18_OPTEE-OS_应用之(三)可信应用的开发
      • 19_OPTEE-OS_应用之(四)安全驱动开发
      • 20_OPTEE-OS_应用之(五)终端密钥在线下发系统
    • Binary
      • 01_ELF文件_目标文件格式
      • 02_ELF文件结构_浅析内部文件结构
      • 03_ELF文件_静态链接
      • 04_ELF文件_加载进程虚拟地址空间
      • 05_ELF文件_动态链接
      • 06_Linux的动态共享库
      • 07_ELF文件_堆和栈调用惯例以ARMv8为例
      • 08_ELF文件_运行库(入口、库、多线程)
      • 09_ELF文件_基于ARMv7的Linux系统调用原理
      • 10_ELF文件_ARM的镜像文件(.bin/.hex/.s19)
    • Build
      • 01_Script_makefile_summary
    • Rust
      • 02_SYS_RUST_文件IO
    • Security
      • Crypto
        • 1.0_Security_计算机安全概述及安全需求
        • 2.0_Security_随机数(伪随机数)
        • 3.0_Security_对称密钥算法加解密
        • 3.1_Security_对称密钥算法之AES
        • 3.2_Security_对称密钥算法之MAC(CMAC/HMAC)
        • 3.3_Security_对称密钥算法之AEAD
        • 8.0_Security_pkcs7(CMS)_embedded
        • 9.0_Security_pkcs11(HSM)_embedded
      • Tools
        • Openssl EVP to implement RSA and SM2 en/dec sign/verify
        • 基于Mac Silicon M1 的OpenSSL 编译
        • How to compile mbedtls library on Linux/Mac/Windows
    • Embedded
      • eMMC启动介质
  • 😃Design
    • Secure Boot
      • JY Secure Boot Desgin
    • FOTA
      • [FOTA] Module of ECUs' FOTA unit design
        • [FOTA] Tech key point: OSTree Deployment
        • [FOTA] Tech key point: repositories role for onboard
        • [FOTA] Tech key point: metadata management
        • [FOTA] Tech key point: ECU verifying and Decrpting
        • [FOTA] Tech key point: time server
      • [FOTA] Local-OTA for Embedded Linux System
    • Provisioning
      • [X-Shield] Module of the Embedded Boards initialization
    • Report
由 GitBook 提供支持
在本页
  • 1. Background and Significance
  • 2. Repos
  • 2.1 Director repository
  • 2.3 Image repository
  • 3. Security Topics
  • 3.1 PKI and Provisioning
  • 3.2 Repository Signing Keys
  • 3.3 Key Types and Thresholds
  • 3.4 Encryption & Decryption
  • Appendix
  • Freeze Attack
  1. Design
  2. FOTA
  3. [FOTA] Module of ECUs' FOTA unit design

[FOTA] Tech key point: repositories role for onboard

上一页[FOTA] Tech key point: OSTree Deployment下一页[FOTA] Tech key point: metadata management

最后更新于1年前

1. Background and Significance

The attack on is a clear example of the issue with numerous software updating methods. Systems that rely on single-key code signing and transport layer security (TLS) may still be vulnerable to a variety of assaults since hostile actors may attack the updating system itself. Productions that update systems must be aware that no system is impenetrable and take steps to lessen the effects of any attacks that do occur. Designers can try to make systems resistant to assault by comprehending the objectives of the attacker. Code signing and secure transport are not enough.

Attackers of update systems intend to:

  1. Read the contents of updates to discover confidential information, reverse-engineer firmware, or compare two firmware images to highlight changes between versions and perhaps identify vulnerable code sections.

  2. Deny installation of updates to prevent vehicles from fixing software problems.

  3. Disrupt functionality in the vehicle, denying use of the vehicle or of certain functions.

  4. Control ECUs within the vehicle, and possibly the vehicle itself.

  5. Modify software to execute their own code.

2. Repos

A malicious update could be signed or new patches could be blocked by an attacker who has access to the update system or signing key. It could be challenging, if not impossible, to repair a vehicle after a malicious update has been loaded without replacing the damaged ECU. Therefore, before installing updates, it's crucial to make sure they can be trusted.

To provide this flexibility, Uptane uses two separate data repositories with different signing authorities:

  • The is a database that contains all of the signed images that an OEM can deploy. Images are signed using offline keys that are signed by a root signing authority. Because offline keys require physical access and can support additional security features such as 2-factor authentication, they are more difficult to compromise remotely.

  • The takes advantage of the flexibility of online keys for machine-to-machine communication. The director will sign metadata for a particular update campaign instructing the vehicle to install a particular software bundle of software packages. This includes coordinating software updates with multiple ECUs.

2.1 Director repository

2.1.2 Director Repo Features

The Director repository instructs ECUs as to which images should be installed by producing signed metadata on demand. Unlike the Image repository, it is mostly controlled by automated, online processes. It also consults a private inventory database containing information on vehicles, ECUs, and software revisions. For the inventory database, please refer to the link.

In the Uptane framework, some rules shall be followed:

  • Public: This interface SHOULD be public;

  • Encryption: The Director MAY encrypt images for ECUs that require them, either by encrypting on-the-fly or by storing encrypted images on the repository.

  • For back-end requirements: The Director repository SHALL implement storage that permits an automated service to write generated metadata files.

2.1.3 Steps to initialize the repository

In order to initialize the repository, an OEM SHOULD perform the following steps:

  1. Set up the storage mechanism according to the directions for the chosen protocol. For example, the OEM might need to set up a ZFS filesystem.

  2. Set up the transport protocol, following the details of the chosen systems. For example, the OEM may need to set up an HTTP server with SSL/TLS enabled.

  3. Set up the private and public APIs to interact over the chosen transport protocol.

  4. Set up the Root, Timestamp, Snapshot, and Targets roles.

  5. If the Director will be serving per-device encrypted images, copy all relevant images from the Image repository.

  6. Initialize the inventory database with the information necessary for the Director repository to perform dependency resolution, or encrypt images per ECU. This information includes:

    1. metadata about all available images for all ECUs on all vehicles;

    2. dependencies and conflicts between images;

    3. ECU keys.

  7. Set up and run the automated process that communicates with Primaries.

2.1.3 Roles

The Director repository does not manage images. Therefore, the Director repository SHOULD contain only the Root, Timestamp, Snapshot, and Targets role as illustrated in the following figure:

2.1.3.1 Inventory database (private API)

Some of the private APIs shall be defined in the Director repository:

  • upload images

  • update the inventory database

In order to allow automated processes on the Director repository to perform their respective functions, without also allowing any attackers who might compromise the repository to tamper with the inventory database, it is strongly RECOMMENDED that these processes should have some boundaries. That is, the automated processes SHOULD be able to read any record in the database and write new records, but SHOULD NOT be able to update or delete existing records.

2.1.4.1 interacting with primaries (public API)

We SHOULD define a public API for the Director repository so that it is able to send updates to vehicles:

  • Can be designed to the wishes of the vehicles;

  • Can use either a push or pull model to send updates to Primaries

In the push and pull model, we SHOULD define the frequency at which Primaries pull updates. There is also no significant difference between these methods when it comes to resistance to denial-of-service (DoS) attacks or flash crowds.

Note, the API SHOULD require authentication.

Sending an update from the Director repository to a Primary requires the following five steps:

  • The Primary sends its latest vehicle version manifest to the Director repository via an automated process.

  • The automated process performs a dependency resolution. It reads associated information about this vehicle, such as ECU identifiers and keys, from the inventory database.

    • It checks that the signatures on the manifest are correct;

    • Adds the manifest to the inventory database.

    • using the given manifest, it computes which images SHOULD be installed next by these ECUs.

    • It SHOULD record the results of this computation on the inventory database so there is a record of what was chosen for installation.

    • If there is an error at any point of this step, due to incorrect signatures, or anything unusual about the set of updates installed on the vehicle, then the Director repository SHOULD also record it.

  • Using the results of the dependency resolution, the automated process signs fresh Timestamp, Snapshot, and Targets metadata about the images that SHOULD be installed next by these ECUs.

    • If the OEM requires it, it MAY encrypt images per ECU, and write them to its storage mechanism.

    • If there are no images to be installed or updated, then the Targets metadata SHOULD contain an empty set of targets.

  • The Primary downloads the metadata and image files.

2.3 Image repository

The Image repository differs from the Director repository in a number of ways:

  • it is managed by human administrators who use offline keys to sign Targets metadata.

  • it also MAY manage images to suppliers;

  • it provides the same metadata to all Primaries.

  • it does not encrypt images per ECU, and it updates its metadata and images relatively infrequently (e.g., every two weeks or monthly).

2.3.1 Steps to initialize the repository

2.3.2 Roles

In order to set up delegations, Image Repo suppliers use the configuration of roles illustrated in the following figure:

There are two important points:

  • The AUTOX maintains the Root, Timestamp, Snapshot, and Targets roles, with the Targets role delegating images to their respective tier-1 suppliers.

  • There SHOULD be a delegated Targets role for every tier-1 supplier, so that the Uptane can:

    • limit the impact of a key compromise.

    • precisely control which Targets metadata vehicles need to download.

The metadata for each tier-1 supplier(uptane) MAY be signed by the AUTOX. In turn, a tier-1 supplier MAY delegate images to members of its organization, such as supplier C who has delegated a subset of its images to one of its developers, or to its tier-2 suppliers who MAY delegate further to tier-3 suppliers

Every delegation SHOULD be prefixed with the unique name of a tier-1 supplier, so that the filenames of images do not conflict with each other. Other than this constraint, a tier-1 supplier is free to name its images however it likes. For example, it MAY use the convention “supplier-X-ECU-Y-version-Z.img” to denote an image produced by supplier X, for ECU model Y, and with a version number Z.

2.3.3 APIs

The AUTOX SHOULD define a public API for Primaries to use when downloading metadata and images to the Image repository. Same, the API SHOULD require authentication.

3. Security Topics

This chapter will introduce security topics as follows:

  • PKI and Provisioning

  • Sign Key

  • Sign and Verify Progress

  • Encryption

3.1 PKI and Provisioning

The FOTA solution uses mutual TLS for transport security and device authentication. This means that:

  • every device needs to have its own X.509 certificate,

  • every device needs to have a way to trust the X.509 certificate of the server’s device gateway, and

  • the server needs to have a way to decide whether it trusts each vehicle’s X.509 certificate.

The vehicle knows it can trust the gateway because each frontend account gets a unique device gateway URL, with its own unique X.509 certificate. We then include that certificate in the credentials.zip you download, and it gets baked into the image as a pinned certificate authority (CA).

The device gateway decides whether to allow a device to connect based on the device’s X.509 certificate. Every frontend account has one or more Fleet Root CAs which are responsible for signing device certificates. When a device connects, your device gateway checks whether its certificate is signed by a trusted Fleet Root CA, and if not, rejects the connection.

Device provisioning, therefore, is simply the process of providing a device with:

  • an X.509 certificate

    • that is unique to the vehicle

      • and is signed by a Fleet Root CA that your frontend account trusts.

In this method, the following steps occur:

  1. Download credentials.zip with the provisioning key inside.

  2. The first time each device comes online, it connects to a special endpoint on the device gateway and says, “Hi, I’m a new device, and I don’t have a TLS certificate yet. Here’s my provisioning key.”

  3. The backend crypto service generates a new keypair and X.509 certificate for the device, signs that certificate with the private Fleet Root CA and sends the whole bundle to the vehicle.

  4. The backend crypto service deletes the vehicle’s private key and the device stores its new keypair and certificate.

3.2 Repository Signing Keys

Uptane uses four design principles that help to achieve compromise-resilience:

  • Different types of metadata are signed using different signing keys so that the impact of a key compromise is minimized and does not necessarily affect the security of the whole system;

  • A threshold number of signatures may be required to sign a metadata file so that a single key compromise is insufficient to publish malicious images;

  • There must be a way to revoke keys when they are compromised. Keys can be revoked explicitly by publishing new keys to replace old ones, or they can be revoked implicitly by setting expiration timestamps in metadata files;

  • The use of offline keys can minimize the risk of a key compromise for high-value roles whose compromise can lead to malicious images.

3.2.1 Keys Storage

To solve this problem, we use offline keys (In Signing Server) that are not accessible from the repository, to sign all metadata. The offline private/secret keys are protected by the signing server which cannot export any private key to the external storage. Only some signing APIs can be called to sign the data.

3.2.2 Signing

Director Repo

The signing process is shown in the following figure in the director repository

The director repository instructs vehicles on what should be installed next, given information about what they have currently installed. This repository uses online keys to sign fresh timestamp, snapshot, and targets metadata for each vehicle that indicates which images from the image repository should be installed next.

Repository administrators SHOULD use offline keys to sign the Root metadata on the Director repository, so attackers cannot tamper with this file after a repository compromise. The Timestamp, Snapshot, and Targets metadata SHOULD be signed using online keys so that an automated process can instantly generate fresh metadata.

Image Repo

On the Image repository, there are two options for signing the Timestamp and Snapshot metadata, each with the opposite trade-off from the other.

In the first option, the OEM uses online keys, meaning automated processes for renewing the Timestamp and Snapshot metadata when new Targets metadata and/or images are available. With this option, fresh metadata can be instantly generated by the automated process. On the other hand, if attackers compromise a supplier’s key as well as the Image repository, they could instantly publish malicious images. If these attackers also compromise the Director repository, then they can execute arbitrary software attacks by selecting these malicious images on the Image repository for installation. Such an attack could also facilitate mix-and-match attacks.

In the second option, the OEM uses offline keys to sign Timestamp and Snapshot metadata, which reduces the risk of attackers immediately publishing malicious images. Here again, though, there is a trade-off, in this case, related to the metadata expiration dates. If the Timestamp and Snapshot metadata expire relatively quickly, then it may be cumbersome to use offline keys to renew their signatures. Yet, if a longer expiration time is used, it would give a man-in-the-middle attacker more time to execute freeze attacks, hence defeating the purpose of the Timestamp role.

3.2.3 Verifying

There are two types of ECUs. A primary downloads, verifies, and distributes images and metadata to secondaries. A secondary receives them from a primary and installs a new image only if it has been successfully verified against the signed metadata. There are two types of metadata verification designed to accommodate ECUs with different security and cost requirements:

  • Full verification

  • Partial verification

Full verification requires checking that the images chosen for installation by the director repository match the same images on the image repository. Primaries always perform full verification in order to protect secondaries from security attacks.

Partial verification requires checking only that the signatures from the director repository are valid. Uptane is designed with automotive requirements in mind, and one of the difficulties in that space is that ECUs requiring OTA updates might have very slow and or memory-limited microcontrollers.

3.3 Key Types and Thresholds

3.3.1 Key Types

If follow the highest security recommendations, you’ll need to manage several different keys.

Key Name

Purpose

Description

Fleet Root

Device Identity

The private key of your Fleet Root CA. This is used to sign the individual device certificates for your fleet of devices. The backend server can then validate device certificates to ensure that a connecting device is part of your fleet.

Uptane Root

Software Integrity

This key is used to sign the "root" metadata file for your software repository. This file contains information about all the roles that can sign software metadata.

Uptane Targets

Software Integrity

This key is used to sign the "targets" metadata file for software updates. This file contains information about all the valid software files in your software repository.

Uptane Snapshot

Software Integrity

This key is used to sign the "snapshot" metadata file for software updates. This file contains information about all the valid software files in your software repository.

Uptane Timestamp

Software Integrity

This key is used to sign the "timestamp" metadata file for software updates. This file contains information about all the valid software files in your software repository.

3.3.2 Key Thresholds

Since the Root role keys on the Director repository are not expected to be revoked and replaced often, its metadata file MAY expire after a relatively long time, such as one year.

The Timestamp, Snapshot, and Targets metadata files SHOULD expire relatively quickly, such as in a day, because they are used to indicate whether updated images are available.

For the Image repository, each role MAY use as many keys as is desired, though the greater the impact of key compromise for a given role, then the greater the number of keys that it SHOULD use. Also, a threshold number of keys SHOULD be required, so that a single key compromise is generally insufficient to sign new metadata. To further increase compromise resilience, each key SHOULD be unique across all roles.

Root Role

Since the Root role has the highest impact when its keys are compromised, it SHOULD use a sufficiently large threshold number of keys. Each key MAY belong to a different repository administrator. For example, if there are 8 administrators, then at least 5 keys SHOULD be required to sign the Root metadata file, so that a quorum is required to trust the metadata.

Targets Role

Since the Targets role also has a high impact when its keys are compromised, it SHOULD also use a sufficiently large threshold number of keys. For example, 3 out of 4 keys MAY be required to sign the Targets metadata file.

Timestamp & Snapshot

Since the Timestamp and Snapshot roles have a relatively low impact when its keys are compromised, each role MAY use a small threshold number of keys. For example, each role MAY use 1 out of 2 keys to sign its metadata file.

3.3.3 Metadata Thresholds

In the metadata, thresholds can be configured by roles node , which is shown in the follow block.

The Uptane Standard requires all metadata files to have expiration times in order to prevent or limit freeze attacks (refer to appendix). If ECUs know the time, then attackers cannot indefinitely replay outdated metadata, and hence, images. In general, the expiration date for a metadata file depends on how often it is updated. The more frequently it is updated, then the faster it SHOULD expire so that man-in-the-middle attackers are unable to execute freeze attacks for too long. Even if it is not updated frequently, it SHOULD expire after a bounded period of time, so that stolen or lost keys can be revoked and replaced.

Note, Since the Root role keys are expected to be revoked and replaced relatively rarely, its metadata file MAY expire after a relatively long time, such as one year.

3.4 Encryption & Decryption

The Director could encrypt images for ECUs that require them, either by encrypting on-the-fly or by storing encrypted images on the repository.

The following information is CONDITIONALLY REQUIRED for each image on the Director repository IF that image is encrypted:

  • Information about filenames, hashes, and file size of the encrypted image.

  • Information about the encryption method, and other relevant information–for example, a symmetric encryption key encrypted by the ECU’s asymmetric key could be included in the Director repository metadata.

3.4.1 Encryption

The encryption progress is shown in the following figure:

  1. is a plain image file that is uploaded by the admin;

  2. is a symmetric key, also called ECU key, red key;

  3. The encrypted image is generated by the symmetric algorithm along with the red key and the plain image.

  4. The director repository makes use of the asymmetric public key to encrypt the red key to the black key.

  5. The asymmetric algorithm can be the RSA or ECC.

  6. The public key will encrypt the ECU key to an encrypted key named black key.

  7. The black key is populated into the target metadata as a node, meanwhile, the filename, hash, and file size of the encrypted image shall be recorded in the target metadata too.

  8. The encrypted image is transformed into the image repository by private API calling.

3.4.2 Decryption

The encryption and decryption process is shown in the following figure:

  1. The vehicle downloads the targets metadata and the encrypted image from the backend.

  2. Parsing the metadata gets the black key.

  3. Decrypting the black key into the red using the asymmetric private key.

  4. Decrypting the encrypted image into the plain image using the symmetric key (ECU key, red key).

By the above introduction, we feel the so important thing is the asymmetric key pair that is required by the ECU key encryption. The asymmetric key shall be provisioned by Chapter 3.1 PKI and Provisioning.

he ECU key encryption. The asymmetric key shall be provisioned by Chapter 3.1 PKI and Provisioning.

Appendix

Freeze Attack

A freeze attack is a physical attack method where hackers or attackers use freezing agents or gases to lower the temperature of the target device, causing it to enter an abnormal state or malfunction. This type of attack leverages the effects of temperature changes on hardware and software to disrupt the operation or compromise the security of the targeted device.

Freeze attacks can be directed at various devices and applications, including computers, embedded systems, encryption chips, and more. Here are some potential impacts and targets of freeze attacks:

  1. Clock Vulnerabilities: Lowering the device's temperature can affect the clock speed inside the device, disrupting normal timing and sequencing.

  2. Power Management Interference: Low temperatures may cause battery performance to decrease or impact battery charging and discharging processes.

  3. Encryption Exploitation: Some encryption devices' circuits may exhibit different behaviors under low temperatures, providing attackers an opportunity to exploit encryption algorithms through side-channel attacks or other means.

  4. Electronic Component Failures: Low temperatures may cause electronic components to contract or become brittle, increasing the risk of failures.

To mitigate freeze attacks, several measures can be taken:

  1. Physical Security: Protect devices from unauthorized access and limit physical contact.

  2. Hardware Safeguards: Integrate temperature sensors within devices to detect abnormal temperature changes and trigger alerts or shutdown mechanisms.

  3. Software Monitoring: Monitor the device's temperature state within software. If abnormal temperature is detected, appropriate security measures can be taken, such as disabling critical functions or triggering alerts.

  4. Encryption and Authentication: Ensure devices remain secure against cooling attacks by using encryption and authentication mechanisms.

Freeze attacks are relatively uncommon, but it's still important to consider preventative measures during device design and implementation to ensure proper device functionality and data security.

Uploading and Download: The Director repository SHALL expose an interface for Primaries to upload vehicle version manifests () and download metadata.

This API SHOULD require authentication so that each user is allowed to access only certain information. Examples include , a password, or an API key encrypted over TLS. For additional security, the OEM may use that utilizes more than one authentication method.

Some security systems use online keys, or signing keys that are accessible from the repository, to sign metadata, protecting ECUs from attacks. Unfortunately, the downside of using an online key to sign all metadata is that attackers who compromise the repository can also immediately abuse this key to sign and distribute malware. This is true even if the online key is protected behind a Hardware Security Module (HSM).

If you are using non-OSTree software images, you’ll have to use to manage your metadata. About how to make use of the garage-sign tool, you can refer to

The encryption process is included in the backend referring to , while the decryption process is invoked in the vehicle’s primary ECU. We can find this process in the .

😃
Section 5.4.2.1.1
client certificates
multi-factor authentication
man-in-the-middle
garage-sign
https://docs.ota.here.com/ota-client/2020.2/rotating-signing-keys.html#_rotate_the_online_keys_with_your_new_offline_keys
https://uptane.github.io/papers/uptane-standard.2.0.0.html#directing-installation-of-images-on-vehicles
https://uptane.github.io/papers/uptane-standard.2.0.0.html#full_verification
SolarWinds
image repository
director repository
A proposed configuration of roles on the Director repository
How Primaries would interact with the Director repository.
A proposed configuration of roles on the Image repository
Using two repositories to provide both compromise-resilience and on-demand customization of vehicles.
An example number of keys that MAY be used by each role. Each role uses a threshold of (n, m) keys, where n out of m signatures are required to trust the signed metadata.