systemd lacks a method to provide assurance of hardware security measures before cryptsetup

オープン
#44,339 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
28/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
c, linux
領域
backend, security

調査の方向性

The report describes Dracut units that configure and measure MOR Lock and TSME/TME before cryptsetup, plus systemd-pcrlock policies. Start by reading the systemd initrd and PCR policy documentation and tracing when enter-initrd secrets are unsealed relative to cryptsetup-pre.target. Define how hardware state is checked and how non-locked MOR is cleared after secrets are erased; the report does not name source files or tests.

索引モデルが issue の本文から書いたものです。

説明

RFE 🎁
Component

No response

Is your feature request related to a problem? Please describe

My problem concerns two technologies to combat cold-boot attacks that I'd want to use together with a disk encryption setup, but that would need to be ensured to be active before any keys are loaded from TPM2 and etc. or passwords provided:

  1. MemoryOverwriteRequestControl and MemoryOverwriteRequestControlLock. These are EFI variables that make the UEFI zero out the entire RAM during a system reset. Specification The OS could clear the control bit if the lock isn't set - a lock without a password is an irrevocable request. So ideally, one would want the MOR Lock enabled before any secrets are loaded into memory.
  2. Transparent memory encryption. This refers to AMD TSME and Intel TME. On a machine capable of them, you'd want a UKI that is authorised to retrieve keys from a TPM2 for example not to do so if the encryption was turned off, as that would make the memory encryption by-passable if it can be turned off simply in the BIOS - and locking to PCR[1] would be the only other way currently to enforce this setting to be enabled.

In both cases, they provide defence against memory reads and so would be effective if ensured at initrd time before cryptsetup-pre.target was reached. But currently there's little way to protect against them just being turned off in the BIOS.

For MOR, if the kernel is compiled with CONFIG_RESET_ATTACK_MITIGATION being set, the Linux efistub will enable MOR, but not lock it. This is also noted in the Kconfig to require unlocking after secrets were erased. At least that would be the idea in case of a non-locked MOR, where the OS should remove the request after secrets were cleared from memory. Currently there exists no tooling for doing so. MOR has been known to significantly prolong reboot times on some systems, so you might only want MOR if the system was suddenly powered off or crashed without securely clearing secrets.

So I'd like a solution that would allow either refusing to continue the boot and/or lock TPM2 secrets to only unseal after both (ideally configurable) are set up and ensured - and ideally for a non-locked MOR to be useable for minimal reboot time impact.

Describe the solution you'd like

What I'm doing locally is I have a small Dracut module to include two systemd units before cryptsetup. One sets up the MOR Lock and verifies its state and then performs a measurement into PCR[15] the other just measures the state of TSME / TME into PCR[15].

Then I have systemd-pcrlock create a policy at a location only after all this is measured into their expected states. This way, if the MOR Lock wasn't successful or memory encryption was turned off, no secrets could be loaded into memory, thus closing a gap that could have allowed them to be bypassed.

The issue however is that it would be arguably even better if this state was assured earlier, ideally before you'd want to unseal the first secrets bound to systemd PCR[11] policies at enter-initrd. Additionally, for a non-locked MOR to work out, a target for when all secrets would have been cleared from memory at which the MOR bit could be unset or something similar would be needed.

Describe alternatives you've considered

No response

The systemd version you checked that didn't have the feature you are asking for

262

主要言語
C
スター
17k
フォーク
4.8k
平均マージ
2日 10時間
マージ済み PR(30日)
342

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

systemd/systemd のほかの issue

systemd/systemd の issue をすべて見る

似ている issue

C の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。