[2024-feb-29] Sad news: Eric Layton aka Nocturnal Slacker aka vtel57 passed away on Feb 26th, shortly after hospitalization. He was one of our Wiki's most prominent admins. He will be missed.

Welcome to the Slackware Documentation Project

Diferencias

Muestra las diferencias entre dos versiones de la página.

Enlace a la vista de comparación

Próxima revisión
Revisión previa
es:howtos:security:enabling_secure_boot [2019/02/11 01:42 (UTC)] – creado slackwarespanoles:howtos:security:enabling_secure_boot [2019/02/21 01:45 (UTC)] (actual) ak3.devel
Línea 1: Línea 1:
-====== Enabling Secure Boot on Slackware ====== +====== Habilitando el arranque seguro en Slackware ====== 
-On Unified Extensible Firmware Interface (UEFI) based hardwarea system can operate in Secure Boot modeIn Secure Boot modeonly EFI binaries (i.e. boot managersboot loadersthat are trusted by the platform ownereither explicitly or via a chain of trustare allowed to run at boot timeThis prevents unauthorised EFI binaries and operating systems from running on your systemwhich can improve security.+En el hardware basado en la Interfaz de firmware extensible unificada (UEFI), un sistema puede operar en modo de arranque seguroEn el modo de arranque segurosolo los binarios EFI (es decir, los gestores de arranquelos cargadores de arranqueen los que el propietario de la plataforma confíaya sea explícitamente o mediante una cadena de confianzapueden ejecutarse en el momento del arranqueEsto evita que los binarios y sistemas operativos no autorizados de EFI se ejecuten en su sistemalo que puede mejorar la seguridad.
  
-This article will teach you+Este artículo te enseñará
-  * About Secure Boot keys and signature databases +  * Acerca de las claves de arranque seguro y las bases de datos de firmas 
-  * How to enroll Secure Boot keys while booted into Slackware +  * Cómo registrar claves de arranque seguro mientras se inicia en Slackware 
-  * How to sign EFI binaries for use in Secure Boot mode+  * Cómo firmar archivos binarios de EFI para su uso en el modo de arranque seguro
-<note important>Make sure you can find and manipulate the Secure Boot settings with your system's UEFI firmware. That wayif you make a mistakeyou can simply turn off Secure Boot to have a bootable system again.</note> +<note important>Asegúrese de que puede encontrar y manipular la configuración de arranque seguro con el firmware UEFI de su sistemaDe esa manerasi comete un errorsimplemente puede desactivar el Arranque seguro para tener nuevamente un sistema de arranque.</note> 
-<note important>Once you have changed your Secure Boot keyssigned your EFI binaries and have tested that Secure Boot is workingyou should store your private keys in a safe location until the keys are required againAnyone with access to your private keys can bypass the protection that Secure Boot offers.</note>+<note important>Una vez que haya cambiado sus claves de arranque segurohaya firmado sus binarios de EFI y haya probado que el arranque seguro está funcionandodebe almacenar sus claves privadas en un lugar seguro hasta que las claves sean requeridas nuevamenteCualquier persona con acceso a sus claves privadas puede pasar por alto la protección que ofrece el arranque seguro.</note>
  
-===== Secure Boot Keys and Signature Databases ===== +===== Claves de arranque seguro y bases de datos de firmas ===== 
-Two types of Secure Boot keys are used to create trust relationships+Se utilizan dos tipos de claves de arranque seguro para crear relaciones de confianza
-  * Platform Key - This establishes the trust relationship between the platform owner and platform firmware. Only one Platform Key can be stored by the UEFI firmwareThe public key is stored in the ''PK'' Secure Boot variableThis key allows the platform owner to manipulate all the Secure Boot keys and signature databases+  * Clave de la plataforma: esto establece la relación de confianza entre el propietario de la plataforma y el firmware de la plataformaEl firmware UEFI solo puede almacenar una clave de plataformaLa clave pública se almacena en la variable de arranque seguro '' PK ''Esta clave permite al propietario de la plataforma manipular todas las claves de arranque seguro y las bases de datos de firmas
-  * Key Exchange Key - This establishes the trust relationship between the operating system and platform firmware. Multiple Key Exchange Keys can be stored by the UEFI firmwareThe public keys are stored in the ''KEK'' Secure Boot variable. Key Exchange Keys only allow the operating system to manipulate the signature databases.+  * Key Exchange Key: establece la relación de confianza entre el sistema operativo y el firmware de la plataformaEl firmware UEFI puede almacenar múltiples claves de intercambio de clavesLas claves públicas se almacenan en la variable de arranque seguro "KEK". Key Exchange Keys solo permite que el sistema operativo manipule las bases de datos de firmas.
  
-There are two signature databases for authorising EFI binaries+Hay dos bases de datos de firmas para autorizar binarios de EFI: 
-  * Forbidden signature database - This stores hashes and public signing keys of forbidden EFI binariesThis uses the ''dbx'' Secure Boot variable. EFI binaries with hashes present in this database or signatures that can be authenticated using a signing key stored in the database are forbidden from loading+  * Base de datos de firmas prohibidas: almacena hashes y claves de firma públicas de binarios EFI prohibidosEsto utiliza la variable de arranque seguro '' dbx ''Los binarios EFI con hashes presentes en esta base de datos o firmas que pueden autenticarse con una clave de firma almacenada en la base de datos tienen prohibido cargarse
-  * Authorised signature database - This stores hashes and public signing keys of trusted EFI binariesThis uses the ''db'' Secure Boot variable. EFI binaries with hashes present in this database or signatures that can be authenticated using a signing key stored in the database are permitted to run if there are no matches with any entries in the Forbidden signature database.+  * Base de datos de firmas autorizada: almacena hashes y claves de firma públicas de binarios de EFI de confianzaEsto utiliza la variable de arranque seguro '' db ''Los binarios EFI con hashes presentes en esta base de datos o firmas que pueden autenticarse usando una clave de firma almacenada en la base de datos pueden ejecutarse si no hay coincidencias con ninguna entrada en la base de datos de firmas prohibidas.
  
-===== Requirements ===== +===== Requisitos ===== 
-You will need the [[https://git.kernel.org/cgit/linux/kernel/git/jejb/efitools.git/|efitools]] and [[https://git.kernel.org/cgit/linux/kernel/git/jejb/sbsigntools.git/|sbsigntools]] packages before you begin. Slackbuilds are available at http://slackbuilds.org.+Necesitarás el paquete [[https://git.kernel.org/cgit/linux/kernel/git/jejb/efitools.git/|efitools]] and [[https://git.kernel.org/cgit/linux/kernel/git/jejb/sbsigntools.git/|sbsigntools]] antes de que empiecesEn Slackbuilds están disponibled http://slackbuilds.org.
  
-If you do not already have your own Platform Key enrolled in the UEFI firmware, the howto assumes you have Secure Boot off and have cleared the ''PK'' variable in the UEFI firmware.+Si aún no tiene su propia clave de plataforma inscrita en el firmware UEFIel howto asume que tiene desactivado el arranque seguro y que ha borrado la variable '' PK '' en el firmware UEFI.
  
-===== Enrolling Secure Boot Keys and Signature Database Entries ===== +===== Inscripción de claves de inicio seguro y entradas de base de datos de firmas ===== 
-If you do not have an existing Platform Key pair and an EFI binary signing key pairthe easiest method to create the key pairs would be to create self signed keysIt is recommended to create 2048-bit RSA key pairs that use the sha256RSA signature algorithmTo generate self signed keys with the recommended propertiesrun:+Si no tiene un par de claves de plataforma existentes y un par de claves de firma binaria EFI, el método más sencillo para crear los pares de claves sería crear claves autofirmadasSe recomienda crear pares de claves RSA de 2048 bits que usen el algoritmo de firma sha256RSA. Para generar claves autofirmadas con las propiedades recomendadasejecute:
 <code>openssl req -new -x509 -newkey rsa:2048 -subj "/CN=Platform Key Common Name/" \ <code>openssl req -new -x509 -newkey rsa:2048 -subj "/CN=Platform Key Common Name/" \
         -keyout PK.priv -out PK.pub -days 3650 -nodes -sha256         -keyout PK.priv -out PK.pub -days 3650 -nodes -sha256
 openssl req -new -x509 -newkey rsa:2048 -subj "/CN=EFI Binary Signing Key Common Name/" \ openssl req -new -x509 -newkey rsa:2048 -subj "/CN=EFI Binary Signing Key Common Name/" \
         -keyout db.priv -out db.pub -days 3650 -nodes -sha256</code>         -keyout db.priv -out db.pub -days 3650 -nodes -sha256</code>
-which creates private keys with the ''.priv'' extension and public key certificates with the ''.pub'' extensionYou may wish to adjust the key validity period and choose a different Common Name (CN) to help distinguish your keys.+que crea claves privadas con la extensión '' .priv '' y certificados de clave pública con la extensión '' .pub ''Es posible que desee ajustar el período de validez de la clave y elegir un Nombre común (CN) diferente para ayudar a distinguir sus claves.
  
-<note>It is not necessary to create or use your own Key Exchange Key as that is intended for use by operating systems. Key Exchange Key instructions, however, have been provided below so you understand how to enroll Key Exchange Keys for operating systems that require it.</note> +<note>No es necesario crear o usar su propia clave de intercambio de clave, ya que está destinada a ser utilizada por los sistemas operativosSin embargo, a continuación se proporcionan las instrucciones de Key Exchange Key para que sepa cómo inscribir las Key Exchange Keys para los sistemas operativos que lo requieren.</note> 
-To prepare a new Platform Key for writing to the ''PK'' variable+Para preparar una nueva Clave de plataforma para escribir en la variable '' PK '': 
-  - Insert the public Platform Key into an EFI signature list: <code>cert-to-efi-sig-list -g owner_guid PK.pub PK.esl </code> replacing ''owner_guid'' with a hexadecimal GUID in the format ''12345678-1234-1234-123456789abc''The owner GUID should be the same for all keys that you ownIf an operating system cannot add signature to signature database due to a lack of resourcesit may remove a signature with an owner GUID associated with the operating system+  - Inserte la clave de plataforma pública en una lista de firmas EFI: <code>cert-to-efi-sig-list -g owner_guid PK.pub PK.esl </code> reemplazando '' owner_guid '' con un GUID hexadecimal en el formato '' 12345678-1234-1234-123456789abc ''El GUID del propietario debe ser el mismo para todas las claves que poseaSi un sistema operativo no puede agregar una firma una base de datos de firmas debido la falta de recursospuede eliminar una firma con un GUID propietario asociado con el sistema operativo
-  - Sign the EFI signature listIn Setup mode (Secure Boot offthe private half of the inserted key should sign the signature listIn User mode (Secure Boot onthe private key of the current Platform key should sign the signature list: <code>sign-efi-sig-list -k PK.priv -c PK.pub PK PK.esl PK.signed</code>+  - Firmando la lista de firmas EFI. En el modo de configuración (arranque seguro desactivado), la mitad privada de la clave insertada debe firmar la lista de firmasEn el modo Usuario (inicio seguro activado), la clave privada de la clave de la plataforma actual debe firmar la lista de firmas: <code>sign-efi-sig-list -k PK.priv -c PK.pub PK PK.esl PK.signed</code>
  
-similar procedure applies for preparing a Key Exchange Key or a signature database entry for writing to the ''KEK'', ''db'', or ''dbx'' variablesKey Exchange Keys must be signed by the private half of the Platform Key:+Se aplica un procedimiento similar para preparar una clave de intercambio de claves o una entrada de la base de datos de firmas para escribir en las variables '' KEK '', '' db '' '' dbx ''Las claves de intercambio de claves deben estar firmadas por la mitad privada de la clave de plataforma:
 <code>cert-to-efi-sig-list -g owner_guid KEK.pub KEK.esl <code>cert-to-efi-sig-list -g owner_guid KEK.pub KEK.esl
 sign-efi-sig-list -a -k PK.priv -c PK.pub KEK KEK.esl KEK.signed</code> sign-efi-sig-list -a -k PK.priv -c PK.pub KEK KEK.esl KEK.signed</code>
-And signature database entries must be signed by the private half of the Platform Key or any of the Key Exchange Keys:+Y las entradas de la base de datos de firmas deben estar firmadas por la mitad privada de la Clave de la plataforma o cualquiera de las Claves de intercambio de claves:
 <code>cert-to-efi-sig-list -g owner_guid db.pub db.esl <code>cert-to-efi-sig-list -g owner_guid db.pub db.esl
 sign-efi-sig-list -a -k PK.priv -c PK.pub db db.esl db.signed</code> sign-efi-sig-list -a -k PK.priv -c PK.pub db db.esl db.signed</code>
-Note that the ''-a'' option was used to prepare for an append write.+Tenga en cuenta que la opción '' -a '' se usó para preparar una escritura anexa.
  
-To update the Secure Boot variables you must have root privilegesYou will need to load the efivarfs kernel module and mount the efivarfs filesystem beforehand if it has not been taken care of already:+Para actualizar las variables de arranque seguro debe tener privilegios de raízNecesitará cargar el módulo del kernel efivarfs y montar el sistema de archivos efivarfs de antemano si aún no se ha resuelto:
 <code>modprobe efivarfs <code>modprobe efivarfs
 mount -t efivarfs efivarfs /sys/firmware/efi/efivars</code> mount -t efivarfs efivarfs /sys/firmware/efi/efivars</code>
  
-To enroll the Platform Keyrun:+Para registrar la Clave de la Plataformaejecute:
 <code>efi-updatevar -f PK.esl.signed PK</code> <code>efi-updatevar -f PK.esl.signed PK</code>
-If the system was in Setup mode it will now be in User mode.+Si el sistema estaba en modo de configuración, ahora estará en modo de usuario.
  
-To add keys to the ''KEK'', ''db'' or ''dbx'' variablesrun (as appropriate):+Para agregar claves a las variables '' KEK '', '' db '' '' dbx '', ejecute (según corresponda):
 <code>efi-updatevar -a -f KEK.signed KEK</code> <code>efi-updatevar -a -f KEK.signed KEK</code>
 <code>efi-updatevar -a -f db.signed db</code> <code>efi-updatevar -a -f db.signed db</code>
 <code>efi-updatevar -a -f dbx.signed dbx</code> <code>efi-updatevar -a -f dbx.signed dbx</code>
  
-You can check that your keys have been properly enrolled using ''efi-readvar''.+Puede verificar que sus claves se hayan inscrito correctamente usando '' efi-readvar ''.
  
-===== Signing EFI Binaries ===== +===== Firma Binarios EFI ===== 
-My recommendation (at the time of writingis that you either use a boot manager with an EFI stub kernel, or directly boot an EFI stub kernel. ELILO, efilinux and syslinux (and possibly GRUB but I do not know for surewill allow unsigned kernels to run (or at least it does on my hardware and VM), which defeats the purpose of Secure BootIf you do follow my recommendationmake sure you sign your kernel every time you change it.+Mi recomendación (en el momento de escribir estoes que use un administrador de arranque con un kernel de stub de EFI, o que arranque directamente un kernel de stub de EFI. ELILO, efilinux syslinux (y posiblemente GRUB, pero no estoy seguropermitirán que se ejecuten núcleos sin firmar (o al menos lo hace en mi hardware VM), lo que anula el propósito de arranque seguroSi sigue mi recomendaciónasegúrese de firmar su kernel cada vez que lo cambie.
  
-You will need to sign all EFI binariesup to, and including your bootloader and/or EFI stub kernelTo sign an binaryrun:+Deberá firmar todos los archivos binarios de EFI, hasta e incluyendo su cargador de arranque y/o el núcleo de stub de EFI. Para firmar un binarioejecute:
 <code>sbsign --key db.priv --cert db.pub --output signed_binary.efi binary.efi</code> <code>sbsign --key db.priv --cert db.pub --output signed_binary.efi binary.efi</code>
  
-An example of how to add an EFI stub kernel entry using efibootmgr is:+Un ejemplo de cómo agregar una entrada de kernel stub EFI usando efibootmgr es:
 <code>efibootmgr -c -L SlackSecureBoot -l '\EFI\Slackware\vmlinuz-signed.efi' -u 'root=/dev/sda3'</code> <code>efibootmgr -c -L SlackSecureBoot -l '\EFI\Slackware\vmlinuz-signed.efi' -u 'root=/dev/sda3'</code>
  
-<note warning>If you see ''warning: gap in section table'' when signing an EFI binary (see below), the binary will probably not work in Secure Boot modeThis warning appears for EFI binaries built against earlier gnu-efi library versionsIf you plan to use ELILO you will need to recompile it yourselfthe version shipped with Slackware will not work.+<note warning>Si ve "" warning: gap in section table "" cuando firma un binario EFI (consulte a continuación), es probable que el binario no funcione en el modo de arranque seguroEsta advertencia aparece para los binarios de EFI creados contra versiones anteriores de la biblioteca gnu-efi. Si planea usar ELILO, deberá volver a compilarlo usted mismo, la versión que se incluye con Slackware no funcionará.
 <code>warning: gap in section table: <code>warning: gap in section table:
     .text   : 0x00000400 - 0x00017c00,     .text   : 0x00000400 - 0x00017c00,
Línea 79: Línea 79:
 </note> </note>
  
-====== Disabling Secure Boot ====== +====== Deshabilitando el arranque seguro ====== 
-If you want to remove all Secure Boot keys and revert to Setup modethe easiest way to do so is to sign an empty file with your Platform Key and write the signed file to all the Secure Boot variables:+Si desea eliminar todas las claves de inicio seguro y volver al modo de configuraciónla forma más sencilla de hacerlo es firmar un archivo vacío con su clave de plataforma y escribir el archivo firmado en todas las variables de inicio seguro:
 <code>touch empty <code>touch empty
 sign-efi-sig-list -k PK.priv -c PK.pub PK empty empty.signed sign-efi-sig-list -k PK.priv -c PK.pub PK empty empty.signed
Línea 88: Línea 88:
 efi-updatevar -f empty.signed dbx</code> efi-updatevar -f empty.signed dbx</code>
  
-====== Dual/Multi-booting with Windows ====== +====== Dual / Multi-booting con Windows ====== 
-If Windows is one of your boot optionsyou will need the Microsoft KEK and db certificatesThe certificates can be found at https://technet.microsoft.com/en-us/library/dn747883.aspx and will need to be converted from DER format to PEM format:+Si Windows es una de sus opciones de arranquenecesitará los certificados KEK db de MicrosoftLos certificados se pueden encontrar en https://technet.microsoft.com/en-us/library/dn747883.aspx y tendrá que convertirse del formato DER al formato PEM:
 <code>openssl x509 -in certificate.der -inform DER -out certificate.pem</code> <code>openssl x509 -in certificate.der -inform DER -out certificate.pem</code>
  
-The instructions that were provided above can then be used to enroll the certificatesThe owner GUID you should use for Microsoft keys is 77fa9abd-0359-4d32-bd60-28f4e78f784b.+Las instrucciones que se proporcionaron anteriormente se pueden utilizar para inscribir los certificadosEl GUID propietario que debe usar para las claves de Microsoft es 77fa9abd-0359-4d32-bd60-28f4e78f784b.
  
 ====== Sources ====== ====== Sources ======
 es:howtos:security:enabling_secure_boot ()