D-RTM for Qubes OS VMs
Qubes OS and 3mdeb mini-summit 2020
Piotr Król
1 / 18
Intro and goals
Terminology
Flicker
Platform relaunch
Virtual Machine Inspection and D-RTM
vTPM and D-RTM
Network booted vDLME
Visual trust level indicator for VMs
Future ideas
Discussion
Agenda
2 / 18
Qubes OS and 3mdeb mini-summit 2020
CC BY | Piotr Król
@pietrushnic
piotr.krol@3mdeb.com
linkedin.com/in/krolpiotr
facebook.com/piotr.krol.756859
open-source firmware
platform security
trusted computing
Piotr Król
Founder & Embedded Systems Consultant
whoami
3 / 18
Qubes OS and 3mdeb mini-summit 2020
CC BY | Piotr Król
To discuss value and usage models of D-RTM implementation
in Qubes OS
Kudos for support
Marek Marczykowski-Górecki (Qubes OS)
Daniel Smith (TrenchBoot)
Andrew Cooper (Xen)
Presentation goal
4 / 18
Qubes OS and 3mdeb mini-summit 2020
CC BY | Piotr Król
Root of Trust (RoT)
RoT for Confidentiality (RTC)
RoT for Update (RTU)
RoT for Verification (RTV)
Hardware RTM (HRTM)
Static Code RTM (S-CRTM)
RoT for Measurement (RTM) RoT for Reporting (RTR)
RoT for Storage (RTS)
RoT for Integrity (RTI)
Static RTM (S-RTM) Dynamic RTM (D-RTM)
Code RTM (CRTM)
Dynamic Hardware RTM
(D-HRTM)
Static Hardware RTM (S-HRTM)
2 most well known implementations use special CPU instruction to trigger
D-RTM (aka Dynamic Launch Event): Intel SENTER and AMD SKINIT
D-RTM is very different from S-RTM in way it establish RTM
Root of Trust family
5 / 18
Qubes OS and 3mdeb mini-summit 2020
CC BY | Piotr Król
DRTM start when Dynamic Launch event call executes
DL Event controls PCRs 17-22, those are initialized with value -1
DL Event change PCRs value to 0 and immediately extends with DCE hash
Any attempt to reset TPM will set PCR[17] to -1 (TPM reset attack
immunity)
TCG D-RTM Architecture v1.0.0
Terminology
6 / 18
Qubes OS and 3mdeb mini-summit 2020
CC BY | Piotr Król
Boot firmware Bootloader Hypervisor VMs
UEFI/coreboot GRUB2 Xen dom0
VM1
VM(...)
VMN
Boot proces overview
Qubes OS boot process
This is just general overview of boot process to build background for
further slides
It applies to many other projects using virtualization technology
Boot process for Qubes OS
7 / 18
Qubes OS and 3mdeb mini-summit 2020
CC BY | Piotr Król
Qubes OS D-RTM Early Launch
UEFI/coreboot GRUB2
LandingZone or
SINIT ACM
Xen dom0
VM1
VM(...)
VMN
secure launch
(DL Event)
BIOS ACM
Early Launch happens once each boot
What is the value?
in STM-enabled configurations we can remove UEFI/coreboot from
TCB
we can avoid complexity of S-RTM (NDAs, convoluted specs and
manufacturing process)
we can leverage PCRs 17-22 for secret unsealing or attestation
STM - SMI Transfer Monitor
Early Launch scenario
8 / 18
Qubes OS and 3mdeb mini-summit 2020
CC BY | Piotr Król
Qubes OS D-RTM Late Launch
dom0
VM1
VM(...)
VMN DCE Payload
DLME(...) Xen
secure launch
secure launch
secure launch
re-entry
vDLME
re-entry
hardware
context
VM
context
Late Launch may happen multiple times during runtime
Way more complex case, but give lot of flexibility
What is the value?
depends on DCE (D-RTM Configuration Environment) Payload
D-RTM provides on-demand secure execution environment
we will discuss further in the presentation
Late Launch scenario
9 / 18
Qubes OS and 3mdeb mini-summit 2020
CC BY | Piotr Król
In 2008 Jonathan M. McCune, Bryan Parno, Adrian Perrig published v0.1
version of Flicker, a technique for executing application code as DCE
Payload
Their papers provide couple interesting use cases:
remote rootkit detector (hash of: kernel text segment, system call
table and loaded modules)
attested results for distributed applications
ssh password protection against malicious server
private key secure storage
https://web.archive.org/web/20160323022110/https://sparrow.ece.cmu.edu/group/flicker.html
Flicker
10 / 18
Qubes OS and 3mdeb mini-summit 2020
CC BY | Piotr Król
dom0
VM1
VM(...)
VMN DCE Payload
DLME(...) Xen
1. secure launch
3. integrity check
1. secure launch
2. pause
1. secure launch
4. pass control
Since Xen can control VMEXIT_{SKINIT,SENTER} we have to reestablish trust
in hypervisor before performing any further system integrity checks
Otherwise Xen could trap our call or fake its results
Platform relaunch
11 / 18
Qubes OS and 3mdeb mini-summit 2020
CC BY | Piotr Król
Virtual Machine Introspection (VMI) is a technique of runtime state, what
can be helpful in debugging or forensics analysis
Use VMI for VM process table (or other running system properties)
attestation:
critical system component periodic audits/relaunch (e.g. vault, gpg,
sys-vtpm)
rootkit and malware detection
checks before performing administrative tasks
VMI when connected with secure execution environment provided by D-
RTM can bring additional use cases, which will be described later
VMI
12 / 18
Qubes OS and 3mdeb mini-summit 2020
CC BY | Piotr Król
Hardware
TPM
dTPM/fTPM
CPU
Qubes OS
dom0
vtpmmgr-dm
sys-vtpm1
TCG TIS/CRB driver TCG TIS/CRB driver
AppVMnAppVM1
sys-vtpmn
DL Event
Hypervisor
vDL Event
Any attestation of sealed secrets when using D-RTM would require TPM
support for VMs
In some cases also DL Event instruction emulation would make sense to
avoid delay which real SKINIT/SENTER may cause
vTPM
13 / 18
Qubes OS and 3mdeb mini-summit 2020
CC BY | Piotr Król
VM DCE Payload vDLME
HTTP(s) server
DHCP server
1. DHCP REQ 2. DHCP Offer
3. HTTP(s)
Request LZ,
kernel and
initrd
4. LZ, kernel
and initrd
Check HTTPS
server cert
5. SKINIT 6. boot kernel
Xen
Attestation VM or
server
7. Quote10. Response
8. TPM Quote
9. TPM
Response
sys-vtpm
vtpmmgr
Extend
PCR17-22
SKINIT (or any other DL Event) instruction is emulated by hypervisor but
from VM perspective it looks like Late Launch
https://blog.3mdeb.com/2020/2020-06-01-ipxe_lz_support/
Network booted vDLME
14 / 18
Qubes OS and 3mdeb mini-summit 2020
CC BY | Piotr Król
Apply VM colors according to trust level established based on VM process
table attestation
various policies possible depending on threat model
if all processes are known and measured then give black
gradually go down to red
early launch - color assigned at boot, also S-RTM can be used
late launch - color change while system is running
Visual trust level indicator for VMs
15 / 18
Qubes OS and 3mdeb mini-summit 2020
CC BY | Piotr Król
Trusted system backups and migration
run critical system actions only in vDLME/DLME
Trusted firmware update
running critical piece of fwupd as DCE Payload or in trusted VM
Dynamic RPC policy
let give ability to run some workloads only in VM that meet
required trust level
pools of VMs meeting certain policy may change over time
most probably would involve developing Qubes RPC extension
Secure storage
it is possible to seal secret in TPM and make it available only to
certain DCE Payload
this may help in implementing per-VM password manager, most
probably simpler and faster solution then vault VM
Future ideas
16 / 18
Qubes OS and 3mdeb mini-summit 2020
CC BY | Piotr Król
It looks like even basic Late Launch implementation to be secure requires
a lot of work
How to solve attestation problem in Qubes OS? We don't want rely on
network connectivity.
Discussion
17 / 18
Qubes OS and 3mdeb mini-summit 2020
CC BY | Piotr Król
Q&A
18 / 18
Qubes OS and 3mdeb mini-summit 2020
CC BY | Piotr Król

D-RTM for Qubes OS VMs

  • 1.
    D-RTM for QubesOS VMs Qubes OS and 3mdeb mini-summit 2020 Piotr Król 1 / 18
  • 2.
    Intro and goals Terminology Flicker Platformrelaunch Virtual Machine Inspection and D-RTM vTPM and D-RTM Network booted vDLME Visual trust level indicator for VMs Future ideas Discussion Agenda 2 / 18 Qubes OS and 3mdeb mini-summit 2020 CC BY | Piotr Król
  • 3.
    @pietrushnic piotr.krol@3mdeb.com linkedin.com/in/krolpiotr facebook.com/piotr.krol.756859 open-source firmware platform security trustedcomputing Piotr Król Founder & Embedded Systems Consultant whoami 3 / 18 Qubes OS and 3mdeb mini-summit 2020 CC BY | Piotr Król
  • 4.
    To discuss valueand usage models of D-RTM implementation in Qubes OS Kudos for support Marek Marczykowski-Górecki (Qubes OS) Daniel Smith (TrenchBoot) Andrew Cooper (Xen) Presentation goal 4 / 18 Qubes OS and 3mdeb mini-summit 2020 CC BY | Piotr Król
  • 5.
    Root of Trust(RoT) RoT for Confidentiality (RTC) RoT for Update (RTU) RoT for Verification (RTV) Hardware RTM (HRTM) Static Code RTM (S-CRTM) RoT for Measurement (RTM) RoT for Reporting (RTR) RoT for Storage (RTS) RoT for Integrity (RTI) Static RTM (S-RTM) Dynamic RTM (D-RTM) Code RTM (CRTM) Dynamic Hardware RTM (D-HRTM) Static Hardware RTM (S-HRTM) 2 most well known implementations use special CPU instruction to trigger D-RTM (aka Dynamic Launch Event): Intel SENTER and AMD SKINIT D-RTM is very different from S-RTM in way it establish RTM Root of Trust family 5 / 18 Qubes OS and 3mdeb mini-summit 2020 CC BY | Piotr Król
  • 6.
    DRTM start whenDynamic Launch event call executes DL Event controls PCRs 17-22, those are initialized with value -1 DL Event change PCRs value to 0 and immediately extends with DCE hash Any attempt to reset TPM will set PCR[17] to -1 (TPM reset attack immunity) TCG D-RTM Architecture v1.0.0 Terminology 6 / 18 Qubes OS and 3mdeb mini-summit 2020 CC BY | Piotr Król
  • 7.
    Boot firmware BootloaderHypervisor VMs UEFI/coreboot GRUB2 Xen dom0 VM1 VM(...) VMN Boot proces overview Qubes OS boot process This is just general overview of boot process to build background for further slides It applies to many other projects using virtualization technology Boot process for Qubes OS 7 / 18 Qubes OS and 3mdeb mini-summit 2020 CC BY | Piotr Król
  • 8.
    Qubes OS D-RTMEarly Launch UEFI/coreboot GRUB2 LandingZone or SINIT ACM Xen dom0 VM1 VM(...) VMN secure launch (DL Event) BIOS ACM Early Launch happens once each boot What is the value? in STM-enabled configurations we can remove UEFI/coreboot from TCB we can avoid complexity of S-RTM (NDAs, convoluted specs and manufacturing process) we can leverage PCRs 17-22 for secret unsealing or attestation STM - SMI Transfer Monitor Early Launch scenario 8 / 18 Qubes OS and 3mdeb mini-summit 2020 CC BY | Piotr Król
  • 9.
    Qubes OS D-RTMLate Launch dom0 VM1 VM(...) VMN DCE Payload DLME(...) Xen secure launch secure launch secure launch re-entry vDLME re-entry hardware context VM context Late Launch may happen multiple times during runtime Way more complex case, but give lot of flexibility What is the value? depends on DCE (D-RTM Configuration Environment) Payload D-RTM provides on-demand secure execution environment we will discuss further in the presentation Late Launch scenario 9 / 18 Qubes OS and 3mdeb mini-summit 2020 CC BY | Piotr Król
  • 10.
    In 2008 JonathanM. McCune, Bryan Parno, Adrian Perrig published v0.1 version of Flicker, a technique for executing application code as DCE Payload Their papers provide couple interesting use cases: remote rootkit detector (hash of: kernel text segment, system call table and loaded modules) attested results for distributed applications ssh password protection against malicious server private key secure storage https://web.archive.org/web/20160323022110/https://sparrow.ece.cmu.edu/group/flicker.html Flicker 10 / 18 Qubes OS and 3mdeb mini-summit 2020 CC BY | Piotr Król
  • 11.
    dom0 VM1 VM(...) VMN DCE Payload DLME(...)Xen 1. secure launch 3. integrity check 1. secure launch 2. pause 1. secure launch 4. pass control Since Xen can control VMEXIT_{SKINIT,SENTER} we have to reestablish trust in hypervisor before performing any further system integrity checks Otherwise Xen could trap our call or fake its results Platform relaunch 11 / 18 Qubes OS and 3mdeb mini-summit 2020 CC BY | Piotr Król
  • 12.
    Virtual Machine Introspection(VMI) is a technique of runtime state, what can be helpful in debugging or forensics analysis Use VMI for VM process table (or other running system properties) attestation: critical system component periodic audits/relaunch (e.g. vault, gpg, sys-vtpm) rootkit and malware detection checks before performing administrative tasks VMI when connected with secure execution environment provided by D- RTM can bring additional use cases, which will be described later VMI 12 / 18 Qubes OS and 3mdeb mini-summit 2020 CC BY | Piotr Król
  • 13.
    Hardware TPM dTPM/fTPM CPU Qubes OS dom0 vtpmmgr-dm sys-vtpm1 TCG TIS/CRBdriver TCG TIS/CRB driver AppVMnAppVM1 sys-vtpmn DL Event Hypervisor vDL Event Any attestation of sealed secrets when using D-RTM would require TPM support for VMs In some cases also DL Event instruction emulation would make sense to avoid delay which real SKINIT/SENTER may cause vTPM 13 / 18 Qubes OS and 3mdeb mini-summit 2020 CC BY | Piotr Król
  • 14.
    VM DCE PayloadvDLME HTTP(s) server DHCP server 1. DHCP REQ 2. DHCP Offer 3. HTTP(s) Request LZ, kernel and initrd 4. LZ, kernel and initrd Check HTTPS server cert 5. SKINIT 6. boot kernel Xen Attestation VM or server 7. Quote10. Response 8. TPM Quote 9. TPM Response sys-vtpm vtpmmgr Extend PCR17-22 SKINIT (or any other DL Event) instruction is emulated by hypervisor but from VM perspective it looks like Late Launch https://blog.3mdeb.com/2020/2020-06-01-ipxe_lz_support/ Network booted vDLME 14 / 18 Qubes OS and 3mdeb mini-summit 2020 CC BY | Piotr Król
  • 15.
    Apply VM colorsaccording to trust level established based on VM process table attestation various policies possible depending on threat model if all processes are known and measured then give black gradually go down to red early launch - color assigned at boot, also S-RTM can be used late launch - color change while system is running Visual trust level indicator for VMs 15 / 18 Qubes OS and 3mdeb mini-summit 2020 CC BY | Piotr Król
  • 16.
    Trusted system backupsand migration run critical system actions only in vDLME/DLME Trusted firmware update running critical piece of fwupd as DCE Payload or in trusted VM Dynamic RPC policy let give ability to run some workloads only in VM that meet required trust level pools of VMs meeting certain policy may change over time most probably would involve developing Qubes RPC extension Secure storage it is possible to seal secret in TPM and make it available only to certain DCE Payload this may help in implementing per-VM password manager, most probably simpler and faster solution then vault VM Future ideas 16 / 18 Qubes OS and 3mdeb mini-summit 2020 CC BY | Piotr Król
  • 17.
    It looks likeeven basic Late Launch implementation to be secure requires a lot of work How to solve attestation problem in Qubes OS? We don't want rely on network connectivity. Discussion 17 / 18 Qubes OS and 3mdeb mini-summit 2020 CC BY | Piotr Król
  • 18.
    Q&A 18 / 18 QubesOS and 3mdeb mini-summit 2020 CC BY | Piotr Król