virtualizaeon cs642 computer security

VirtualizaEon CS642: Computer Security Professor - PowerPoint PPT Presentation

VirtualizaEon CS642: Computer Security Professor Ristenpart h9p://www.cs.wisc.edu/~rist/ rist at cs dot wisc dot edu University of Wisconsin CS 642


  1. VirtualizaEon ¡ CS642: ¡ ¡ Computer ¡Security ¡ Professor ¡Ristenpart ¡ h9p://www.cs.wisc.edu/~rist/ ¡ rist ¡at ¡cs ¡dot ¡wisc ¡dot ¡edu ¡ University ¡of ¡Wisconsin ¡CS ¡642 ¡

  2. VirtualizaEon ¡and ¡cloud ¡security ¡ VMs ¡ Cloud ¡compuEng ¡paradigms ¡ VM ¡image ¡security ¡issues ¡ VM ¡IntrospecEon ¡ IntrospecEon ¡ University ¡of ¡Wisconsin ¡CS ¡642 ¡

  3. 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 ¡

  4. 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 ¡

  5. 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 ¡

  6. Xen ¡ • 2003: ¡academic ¡paper ¡ ¡ – “Xen ¡and ¡the ¡Art ¡of ¡VirtualizaEon” ¡ • ParavirtualizaEon ¡ – Hypercalls ¡vs ¡system ¡ ¡ Control User User User Plane Software Software Software ¡ ¡ ¡ ¡calls ¡ Software – Modified ¡guest ¡OS ¡ GuestOS GuestOS GuestOS GuestOS (XenoLinux) (XenoLinux) (XenoBSD) (XenoXP) – Each ¡guest ¡given ¡ ¡ Xeno-Aware Xeno-Aware Xeno-Aware Xeno-Aware Device Drivers Device Drivers Device Drivers Device Drivers ¡ ¡ ¡1 ¡or ¡more ¡ ¡VCPUs ¡ X Domain0 virtual virtual virtual virtual E control x86 CPU phy mem network blockdev interface N • Why? ¡ H/W (SMP x86, phy mem, enet, SCSI/IDE)

  7. Other ¡VM ¡soluEons ¡ • VMWare ¡ • Virtual ¡Box ¡ • KVM ¡

  8. Example ¡VM ¡Use ¡Cases ¡ • Legacy ¡support ¡(e.g., ¡VM/370) ¡ • Development ¡ • Server ¡consolidaEon ¡ • Cloud ¡compuEng ¡Infrastructure-­‑as-­‑a-­‑Service ¡ • Sandboxing ¡/ ¡containment ¡

  9. 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 ¡

  10. 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 ¡

  11. 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 ¡

  12. 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? ¡ – Containment ¡ – IsolaEon ¡ – Assume ¡guests ¡are/can ¡be ¡compromised ¡

  13. 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 ¡

  14. ViolaEng ¡isolaEon ¡ • Covert ¡channels ¡between ¡VMs ¡ P1 ¡ P2 ¡ P1 ¡ P2 ¡ circumvent ¡access ¡controls ¡ OS1 ¡ OS2 ¡ – Bugs ¡in ¡VMM ¡ Hypervisor ¡ – Side-­‑effects ¡of ¡resource ¡usage ¡ Hardware ¡

  15. Isolation? h9p://handlers.sans.org/tliston/ThwarEngVMDetecEon_Liston_Skoudis.pdf ¡

  16. ViolaEng ¡isolaEon ¡ • Covert ¡channels ¡between ¡VMs ¡ P1 ¡ P2 ¡ P1 ¡ P2 ¡ circumvent ¡access ¡controls ¡ OS1 ¡ OS2 ¡ – Bugs ¡in ¡VMM ¡ Hypervisor ¡ – Side-­‑effects ¡of ¡resource ¡usage ¡ • DegradaEon-­‑of-­‑Service ¡a9acks ¡ Hardware ¡ – Guests ¡might ¡maliciously ¡contend ¡ for ¡resources ¡ – Xen ¡scheduler ¡vulnerability ¡

  17. ¡Measuring ¡Resource ¡ContenEon ¡ • ContenEon ¡for ¡the ¡same ¡resource ¡ 600 ¡ Performance ¡Degrada>on ¡(%) ¡ Local ¡Xen ¡Testbed ¡ 500 ¡ Machine ¡ Intel ¡Xeon ¡E5430, ¡ 2.66 ¡Ghz ¡ 400 ¡ Packages ¡ 2, ¡2 ¡cores ¡per ¡ package ¡ 300 ¡ LLC ¡Size ¡ 6MB ¡per ¡package ¡ 200 ¡ 100 ¡ 0 ¡ CPU ¡ Net ¡ Disk ¡ Memory ¡ Cache ¡ 19 ¡

  18. ViolaEng ¡isolaEon ¡ • Covert ¡channels ¡between ¡VMs ¡ P1 ¡ P2 ¡ P1 ¡ P2 ¡ circumvent ¡access ¡controls ¡ – Bugs ¡in ¡VMM ¡ OS1 ¡ OS2 ¡ – Side-­‑effects ¡of ¡resource ¡usage ¡ Hypervisor ¡ • DegradaEon-­‑of-­‑Service ¡a9acks ¡ Hardware ¡ – Guests ¡might ¡maliciously ¡contend ¡ for ¡resources ¡ – Xen ¡scheduler ¡vulnerability ¡ • Side ¡channels ¡ – Spy ¡on ¡other ¡guest ¡via ¡shared ¡ resources ¡

  19. Square-­‑and-­‑Mul>ply ¡ /* ¡y ¡= ¡x e ¡mod ¡N ¡, ¡from ¡ libgcrypt */ ¡ Modular ¡Exponen>a>on ¡(x, ¡e, ¡N): ¡ ¡let ¡e n ¡… ¡e 1 ¡be ¡the ¡bits ¡of ¡e ¡ ¡y ¡← ¡1 ¡ e i ¡ = ¡1 ¡→ ¡SRMR ¡ ¡for ¡e i ¡in ¡{e n ¡…e 1 } ¡ e i ¡ = ¡0 ¡→ ¡SR ¡ ¡ ¡y ¡← ¡ Square (y) ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ (S) ¡ ¡ ¡y ¡← ¡ Reduce (y, ¡N) ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ (R) ¡ ¡ ¡if ¡ ¡e i ¡= ¡1 ¡then ¡ ¡ ¡ ¡ ¡y ¡← ¡ Mul> (y, ¡x) ¡ ¡ ¡ ¡ ¡ ¡ ¡ (M) ¡ ¡ ¡ ¡y ¡← ¡ Reduce (y, ¡N) ¡ ¡ ¡ ¡ (R) ¡ ¡ Control ¡flow ¡(sequence ¡of ¡instrucEons ¡used) ¡leaks ¡secret ¡

  20. Xen ¡core ¡scheduling ¡ Xen ¡core ¡scheduler ¡determines ¡ the ¡VCPU ¡to ¡CPU ¡core ¡assignment ¡ VM ¡ VM ¡ ¡ Typical ¡configuraEon: ¡ VCPUs ¡of ¡different ¡VMs ¡will ¡osen ¡ Eme-­‑share ¡a ¡core, ¡assignment ¡ AWacker ¡ Vic>m ¡ changes ¡over ¡Eme ¡ Virtualiza>on ¡(Xen) ¡ L1 ¡ L1 ¡ L1 ¡ L1 ¡ I-­‑Cache ¡ I-­‑Cache ¡ I-­‑Cache ¡ I-­‑Cache ¡

  21. Time-­‑sharing ¡a ¡core ¡ VM/VCPU ¡ VM/VCPU ¡ Idea ¡will ¡be ¡to ¡snoop ¡on ¡ the ¡I-­‑cache ¡usage ¡every ¡ ¡ Eme ¡the ¡a9acker ¡gets ¡ to ¡run ¡ AWacker ¡ Vic>m ¡ L1 ¡ I-­‑Cache ¡ Time ¡ 30ms ¡ 30ms ¡

  22. Prime-­‑Probe ¡Protocol ¡ PRIME ¡ Runs ¡square ¡op ¡ PROBE ¡ Time ¡ Vector ¡of ¡cache ¡set ¡ Emings, ¡biased ¡by ¡ ¡ cache ¡usage ¡of ¡vicEm ¡ 4-­‑way ¡set ¡associa>ve ¡ Cache ¡Set ¡ L1 ¡I-­‑Cache ¡

Recommend


More recommend