Secure Boot/ru: Difference between revisions

From NixOS Wiki
Unabomberlive (talk | contribs)
Created page with "<code>stub</code> - это UEFI-приложение, которое загружает ядро и initrd из ESP. Оно отличается от systemd-stub, смотрите ниже, чтобы увидеть точные различия."
Unabomberlive (talk | contribs)
Created page with "{{warning|Lanzaboote все еще находится в разработке и требует некоторых предварительных условий и мер предосторожности. В настоящее время он доступен только для nixos-unstable. Для получения дополнительной информации, пожалуйста, обратитесь к репозиторию GitHub или руководст..."
Line 15: Line 15:
<code>stub</code> - это UEFI-приложение, которое загружает ядро и initrd из ESP. Оно отличается от systemd-stub, смотрите ниже, чтобы увидеть точные различия.  
<code>stub</code> - это UEFI-приложение, которое загружает ядро и initrd из ESP. Оно отличается от systemd-stub, смотрите ниже, чтобы увидеть точные различия.  


<div lang="en" dir="ltr" class="mw-content-ltr">
{{warning|Lanzaboote все еще находится в разработке и требует некоторых предварительных условий и мер предосторожности. В настоящее время он доступен только для nixos-unstable. Для получения дополнительной информации, пожалуйста, обратитесь к репозиторию GitHub или руководству по Quick Start}}.
{{warning|Lanzaboote is still in development and requires some prerequisites and precautions. Currently it's only available for nixos-unstable. For more information, please see the GitHub repository or the Quick Start guide.}}
</div>


<span id="Requirements"></span>
<span id="Requirements"></span>

Revision as of 17:43, 20 July 2024

Под безопасной загрузкой обычно подразумевается возможность встроенного программного обеспечения платформы проверять компоненты загрузки и гарантировать, что загрузится только ваша собственная операционная система.

Secure Boot имеет несколько реализаций, наиболее известная - UEFI Secure Boot, которая опирается на прошивку платформы UEFI, но во встраиваемых системах могут существовать и другие реализации.

On NixOS, Secure Boot can be enabled via the project Lanzaboote.

Lanzaboote состоит из двух компонентов: lzbt and stub.

lzbt - это программа командной строки, которая подписывает и устанавливает загрузочные файлы на ESP.

stub - это UEFI-приложение, которое загружает ядро и initrd из ESP. Оно отличается от systemd-stub, смотрите ниже, чтобы увидеть точные различия.

Warning: Lanzaboote все еще находится в разработке и требует некоторых предварительных условий и мер предосторожности. В настоящее время он доступен только для nixos-unstable. Для получения дополнительной информации, пожалуйста, обратитесь к репозиторию GitHub или руководству по Quick Start

.

Требования

The Secure Boot implementation of Lanzaboote requires a system installed in UEFI mode together with systemd-boot enabled. This can be checked by running bootctl status:

$ bootctl status
System:
     Firmware: UEFI 2.70 (Lenovo 0.4720)
  Secure Boot: disabled (disabled)
 TPM2 Support: yes
 Boot into FW: supported
</div>

<div lang="en" dir="ltr" class="mw-content-ltr">
Current Boot Loader:
      Product: systemd-boot 251.7
...

It is recommended to enable a BIOS password and full disc encryption to prevent attacks against UEFI and Secure Boot.

Setup

Follow the instructions in the Quick Start guide.

Key management

At the time of writing, Lanzaboote offers only local storage of the keyring, otherwise, it is not possible to rebuild the system and sign the new resulting files.

In the future, Lanzaboote will offer two new signature backends: remote signing (an HTTP server which receives signature requests and answers with signatures) and PKCS#11-based signing (that is, bringing an HSM-like device, e.g. YubiKey, NitroKey, etc.).

Warning: Key management is a hard problem which is out of scope for Lanzaboote project, many recipes exist and there is no single perfect solution. Taking the time to learn how to key manage and figure out the right level of threat protection is crucial to achieve an effective boot protection.

Differences with `systemd-stub`

systemd and distribution upstream have an existing solution called `systemd-stub` but this is not a realistic solution for NixOS as there's too many generations on a system.

Using `systemd-stub`, a kernel and an initrd has to be duplicated for each generation, using Lanzaboote's stub, a kernel and initrd can be deduplicated without compromising on the security.

Tracking the feature parity with `systemd-stub` can be done in this issue: https://github.com/nix-community/lanzaboote/issues/94.