strengthening the chain of trust - welcome to unified ... · • prohibits the ability of rootkits...

26
presented by presented by Strengthening the Chain of Trust Kevin Lane HP Jeff Bobzin Insyde Software Updated 2011-06-01 August 22, 2014

Upload: others

Post on 22-May-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Strengthening the Chain of Trust - Welcome to Unified ... · • Prohibits the ability of rootkits to install themselves into the computer system’s boot loader • Required WITH

presented bypresented by

Strengthening the

Chain of Trust

Kevin Lane – HP

Jeff Bobzin – Insyde Software

Updated 2011-06-01August 22, 2014

Page 2: Strengthening the Chain of Trust - Welcome to Unified ... · • Prohibits the ability of rootkits to install themselves into the computer system’s boot loader • Required WITH

Agenda

• Quick Intro to UEFI

• UEFI Myths

• Using Linux + Secure Boot

• Continuing the Chain-of-

Trust

www.uefi.org 2LinuxCon 2014

Page 3: Strengthening the Chain of Trust - Welcome to Unified ... · • Prohibits the ability of rootkits to install themselves into the computer system’s boot loader • Required WITH

UEFI Specification: What Is It?

• Defines a PC operating system and platform firmware interface

• Replaces Basic Input/Output System (BIOS) firmware interface

– Note: most UEFI images provide legacy support for BIOS services.

• Consists of platform data tables, boot and runtime service calls

• Supports remote diagnostics and repair, even without an OS

• Standardizes booting of OSes and running pre-boot

applications

• Evolved from Intel’s EFI (Extensible Firmware Interface)

specification

– Note: EFI was deprecated by UEFI in 2005.

• Managed by the UEFI Forum

www.uefi.org 3LinuxCon 2014

Page 4: Strengthening the Chain of Trust - Welcome to Unified ... · • Prohibits the ability of rootkits to install themselves into the computer system’s boot loader • Required WITH

UEFI Specification: Milestones

• Mid-90s: First Intel–HP Itanium system development occurs

– BIOS limitations (e.g., 16-bit processor mode, 1 MB addressable space

and PC AT hardware) don’t meet needs of larger server platforms

• 1998: Intel creates EFI (originally “Intel Boot Initiative") to solve BIOS issue

• 2005: Intel ceases EFI spec development at v1.10; contributes it to UEFI

Forum

– Original EFI specification remains owned and licensed by Intel

• 2007: UEFI Forum releases UEFI specification v2.1

– Adds cryptography, network authentication, user interface architecture

(UEFI’s Human Interface Infrastructure)

• 2008: UEFI Forum releases UEFI specification v2.2

– Adds Secure Boot

• 2013: UEFI Forum releases current UEFI specification v2.4

www.uefi.org 4LinuxCon 2014

Page 5: Strengthening the Chain of Trust - Welcome to Unified ... · • Prohibits the ability of rootkits to install themselves into the computer system’s boot loader • Required WITH

Secure Boot: What Is It?

• Security protocol component of UEFI

• Secures the boot process by preventing loading of drivers or OSes

that are not digitally signed in with acceptable markers

• Prohibits the ability of rootkits to install themselves into the computer

system’s boot loader

• Required WITH UEFI firmware by all manufactured PC’s since

advent of Windows 8 and 8.1

– Secure Boot keys were developed by Microsoft and embedded

in the UEFI firmware on the system.

• The UEFI feature causing the most Linux boot issues

www.uefi.org 5LinuxCon 2014

Page 6: Strengthening the Chain of Trust - Welcome to Unified ... · • Prohibits the ability of rootkits to install themselves into the computer system’s boot loader • Required WITH

Myth #1

I can’t install Linux on a UEFI Computer!

• UEFI will not prevent you from installing Linux or any other (supported) operating system.

• Secure Boot may make it difficult to install operating systems other than Windows 8.

• Some PC manufacturers also allow a “legacy mode” to be selected that will emulate a PC BIOS.

www.uefi.org 6LinuxCon 2014

Page 7: Strengthening the Chain of Trust - Welcome to Unified ... · • Prohibits the ability of rootkits to install themselves into the computer system’s boot loader • Required WITH

Myth #2

Linux will not work with Secure Boot!

Secure Boot can always be disabled, thus

allowing you to install Linux or any other

supported operating system.

Most newer versions of the popular Linux distributions

now ship with support for Secure Boot, allowing you to

not only install with Secure Boot enabled in UEFI, but

also helping to secure the chain of trust.

www.uefi.org 7LinuxCon 2014

Page 8: Strengthening the Chain of Trust - Welcome to Unified ... · • Prohibits the ability of rootkits to install themselves into the computer system’s boot loader • Required WITH

Myth #3

I need TPM to get Secure Boot to work!

TPM (Trusted Platform Module)…

• Is just another layer that you can use to store your credentials.

• Was also implemented prior to UEFI on PC platforms (non-enterprise).

• Is already implemented by the major PC vendors, and offers an additional layer of security, but is not a prerequisite for Secure Boot.

• Is a hardware-based (chip) with an API layer that encompasses middleware and applications.

www.uefi.org 8LinuxCon 2014

Page 9: Strengthening the Chain of Trust - Welcome to Unified ... · • Prohibits the ability of rootkits to install themselves into the computer system’s boot loader • Required WITH

What Can I Do With UEFI?

• The UEFI Shell

– A shell/terminal for the firmware

– Allows launching of UEFI applications (e.g., UEFI bootloaders)

– Can be used to obtain other system or firmware information

(e.g., memory map (memmap), modifying boot manager

variables (bcfg), running partitioning programs (diskpart), loading

UEFI drivers, editing text files (edit), hexedit, etc.)

• uefitoolkit

– Provides examples of what you can do with EFI

• Driver development – Intel

• Programmable boot options

– Implementation depends on Hardware vendor

www.uefi.org 9LinuxCon 2014

Page 10: Strengthening the Chain of Trust - Welcome to Unified ... · • Prohibits the ability of rootkits to install themselves into the computer system’s boot loader • Required WITH

What Can I Do With UEFI?

rEFInd – Boot Manager

for EFI/UEFI

– NOT a boot loader

– All EFI-capable

Operating Systems

include boot loaders.

– Most EFI

implementations

should provide a

boot manager.

– Sadly, most are

very poor or useless.

www.uefi.org 10LinuxCon 2014

Page 11: Strengthening the Chain of Trust - Welcome to Unified ... · • Prohibits the ability of rootkits to install themselves into the computer system’s boot loader • Required WITH

How Do I Get Linux To Work

With Secure Boot?

Why not just disable Secure Boot?

This is BAD Mojo!

The main reason for Secure Boot is to keep the boot process

and boot code secure.

• Disabling Secure Boot leaves you susceptible to rootkits that

hide in the boot code and go undetected.

• Most major Linux distributions support Secure Boot!

• Add a signing key to the UEFI Firmware!

www.uefi.org 11LinuxCon 2014

Page 12: Strengthening the Chain of Trust - Welcome to Unified ... · • Prohibits the ability of rootkits to install themselves into the computer system’s boot loader • Required WITH

Chain-of-Trust:

Use Linux

Distributions

or Create Your Own

www.uefi.org 12LinuxCon 2014

Page 13: Strengthening the Chain of Trust - Welcome to Unified ... · • Prohibits the ability of rootkits to install themselves into the computer system’s boot loader • Required WITH

System Firmware

Linux Loader

Implementing A Trust Chain

www.uefi.org 13LinuxCon 2014

Pre-Loader

LinuxKernel

Checks

Checks

Checks

Checks

Page 14: Strengthening the Chain of Trust - Welcome to Unified ... · • Prohibits the ability of rootkits to install themselves into the computer system’s boot loader • Required WITH

Who Do We Trust?

• Firmware as the “Root of Trust” verifies

First Stage Bootloader

• shim.efi binary is signed by either:

1) Microsoft CA – installed into system at

factory

2) OEM or Owner Created Key – Certificate

must be provisioned into system (db)

www.uefi.org 14LinuxCon 2014

Page 15: Strengthening the Chain of Trust - Welcome to Unified ... · • Prohibits the ability of rootkits to install themselves into the computer system’s boot loader • Required WITH

Booting Continues

• shim.efi in turn verifies Grub2, and Grub2

uses shim service to verify Kernel

• grubx64.efi and kernel are signed by one of

these:

1) Distro-created key inserted into Distro-created build

of SHIM.EFI, (which must then be submitted to MS

for signing)

2) Signed by Key enrolled by User during Linux Install

(the MOK)

www.uefi.org 15LinuxCon 2014

Page 16: Strengthening the Chain of Trust - Welcome to Unified ... · • Prohibits the ability of rootkits to install themselves into the computer system’s boot loader • Required WITH

System Firmware

Pre-Loader

Linux Loader

LinuxKernel

Using The ‘Distro’ Signing

Transitions from UEFI to Distro Signing

www.uefi.org 16LinuxCon 2014

UEFI CA KEY SIGNED BY DISTRO KEY

KEY

Checks

Checks

Checks

Page 17: Strengthening the Chain of Trust - Welcome to Unified ... · • Prohibits the ability of rootkits to install themselves into the computer system’s boot loader • Required WITH

Using The ‘Disto’ Signed Boot

• Advantages:

1) Simple – no per-machine configuration

2) Do not need to keep local-generated private

keys secure

• Disadvantages:

1) Cannot use local-built grub, Linux, or drivers

www.uefi.org 17LinuxCon 2014

Page 18: Strengthening the Chain of Trust - Welcome to Unified ... · • Prohibits the ability of rootkits to install themselves into the computer system’s boot loader • Required WITH

System Firmware

Linux Loader

Pre-Loader

LinuxKernel

Checks

Checks

Checks

Machine Owner Key (MOK)

Switch from UEFI to Local Security Space

www.uefi.org 18LinuxCon 2014

UEFI CA KEY SIGNED BY MOK KEY

MOK

Page 19: Strengthening the Chain of Trust - Welcome to Unified ... · • Prohibits the ability of rootkits to install themselves into the computer system’s boot loader • Required WITH

Steps For Setting Up MOK

• Set up corporate infrastructure for creating

public/private key pairs and keeping secure

• Use mokutil to request install

• On reboot, shim.efi loads MokManager.efi

• Load the MOK public key (kept safe by f/w)

• Sign all rebuilt components before install

www.uefi.org 19LinuxCon 2014

Note: requires hands-on config for every system

Page 20: Strengthening the Chain of Trust - Welcome to Unified ... · • Prohibits the ability of rootkits to install themselves into the computer system’s boot loader • Required WITH

Possible Site Policy

www.uefi.org 20LinuxCon 2014

UEFI CA DISTRO Machine Owner

shim.efi

grubx64.efi

Linux Kernel

Driver #1,3,4…

Driver #2

Note: Approved Key Accumulate as Boot Progresses

Page 21: Strengthening the Chain of Trust - Welcome to Unified ... · • Prohibits the ability of rootkits to install themselves into the computer system’s boot loader • Required WITH

System Firmware

Linux Loader

Pre-Loader

LinuxKernel

Checks

Checks

Checks

Site With Total Local Control

Complete Local Security Space

www.uefi.org 21LinuxCon 2014

SIGNED BY MOK KEY

MOK

MOK

Page 22: Strengthening the Chain of Trust - Welcome to Unified ... · • Prohibits the ability of rootkits to install themselves into the computer system’s boot loader • Required WITH

Replacing The Factory

UEFI DB

1) Use “Efitools” at

http://git.kernel.org/cgit/linux/kernel/git/jejb/efit

ools.git

2) Generate custom database in form of

lockdown.efi

3) Clear firmware db using BIOS menus

4) Use BIOS menus to run lockdown.efi

www.uefi.org 22LinuxCon 2014

High-touch and For Experts Only!

Page 23: Strengthening the Chain of Trust - Welcome to Unified ... · • Prohibits the ability of rootkits to install themselves into the computer system’s boot loader • Required WITH

Help From Redhat

www.uefi.org 23LinuxCon 2014

Chapter 24.7 in Red Hat Enterprise Linux 7

System Administrators Guidehttps://access.redhat.com/documentation/en-

US/Red_Hat_Enterprise_Linux/7/html/System_Administrators_Guide/

Fedora UEFI Secure Boot Guidehttp://docs.fedoraproject.org/en-

US/Fedora/18/html/UEFI_Secure_Boot_Guide/chap-UEFI_Secure_Boot_Guide-

What_is_Secure_Boot.html

Page 24: Strengthening the Chain of Trust - Welcome to Unified ... · • Prohibits the ability of rootkits to install themselves into the computer system’s boot loader • Required WITH

Help From SUSE/ openSUSE

www.uefi.org 24LinuxCon 2014

Suse and Secure Boot: The Details

https://www.suse.com/communities/conversations/uefi-

secure-boot-details/

http://en.opensuse.org/openSUSE:UEFI#Booting_a_cust

om_kernel

Chapter 11 in SUSE Linux

Enterprise Server – Administrators

Guidehttps://www.suse.com/documentation/sles11/book_

sle_admin/data/book_sle_admin.html

Page 25: Strengthening the Chain of Trust - Welcome to Unified ... · • Prohibits the ability of rootkits to install themselves into the computer system’s boot loader • Required WITH

Helpful Blogs And Web Books

• http://www.rodsbooks.com/efi-bootloaders/secureboot.html

• http://blog.hansenpartnership.com/uefi-secure-boot/

• http://mjg59.dreamwidth.org/

• http://uefidk.intel.com/blog

www.uefi.org 25LinuxCon 2014

Page 26: Strengthening the Chain of Trust - Welcome to Unified ... · • Prohibits the ability of rootkits to install themselves into the computer system’s boot loader • Required WITH

For more information on

the Unified EFI Forum

and UEFI Specifications,

visit http://www.uefi.org

presented bypresented by

www.uefi.org 26LinuxCon 2014