TEE Engineer License study materials
TEE Engineer License study resources

Secure-Boot Fallback, Attestation Pinning, and Root-Key Rotation for Remote Gateways

TEE Engineer License · Put your knowledge to work in context.

All case studies

Secure-Boot Fallback, Attestation Pinning, and Root-Key Rotation for Remote Gateways

An industrial operator has 8,000 battery-powered gateways in remote substations. Each gateway boots with a ROM verifier that checks an RSA-3072 bootloader against a root-key hash burned into OTP, then measures the OS and a container. A cloud attestation service compares the resulting measurement against a single golden value before releasing a wrapping key from an on-premises HSM. Last month a signed firmware update was interrupted by a lightning-induced power loss at 12% of sites. The gateways’ A/B slots fell back to the previous image, which still boots, but attestation now rejects them because the measurement is the old one. Field technicians cannot reach most sites for six months, and the update window is 30 minutes. The bootloader supports A/B slots but no rollback protection. Separately, the root-key custodian is retiring in nine months, and the OTP root hash cannot be changed in the field.

1. Why did the fallback gateways fail attestation, and what is wrong with the policy? What immediate recovery steps would you take without weakening rollback protection?

Read the worked answer

The attestation service pins one golden measurement, so any legitimate boot path other than the newest image is rejected. The A/B fallback did what it was designed to do, but the policy treated a valid old image as an attacker. The deeper error is conflating measurement equality with security state: it cannot distinguish a planned fallback from a rollback attack. Immediate steps:

  • Do not simply add the old measurement to the allowlist; that would let an attacker replay the old image indefinitely.
  • Issue a signed recovery bundle that contains the old image plus a signed manifest with a security version number and a nonce; have the device attest the boot slot, version, and reason for fallback.
  • Update the HSM release policy to require a known measurement allowlist, a minimum security version, and a signed device boot log. Release the wrapping key for the old image only if its version is at or above the floor and the fallback is recorded.
  • Check the A/B metadata for partial writes; make slot selection atomic and mark a slot bootable only after self-test.
  • Because technicians cannot reach sites, use the existing management channel to push the recovery bundle and re-attest; do not require physical reprovisioning.

2. Redesign the measurement and attestation policy so that power-loss fallback is safe and rollback is still detected.

Read the worked answer

Use measured boot with a signed event log, not a single hash. The device key signs a quote over the log and a server nonce. Policy should evaluate:

  • measurement allowlist with a minimum security version, not exact match;
  • boot slot and fallback reason;
  • anti-rollback counter stored in a TEE or secure element, or OTP fuses for major versions;
  • device identity and revocation status. For updates: write the image to the inactive slot, verify signature, set a trial flag, boot it, run self-test, then commit and increment the security version. If power fails before commit, the bootloader returns to the old slot, and the old slot is still acceptable because its version is at or above the floor. The server logs the fallback for anomaly detection. Keep a signed revocation list so a known-bad image can be excluded even if its version is high. This separates availability, where fallback is allowed, from security, where minimum version and revocation still apply.

3. The OTP root hash cannot change and the root-key custodian retires in nine months. Propose a root-key rotation plan and the governance controls needed.

Read the worked answer

Because the OTP hash is immutable, rotation must be authorized by the old root. The practical design is a root delegation certificate: the retiring root signs a new root public key and a policy that limits its scope and validity; the bootloader verifies the delegation chain from the OTP root, stores the new root in secure storage or spare OTP, and then trusts it. This requires a bootloader update before the custodian leaves. Steps:

  • Inventory devices and spare OTP; confirm bootloader support for delegation.
  • Generate the new root in an HSM with split knowledge; have the old root sign the delegation.
  • Dual-sign firmware for a transition period; keep the old root only for delegation, not for new images.
  • Add revocation for the old root after the fleet is updated; test recovery if a device misses the update.
  • Governance: M-of-N custodians, documented ceremony, HSM backups, audit logs, and a rollback plan. If the bootloader cannot support delegation, the only options are recall/replacement or accepting that the root cannot be rotated; do not pretend a field update can change OTP.