SlideShare a Scribd company logo
Securing Your Cloud With the
Xen Hypervisor
Russell Pavlicek
Xen Project Evangelist
Citrix Systems
Who is the Old, Fat Geek Up Front?
●

Xen project Evangelist

●

Employed by Citrix, focused entirely on Xen project

●

History with open source begins in 1995

●

Former columnist for Infoworld, Processor magazines

●

●

Former panelist on The Linux Show, repeat
guest on The Linux Link Tech Show
Over 150 pieces published, one book on
open source, plus blogs
Presentation Goals
●

Introduce the subject of security in the Cloud

●

Introduce you to the Xen Project Security Tools

●

Discuss some key Xen security features

●

Get you started in the right direction toward securing
your Xen installation
Presentation Outline
●

A few thoughts on the problem of securing the Cloud

●

Overview of the Xen architecture

●

Brief introduction to the principles of security analysis

●

Examine some of the attack surfaces and the Xen
features we can use to mitigate them:
–

Driver Domains

–

PVgrub

–

Stub Domains

–

Paravirtualization (PV) versus
Hardware Virtualization (HVM)

–

FLASK example policy
Introduction: Xen Project, The Cloud,
and Security
Introduction: Xen Project and
Security
●

Xen project produces an enterprise-grade Type 1
hypervisor

●

Built for the cloud before it was called cloud

●

A number of advanced security features
–

Driver domains, stub domains, FLASK, and more

–

Most of them are not (or cannot) be turned on by
default

–

Although they can be simple to use, sometimes
they appear complicated
The Cloud Security Conundrum
●

Cloud Security: The 800lb Gorilla in the room
–

Nothing generates more fear in specific, and FUD in
general

–

Probably the single greatest barrier to Cloud adoption

–

Immediately behind it is the inability to get out of the
20th century IT mindset
– Must get past the “Change is Bad” concept of 1980
– Cloud is about embracing change at a rapid pace
The good news: the “Gorilla” is actually a “Red Herring”
●

●

We don't need to fear it – we just need to solve it
Cloud Security: New Visibility to an
Old Problem
●

●

●

●

Security has always been an IT issue
Putting a truly secure system in the open does not
reduce its security, it just increases the frequency of
attack
Unfortunately, system security behind the firewall has
not always been comprehensive
Having solutions in an external cloud forces us to
solve the security issues we should have already
solved

News Flash: Security Through Obscurity is Dead
Use Security by Design, Not by
Wishful Thinking
●

Security by wishful thinking no longer works
–

–

Addressing security in one area while ignoring others is NOT
good enough

–
●

Merely hoping that your firewall holds off the marauding hordes
is NOT good enough

Saying, “We never had a problem before” is NOT good enough

Comprehensive security starts with design
–

It needs to be planned carefully and thought through

–

It needs to be implemented at multiple levels

–

It needs components which are themselves securable
Xen Project: Security by Design
●

Xen Project was designed for clouds before the term
“cloud” was ever coined in the industry
–

http://www.cl.cam.ac.uk/research//srg/netos/xeno/publi
cations.html
Xen is designed to thwart attacks from many attack
vectors, using different defensive techniques
–

●

Designers foresaw the day of “infrastructure for
wide-area distributed computing” which we now call
“the cloud”
Basic Architecture of the Xen Hypervisor
Hypervisor Architectures
Type 1: Bare metal Hypervisor
A pure Hypervisor that runs directly on the
hardware and hosts Guest OS’s.
VMn
VM1
VM0
Guest OS
and Apps

Hypervisor

Host HW

Device Drivers/
Models

I/O

Memory

Scheduler
MMU
CPUs

Provides partition isolation +
reliability, higher security
Hypervisor Architectures
Type 1: Bare metal Hypervisor

Type 2: OS ‘Hosted’

A pure Hypervisor that runs directly on the
hardware and hosts Guest OS’s.

A Hypervisor that runs within a Host OS and
hosts Guest OS’s inside of it, using the host OS
services to provide the virtual environment.

VMn
VM1
VM0

User-level VMM
User
Apps

Device Models

Guest OS
and Apps

Hypervisor

Host HW

I/O

Memory

Scheduler
MMU
CPUs

Provides partition isolation +
reliability, higher security

Device Drivers

Host HW

VM0
Guest OS
and Apps

Host OS
Device Drivers/
Models

VMn
VM1

I/O

Ring-0 VM Monitor
“Kernel “

Memory

CPUs

Low cost, no additional drivers
Ease of use and installation
Xen: Type 1 with a Twist
Type 1: Bare metal Hypervisor

VMn
VM1
VM0
Guest OS
and Apps

Hypervisor

Host HW

Device Drivers/
Models

I/O

Memory

Scheduler
MMU
CPUs
Xen: Type 1 with a Twist
Type 1: Bare metal Hypervisor

XEN Architecture

VMn
VM1

VMn
VM1

VM0
Guest OS
and Apps

Hypervisor

Host HW

Device Drivers/
Models

I/O

Memory

VM0
Guest OS
and Apps

Scheduler
MMU
CPUs

MMU

Scheduler

Host HW

I/O

Memory

CPUs
Xen: Type 1 with a Twist
Type 1: Bare metal Hypervisor

VMn
VM1
VM0
Guest OS
and Apps

Hypervisor

Host HW

Device Drivers/
Models

I/O

Memory

Scheduler
MMU
CPUs

XEN Architecture
Control domain
(dom0)
VMn
VM1

Device Models

VM0

Drivers

Guest OS
and Apps

Linux & BSD
MMU

Scheduler

Host HW

I/O

Memory

CPUs
Xen Architecture: Basic Parts
Security Thinking: An Approach
An Approach to Security Thinking
●

Threat models:
–
–

●

Attacker can access network
Attacker controls one Guest VM

Security considerations to evaluate:
–
–

What is the interface like? (e.g., pointers vs scalars)

–
●

How much code is accessible?
Defense-in-depth: how many rings of defense surround you?

Then combine security tactics to secure the installation
–

There is no single "magic bullet"

–

Individual tactics reduce danger; combined tactics go farther
Example System For This
Discussion
●

Hardware setup
–
–

●

Two networks: one Control network, one Guest network
IOMMU with interrupt remapping (AMD or Intel VT-d v2) to
allow for full hardware virtualization (HVM)

Default configuration
–

Network drivers in the Control Domain (aka "Domain 0" or just
"Dom0")

–

Paravirtualized (PV) guests using PyGrub (grub-like boot utility
within context of Guest Domain)

–

Hardware Virtualized (HVM) guests using Qemu (as the device
model) running in the Control Domain
Attacking the Network Interface
Attack Surface: Network Path
Attack Surface: Network Path
●

Where might an exploit focus?
–

Bugs in hardware driver

–

Bugs in bridging / filtering

–

Bugs in netback (via the ring protocol)
●

●

Netback and Netfront are part of the Paravirtualization mode

Note the exploits
–

The main exploits exist already, even in hardware

–

The netback surface is very small, but needs to be acknowledged

–

When these are attacked in hardware, you have deep trouble

–

You actually have better defense in the VM than in hardware
Result: Network Path Compromised
Result: Network Path Compromised
Vulnerability Analysis:
What could a successful exploit yield?

Control of Domain 0 kernel

This could lead to the control of the whole system
Security Feature: Driver Domains
Security Feature: Driver Domains
●

What is a Driver Domain?
–

Unprivileged VM which drives hardware

–

It provides driver access to guest VMs

–

Very limited scope; not a full operating system

–

Does not have the access or capability of a full VM
Result: Driver Domain Compromised
Result: Driver Domain Compromised
●

Now a successful exploit could yield:
–

Control of the Driver Domain
(Paravirtualization hypercall interface)
●

–

But the Driver Domain is limited: no shell, no utilities

Control of that guest's network traffic
●

But in the cloud, most orchestrators detect network traffic failure

●

The problem is not allowed to stand very long

–

Control of the network interface card (NIC)

–

An opportunity to attack the netfront of other guest VMs
●

●

But to take advantage of this platform, you need to launch another attack
Compound attacks are complex, and they take time which you may not
have
Basic How To: Driver Domains
●

Create a VM with appropriate drivers
–

●

Install the Xen-related hotplug scripts
–

●

●

Use any distribution suitable as a Control Domain

Just installing the Xen tools in the VM is usually good
enough

Give the VM access to the physical NIC with PCI
passthrough
Configure the network topology in the Driver Domain
–

Just like you would for the Control Domain
Basic How To: Driver Domains
●

Configure the guest Virtual Network Interface (vif) to
use the new domain ID
–

Add “backend=domnet” to vif declaration

vif = [ 'type=pv, bridge=xenbr0, backend=domnet' ]

Detailed Info
http://wiki.xenproject.org/wiki/Driver_Domain
Attacking the PyGrub Boot Loader
Attack Surface: PyGrub
Attack Surface: PyGrub
●

What is PyGrub?
–
–

●

“grub” implementation for Paravirtualized guests
A Python program running in Control Domain

What does it do?
–

It reads the guest VM's filesystem

–

It parses grub.conf

–

It displays a boot menu to the user

–

It passes the selected kernel image to domain builder
Attack Surface: PyGrub
Attack Surface: PyGrub
●

Where might an exploit focus?
–
–

Bugs in menu parser

–
●

Bugs in file system parser

Bugs in domain builder

Again, note the exploits
–

Forms of these exist in hardware as well

–

But hardware doesn't have as many options to
combat the situation
Result: PyGrub Compromised
Result: PyGrub Compromised
Vulnerability Analysis:
What could a successful exploit yield?

Control of Domain 0 user space

This could lead to the control of the whole system
Security Feature: Fixed Kernels
Security Feature: Fixed Kernels
●

What is a fixed kernel?
–

Passing a known-good kernel from Control Domain
●

●

–
●

No longer allows a user to choose the kernel
Best practice for anything in production

Removes attacker avenue to domain builder

Disadvantages
–

Host administrator must keep up with kernel updates

–

Guest admin can't pass kernel parameters or custom
kernels
Security Feature: PVgrub
Security Feature: PVgrub
●

What is PVgrub?
–

MiniOS plus the Paravirtualized port of “grub” running
in a guest context

–

Paravirtualized equivalent of Hardware Virtualized
combination of BIOS plus grub
Result: PVgrub Compromised
Vulnerability Analysis:
Now a successful exploit could yield:

Control of the attacked Guest Domain alone

Control Domain is no longer at risk
Basic HowTo: PVgrub
●

Make sure that you have the PVgrub image
–
–

Normally lives in “/usr/lib/xen/boot”

–

SUSE SLES: Currently need to build for yourself

–

Included in Fedora Xen packages

–
●

“pvgrub-$ARCH.gz”

Debian-based: need to build yourself

Use appropriate PVgrub as bootloader in guest
configuration:
–

kernel="/usr/lib/xen/boot/pvgrub-x86_32.gz"
See http://wiki.xenproject.org/wiki/Pvgrub
Attacking the Qemu Device Model
Attack Surface: Device Model
(Qemu)
Attack Surface: Device Model
(Qemu)
●

What is Qemu?
–
–

●

In other contexts, a virtualization provider
In the Xen Project context, a provider of needed
device models

Where might an exploit focus?
–

Bugs in NIC emulator parsing packets

–

Bugs in emulation of virtual devices
Result: Device Model Compromised
Vulnerability Analysis:
What could a successful exploit yield?

Control Domain privileged user space

This could lead to the control of the whole system
Security Feature: Qemu Stub
Domains
●

What is a stub domain?
–

Stub domain: a small “service'' domain running just
one application

–

Qemu stub domain: run each Qemu in its own
domain
Result: Stub Domain Compromised
Vulnerability Analysis:
Now a successful exploit could yield:

Control only of the stub domain VM
(which, if FLASK is employed, is a relatively small universe)

You need to devise another attack entirely to do
anything more significant
Basic HowTo: Qemu Stub Domains
●

Make sure that you have the ioemu image:
–
–

Normally lives in “/usr/lib/xen/boot”

–

SUSE SLES, currently need to build it yourself (SLES 12?)

–

Included in Fedora Xen packages

–
●

“ioemu-$ARCH.gz”

On Debian (and offshoots), you will need to build it yourself

Specify stub domains in your guest configuration:
device_model_stubdomain_override = 1

Detailed Info
http://wiki.xenproject.org/wiki/Device_Model_Stub_Domains
Attacking the Hypervisor Itself
Attack Surface: Xen Hypervisor Itself
●

Where might an exploit focus?
–

On Paravirtualized (PV) Guests:

–

PV Hypercalls
On full Hardware Virtualized (HVM) Guests:
●

HVM hypercalls (Subset of PV hypercalls)
● Instruction emulation (MMIO, shadow pagetables)
● Emulated platform devices: APIC, HPET, PIT
● Nested virtualization
Security practice: Use PV VMs whenever possible
●

●
Using the Xen Security Module
Security Feature: FLASK Policy
●

What is FLASK?
–

Xen Security Module (XSM): Xen equivalent of LSM

–

FLASK: FLux Advanced Security Kernel

–

Framework for XSM developed by NSA

–

Xen equivalent of SELinux

–

Uses same concepts and tools as SELinux

–

Allows a policy to restrict hypercalls
Security Feature: FLASK Policy
●

What can FLASK do?
–

–
●

Basic: Restricts hypercalls to those needed by a particular
guest
Advanced: Allows more fine-grained granting of privileges

FLASK example policy
–

This contains example roles for the Control Domain
(dom0), User/Guest Domain(domU), stub domains, driver
domains, etc.

–

Make sure you TEST the example policy in your
environment BEFORE putting it into production!

NOTE: As an example policy, it is not as rigorously tested as
other parts of Xen during release; make sure it is suitable for you
Basic HowTo: FLASK Example
Policy
●

Build Xen with XSM enabled

●

Build the example policy

●

Add the appropriate label to guest config files:
–

“seclabel=[foo]”

–

“stubdom_label=[foo]”

Detailed Info
http://wiki.xenproject.org/wiki/Xen_Security_Modules_:_XSM-FLASK
ARM-Specific Security Features
Xen + ARM = A Perfect Match
ARM Architecture Features for Virtualization

ARM SOC

User mode : EL0
Device Tree describes …

Kernel mode : EL1

I/O

Hypercall Interface HVC
GT

GIC
v2

2
stage
MMU

Hypervisor mode : EL2
Xen + ARM = A Perfect Match
ARM Architecture Features for Virtualization

ARM SOC

EL0
Device Tree describes …

EL1

I/O

HVC
GT

GIC
v2

2
stage
MMU

EL2
Xen Hypervisor
Xen + ARM = A Perfect Match
ARM Architecture Features for Virtualization

ARM SOC

Any Xen Guest VM (including Dom0)
Any Xen Guest VM (including Dom0)
EL0
User Space
User Space

Device Tree describes …

Kernel
Kernel

EL1

I/O

HVC
GT

GIC
v2

2
stage
MMU

EL2
Xen Hypervisor
Xen + ARM = A Perfect Match
ARM Architecture Features for Virtualization

ARM SOC
Dom0
Dom0
only

Any Xen Guest VM (including Dom0)
Any Xen Guest VM (including Dom0)
EL0
User Space
User Space

Device Tree describes …

Kernel
Kernel
PV
back

I/O

PV

EL1
front

HVC
GT

GIC
v2

2
stage
MMU

EL2
Xen Hypervisor
ARM: Right Solution for Security
●

Stays in ARM Hypervisor Mode
–
–

Because Xen's architecture maps so well to the ARM architecture, Xen never
has to use Kernel mode

–

Other hypervisors have to flip back and forth between modes

–

If a hypervisor has to enter Kernel mode, it loses the security of running in a
privileged mode, isolated from the rest of the system

–
●

The ARM architecture has separate Hypervisor and Kernel modes

This is a non-issue with the Xen Hypervisor on ARM

Does not need to use device emulation
–

No emulation means a smaller attack surface for bad guys
For More Information...
Detailed Info
http://wiki.xenproject.org/wiki/Securing_Xen
Thanks to George Dunlap for supplying much of the information
presented here, and Stefano Stabellini for ARM information

Center of the Xen universe: http://www.XenProject.org/
Contact me at russell.pavlicek@xenproject.org

Thank You!
Securing Your Cloud With the Xen Hypervisor by Russell Pavlicek

More Related Content

PPTX
Linuxcon EU : Virtualization in the Cloud featuring Xen and XCP
PDF
Securing your cloud with Xen's advanced security features
PDF
BSDcon Asia 2015: Xen on FreeBSD
PPTX
BACD July 2012 : The Xen Cloud Platform
ODP
S4 xen hypervisor_20080622
PDF
Aplura virtualization slides
PDF
Linaro connect : Introduction to Xen on ARM
PDF
XPDDS18: LCC18: Xen Project: After 15 years, What's Next? - George Dunlap, C...
Linuxcon EU : Virtualization in the Cloud featuring Xen and XCP
Securing your cloud with Xen's advanced security features
BSDcon Asia 2015: Xen on FreeBSD
BACD July 2012 : The Xen Cloud Platform
S4 xen hypervisor_20080622
Aplura virtualization slides
Linaro connect : Introduction to Xen on ARM
XPDDS18: LCC18: Xen Project: After 15 years, What's Next? - George Dunlap, C...

What's hot (20)

PPTX
LFCOLLAB15: Xen 4.5 and Beyond
PPTX
Xen in the Cloud at SCALE 10x
PDF
LCEU13: Securing your cloud with Xen's advanced security features - George Du...
PPTX
Xen cloud platform v1.1 (given at Build a Cloud Day in Antwerp)
PDF
Why Choose Xen For Your Cloud?
PDF
Xen Cloud Platform at Build a Cloud Day at SCALE 10x
PDF
LF Collaboration Summit: Xen Project 4 4 Features and Futures
PDF
Xen, XenServer, and XAPI: What’s the Difference?-XPUS13 Bulpin,Pavlicek
PDF
Securing Your Cloud with Xen (CloudOpen NA 2013)
PDF
Xen time machine
PPTX
Xen Project Update LinuxCon Brazil
PDF
Performance Tuning Xen
PDF
Xen ATG case study
PPTX
CIF16/Scale14x: The latest from the Xen Project (Lars Kurth, Chairman of Xen ...
PDF
XS Boston 2008 XenLoop
PDF
XCP: The Art of Open Virtualization for the Enterprise and the Cloud
PDF
Xen PV Performance Status and Optimization Opportunities
PDF
Xen 10th anniversary Status Report (at SELF 2013)
PDF
XPDS14: Xen and the Art of Certification - Nathan Studer & Robert VonVossen, ...
PDF
Why xen slides
LFCOLLAB15: Xen 4.5 and Beyond
Xen in the Cloud at SCALE 10x
LCEU13: Securing your cloud with Xen's advanced security features - George Du...
Xen cloud platform v1.1 (given at Build a Cloud Day in Antwerp)
Why Choose Xen For Your Cloud?
Xen Cloud Platform at Build a Cloud Day at SCALE 10x
LF Collaboration Summit: Xen Project 4 4 Features and Futures
Xen, XenServer, and XAPI: What’s the Difference?-XPUS13 Bulpin,Pavlicek
Securing Your Cloud with Xen (CloudOpen NA 2013)
Xen time machine
Xen Project Update LinuxCon Brazil
Performance Tuning Xen
Xen ATG case study
CIF16/Scale14x: The latest from the Xen Project (Lars Kurth, Chairman of Xen ...
XS Boston 2008 XenLoop
XCP: The Art of Open Virtualization for the Enterprise and the Cloud
Xen PV Performance Status and Optimization Opportunities
Xen 10th anniversary Status Report (at SELF 2013)
XPDS14: Xen and the Art of Certification - Nathan Studer & Robert VonVossen, ...
Why xen slides
Ad

Similar to Securing Your Cloud With the Xen Hypervisor by Russell Pavlicek (20)

PDF
Scale 12x Securing Your Cloud with The Xen Hypervisor
PDF
LFNW2014 Advanced Security Features of Xen Project Hypervisor
PDF
Securing your Cloud with Xen - SUSECon 2013
PPT
cybersecurityawarnessiit------------------------------.ppt
ODP
A Xen Case Study
PDF
Kernel Recipes 2014 - Xen as a foundation for cloud infrastructure
DOCX
V mwarev sphere5.1notes-v2
PDF
Xen and Client Virtualization: the case of XenClient XT
PDF
Xen: Hypervisor for the Cloud - CCC13
PPTX
Open source hypervisors in cloud
PDF
OSSNA18: Xen Beginners Training
PDF
IITCC15: The Bare-Metal Hypervisor as a Platform for Innovation
PDF
XPDDS19: The Xen-Blanket for 2019 - Christopher Clark and Kelli Little, Star ...
PDF
Xen Project Hypervisor for the Cloud
PDF
Oscon 2012 : From Datacenter to the Cloud - Featuring Xen and XCP
PPT
Usenix Invited Talk
PPTX
Zero footprint guest memory introspection from xen
PDF
Bare-Metal Hypervisor as a Platform for Innovation
PDF
Docker San Diego 2015-03-25
PDF
Platform Security Summit 18: Xen Security Weather Report 2018
Scale 12x Securing Your Cloud with The Xen Hypervisor
LFNW2014 Advanced Security Features of Xen Project Hypervisor
Securing your Cloud with Xen - SUSECon 2013
cybersecurityawarnessiit------------------------------.ppt
A Xen Case Study
Kernel Recipes 2014 - Xen as a foundation for cloud infrastructure
V mwarev sphere5.1notes-v2
Xen and Client Virtualization: the case of XenClient XT
Xen: Hypervisor for the Cloud - CCC13
Open source hypervisors in cloud
OSSNA18: Xen Beginners Training
IITCC15: The Bare-Metal Hypervisor as a Platform for Innovation
XPDDS19: The Xen-Blanket for 2019 - Christopher Clark and Kelli Little, Star ...
Xen Project Hypervisor for the Cloud
Oscon 2012 : From Datacenter to the Cloud - Featuring Xen and XCP
Usenix Invited Talk
Zero footprint guest memory introspection from xen
Bare-Metal Hypervisor as a Platform for Innovation
Docker San Diego 2015-03-25
Platform Security Summit 18: Xen Security Weather Report 2018
Ad

More from buildacloud (20)

PDF
The Future of SDN in CloudStack by Chiradeep Vittal
PPTX
Policy Based SDN Solution for DC and Branch Office by Suresh Boddapati
PDF
L4-L7 services for SDN and NVF by Youcef Laribi
POTX
Jenkins, jclouds, CloudStack, and CentOS by David Nalley
PPTX
Intro to Zenoss by Andrew Kirch
ODP
Guaranteeing Storage Performance by Mike Tutkowski
PDF
Cloud Application Blueprints with Apache Brooklyn by Alex Henevald
PPT
Introduction to Apache CloudStack by David Nalley
PDF
Managing infrastructure with Application Policy by Mike Cohen
PPTX
Intro to Zenoss by Andrew Kirch
PPTX
Monitoring CloudStack in context with Converged Infrastructure by Mike Turnlund
PDF
Rest api design by george reese
PPTX
Enterprise grade firewall and ssl termination to ac by will stevens
PDF
State of the cloud by reuven cohen
PPTX
DevCloud - Setup and Demo on Apache CloudStack
PDF
Cloud Network Virtualization with Juniper Contrail
PPTX
Ian rae panel cloud stack & cloud storage where are we at, and where do we ne...
PDF
Troubleshooting Strategies for CloudStack Installations by Kirk Kosinski
PPT
CloudStack University by Sebastien Goasguen
PDF
Building Scalable, Resilient Infrastructure on CloudStack by Sebastian Stadil
The Future of SDN in CloudStack by Chiradeep Vittal
Policy Based SDN Solution for DC and Branch Office by Suresh Boddapati
L4-L7 services for SDN and NVF by Youcef Laribi
Jenkins, jclouds, CloudStack, and CentOS by David Nalley
Intro to Zenoss by Andrew Kirch
Guaranteeing Storage Performance by Mike Tutkowski
Cloud Application Blueprints with Apache Brooklyn by Alex Henevald
Introduction to Apache CloudStack by David Nalley
Managing infrastructure with Application Policy by Mike Cohen
Intro to Zenoss by Andrew Kirch
Monitoring CloudStack in context with Converged Infrastructure by Mike Turnlund
Rest api design by george reese
Enterprise grade firewall and ssl termination to ac by will stevens
State of the cloud by reuven cohen
DevCloud - Setup and Demo on Apache CloudStack
Cloud Network Virtualization with Juniper Contrail
Ian rae panel cloud stack & cloud storage where are we at, and where do we ne...
Troubleshooting Strategies for CloudStack Installations by Kirk Kosinski
CloudStack University by Sebastien Goasguen
Building Scalable, Resilient Infrastructure on CloudStack by Sebastian Stadil

Recently uploaded (20)

PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Encapsulation theory and applications.pdf
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPT
Teaching material agriculture food technology
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
cuic standard and advanced reporting.pdf
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Machine learning based COVID-19 study performance prediction
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Approach and Philosophy of On baking technology
PPTX
A Presentation on Artificial Intelligence
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Diabetes mellitus diagnosis method based random forest with bat algorithm
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Encapsulation theory and applications.pdf
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Mobile App Security Testing_ A Comprehensive Guide.pdf
Teaching material agriculture food technology
Chapter 3 Spatial Domain Image Processing.pdf
20250228 LYD VKU AI Blended-Learning.pptx
Dropbox Q2 2025 Financial Results & Investor Presentation
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
cuic standard and advanced reporting.pdf
Review of recent advances in non-invasive hemoglobin estimation
Machine learning based COVID-19 study performance prediction
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Network Security Unit 5.pdf for BCA BBA.
Encapsulation_ Review paper, used for researhc scholars
Approach and Philosophy of On baking technology
A Presentation on Artificial Intelligence

Securing Your Cloud With the Xen Hypervisor by Russell Pavlicek

  • 1. Securing Your Cloud With the Xen Hypervisor Russell Pavlicek Xen Project Evangelist Citrix Systems
  • 2. Who is the Old, Fat Geek Up Front? ● Xen project Evangelist ● Employed by Citrix, focused entirely on Xen project ● History with open source begins in 1995 ● Former columnist for Infoworld, Processor magazines ● ● Former panelist on The Linux Show, repeat guest on The Linux Link Tech Show Over 150 pieces published, one book on open source, plus blogs
  • 3. Presentation Goals ● Introduce the subject of security in the Cloud ● Introduce you to the Xen Project Security Tools ● Discuss some key Xen security features ● Get you started in the right direction toward securing your Xen installation
  • 4. Presentation Outline ● A few thoughts on the problem of securing the Cloud ● Overview of the Xen architecture ● Brief introduction to the principles of security analysis ● Examine some of the attack surfaces and the Xen features we can use to mitigate them: – Driver Domains – PVgrub – Stub Domains – Paravirtualization (PV) versus Hardware Virtualization (HVM) – FLASK example policy
  • 5. Introduction: Xen Project, The Cloud, and Security
  • 6. Introduction: Xen Project and Security ● Xen project produces an enterprise-grade Type 1 hypervisor ● Built for the cloud before it was called cloud ● A number of advanced security features – Driver domains, stub domains, FLASK, and more – Most of them are not (or cannot) be turned on by default – Although they can be simple to use, sometimes they appear complicated
  • 7. The Cloud Security Conundrum ● Cloud Security: The 800lb Gorilla in the room – Nothing generates more fear in specific, and FUD in general – Probably the single greatest barrier to Cloud adoption – Immediately behind it is the inability to get out of the 20th century IT mindset – Must get past the “Change is Bad” concept of 1980 – Cloud is about embracing change at a rapid pace The good news: the “Gorilla” is actually a “Red Herring” ● ● We don't need to fear it – we just need to solve it
  • 8. Cloud Security: New Visibility to an Old Problem ● ● ● ● Security has always been an IT issue Putting a truly secure system in the open does not reduce its security, it just increases the frequency of attack Unfortunately, system security behind the firewall has not always been comprehensive Having solutions in an external cloud forces us to solve the security issues we should have already solved News Flash: Security Through Obscurity is Dead
  • 9. Use Security by Design, Not by Wishful Thinking ● Security by wishful thinking no longer works – – Addressing security in one area while ignoring others is NOT good enough – ● Merely hoping that your firewall holds off the marauding hordes is NOT good enough Saying, “We never had a problem before” is NOT good enough Comprehensive security starts with design – It needs to be planned carefully and thought through – It needs to be implemented at multiple levels – It needs components which are themselves securable
  • 10. Xen Project: Security by Design ● Xen Project was designed for clouds before the term “cloud” was ever coined in the industry – http://www.cl.cam.ac.uk/research//srg/netos/xeno/publi cations.html Xen is designed to thwart attacks from many attack vectors, using different defensive techniques – ● Designers foresaw the day of “infrastructure for wide-area distributed computing” which we now call “the cloud”
  • 11. Basic Architecture of the Xen Hypervisor
  • 12. Hypervisor Architectures Type 1: Bare metal Hypervisor A pure Hypervisor that runs directly on the hardware and hosts Guest OS’s. VMn VM1 VM0 Guest OS and Apps Hypervisor Host HW Device Drivers/ Models I/O Memory Scheduler MMU CPUs Provides partition isolation + reliability, higher security
  • 13. Hypervisor Architectures Type 1: Bare metal Hypervisor Type 2: OS ‘Hosted’ A pure Hypervisor that runs directly on the hardware and hosts Guest OS’s. A Hypervisor that runs within a Host OS and hosts Guest OS’s inside of it, using the host OS services to provide the virtual environment. VMn VM1 VM0 User-level VMM User Apps Device Models Guest OS and Apps Hypervisor Host HW I/O Memory Scheduler MMU CPUs Provides partition isolation + reliability, higher security Device Drivers Host HW VM0 Guest OS and Apps Host OS Device Drivers/ Models VMn VM1 I/O Ring-0 VM Monitor “Kernel “ Memory CPUs Low cost, no additional drivers Ease of use and installation
  • 14. Xen: Type 1 with a Twist Type 1: Bare metal Hypervisor VMn VM1 VM0 Guest OS and Apps Hypervisor Host HW Device Drivers/ Models I/O Memory Scheduler MMU CPUs
  • 15. Xen: Type 1 with a Twist Type 1: Bare metal Hypervisor XEN Architecture VMn VM1 VMn VM1 VM0 Guest OS and Apps Hypervisor Host HW Device Drivers/ Models I/O Memory VM0 Guest OS and Apps Scheduler MMU CPUs MMU Scheduler Host HW I/O Memory CPUs
  • 16. Xen: Type 1 with a Twist Type 1: Bare metal Hypervisor VMn VM1 VM0 Guest OS and Apps Hypervisor Host HW Device Drivers/ Models I/O Memory Scheduler MMU CPUs XEN Architecture Control domain (dom0) VMn VM1 Device Models VM0 Drivers Guest OS and Apps Linux & BSD MMU Scheduler Host HW I/O Memory CPUs
  • 19. An Approach to Security Thinking ● Threat models: – – ● Attacker can access network Attacker controls one Guest VM Security considerations to evaluate: – – What is the interface like? (e.g., pointers vs scalars) – ● How much code is accessible? Defense-in-depth: how many rings of defense surround you? Then combine security tactics to secure the installation – There is no single "magic bullet" – Individual tactics reduce danger; combined tactics go farther
  • 20. Example System For This Discussion ● Hardware setup – – ● Two networks: one Control network, one Guest network IOMMU with interrupt remapping (AMD or Intel VT-d v2) to allow for full hardware virtualization (HVM) Default configuration – Network drivers in the Control Domain (aka "Domain 0" or just "Dom0") – Paravirtualized (PV) guests using PyGrub (grub-like boot utility within context of Guest Domain) – Hardware Virtualized (HVM) guests using Qemu (as the device model) running in the Control Domain
  • 23. Attack Surface: Network Path ● Where might an exploit focus? – Bugs in hardware driver – Bugs in bridging / filtering – Bugs in netback (via the ring protocol) ● ● Netback and Netfront are part of the Paravirtualization mode Note the exploits – The main exploits exist already, even in hardware – The netback surface is very small, but needs to be acknowledged – When these are attacked in hardware, you have deep trouble – You actually have better defense in the VM than in hardware
  • 24. Result: Network Path Compromised
  • 25. Result: Network Path Compromised Vulnerability Analysis: What could a successful exploit yield? Control of Domain 0 kernel This could lead to the control of the whole system
  • 27. Security Feature: Driver Domains ● What is a Driver Domain? – Unprivileged VM which drives hardware – It provides driver access to guest VMs – Very limited scope; not a full operating system – Does not have the access or capability of a full VM
  • 28. Result: Driver Domain Compromised
  • 29. Result: Driver Domain Compromised ● Now a successful exploit could yield: – Control of the Driver Domain (Paravirtualization hypercall interface) ● – But the Driver Domain is limited: no shell, no utilities Control of that guest's network traffic ● But in the cloud, most orchestrators detect network traffic failure ● The problem is not allowed to stand very long – Control of the network interface card (NIC) – An opportunity to attack the netfront of other guest VMs ● ● But to take advantage of this platform, you need to launch another attack Compound attacks are complex, and they take time which you may not have
  • 30. Basic How To: Driver Domains ● Create a VM with appropriate drivers – ● Install the Xen-related hotplug scripts – ● ● Use any distribution suitable as a Control Domain Just installing the Xen tools in the VM is usually good enough Give the VM access to the physical NIC with PCI passthrough Configure the network topology in the Driver Domain – Just like you would for the Control Domain
  • 31. Basic How To: Driver Domains ● Configure the guest Virtual Network Interface (vif) to use the new domain ID – Add “backend=domnet” to vif declaration vif = [ 'type=pv, bridge=xenbr0, backend=domnet' ] Detailed Info http://wiki.xenproject.org/wiki/Driver_Domain
  • 32. Attacking the PyGrub Boot Loader
  • 34. Attack Surface: PyGrub ● What is PyGrub? – – ● “grub” implementation for Paravirtualized guests A Python program running in Control Domain What does it do? – It reads the guest VM's filesystem – It parses grub.conf – It displays a boot menu to the user – It passes the selected kernel image to domain builder
  • 36. Attack Surface: PyGrub ● Where might an exploit focus? – – Bugs in menu parser – ● Bugs in file system parser Bugs in domain builder Again, note the exploits – Forms of these exist in hardware as well – But hardware doesn't have as many options to combat the situation
  • 38. Result: PyGrub Compromised Vulnerability Analysis: What could a successful exploit yield? Control of Domain 0 user space This could lead to the control of the whole system
  • 40. Security Feature: Fixed Kernels ● What is a fixed kernel? – Passing a known-good kernel from Control Domain ● ● – ● No longer allows a user to choose the kernel Best practice for anything in production Removes attacker avenue to domain builder Disadvantages – Host administrator must keep up with kernel updates – Guest admin can't pass kernel parameters or custom kernels
  • 42. Security Feature: PVgrub ● What is PVgrub? – MiniOS plus the Paravirtualized port of “grub” running in a guest context – Paravirtualized equivalent of Hardware Virtualized combination of BIOS plus grub
  • 43. Result: PVgrub Compromised Vulnerability Analysis: Now a successful exploit could yield: Control of the attacked Guest Domain alone Control Domain is no longer at risk
  • 44. Basic HowTo: PVgrub ● Make sure that you have the PVgrub image – – Normally lives in “/usr/lib/xen/boot” – SUSE SLES: Currently need to build for yourself – Included in Fedora Xen packages – ● “pvgrub-$ARCH.gz” Debian-based: need to build yourself Use appropriate PVgrub as bootloader in guest configuration: – kernel="/usr/lib/xen/boot/pvgrub-x86_32.gz" See http://wiki.xenproject.org/wiki/Pvgrub
  • 45. Attacking the Qemu Device Model
  • 46. Attack Surface: Device Model (Qemu)
  • 47. Attack Surface: Device Model (Qemu) ● What is Qemu? – – ● In other contexts, a virtualization provider In the Xen Project context, a provider of needed device models Where might an exploit focus? – Bugs in NIC emulator parsing packets – Bugs in emulation of virtual devices
  • 48. Result: Device Model Compromised Vulnerability Analysis: What could a successful exploit yield? Control Domain privileged user space This could lead to the control of the whole system
  • 49. Security Feature: Qemu Stub Domains ● What is a stub domain? – Stub domain: a small “service'' domain running just one application – Qemu stub domain: run each Qemu in its own domain
  • 50. Result: Stub Domain Compromised Vulnerability Analysis: Now a successful exploit could yield: Control only of the stub domain VM (which, if FLASK is employed, is a relatively small universe) You need to devise another attack entirely to do anything more significant
  • 51. Basic HowTo: Qemu Stub Domains ● Make sure that you have the ioemu image: – – Normally lives in “/usr/lib/xen/boot” – SUSE SLES, currently need to build it yourself (SLES 12?) – Included in Fedora Xen packages – ● “ioemu-$ARCH.gz” On Debian (and offshoots), you will need to build it yourself Specify stub domains in your guest configuration: device_model_stubdomain_override = 1 Detailed Info http://wiki.xenproject.org/wiki/Device_Model_Stub_Domains
  • 53. Attack Surface: Xen Hypervisor Itself ● Where might an exploit focus? – On Paravirtualized (PV) Guests: – PV Hypercalls On full Hardware Virtualized (HVM) Guests: ● HVM hypercalls (Subset of PV hypercalls) ● Instruction emulation (MMIO, shadow pagetables) ● Emulated platform devices: APIC, HPET, PIT ● Nested virtualization Security practice: Use PV VMs whenever possible ● ●
  • 54. Using the Xen Security Module
  • 55. Security Feature: FLASK Policy ● What is FLASK? – Xen Security Module (XSM): Xen equivalent of LSM – FLASK: FLux Advanced Security Kernel – Framework for XSM developed by NSA – Xen equivalent of SELinux – Uses same concepts and tools as SELinux – Allows a policy to restrict hypercalls
  • 56. Security Feature: FLASK Policy ● What can FLASK do? – – ● Basic: Restricts hypercalls to those needed by a particular guest Advanced: Allows more fine-grained granting of privileges FLASK example policy – This contains example roles for the Control Domain (dom0), User/Guest Domain(domU), stub domains, driver domains, etc. – Make sure you TEST the example policy in your environment BEFORE putting it into production! NOTE: As an example policy, it is not as rigorously tested as other parts of Xen during release; make sure it is suitable for you
  • 57. Basic HowTo: FLASK Example Policy ● Build Xen with XSM enabled ● Build the example policy ● Add the appropriate label to guest config files: – “seclabel=[foo]” – “stubdom_label=[foo]” Detailed Info http://wiki.xenproject.org/wiki/Xen_Security_Modules_:_XSM-FLASK
  • 59. Xen + ARM = A Perfect Match ARM Architecture Features for Virtualization ARM SOC User mode : EL0 Device Tree describes … Kernel mode : EL1 I/O Hypercall Interface HVC GT GIC v2 2 stage MMU Hypervisor mode : EL2
  • 60. Xen + ARM = A Perfect Match ARM Architecture Features for Virtualization ARM SOC EL0 Device Tree describes … EL1 I/O HVC GT GIC v2 2 stage MMU EL2 Xen Hypervisor
  • 61. Xen + ARM = A Perfect Match ARM Architecture Features for Virtualization ARM SOC Any Xen Guest VM (including Dom0) Any Xen Guest VM (including Dom0) EL0 User Space User Space Device Tree describes … Kernel Kernel EL1 I/O HVC GT GIC v2 2 stage MMU EL2 Xen Hypervisor
  • 62. Xen + ARM = A Perfect Match ARM Architecture Features for Virtualization ARM SOC Dom0 Dom0 only Any Xen Guest VM (including Dom0) Any Xen Guest VM (including Dom0) EL0 User Space User Space Device Tree describes … Kernel Kernel PV back I/O PV EL1 front HVC GT GIC v2 2 stage MMU EL2 Xen Hypervisor
  • 63. ARM: Right Solution for Security ● Stays in ARM Hypervisor Mode – – Because Xen's architecture maps so well to the ARM architecture, Xen never has to use Kernel mode – Other hypervisors have to flip back and forth between modes – If a hypervisor has to enter Kernel mode, it loses the security of running in a privileged mode, isolated from the rest of the system – ● The ARM architecture has separate Hypervisor and Kernel modes This is a non-issue with the Xen Hypervisor on ARM Does not need to use device emulation – No emulation means a smaller attack surface for bad guys
  • 64. For More Information... Detailed Info http://wiki.xenproject.org/wiki/Securing_Xen Thanks to George Dunlap for supplying much of the information presented here, and Stefano Stabellini for ARM information Center of the Xen universe: http://www.XenProject.org/ Contact me at russell.pavlicek@xenproject.org Thank You!