VirtualizaEon ¡ CS642: ¡ ¡ Computer ¡Security ¡ Professor ¡Ristenpart ¡ h9p://www.cs.wisc.edu/~rist/ ¡ rist ¡at ¡cs ¡dot ¡wisc ¡dot ¡edu ¡ University ¡of ¡Wisconsin ¡CS ¡642 ¡
AdministraEve ¡ • Homework ¡4 ¡will ¡be ¡posted ¡today ¡or ¡ tomorrow ¡ • Last ¡week ¡of ¡class ¡– ¡project ¡presentaEons ¡ ¡ – 10-‑15 ¡minute ¡presentaEons ¡ – Turn ¡in ¡slides ¡(PDF ¡or, ¡preferably, ¡PPTX) ¡ • Must ¡be ¡comprehensive: ¡extra ¡slides ¡not ¡covered ¡in ¡ talk ¡should ¡be ¡added ¡to ¡flesh ¡out ¡details ¡ • Or: ¡opEonal ¡supporEng ¡writeup ¡(PDF) ¡ – I’ll ¡email ¡about ¡a ¡Doodle ¡to ¡sign ¡up ¡for ¡ presentaEon ¡day/Eme ¡
VirtualizaEon ¡and ¡cloud ¡security ¡ VMs ¡ Cloud ¡compuEng ¡paradigms ¡ VM ¡image ¡security ¡issues ¡ VM ¡IntrospecEon ¡ IntrospecEon ¡ University ¡of ¡Wisconsin ¡CS ¡642 ¡
VirtualizaEon ¡ P1 ¡ P2 ¡ P1 ¡ P2 ¡ P1 ¡ P2 ¡ P1 ¡ P2 ¡ OS1 ¡ OS2 ¡ Process ¡1 ¡ Process ¡2 ¡ OS1 ¡ OS2 ¡ ¡ ¡ Drivers ¡ Drivers ¡ ¡ ¡ Hypervisor ¡ OS ¡ Hypervisor ¡ Hardware ¡ Hardware ¡ Hardware ¡ No ¡virtualizaEon ¡ Full ¡virtualizaEon ¡ ParavirtualizaEon ¡ Type-‑1: ¡Hypervisor ¡runs ¡directly ¡on ¡hardware ¡
VirtualizaEon ¡ P1 ¡ P2 ¡ P1 ¡ P2 ¡ P1 ¡ P2 ¡ P1 ¡ P2 ¡ OS1 ¡ OS2 ¡ Process ¡1 ¡ Process ¡2 ¡ OS1 ¡ OS2 ¡ ¡ ¡ Drivers ¡ Drivers ¡ ¡ ¡ Hypervisor ¡ OS ¡ Hypervisor ¡ Host ¡OS ¡ Hardware ¡ Hardware ¡ Hardware ¡ No ¡virtualizaEon ¡ Full ¡virtualizaEon ¡ ParavirtualizaEon ¡ Type-‑1: ¡Hypervisor ¡runs ¡directly ¡on ¡hardware ¡ Type-‑2: ¡Hypervisor ¡runs ¡on ¡host ¡OS ¡
IBM ¡VM/370 ¡ • Released ¡in ¡1972 ¡ – Used ¡with ¡System/370, ¡System/390, ¡zSeries ¡ mainframes ¡ – Full ¡virtualizaEon ¡ • Supported ¡CP/CMS ¡operaEng ¡system ¡ – IniEal ¡applicaEon ¡was ¡to ¡support ¡legacy ¡OS ¡ • z/VM ¡is ¡newer ¡version, ¡most ¡recent ¡version ¡ 2010 ¡ – Be9er ¡use ¡of ¡64-‑bit ¡mainframes ¡
Xen ¡ • 2003: ¡academic ¡paper ¡ ¡ – “Xen ¡and ¡the ¡Art ¡of ¡VirtualizaEon” ¡ • ParavirtualizaEon ¡ Control – Hypercalls ¡vs ¡system ¡ ¡ User User User Plane Software Software Software Software ¡ ¡ ¡ ¡calls ¡ GuestOS GuestOS GuestOS GuestOS – Modified ¡guest ¡OS ¡ (XenoLinux) (XenoLinux) (XenoBSD) (XenoXP) Xeno-Aware Xeno-Aware Xeno-Aware Xeno-Aware Device Drivers Device Drivers Device Drivers Device Drivers • Why? ¡ X Domain0 virtual virtual virtual virtual E control x86 CPU phy mem network blockdev interface N H/W (SMP x86, phy mem, enet, SCSI/IDE)
VMWare ¡
Example ¡VM ¡Use ¡Cases ¡ • Legacy ¡support ¡(e.g., ¡VM/370) ¡ • Development ¡ • Server ¡consolidaEon ¡ • Cloud ¡compuEng ¡Infrastructure-‑as-‑a-‑Service ¡ • Sandboxing ¡/ ¡containment ¡
Study ¡of ¡malware ¡ • Researchers ¡use ¡VMs ¡to ¡study ¡ malware ¡ P1 ¡ P2 ¡ P1 ¡ P2 ¡ • Example ¡of ¡VM ¡sandboxing ¡ OS1 ¡ OS2 ¡ – Hypervisor ¡must ¡contain ¡ malicious ¡code ¡ Hypervisor ¡ • IntrospecEon ¡ Hardware ¡ • How ¡would ¡you ¡evade ¡analysis ¡ as ¡a ¡malware ¡writer? ¡ – split ¡personaliEes ¡
VMM ¡Transparency ¡ A ¡ B ¡ P1 ¡ P2 ¡ Adversary ¡ P1 ¡ P2 ¡ P1 ¡ P2 ¡ controlled ¡ OS1 ¡ OS1 ¡ OS1 ¡ VMM ¡ Hardware ¡ Is ¡this ¡opEon ¡ ??? ¡ A ¡or ¡B? ¡ Hardware ¡ • Adversary ¡can ¡detect ¡if: ¡ Garfinkel ¡et ¡al. ¡ – ParavirtualizaEon ¡ “CompaEbility ¡ is ¡not ¡transparency: ¡ – Logical ¡discrepancies ¡ ¡ VMM ¡DetecEon ¡ Myths ¡and ¡Reality” ¡ • Expected ¡CPU ¡behavior ¡vs ¡virtualized ¡ ¡ • Red ¡pill ¡(Store ¡Interrupt ¡Descriptor ¡Table ¡instr) ¡ – Timing ¡discrepancies ¡ • Slower ¡use ¡of ¡some ¡resources ¡
DetecEon ¡of ¡VMWare ¡ MOV ¡EAX,564D5868 ¡ <-‑-‑ ¡"VMXh" ¡ ¡ IN ¡instrucEon ¡used ¡by ¡VMWare ¡ MOV ¡EBX,0 ¡ ¡ to ¡facilitate ¡host-‑to-‑guest ¡ ¡ communicaEon ¡ MOV ¡ECX,0A ¡ ¡ MOV ¡EDX,5658 ¡ <-‑-‑ ¡"VX" ¡ VMWare: ¡ IN ¡EAX,DX ¡ <-‑-‑ ¡Check ¡for ¡VMWare ¡ ¡ ¡places ¡VMXh ¡in ¡EBX ¡ CMP ¡EBX,564D5868 ¡ Physical: ¡ ¡processor ¡excepEon ¡ From ¡ ¡ h9p://handlers.sans.org/tliston/ThwarEngVMDetecEon_Liston_Skoudis.pdf ¡
Server ¡consolidaEon ¡ • ConsolidaEon ¡ P1 ¡ P2 ¡ P1 ¡ P2 ¡ P1 ¡ P2 ¡ – Use ¡VMs ¡to ¡opEmize ¡use ¡of ¡ OS1 ¡ OS2 ¡ OS2 ¡ hardware ¡ – Pack ¡as ¡many ¡VMs ¡onto ¡each ¡ Hypervisor ¡ server ¡as ¡possible ¡ Hardware ¡ – Turn ¡off ¡other ¡servers ¡ • Threat ¡model? ¡ – IsolaEon ¡ – Containment ¡ – Assume ¡guests ¡are/can ¡be ¡compromised ¡
ViolaEng ¡isolaEon ¡ • Covert ¡channels ¡between ¡VMs ¡ P1 ¡ P2 ¡ P1 ¡ P2 ¡ – Illicit ¡communicaEons ¡ OS1 ¡ OS2 ¡ – Hard ¡drives ¡ Hypervisor ¡ – Exploits ¡against ¡VMM ¡ Hardware ¡
Isolation? h9p://handlers.sans.org/tliston/ThwarEngVMDetecEon_Liston_Skoudis.pdf ¡
ViolaEng ¡isolaEon ¡ • Covert ¡channels ¡between ¡VMs ¡ P1 ¡ P2 ¡ P1 ¡ P2 ¡ – Illicit ¡communicaEons ¡ OS1 ¡ OS2 ¡ – Hard ¡drives ¡ Hypervisor ¡ – Exploits ¡against ¡VMM ¡ • DegradaEon-‑of-‑Service ¡a9acks ¡ Hardware ¡ – Guests ¡might ¡maliciously ¡contend ¡ for ¡resources ¡ – Xen ¡scheduler ¡vulnerability ¡
ViolaEng ¡containment ¡ • Escape-‑from-‑VM ¡ P1 ¡ P2 ¡ P1 ¡ P2 ¡ – Vulnerability ¡in ¡VMM ¡or ¡host ¡OS ¡ OS1 ¡ OS2 ¡ (e.g., ¡Dom0) ¡ – Seemingly ¡rare, ¡but ¡exist ¡ Hypervisor ¡ Hardware ¡
ViolaEng ¡containment ¡ • Escape-‑from-‑VM ¡ P1 ¡ P2 ¡ P1 ¡ P2 ¡ – Vulnerability ¡in ¡VMM ¡or ¡host ¡OS ¡ OS1 ¡ OS2 ¡ (e.g., ¡Dom0) ¡ – Seemingly ¡rare, ¡but ¡exist ¡ Hypervisor ¡ • Side ¡channels ¡ Hardware ¡ – Spy ¡on ¡other ¡guest ¡via ¡shared ¡ resources ¡
Cross-‑VM ¡side ¡channels ¡using ¡CPU ¡cache ¡contenEon ¡ A9acker ¡VM ¡ Main ¡ ¡ memory ¡ VicEm ¡VM ¡ CPU ¡data ¡cache ¡ 1) ¡Read ¡in ¡a ¡large ¡array ¡(fill ¡CPU ¡cache ¡with ¡a9acker ¡data) ¡ 2) ¡Busy ¡loop ¡(allow ¡vicEm ¡to ¡run) ¡ 3) ¡Measure ¡Eme ¡to ¡read ¡large ¡array ¡ ¡(the ¡load ¡measurement) ¡ Memory ¡bus, ¡Hard ¡disk, ¡i-‑Cache, ¡ ¡ What ¡else ¡is ¡shared? ¡ CPU ¡registers, ¡NIC, ¡Hypervisor ¡itself, ¡… ¡ ¡ ¡ ¡
Lessons ¡ • Don’t ¡count ¡on: ¡ – VMM ¡transparency ¡ – Strong ¡isolaEon ¡(side ¡channels ¡exist) ¡ • Don’t ¡rely ¡on: ¡ – Containment ¡ • Securing ¡guest ¡OS ¡and ¡host ¡OS ¡sEll ¡very ¡ important ¡
Virtual ¡Machine ¡Management ¡ • Snapshots ¡ – Volume ¡snapshot ¡/ ¡checkpoint ¡ ¡ • persistent ¡storage ¡of ¡VM ¡ • must ¡boot ¡from ¡storage ¡when ¡resuming ¡snapshot ¡ – Full ¡snapshot ¡ • persistent ¡storage ¡and ¡ephemeral ¡storage ¡(memory, ¡ register ¡states, ¡caches, ¡etc.) ¡ • start/resume ¡in ¡between ¡(essenEally) ¡arbitrary ¡ instrucEons ¡ • VM ¡image ¡is ¡a ¡file ¡that ¡stores ¡a ¡snapshot ¡
Virtual ¡machines ¡and ¡secure ¡browsing ¡ “ Protect ¡Against ¡Adware ¡and ¡Spyware: ¡Users ¡protect ¡their ¡PCs ¡against ¡adware, ¡ spyware ¡and ¡other ¡malware ¡while ¡browsing ¡the ¡Internet ¡with ¡Firefox ¡in ¡a ¡virtual ¡ machine.” ¡ [h9p://www.vmware.com/company/news/releases/player.html] ¡ h9p://www.freesoqware.com/ ¡ browser ¡exploit ¡ Clean ¡ ¡ Virtual ¡machine ¡compromised, ¡but ¡not ¡host ¡OS ¡ snapshot ¡ ¡ of ¡VM ¡with ¡ ¡ browser ¡ ¡ running ¡ Reserng ¡to ¡snapshot ¡removes ¡malware ¡
Recommend
More recommend