Hypervisor Security - OpenStack Summit Hong Kong

67
Robert Clark Lead Security Architect HP Cloud Hypervisor Security

description

Hypervisor Security and steps that must be taken to protect against breakouts Video here: https://www.youtube.com/watch?v=y8L6B6Q5EdI

Transcript of Hypervisor Security - OpenStack Summit Hong Kong

Page 1: Hypervisor Security - OpenStack Summit Hong Kong

Robert ClarkLead Security ArchitectHP Cloud

Hypervisor Security

Page 2: Hypervisor Security - OpenStack Summit Hong Kong
Page 3: Hypervisor Security - OpenStack Summit Hong Kong

About the Speaker

Page 4: Hypervisor Security - OpenStack Summit Hong Kong

OpenStack Security Group

• Established 18-24 months ago• Issues OpenStack Security Notes• Consults on OpenStack Security Advisories• Security Initiatives• Nearly 100 members

Page 5: Hypervisor Security - OpenStack Summit Hong Kong

OpenStack Security Guide

http://docs.openstack.org/security

Page 6: Hypervisor Security - OpenStack Summit Hong Kong

OpenStack Security Guide

Page 7: Hypervisor Security - OpenStack Summit Hong Kong

Virtualization Overview

Page 8: Hypervisor Security - OpenStack Summit Hong Kong

Virtualization Technologies

• Hosted OS Virtualization – VMware Desktop Solutions

• Para Virtualization – The guest needs to know it’s running in a virtualized environment

• Full Virtualization – The guest is un-aware that it is running on a virtualized platform.

Page 9: Hypervisor Security - OpenStack Summit Hong Kong

Virtualization StackCompute Host

AliceVM

AliceVM

AliceVM

Hardware

Hypervisor

Device Emulation

Page 10: Hypervisor Security - OpenStack Summit Hong Kong

Simplified KVMCompute Host

AliceVM

AliceVM

AliceVM

Hardware CPU VIRT

Linux Kernel KVM

QEMU

Linux OS

Page 11: Hypervisor Security - OpenStack Summit Hong Kong

Simplified XenCompute Host

Dom0 AliceVM

Hardware

Xen Hypervisor

AliceVM

QEMU

Page 12: Hypervisor Security - OpenStack Summit Hong Kong

Generalized Virtualization StackCompute Host

AliceVM

AliceVM

AliceVM

Hardware

Hypervisor / Host OS / Dom0

QEMU

Compute Instances

Device Emulation/ Paravirt

Hardware Interfacing/ Enabling

HardwareMemory, Disk, CPU etc

Page 13: Hypervisor Security - OpenStack Summit Hong Kong

Attack Vectors

Page 14: Hypervisor Security - OpenStack Summit Hong Kong

Introducing ‘Mal’

MalVM

Page 15: Hypervisor Security - OpenStack Summit Hong Kong

Compute Host Attack Vectors

Compute Host [Nova]

AliceVM

AliceVM

Page 16: Hypervisor Security - OpenStack Summit Hong Kong

Compute Instance Attack Vectors

Compute Host [Nova]

AliceVM

AliceVM

BobVM

BobVM

Page 17: Hypervisor Security - OpenStack Summit Hong Kong

Compute Instance Attack Vectors

Compute Host [Nova]

AliceVM

AliceVM

BobVM

BobVM

KVM / XEN

QEMU

Page 18: Hypervisor Security - OpenStack Summit Hong Kong

Compute Instance Attack Vectors

Compute Host [Nova]

AliceVM

AliceVM

BobVM

BobVM

KVM / XEN

QEMU

Dom0

Linux Kernel

Linux OS

Page 19: Hypervisor Security - OpenStack Summit Hong Kong

Compute Instance Attack Vectors

Compute Host [Nova]

AliceVM

AliceVM

BobVM

BobVM

MalVM KVM / XEN

QEMU

Dom0

Linux Kernel

Linux OS

Page 20: Hypervisor Security - OpenStack Summit Hong Kong

Compute Instance Attack Vectors

Compute Host [Nova]

AliceVM

AliceVM

BobVM

BobVM

MalVM

QEMU

Basic VM to VM network Attacks

KVM / XEN

QEMU

Dom0

Linux Kernel

Linux OS

Page 21: Hypervisor Security - OpenStack Summit Hong Kong

Compute Instance Attack Vectors

Compute Host [Nova]

AliceVM

AliceVM

BobVM

BobVM

MalVM KVM / XEN

QEMU

VM to hypervisor attacks

KVM / XEN

QEMU

Dom0

Linux Kernel

Linux OS

Page 22: Hypervisor Security - OpenStack Summit Hong Kong

Compute Instance Attack Vectors

Compute Host [Nova]

AliceVM

AliceVM

BobVM

BobVM

MalVM KVM / XEN

QEMU

VM to QEMU / Device attacks

KVM / XEN

QEMU

Dom0

Linux Kernel

Linux OS

Page 23: Hypervisor Security - OpenStack Summit Hong Kong

Dom0

Compute Instance Attack Vectors

Compute Host [Nova]

AliceVM

AliceVM

BobVM

BobVM

MalVM

QEMU

Linux Kernel

Linux OS

VM to QEMU

KVM / XEN

QEMU

Page 24: Hypervisor Security - OpenStack Summit Hong Kong

Dom0

Compute Instance Attack Vectors

Compute Host [Nova]

AliceVM

AliceVM

BobVM

BobVM

MalVM

QEMU

Linux Kernel

Linux OS

VM to QEMU

KVM / XEN

QEMU

Page 25: Hypervisor Security - OpenStack Summit Hong Kong

Dom0

Compute Instance Attack Vectors

Compute Host [Nova]

AliceVM

AliceVM

BobVM

BobVM

MalVM

QEMU

Linux Kernel

Linux OS

1.

VM to QEMU

KVM / XEN

QEMU

2.

Page 26: Hypervisor Security - OpenStack Summit Hong Kong

Dom0

Compute Instance Attack Vectors

Compute Host [Nova]

AliceVM

AliceVM

BobVM

BobVM

MalVM

QEMU

Linux Kernel

Linux OS

1.

VM to QEMU

KVM / XEN

QEMU

2.

Page 27: Hypervisor Security - OpenStack Summit Hong Kong

Dom0

Compute Instance Attack Vectors

Compute Host [Nova]

AliceVM

AliceVM

BobVM

BobVM

MalVM

QEMU

Linux Kernel

Linux OS

VM to hypervisor attacks

KVM / XEN

QEMU

Page 28: Hypervisor Security - OpenStack Summit Hong Kong

Dom0

Compute Instance Attack Vectors

Compute Host [Nova]

AliceVM

AliceVM

BobVM

BobVM

MalVM

QEMU

Linux Kernel

Linux OS

VM to hypervisor attacks

KVM / XEN

QEMU

Page 29: Hypervisor Security - OpenStack Summit Hong Kong

Dom0

Compute Instance Attack Vectors

Compute Host [Nova]

AliceVM

AliceVM

BobVM

BobVM

MalVM

QEMU

Linux Kernel

Linux OS

VM to hypervisor attacks

KVM / XEN

QEMU

Page 30: Hypervisor Security - OpenStack Summit Hong Kong

Dom0

Compute Instance Attack Vectors

Compute Host [Nova]

AliceVM

AliceVM

BobVM

BobVM

MalVM

QEMU

Linux Kernel

Linux OS

VM to OS / Management / Linux Kernel / Dom0

KVM / XEN

QEMU

Page 31: Hypervisor Security - OpenStack Summit Hong Kong

Dom0

Compute Instance Attack Vectors

Compute Host [Nova]

AliceVM

AliceVM

BobVM

BobVM

MalVM

QEMU

Linux Kernel

Linux OS

VM to OS / Management / Linux Kernel / Dom0

KVM / XEN

QEMU

Page 32: Hypervisor Security - OpenStack Summit Hong Kong

Dom0

Compute Instance Attack Vectors

Compute Host [Nova]

AliceVM

AliceVM

BobVM

BobVM

MalVM

QEMU

Linux Kernel

Linux OS

1.

2.

VM to OS / Management / Linux Kernel / Dom0

KVM / XEN

QEMU

Page 33: Hypervisor Security - OpenStack Summit Hong Kong

Dom0

Compute Instance Attack Vectors

Compute Host [Nova]

AliceVM

AliceVM

BobVM

BobVM

MalVM

QEMU

Linux Kernel

Linux OS

1.

2.

3.

VM to OS / Management / Linux Kernel / Dom0

KVM / XEN

QEMU

Page 34: Hypervisor Security - OpenStack Summit Hong Kong

Cloud Issues

Compute Host [Nova]

AliceVM

BobVM

Page 35: Hypervisor Security - OpenStack Summit Hong Kong

Cloud Issues - Scale

Compute Host [Nova]

CherVM

DaveVM

Compute Host [Nova]

AliceVM

BobVM

Page 36: Hypervisor Security - OpenStack Summit Hong Kong

Cloud Issues - Scale

Compute Host [Nova]

CherVM

DaveVM

Compute Host [Nova]

AliceVM

BobVM

Compute Manager

Block Storage

Network Nodes

Operations Systems

Object Storage

Page 37: Hypervisor Security - OpenStack Summit Hong Kong

Cloud Issues - Scale

Compute Host [Nova]

CherVM

DaveVM

Compute Host [Nova]

AliceVM

BobVM

Compute Manager

Block Storage

Network Nodes

Operations Systems

Object Storage

MalVM

Page 38: Hypervisor Security - OpenStack Summit Hong Kong

Cloud Issues – Flat Exploitation

Compute Host [Nova]

CherVM

DaveVM

Compute Host [Nova]

AliceVM

BobVM

Compute Manager

Block Storage

Network Nodes

Operations Systems

Object Storage

MalVM

Page 39: Hypervisor Security - OpenStack Summit Hong Kong

Cloud Issues – Flat Exploitation

Compute Host [Nova]

CherVM

DaveVM

Compute Host [Nova]

AliceVM

BobVM

Compute Manager

Block Storage

Network Nodes

Operations Systems

Object Storage

MalVM

Page 40: Hypervisor Security - OpenStack Summit Hong Kong

Cloud Issues – Service Trust

Compute Host [Nova]

CherVM

DaveVM

Compute Host [Nova]

AliceVM

BobVM

Compute Manager

Block Storage

Network Nodes

Operations Systems

Object Storage

MalVM

Page 41: Hypervisor Security - OpenStack Summit Hong Kong

Cloud Issues – Service Trust

Compute Host [Nova]

CherVM

DaveVM

Compute Host [Nova]

AliceVM

BobVM

Compute Manager

Block Storage

Network Nodes

Operations Systems

Object Storage

MalVM

Page 42: Hypervisor Security - OpenStack Summit Hong Kong

Cloud Issues – Nova RPC

Compute Host [Nova]

CherVM

DaveVM

Compute Host [Nova]

AliceVM

BobVM

Compute Manager

Block Storage

Network Nodes

Operations Systems

Object Storage

MalVM

Page 43: Hypervisor Security - OpenStack Summit Hong Kong

What about side channels?

Page 44: Hypervisor Security - OpenStack Summit Hong Kong

Cross-VM Side Channel Attacks

• Web Servers providing SSL• VOIP providers• Cloud VPN• Chat Applications• Secure File Storage• Virtually any service doing anything useful

Page 45: Hypervisor Security - OpenStack Summit Hong Kong

Cross-VM Side Channel Attacks

AliceClient

Compute Host [Nova]

BobVM

TLS/SSL

CPU

L1 Cache

• Disrupting or observing system operation

Page 46: Hypervisor Security - OpenStack Summit Hong Kong

Cross-VM Side Channel Attacks

AliceClient

Compute Host [Nova]

BobVM

TLS/SSL

Stealing the bits!

MalMITM

CPU

L1 Cache

Page 47: Hypervisor Security - OpenStack Summit Hong Kong

Cross-VM Side Channel Attacks

AliceClient

Compute Host [Nova]

BobVM

MalVM

TLS/SSL

MalMITM

CPU

L1 Cache

Stealing the bits!

Page 48: Hypervisor Security - OpenStack Summit Hong Kong

Cross-VM Side Channel Attacks

AliceClient

Compute Host [Nova]

BobVM

MalVM

TLS/SSL

MalMITM

CPU

L1 Cache

Stealing the bits!

Page 49: Hypervisor Security - OpenStack Summit Hong Kong

Cross-VM Side Channel Attacks

AliceClient

Compute Host [Nova]

BobVM

MalVM

TLS/SSL

MalMITM

CPU

L1 Cache

Stealing the bits!

Page 50: Hypervisor Security - OpenStack Summit Hong Kong

Isn’t this all a bit theoretical?

Page 51: Hypervisor Security - OpenStack Summit Hong Kong

CloudBurst

• Date: 2008• Type: OS Virtualization - VMWare• Result: Full Breakout• Author: Kostya Kirtchinsky, Immunity Inc

Page 52: Hypervisor Security - OpenStack Summit Hong Kong

Xen Ownage Trilogy

• Date: 2011• Type: Xen • Result: Full Breakout• Author: Joanna Rutkowska

Page 53: Hypervisor Security - OpenStack Summit Hong Kong

VirtuNoid

• Date: 2011• Type: Kernel Side Full Virtualization - KVM• Result: Full Breakout• Author: Nelson Elhage• CVE-2011-1751

Page 54: Hypervisor Security - OpenStack Summit Hong Kong

SYSRET-64

• Date: 2012• Type: Para Virtualization - Xen• Result: Full Breakout• Author: Rafal Wojtczuk• US-CERT #649219

Page 55: Hypervisor Security - OpenStack Summit Hong Kong

VMDK Has Left The Building

• Date: 2012• Type: ESXi File Handling Logic• Result: Data Leakage / Loss• Author: Friedwart Kuhn

Page 56: Hypervisor Security - OpenStack Summit Hong Kong

KVM IOAPIC, SET MSR, TIME

• Date: 2013• Type: Full Virtualization - KVM• Result: Denial of Service, Potential Breakout• Author: Andrew Honig• IOAPIC: CVE-2013-1798• TIME: CVE-2013-1797• SET MSR: CVE-2013-1796

Page 57: Hypervisor Security - OpenStack Summit Hong Kong

Virtualization Security Trends

IBM X-Force 2010 Mid-Term Report

Page 58: Hypervisor Security - OpenStack Summit Hong Kong

Virtualization Security TrendsAttack Vector Xen KVM

Virtual CPUs 5 (8.5%) 8 (21.1%)

SMP 1 (1.7%) 3 (7.9%)

Software MMU 4 (6.8%) 2 (5.3%)

Interrupt and Timer Mechanisms 2 (3.4%) 4 (10.5%)

I/O and Networking 11 (18.6%) 10 (26.3%)

VM Exits 4 (6.8%) 2 (5.3%)

Hypercalls 2 (3.4%) 1 (2.6%)

VM Management 7 (11.9%) 2 (5.3%)

Remote Management Software 9 (15.3%) 1 (2.6%)

Hypervisor add-ons 5 (8.5%) 0 (0.0%)

TOTAL 59 38

Page 59: Hypervisor Security - OpenStack Summit Hong Kong

Time to unplug?

Go home cloud, you’re drunk!

Page 60: Hypervisor Security - OpenStack Summit Hong Kong

Protections – Compiler Hardening

• RELocation Read-Only• Stack Canaries• Never eXecute (NX) / (DEP)• Position Independent Executable• Address Space Layout Randomization• QEMU:

CFLAGS="-arch x86_64 -fstack-protector-all -Wstack-protector --param ssp-buffer-size=4 -pie -fPIE -ftrapv - D_FORTIFY_SOURCE=2 O2 -Wl,-z,relro,-z,now"

Page 61: Hypervisor Security - OpenStack Summit Hong Kong

Protections – Reduce Attack Surface

• Out of the box you probably support– 3D Graphics– Multiple Network Devices– Sound– Bluetooth!?

• Compile them out!

Page 62: Hypervisor Security - OpenStack Summit Hong Kong

Protections – Mandatory Access Controls

• Limit the capabilities of a successful exploit• Define and constrain with QEMU should be

doing• Provide isolation for VM processes (KVM)• SELinux • AppArmour

Page 63: Hypervisor Security - OpenStack Summit Hong Kong

Protections – Mandatory Access Controls

Page 64: Hypervisor Security - OpenStack Summit Hong Kong

Protection

• Reduce Attack Surface• Harden Compilation• Isolate, detect and alert on exploitation

through MAC• Harden your base OS/Dom0 using the same

techniques• Apply MAC to other OpenStack components

Page 65: Hypervisor Security - OpenStack Summit Hong Kong

OpenStack Security Guide

• http://docs.openstack.org/sec• Chapter 26 – Securing OpenStack Networking

Services• Chapter 40 – Hypervisor Selection• Chapter 41 – Hardening the Virtualization

Layers• Chapter 43 – Security Services for Instances

Page 66: Hypervisor Security - OpenStack Summit Hong Kong

Thank You

Please consider contributing to the OpenStack Security Group

Page 67: Hypervisor Security - OpenStack Summit Hong Kong

References• Directly Referenced / Informed This Talk

– http://www.insinuator.net/2013/05/analysis-of-hypervisor-breakouts/– https://www.ernw.de/download/ERNW_DCVI-HypervisorsToClouds.pdf– https://www.hashdays.ch/downloads/slides/jonathan_sinclair_vm_state.pdf– ftp://public.dhe.ibm.com/linux/pdfs/LXW03004-USEN-00.pdf– http://blog.cryptographyengineering.com/2012/10/attack-of-week-cross-vm-timing-

attacks.html– http://www.vupen.com/blog/

20120904.Advanced_Exploitation_of_Xen_Sysret_VM_Escape_CVE-2012-0217.php– http://www.symantec.com/avcenter/reference/Virtual_Machine_Threats.pdf– http://invisiblethingslab.com/resources/bh08/part1.pdf– http://blogs.gartner.com/neil_macdonald/2011/01/26/yes-hypervisors-are-

vulnerable/– ftp://public.dhe.ibm.com/common/ssi/ecm/en/wgl03003usen/

WGL03003USEN.PDF