Secure Boot/ru: Difference between revisions

Unabomberlive (talk | contribs)
No edit summary
FuzzyBot (talk | contribs)
Updating to match new version of source page
 
(4 intermediate revisions by 2 users not shown)
Line 4: Line 4:
Secure Boot имеет несколько реализаций, наиболее известная - UEFI Secure Boot, которая опирается на прошивку платформы UEFI, но во встраиваемых системах могут существовать и другие реализации.  
Secure Boot имеет несколько реализаций, наиболее известная - UEFI Secure Boot, которая опирается на прошивку платформы UEFI, но во встраиваемых системах могут существовать и другие реализации.  


На NixOS, Secure Boot может быть включён с помощью проекта [Lanzaboote].
<div lang="en" dir="ltr" class="mw-content-ltr">
[[Category:Security]]
[[Category:Booting]]
</div>


Lanzaboote состоит из двух компонентов:
<div lang="en" dir="ltr" class="mw-content-ltr">
<code>lzbt</code> and <code>stub</code>.
== Checking Secure Boot status ==
 
The easiest way to check if your machine has Secure Boot enabled is through the use of [[Systemd]]'s <code>bootctl</code>. There is no need to be using [[Systemd/boot|systemd-boot]] as your bootloader for this command to work. <syntaxhighlight lang="console">
<code>lzbt</code> - это программа командной строки, которая подписывает и устанавливает загрузочные файлы на ESP. 
 
<code>stub</code> - это UEFI-приложение, которое загружает ядро и initrd из ESP. Оно отличается от systemd-stub, смотрите ниже, чтобы увидеть точные различия.
 
{{warning|Lanzaboote все еще находится в разработке и требует некоторых предварительных условий и мер предосторожности. В настоящее время он доступен только для nixos-unstable. Для получения дополнительной информации, пожалуйста, обратитесь к репозиторию GitHub или руководству по Quick Start}}.
 
<span id="Requirements"></span>
== Требования ==
 
Для реализации Secure Boot в Lanzaboote требуется система, установленная в режиме UEFI с включенной загрузкой systemd-boot. Это можно проверить, выполнив команду <code>bootctl status</code>:
 
<syntaxHighlight lang=console>
$ bootctl status
$ bootctl status
System:
System:
    Firmware: UEFI 2.70 (Lenovo 0.4720)
    Firmware: UEFI 2.80 (American Megatrends 5.25)
  Secure Boot: disabled (disabled)
    Firmware Arch: x64
TPM2 Support: yes
    Secure Boot: enabled (user)
Boot into FW: supported
    TPM2 Support: yes
 
    Measured UKI: yes
Current Boot Loader:
    Boot into FW: supported
      Product: systemd-boot 251.7
...
...
</syntaxHighlight>
</syntaxhighlight>The system above has secure boot enabled and enforced. Other values include <code>disabled (setup)</code> for Setup Mode, <code>disabled (disabled)</code> or <code>disabled (unsupported)</code>. The unsupported tag only appears if your device firmware does not support Secure Boot at all.
If you see <code>disabled (disabled)</code>, this means you will need to enable Secure Boot in your UEFI firmware settings before proceeding to use one of the projects outlined below.
</div>  


Рекомендуется включить пароль BIOS и полное шифрование диска, чтобы предотвратить атаки на UEFI и Secure Boot.
<div lang="en" dir="ltr" class="mw-content-ltr">
 
== Enabling Secure Boot on NixOS ==  
<span id="Setup"></span>
On NixOS, there are currently two main ways to enable Secure Boot, [[Lanzaboote]] and [[Limine]]. See their respective wiki pages for step by step instructions on each.
== Настройка ==
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
<div lang="en" dir="ltr" class="mw-content-ltr">
Follow the instructions in the [https://github.com/nix-community/lanzaboote/blob/master/docs/QUICK_START.md Quick Start guide].
For Secure Boot to be most effective, there are certain conditions which should also be met. The most important are:
</div>
</div>


== Управление ключами ==
<div lang="en" dir="ltr" class="mw-content-ltr">
На момент написания статьи Lanzaboote предлагает только локальное хранение связки ключей, иначе невозможно перестроить систему и подписать новые результирующие файлы.
# The UEFI firmware is protected by a strong password to prevent an untrusted drive from being booted or Secure Boot being disabled.
 
# Full disk encryption is enabled so that your drive cannot simply be read by putting it another another machine.
В будущем Lanzaboote предложит два новых варианта подписи: удаленная подпись (HTTP-сервер, который получает запросы на подпись и отвечает подписями) и подпись на основе PKCS#11 (то есть с использованием HSM-подобного устройства, например, YubiKey, NitroKey и т.д.).
# Ideally, default OEM/third party keys are not in use as these have been shown to weaken the security of Secure Boot significantly.<ref>https://habr.com/ru/articles/446238/</ref> However, this may brick some devices which use Microsoft-signed OpROMS for certain hardware during the boot process, particularly some laptops, so you must be certain before removing them. It may be impossible to fix if, for example, the GPU relies on these OpROMS.
 
</div>
{{Warning|Управление ключами - сложная проблема, которая выходит за рамки проекта Lanzaboote, существует множество решений, но не существует единого идеального. Потратьте время на то, чтобы научиться управлять ключами и определить правильный уровень защиты от угроз - это очень важно для эффективной защиты загрузки}}.
 
== Различия с `systemd-stub` ==
У systemd и upstream дистрибутивов есть существующее решение под названием `systemd-stub`, но оно не подходит для NixOS, так как в системе слишком много поколений.


<div lang="en" dir="ltr" class="mw-content-ltr">
<div lang="en" dir="ltr" class="mw-content-ltr">
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.
== See Also ==
</div>
[https://wiki.archlinux.org/title/Unified_Extensible_Firmware_Interface/Secure_Boot Arch Wiki/Secure Boot] Extensive information on Secure Boot including using UKIs.
</div>  


<div lang="en" dir="ltr" class="mw-content-ltr">
<references />
Tracking the feature parity with `systemd-stub` can be done in this issue: https://github.com/nix-community/lanzaboote/issues/94.
[[Category:Security]]
[[Category:Booting]]
</div>