Top Banner
Security in a Virtual World Kai Axford, CISSP, MCSE Sr. Security Strategist, Trustworthy Computing Group Microsoft Corporation [email protected] http://blogs.technet.com/kaiaxford
39

Security in a Virtual World Kai Axford, CISSP, MCSE Sr. Security Strategist, Trustworthy Computing Group Microsoft Corporation [email protected] .

Dec 27, 2015

Download

Documents

Jonas Moody
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Security in a Virtual World Kai Axford, CISSP, MCSE Sr. Security Strategist, Trustworthy Computing Group Microsoft Corporation kaiax@microsoft.com .

Security in a Virtual World

Kai Axford, CISSP, MCSESr. Security Strategist, Trustworthy Computing GroupMicrosoft [email protected] http://blogs.technet.com/kaiaxford

Page 2: Security in a Virtual World Kai Axford, CISSP, MCSE Sr. Security Strategist, Trustworthy Computing Group Microsoft Corporation kaiax@microsoft.com .

Why should I care?

The number of virtual servers will rise to more than 1.7 million physical servers by 2010, resulting in 7.9 million logical servers. Virtualized servers will represent 14.6% of all physical servers in 2010 compared to just 4.5% in 2005.

60% of production virtual machines will be less secure than their physical counterparts through to 2009.

Source: Gartner

Source: IDC

Page 3: Security in a Virtual World Kai Axford, CISSP, MCSE Sr. Security Strategist, Trustworthy Computing Group Microsoft Corporation kaiax@microsoft.com .

Virtualization…is a good thing.

Page 4: Security in a Virtual World Kai Axford, CISSP, MCSE Sr. Security Strategist, Trustworthy Computing Group Microsoft Corporation kaiax@microsoft.com .

Microsoft’s Virtualization Technologies

Server VirtualizationPresentation

Virtualization

Application Virtualization

Desktop Virtualization

Management

Page 5: Security in a Virtual World Kai Axford, CISSP, MCSE Sr. Security Strategist, Trustworthy Computing Group Microsoft Corporation kaiax@microsoft.com .

Some Common VM Security Myths…

• “I only have to patch my host OS / Kernel”• “If I protect my Host machine, it will protect

my VMs.”• “Virtual Hard Disk files are secure by default.”• “If you expose the virtual machine, you have

to expose all virtual machines and the host.”• “All virtual machines can see each other.”

Page 6: Security in a Virtual World Kai Axford, CISSP, MCSE Sr. Security Strategist, Trustworthy Computing Group Microsoft Corporation kaiax@microsoft.com .

Windows Server Virtualization

Greater Scalability and improved performance

x64 bit host and guest supportSMP support

Increased reliability and securityMinimal Trusted Code base Windows running a foundation role

Better flexibility and manageabilityNew UI/Integration with SCVMM

AMD-V / Intel VT

Windows Hypervisor

VM 1“Parent”

VM 2“Child”

VM 3“Child”

VirtualHard Disks

(VHD)

Hardware

Windows Server 2003

Virtual Server 2005 R2

VM 2 VM 3

Page 7: Security in a Virtual World Kai Axford, CISSP, MCSE Sr. Security Strategist, Trustworthy Computing Group Microsoft Corporation kaiax@microsoft.com .

The Old Virtualization Architecture

Host

Guest App

Hardware

Virtualisation layer

Designed for Windows Server Hardware

Windows Server 2003 or XP

Kernel VMM.sys

Ring 0

Ring 3

Host OS

Virtual ServerService

Ring 0

Ring 1

Ring 3

Guest OS

VMM.sys

Windows (NT4, 2000, 2003)

GuestApplications

VS Additions

IIS

Virtual ServerWebApp

Page 8: Security in a Virtual World Kai Axford, CISSP, MCSE Sr. Security Strategist, Trustworthy Computing Group Microsoft Corporation kaiax@microsoft.com .

Virtualization Architecture Hypervisor

Server Hardware

WindowsKernel

VirtualizationService

Providers(VSPs)

Primary Partition

VMService

Child Partitions

Windows hypervisor

Applications

Ring “-1”

MinWin

IHVDrivers

VMBus

WMI Provider

VM WorkerProcesses

Ring 0

Ring 3

VirtualizationServiceClients(VSCs)

VMBus

Virtualization Stack

Guest OSKernel

Enlightenments

Page 9: Security in a Virtual World Kai Axford, CISSP, MCSE Sr. Security Strategist, Trustworthy Computing Group Microsoft Corporation kaiax@microsoft.com .

Hyper-V Security Assumptions

• Guests are untrusted• Trust relationships

– Parent must be trusted by hypervisor– Parent must be trusted by children

• Code in guests can run in all available processor modes, rings, and segments

• Hypercall interface will be well documented and widely available to attackers

• All hypercalls can be attempted by guests• Can detect you are running on a hypervisor

– (We’ll even give you the version)

• The internal design of the hypervisor will be well understood

Page 10: Security in a Virtual World Kai Axford, CISSP, MCSE Sr. Security Strategist, Trustworthy Computing Group Microsoft Corporation kaiax@microsoft.com .

Hyper –V Security Goals

• Strong isolation between partitions• Protect confidentiality and integrity of guest data• Separation

• Unique hypervisor resource pools per guest• Separate worker processes per guest• Guest-to-parent communications over unique channels

• Non-interference• Guests cannot affect the contents of other guests, parent,

hypervisor• Guest computations protected from other guests• Guest-to-guest communications not allowed through VM interfaces

Page 11: Security in a Virtual World Kai Axford, CISSP, MCSE Sr. Security Strategist, Trustworthy Computing Group Microsoft Corporation kaiax@microsoft.com .

Hyper-V Isolation

• We’re serious….– No sharing of virtualized devices– Separate VMBus per VM to the parent – No sharing of memory

• Each has its own address space

– VMs cannot communicate with each other, except through traditional networking

– Guests can’t perform DMA attacks because they’re never mapped to physical devices

– Guests cannot write to the hypervisor– Parent partition cannot write to the hypervisor

Page 12: Security in a Virtual World Kai Axford, CISSP, MCSE Sr. Security Strategist, Trustworthy Computing Group Microsoft Corporation kaiax@microsoft.com .

Hyper-V Security Hardening

• Hypervisor has separate address space– Guest addresses != Hypervisor addresses

• No 3rd party code in the Hypervisor• Limited number of channels from guests to hypervisor

– No “IOCTL”-like things• Guest to guest communication through hypervisor is

prohibited• No shared memory mapped between guests• Guests never touch real hardware I/O

Page 13: Security in a Virtual World Kai Axford, CISSP, MCSE Sr. Security Strategist, Trustworthy Computing Group Microsoft Corporation kaiax@microsoft.com .

Hyper-V Security Model• Uses Authorization Manager

(AzMan)– Fine grained authorization and access

control– Department and role based– Segregate who can manage groups of

VMs

• Define specific functions for individuals or roles– Start, stop, create, add hardware,

change drive image

• VM administrators don’t have to be Server 2008 administrators

• Guest resources are controlled by per VM configuration files

• Shared resources are protected– Read-only (CD ISO file)– Copy on write (differencing disks)

Page 14: Security in a Virtual World Kai Axford, CISSP, MCSE Sr. Security Strategist, Trustworthy Computing Group Microsoft Corporation kaiax@microsoft.com .

Windows Server 2008 Hyper-V

demo

Page 15: Security in a Virtual World Kai Axford, CISSP, MCSE Sr. Security Strategist, Trustworthy Computing Group Microsoft Corporation kaiax@microsoft.com .

Virtualization Attack Vectors

Host Hardware

Virtual Machine Host OS

Virtual Machine Hard Disk Files

Virtual Machine Configuration Files

Remote Management/Control interfaces

Guest Operating System

Virtual Networks

Page 16: Security in a Virtual World Kai Axford, CISSP, MCSE Sr. Security Strategist, Trustworthy Computing Group Microsoft Corporation kaiax@microsoft.com .

Common Attacks: Host • Host Compromise for

– Deployment, Duplication and Deletion– Control of Virtual Machines– Direct Code / File injection to Virtualization File Structure

• Virtual Hard Disks• Virtual Configuration Files

– Time Sync• Hardware

– Rootkits / Malware– Drivers (Attack Surface / Stability)

Page 17: Security in a Virtual World Kai Axford, CISSP, MCSE Sr. Security Strategist, Trustworthy Computing Group Microsoft Corporation kaiax@microsoft.com .

Some attacks making the news..

• SubVirt (Samuel T. King, Peter M. Chen: Michigan U)– Kernel based Rootkit based on a commercial VMM, which creates

and emulates virtual hardware.

• BluePill (AMD SVM) – Joanna Rutkowska– Moves the Host OS to a Virtual Machine at the hardware later (PoC

on AMD, Theory on Intel)

• Vitriol (Intel VT-x Mac OSX) – Dino Dai Zovi– VM Rootkit similar to BluePill but this time targeting Mac OSX

• Detecting a Virtual Environment..– RedPill / NoPill / scoopy_doo – Determines if a current OS is running inside a Virtual Machine

Page 18: Security in a Virtual World Kai Axford, CISSP, MCSE Sr. Security Strategist, Trustworthy Computing Group Microsoft Corporation kaiax@microsoft.com .

Use Remote Management

• All Virtualization Solutions include some form of remote control. – Access to these tools should be limited.– Limit scope of access / control

• Protect the remote control mechanisms!– Use limited use accounts for control– Make sure the connections are encrypted /

authenticated (SSL, RDP over SSL)– Use logging VMVM

VMVM

VMVMVM

VMVMVM

VM VMVM

VMVM

VMVMVM

VMVM VM

VMVM

VM

Page 19: Security in a Virtual World Kai Axford, CISSP, MCSE Sr. Security Strategist, Trustworthy Computing Group Microsoft Corporation kaiax@microsoft.com .

ANNOUNCING: Systems Center Virtual Machine Manager 2008 (Beta)

Page 20: Security in a Virtual World Kai Axford, CISSP, MCSE Sr. Security Strategist, Trustworthy Computing Group Microsoft Corporation kaiax@microsoft.com .

Top 10 Reasons for SCVMM 20081. Designed for virtual machines running on Windows Server 2008 and Microsoft Hyper-V Server 2. Support for Microsoft Virtual Server and VMware ESX

3. Performance and Resource Optimization (PRO)

4. Maximize datacenter resources through consolidation

5. Machine conversions are a snap!

6. Quick provisioning of new machines

7. Intelligent Placement minimizes virtual machine guesswork in deployment

8. Delegated virtual machine management for Development and Test

9. The library helps keep virtual machine components organized

10. Windows PowerShell™ provides rich management and scripting environment

Page 22: Security in a Virtual World Kai Axford, CISSP, MCSE Sr. Security Strategist, Trustworthy Computing Group Microsoft Corporation kaiax@microsoft.com .

Host Attacks: Potential Solutions

• Harden the Host Servers– Where a Hypervisor or Specialist Kernel is used, the Host attack surface is smaller, however

updating and patching is still required.– Use single role servers and remove unwanted and un-necessary services / attack vectors– Use a local firewall and only allow limited host control / management ports over encrypted

and authenticated channels.– Use limited scope admin accounts with strong passwords

• Protect the Virtual Machine files– Access Control Lists (limited to the security context for the users who manage them and

the services that control them.– Encryption

• Disk / Volume / Folder / File

– Auditing • file access, creation, deletion …

– Don’t forget the backup files / archives

Page 23: Security in a Virtual World Kai Axford, CISSP, MCSE Sr. Security Strategist, Trustworthy Computing Group Microsoft Corporation kaiax@microsoft.com .

COMING SOON: Windows Server 2008 Virtualization Hardening Guide

Page 24: Security in a Virtual World Kai Axford, CISSP, MCSE Sr. Security Strategist, Trustworthy Computing Group Microsoft Corporation kaiax@microsoft.com .

Use Access Control Lists

Deny•Cannot modify VMC file•Will not appear in web console or VMRC

Read-only•See the VM in web console and VRMC•Can interact with VM•Cannot start, stop, pause or resume VMs

Read/Write•See the VM in web console and VMRC•Can interact with the VM•Can start, stop, pause, resume VMs

Page 25: Security in a Virtual World Kai Axford, CISSP, MCSE Sr. Security Strategist, Trustworthy Computing Group Microsoft Corporation kaiax@microsoft.com .

Common Attacks: Guest

• Unpatched Virtual Machines• Older Operating Systems• Test or Development machines (these often

are not managed in the same way as production machines)

• Un-managed or user deployed virtual machines

• Backups and archives

Page 26: Security in a Virtual World Kai Axford, CISSP, MCSE Sr. Security Strategist, Trustworthy Computing Group Microsoft Corporation kaiax@microsoft.com .

Guest Attacks: Potential Solutions

• Harden the Guest Operating Systems– Treat the guest OS as if it was a physical machine

• Isolate the machine with Virtual Networks / VLANs– Local Only Access– NAT– Segmented networks

• IPSec Isolation• Physical Isolation (Separate NICs)

Page 27: Security in a Virtual World Kai Axford, CISSP, MCSE Sr. Security Strategist, Trustworthy Computing Group Microsoft Corporation kaiax@microsoft.com .

The Segmented Network (with DMZ)The Segmented Network (with DMZ)

Virtual NICS Virtual NICs

Hardware serverHardware server Physical NICs

Common VirtualizationScenario

DMZ

Database ServerDatabase Server

VM

Internal network 1

Bridged virtual network

Virtual Switch

Application Server

Application Server

VM

Web ServerWeb Server

VM

Internal network 2

Bridged virtual network

Page 28: Security in a Virtual World Kai Axford, CISSP, MCSE Sr. Security Strategist, Trustworthy Computing Group Microsoft Corporation kaiax@microsoft.com .

The three leg network (DMZ and VPN)The three leg network (DMZ and VPN)

Virtual NICS Virtual NICs

Hardware serverHardware server Physical NICs

Common VirtualizationScenario

DMZ

Web ServerWeb Server

VM

Private internal network

Bridged virtual network

Virtual Switch

Application Server

Application Server

VM

Gateway ServerGateway Server

VM

Public external network

Bridged virtual network

Page 29: Security in a Virtual World Kai Axford, CISSP, MCSE Sr. Security Strategist, Trustworthy Computing Group Microsoft Corporation kaiax@microsoft.com .

Patching a Virtual Machine

Page 30: Security in a Virtual World Kai Axford, CISSP, MCSE Sr. Security Strategist, Trustworthy Computing Group Microsoft Corporation kaiax@microsoft.com .

Backup and DR

Host to HostGuest to Guest

Cluster storage

iSCSI connection

Cluster storage

SAN or iSCSI connection

Page 31: Security in a Virtual World Kai Axford, CISSP, MCSE Sr. Security Strategist, Trustworthy Computing Group Microsoft Corporation kaiax@microsoft.com .

Threat Landscape:Virtualized Attackers?

• Is this is one of the next big attack vectors on the horizon?

• The VM industry is focused on securing the VMs from attack. Very little thought of VMs being used as the attacker.

• Cases are starting to appear where people use VMs to attack, then shutdown the VM to remove any trace of evidence.

Page 32: Security in a Virtual World Kai Axford, CISSP, MCSE Sr. Security Strategist, Trustworthy Computing Group Microsoft Corporation kaiax@microsoft.com .

Threat Landscape:Virtualized Attackers?

• But we do write all events to the SysLog• Things that go into drive slack are recoverable

using forensics tools• We still have network traces…• …and audit logs• …and firewall and router logs• …not to mention video cameras in the server

room.

Page 33: Security in a Virtual World Kai Axford, CISSP, MCSE Sr. Security Strategist, Trustworthy Computing Group Microsoft Corporation kaiax@microsoft.com .

Virtualization Best Practices + Tips and Tricks

Page 34: Security in a Virtual World Kai Axford, CISSP, MCSE Sr. Security Strategist, Trustworthy Computing Group Microsoft Corporation kaiax@microsoft.com .

Deployment Considerations• Minimize risk to the Parent Partition

– Use Server Core– Don’t run arbitrary apps, no web surfing

• Run your apps and services in guests

• Moving VMs from Virtual Server to Hyper-V– FIRST: Uninstall the VM Additions

• Two physical network adapters at minimum– One for management (use a VLAN too)– One (or more) for vm networking– Dedicated iSCSI– Connect to back-end management network

• Only expose guests to internet traffic

Page 35: Security in a Virtual World Kai Axford, CISSP, MCSE Sr. Security Strategist, Trustworthy Computing Group Microsoft Corporation kaiax@microsoft.com .

Anti-Virus & BitLocker…• Parent partition

– Run AV software and exclude .vhd• Child partitions

– Run AV software within each VM• BitLocker

– Great for branch office– Can be used within a VM

• http://blogs.technet.com/virtualworld/archive/2008/02/16/using-bitlocker-under-virtual-pc-virtual-server.aspx

– Still testing with Hyper-V; More to come…

Page 36: Security in a Virtual World Kai Axford, CISSP, MCSE Sr. Security Strategist, Trustworthy Computing Group Microsoft Corporation kaiax@microsoft.com .

Extra Tips…• Mitigate Bottlenecks

– Processors– Memory– Storage

• Don't run everything off a single spindle…

– Networking• VHD Compaction/Expansion

– Run it on a non-production system• Use .ISOs

– Great performance– Can be mounted and unmounted remotely– Having them in SCVMM Library fast & convenient

Page 37: Security in a Virtual World Kai Axford, CISSP, MCSE Sr. Security Strategist, Trustworthy Computing Group Microsoft Corporation kaiax@microsoft.com .

Conclusions

• Reduce the attack surface on the Host• Use least privilege access • Audit the deployment, maintenance, control and access to

virtual machines• Leverage backups, snapshots and redundancy to reduce

impact of Host / Guest maintenance• Secure your Virtual Machine Hard Disk and configuration files,

including backups and archives• Use Virtual Networks / VLANs / IPSec to Isolate machines,

especially before they are exposed to the network.

Page 38: Security in a Virtual World Kai Axford, CISSP, MCSE Sr. Security Strategist, Trustworthy Computing Group Microsoft Corporation kaiax@microsoft.com .

Resources

• Get the slides! (Available June 2008)– http://www.microsoft.ca/bootcamp

• Step-by-Step Guide to Getting Started with Hyper-V– http://technet2.microsoft.com/windowsserver2008/en/library/

c513e254-adf1-400e-8fcb-c1aec8a029311033.mspx?mfr=true • Virtualization Team Blog

– http://blogs.technet.com/virtualization• Microsoft Virtualization Website

– http://www.microsoft.com/virtualization• Using BitLocker under Virtual PC / Virtual Server

– http://blogs.technet.com/virtualworld/archive/2008/02/16/using-bitlocker-under-virtual-pc-virtual-server.aspx

Page 39: Security in a Virtual World Kai Axford, CISSP, MCSE Sr. Security Strategist, Trustworthy Computing Group Microsoft Corporation kaiax@microsoft.com .

Questions?

Kai Axford, CISSP, MCSESr. Security Strategist, Trustworthy Computing GroupMicrosoft [email protected] http://blogs.technet.com/kaiaxford