Module 12 · Lesson 71 of 114

Secure boot, certificates and the threat model

Trace an ECU’s boot verification, explain how OTA certificates are managed, and identify controls that limit what a compromised ECU can reach.

  • Beginner to advanced
  • 10 min read
  • 15 min lab
What you will need

Ubuntu 24.04 in WSL2 or a VM for writing the practice notes, plus familiarity with ECU networks and embedded Linux startup. No board is required.

Your place in the module
By the end you can 4 objectives
  • Trace signature verification from a hardware-protected trust anchor to the Linux kernel and root filesystem.
  • Distinguish enforced boot verification from measured boot.
  • Explain provisioning, renewal, and revocation for OTA endpoint and signing credentials.
  • Map external interfaces to ECU trust boundaries and choose controls that limit lateral movement.
Video coming soonSecure boot, certificates and the threat model
The video for this lesson is being recorded. Read the lesson below in the meantime.
Recall first from SecOC message authentication
  • The sender authenticates the configured Data ID, authentic PDU bytes, and complete freshness value.
  • The receiver verifies a CMAC tag and checks freshness before delivering the payload.
  • Shorter tags save bandwidth and increase the chance of a successful guess.
01

What the ECU is allowed to boot

4 min read

Message-level security is covered; this lesson answers how secure boot anchors trust, how certificates are managed, and what the overall threat model is.

On a Linux system, verifying the kernel still leaves a practical question. When that kernel reads a program from the root filesystem, what tells it whether the storage blocks match the approved image? Linux provides dm-verity for this problem. It checks blocks against a hash tree as they are read. The check depends on an expected root hash obtained from a trusted source. If the system accepts the image and its expected hash from the same untrusted source, both can be replaced together. Linux kernel documentation on dm-verity

The first boot decision has the same dependency. A gives the ECU a starting point. For example, an SoC can run its first verifier from immutable boot ROM and use a public key whose hash is stored in one-time programmable hardware. The ROM checks the supplied public key against that hash, then uses the key to verify a signature over the next boot stage. The corresponding private key is held by the signing authority. The device needs the public verification material. A raw public key can serve this purpose without an X.509 certificate.

Each verified stage can then verify the next stage before transferring control. In one embedded Linux design, the ROM verifies a first-stage loader, that loader verifies a later bootloader, and the later bootloader verifies the kernel and its boot configuration. The signed data must cover the configuration that determines what the device starts. Depending on the design, that includes the device tree, the initial RAM filesystem and settings that select the root filesystem. The trusted configuration can supply the expected dm-verity root hash to the kernel. The kernel then checks the covered filesystem blocks as it reads them. A failed verification leads to the response defined by policy, such as refusing the selected image and trying an independently verified recovery image.

One verified Linux startup pathBoot ROMUsesprotectedtrustanchorFirstloaderVerifieslaterloaderLaterloaderVerifieskernel andboot configurationLinuxkernelUses authenticatedroot hashRootfilesystemblocksChecked asreadBoot ROMUsesprotectedtrustanchorFirstloaderVerifieslaterloaderLaterloaderVerifieskernel andboot configurationLinuxkernelUses authenticatedroot hashRootfilesystemblocksChecked asread
Each boot decision depends on verification material whose authenticity was established earlier

From the embedded boot material in M4, carry forward the order in which the board loads its firmware, kernel and root filesystem. At each handoff, identify the verifier, the bytes it checks and the source of its verification key. Connect that exercise to virtualization in M11. If a hypervisor starts first, it belongs within the verified startup path, and the design must also say who verifies guest images before launch. Bootlin’s training materials provide board-oriented context for tracing secure boot through firmware and bootloader stages. Bootlin training materials and documentation

A correct signature establishes integrity and authenticity under the accepted key. An older image can pass that check even when it contains a known flaw. Where the threat model includes reinstallation of vulnerable releases, the ECU needs a rollback policy that checks the version against a protected minimum. Recovery must follow an explicit version and signing policy as well. Otherwise the platform could enforce a strict policy on normal startup while accepting obsolete software through its recovery path.

answers a different question. In a TPM-based design, firmware or a bootloader extends measurements into platform configuration registers and records the corresponding events in a log. An attestation verifier can use a fresh TPM quote and the event log to check the reported register state against expected measurements. A measurement can be recorded even if the component is permitted to execute. A system can enforce signatures and collect measurements during the same startup. The evidence describes what was measured and says nothing by itself about whether a service was compromised later.

02

Which credentials an OTA verifier accepts

4 min read

An ECU that downloads an update has two decisions to make. First, is it communicating with the expected update service? Second, did an authority permitted to release software approve these exact bytes for this ECU? In a design that uses certificates for both decisions, the OTA client checks the service’s TLS certificate, while the update verifier checks a signed manifest against its software-signing policy. The manifest can include the image digest, target ECU type and version so that those fields are authenticated together. The client computes the received image digest and compares it with the signed value. A download served by the expected endpoint can still fail the package check.

An X.509 certificate contains a public key, subject information, a serial number, a validity interval and, where present, extensions that constrain its use. A certificate authority (CA) signs the certificate. A verifier can validate a path through intermediate CAs to a configured trust anchor, check the applicable validity and usage constraints, and apply the identity and authorization rules for that decision. An update client, for example, checks whether the service identity matches the endpoint it intended to contact. An update verifier separately checks whether the signing credential is authorized for the given update role and target. Acceptance of a certificate path establishes a basis for that role check. The Linux kernel key retention service documents kernel keyrings and their use by kernel consumers. An OTA client can maintain its own application-level trust configuration, so check what the actual verifier uses. Linux kernel key retention service

Two OTA verification decisionsEndpoint authenticationUpdateverificationVerifierOTA clientUpdateverifierEvidenceServicecertificateand key proofSignedmanifest andsigningcredentialPolicyExpectedserviceidentityAuthorizedreleasesigner andtargetDecisionAcceptauthenticatedpeerAcceptsoftware fortarget
The OTA client checks the service identity, and the update verifier checks release authorization

A public key infrastructure, or PKI, includes the authorities, processes and trust configuration used to issue and manage certificates. It starts on the ECU with provisioning. In a factory enrollment flow, an authenticated station can associate a device identity with a public key generated in protected storage on the device, then arrange for a CA to issue the device certificate. The ECU also receives the trust material it needs to validate the service and update signatures. If the backend uses mutual TLS, it can require the ECU to prove possession of the private key that matches its device certificate. Giving each unit its own credential lets the backend withdraw access for that unit individually.

Renewal keeps credentials usable as their validity periods end. A device may renew using its existing authenticated identity and may generate a new key during the process. A fleet needs a way to handle vehicles that remain offline across a renewal window. It also needs a protected method for distributing new trust anchors before it relies on certificates that require them. An ECU needs a reliable basis for validity-time checks, which matters if it starts without trustworthy wall-clock time. When planning a transition, test the verifiers with both the credentials already deployed and the credentials that will replace them.

Revocation withdraws acceptance before normal expiry. A CA can publish a certificate revocation list (CRL) or provide certificate status through the Online Certificate Status Protocol (OCSP). These mechanisms affect a decision when the verifier obtains and checks status under its policy. A backend that rejects a revoked device certificate can stop that device from opening new authenticated sessions. An offline ECU cannot learn a newly published revocation immediately. Its update policy must say how recent its revocation information needs to be and what happens when that information is unavailable. For example, it can defer accepting a newly presented update until it has sufficiently fresh status while continuing to run its already approved software.

If a software-signing key is compromised, locate every verifier that accepts it. With certificate-based package signing, the update verifier may learn about the revocation through its certificate policy. If a bootloader accepts the same signer as a pinned raw key, an X.509 revocation list cannot change that bootloader’s trust configuration. It needs a separate authenticated way to withdraw trust from the key. That difference is a reason to track the device identity, the service identity, the release signer and the boot verifier’s trusted keys as distinct roles. M12-S09 picks up these decisions when it covers software packages and OTA architecture.

03

What changes when an ECU is compromised

3 min read

A gives each control a specific purpose. For an update-capable vehicle, assets include boot configuration, approved software, private keys and the availability and integrity of ECU functions. Begin by identifying what is reachable from outside the vehicle and what each reachable component can do inside it. Treat external traffic as untrusted input even when a known device or service sends it. A valid identity tells a receiver who is communicating, and the receiver still has to decide which operations to allow.

Consider three interfaces. The OBD connector exposes diagnostics to equipment with physical access. A diagnostic gateway can restrict which services and destination ECUs are reachable, and require suitable authorization and vehicle conditions for sensitive requests. Bluetooth accepts traffic from nearby devices within the scope of the supported profiles. The Bluetooth-facing process needs limited permissions and only the internal access required for those profiles. Telematics exchanges data with external networks and backend services. Restrict the services that the telematics ECU can call and the messages it can forward to other vehicle networks. A maintenance function and a routine telemetry upload should have permissions appropriate to their different purposes.

Reachability in an example vehicleCentral gatewayEnforces cross-network access policyOBD connectorPhysical diagnostic accessInfotainment ECUBluetooth devicesNearby wireless accessTelematics ECUExternal networksBackend and network trafficChassis ECURestricted diagnostic operationsCentral gatewayEnforces cross-network accesspolicyOBD connectorPhysical diagnostic accessInfotainment ECUBluetooth devicesNearby wireless accessTelematics ECUExternal networksBackend and networktrafficChassis ECURestricted diagnosticoperations
External interfaces reach different vehicle components, and gateway policy restricts access across internal network boundaries

Assume a vehicle’s telematics application has been compromised while running on correctly verified software. The process might be able to use credentials that the legitimate application is allowed to use, including asking protected hardware to perform an authorized cryptographic operation without extracting the key. It may also have access to internal services through an existing route. becomes possible when the next component accepts that access. Review what the compromised process can actually reach and what the receiving service would allow it to do.

For example, a central gateway could allow a telematics ECU to report connectivity status but deny its requests for programming operations on a chassis ECU. The chassis ECU can also enforce authorization for its own sensitive diagnostic services. With those independent decisions, a valid telematics identity grants only its intended privileges. Network segmentation gives the gateway a place to enforce the routing rule, and process isolation on the telematics ECU limits which credentials and interfaces the application can use. These controls address runtime exposure. Boot verification addresses persistence through modification of the software and configuration that it covers.

Bring the decisions together by asking what should happen under a particular failure. If software on storage changes, identify the verification step that should detect it. If a release certificate is revoked, identify who provides the status, when the ECU can receive it and which verifier uses it. If a running process is compromised, identify the next destination it could contact and the permissions that destination would enforce. Each answer names a verifier, evidence it can check, and an action it can take. That makes the threat model specific enough to find gaps, such as a route that permits more operations than the receiving ECU expects or a signer that can be retired by one verifier but remains trusted by another.

Before moving on, choose one reachable ECU and write a short explanation of what it verifies at startup, what authorizes a software update for it, and what another ECU may ask it to do. The practice pack applies those questions to one boot configuration and one vehicle network. The next lesson, R155 and the ISO/SAE 21434 lifecycle, asks how an organization manages cybersecurity decisions and their evidence over the vehicle lifecycle.

Key takeaways

  • Secure boot enforces a policy before running each covered stage, while measured boot records evidence about covered components.
  • OTA endpoint authentication and update signing authorize different actions.
  • Certificate renewal and revocation depend on what each verifier trusts and how it receives current policy.
  • A correctly booted ECU can still be compromised at runtime, so gateways and receiving services must enforce their own access policies.
Reflect
  1. Explain to a colleague, in two sentences: trace signature verification from a hardware-protected trust anchor to the Linux kernel and root filesystem.
  2. Which objective are you least sure about? Re-read that section, then do its exercise in the practice pack.
  3. What surprised you when you ran the commands yourself?
On a real board

Repeat the key commands on your Raspberry Pi or lab board over SSH or the serial console. Note anything that behaves differently from your PC, such as missing tools, a BusyBox shell or a read-only filesystem.

References and further reading

Find your next step

↑ ↓ to move · Enter to open · Esc to close