VirtualizaEon CS642: Computer Security Professor - - PowerPoint PPT Presentation

virtualizaeon cs642 computer security
SMART_READER_LITE
LIVE PREVIEW

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


slide-1
SLIDE 1

CS642: ¡ ¡ Computer ¡Security ¡

Professor ¡Ristenpart ¡ h9p://www.cs.wisc.edu/~rist/ ¡ rist ¡at ¡cs ¡dot ¡wisc ¡dot ¡edu ¡

University ¡of ¡Wisconsin ¡CS ¡642 ¡

VirtualizaEon ¡

slide-2
SLIDE 2

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 ¡

slide-3
SLIDE 3

University ¡of ¡Wisconsin ¡CS ¡642 ¡

VirtualizaEon ¡and ¡cloud ¡security ¡

VM ¡IntrospecEon ¡ VMs ¡ VM ¡image ¡security ¡issues ¡ Cloud ¡compuEng ¡paradigms ¡ IntrospecEon ¡

slide-4
SLIDE 4

VirtualizaEon ¡

Hardware ¡ Hardware ¡ OS ¡ Process ¡1 ¡ Process ¡2 ¡ OS1 ¡ P1 ¡ P2 ¡ Hypervisor ¡ No ¡virtualizaEon ¡ Full ¡virtualizaEon ¡ Hardware ¡ Hypervisor ¡ ParavirtualizaEon ¡ OS2 ¡ P1 ¡ P2 ¡ OS1 ¡ ¡ ¡ P1 ¡ P2 ¡ OS2 ¡ ¡ ¡ P1 ¡ P2 ¡

Drivers ¡ Drivers ¡

Type-­‑1: ¡Hypervisor ¡runs ¡directly ¡on ¡hardware ¡

slide-5
SLIDE 5

VirtualizaEon ¡

Hardware ¡ Hardware ¡ OS ¡ Process ¡1 ¡ Process ¡2 ¡ OS1 ¡ P1 ¡ P2 ¡ Hypervisor ¡ No ¡virtualizaEon ¡ Full ¡virtualizaEon ¡ Hardware ¡ Hypervisor ¡ ParavirtualizaEon ¡ OS2 ¡ P1 ¡ P2 ¡ OS1 ¡ ¡ ¡ P1 ¡ P2 ¡ OS2 ¡ ¡ ¡ P1 ¡ P2 ¡

Drivers ¡ Drivers ¡

Host ¡OS ¡

Type-­‑1: ¡Hypervisor ¡runs ¡directly ¡on ¡hardware ¡ Type-­‑2: ¡Hypervisor ¡runs ¡on ¡host ¡OS ¡

slide-6
SLIDE 6

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 ¡

slide-7
SLIDE 7

Xen ¡

  • 2003: ¡academic ¡paper ¡ ¡

– “Xen ¡and ¡the ¡Art ¡of ¡VirtualizaEon” ¡

  • ParavirtualizaEon ¡

– Hypercalls ¡vs ¡system ¡ ¡ ¡ ¡ ¡ ¡calls ¡ – Modified ¡guest ¡OS ¡

  • Why? ¡

X E N H/W (SMP x86, phy mem, enet, SCSI/IDE)

virtual network virtual blockdev virtual x86 CPU virtual phy mem

Control Plane Software

GuestOS

(XenoLinux)

GuestOS

(XenoBSD)

GuestOS

(XenoXP)

User Software User Software User Software

GuestOS

(XenoLinux)

Xeno-Aware Device Drivers Xeno-Aware Device Drivers Xeno-Aware Device Drivers Xeno-Aware Device Drivers

Domain0 control interface

slide-8
SLIDE 8

VMWare ¡

slide-9
SLIDE 9

Example ¡VM ¡Use ¡Cases ¡

  • Legacy ¡support ¡(e.g., ¡VM/370) ¡
  • Development ¡
  • Server ¡consolidaEon ¡
  • Cloud ¡compuEng ¡Infrastructure-­‑as-­‑a-­‑Service ¡
  • Sandboxing ¡/ ¡containment ¡
slide-10
SLIDE 10

Study ¡of ¡malware ¡

  • Researchers ¡use ¡VMs ¡to ¡study ¡

malware ¡

  • Example ¡of ¡VM ¡sandboxing ¡

– Hypervisor ¡must ¡contain ¡ malicious ¡code ¡

  • IntrospecEon ¡
  • How ¡would ¡you ¡evade ¡analysis ¡

as ¡a ¡malware ¡writer? ¡

– split ¡personaliEes ¡

Hardware ¡ OS1 ¡ P1 ¡ P2 ¡ Hypervisor ¡ OS2 ¡ P1 ¡ P2 ¡

slide-11
SLIDE 11

VMM ¡Transparency ¡

  • Adversary ¡can ¡detect ¡if: ¡

– ParavirtualizaEon ¡ – Logical ¡discrepancies ¡ ¡

  • Expected ¡CPU ¡behavior ¡vs ¡virtualized ¡ ¡
  • Red ¡pill ¡(Store ¡Interrupt ¡Descriptor ¡Table ¡instr) ¡

– Timing ¡discrepancies ¡

  • Slower ¡use ¡of ¡some ¡resources ¡

Hardware ¡ OS1 ¡ P1 ¡ P2 ¡ Hardware ¡ OS1 ¡ P1 ¡ P2 ¡ VMM ¡ A ¡ B ¡ Garfinkel ¡et ¡al. ¡ “CompaEbility ¡ is ¡not ¡transparency: ¡ VMM ¡DetecEon ¡ Myths ¡and ¡Reality” ¡ OS1 ¡ P1 ¡ P2 ¡ ??? ¡ Adversary ¡ controlled ¡ Is ¡this ¡opEon ¡ A ¡or ¡B? ¡

slide-12
SLIDE 12

DetecEon ¡of ¡VMWare ¡

MOV ¡EAX,564D5868 ¡<-­‑-­‑ ¡"VMXh" ¡ ¡ MOV ¡EBX,0 ¡ ¡ MOV ¡ECX,0A ¡ ¡ MOV ¡EDX,5658 ¡<-­‑-­‑ ¡"VX" ¡ IN ¡EAX,DX ¡<-­‑-­‑ ¡Check ¡for ¡VMWare ¡ ¡ CMP ¡EBX,564D5868 ¡

From ¡ ¡ h9p://handlers.sans.org/tliston/ThwarEngVMDetecEon_Liston_Skoudis.pdf ¡

IN ¡instrucEon ¡used ¡by ¡VMWare ¡ to ¡facilitate ¡host-­‑to-­‑guest ¡ ¡ communicaEon ¡ VMWare: ¡ ¡places ¡VMXh ¡in ¡EBX ¡ Physical: ¡ ¡processor ¡excepEon ¡

slide-13
SLIDE 13

Server ¡consolidaEon ¡

  • ConsolidaEon ¡

– Use ¡VMs ¡to ¡opEmize ¡use ¡of ¡ hardware ¡ – Pack ¡as ¡many ¡VMs ¡onto ¡each ¡ server ¡as ¡possible ¡ – Turn ¡off ¡other ¡servers ¡

Hardware ¡ OS1 ¡ P1 ¡ P2 ¡ Hypervisor ¡ OS2 ¡ P1 ¡ P2 ¡

  • Threat ¡model? ¡

– IsolaEon ¡ – Containment ¡ – Assume ¡guests ¡are/can ¡be ¡compromised ¡

OS2 ¡ P1 ¡ P2 ¡

slide-14
SLIDE 14

ViolaEng ¡isolaEon ¡

  • Covert ¡channels ¡between ¡VMs ¡

– Illicit ¡communicaEons ¡ – Hard ¡drives ¡ – Exploits ¡against ¡VMM ¡

Hardware ¡ OS1 ¡ P1 ¡ P2 ¡ Hypervisor ¡ OS2 ¡ P1 ¡ P2 ¡

slide-15
SLIDE 15

h9p://handlers.sans.org/tliston/ThwarEngVMDetecEon_Liston_Skoudis.pdf ¡

Isolation?

slide-16
SLIDE 16

ViolaEng ¡isolaEon ¡

  • Covert ¡channels ¡between ¡VMs ¡

– Illicit ¡communicaEons ¡ – Hard ¡drives ¡ – Exploits ¡against ¡VMM ¡

  • DegradaEon-­‑of-­‑Service ¡a9acks ¡

– Guests ¡might ¡maliciously ¡contend ¡ for ¡resources ¡ – Xen ¡scheduler ¡vulnerability ¡

Hardware ¡ OS1 ¡ P1 ¡ P2 ¡ Hypervisor ¡ OS2 ¡ P1 ¡ P2 ¡

slide-17
SLIDE 17

ViolaEng ¡containment ¡

  • Escape-­‑from-­‑VM ¡

– Vulnerability ¡in ¡VMM ¡or ¡host ¡OS ¡ (e.g., ¡Dom0) ¡ – Seemingly ¡rare, ¡but ¡exist ¡

Hardware ¡ OS1 ¡ P1 ¡ P2 ¡ Hypervisor ¡ OS2 ¡ P1 ¡ P2 ¡

slide-18
SLIDE 18

ViolaEng ¡containment ¡

  • Escape-­‑from-­‑VM ¡

– Vulnerability ¡in ¡VMM ¡or ¡host ¡OS ¡ (e.g., ¡Dom0) ¡ – Seemingly ¡rare, ¡but ¡exist ¡

  • Side ¡channels ¡

– Spy ¡on ¡other ¡guest ¡via ¡shared ¡ resources ¡

Hardware ¡ OS1 ¡ P1 ¡ P2 ¡ Hypervisor ¡ OS2 ¡ P1 ¡ P2 ¡

slide-19
SLIDE 19

Cross-­‑VM ¡side ¡channels ¡using ¡CPU ¡cache ¡contenEon ¡

A9acker ¡VM ¡ VicEm ¡VM ¡ Main ¡ ¡ memory ¡ 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) ¡

What ¡else ¡is ¡shared? ¡ Memory ¡bus, ¡Hard ¡disk, ¡i-­‑Cache, ¡ ¡ CPU ¡registers, ¡NIC, ¡Hypervisor ¡itself, ¡… ¡ ¡ ¡ ¡

slide-20
SLIDE 20

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 ¡

slide-21
SLIDE 21

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 ¡
slide-22
SLIDE 22

“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 ¡ Virtual ¡machine ¡compromised, ¡but ¡not ¡host ¡OS ¡ Reserng ¡to ¡snapshot ¡removes ¡malware ¡ Clean ¡ ¡ snapshot ¡ ¡

  • f ¡VM ¡with ¡ ¡

browser ¡ ¡ running ¡

Virtual ¡machines ¡and ¡secure ¡browsing ¡

slide-23
SLIDE 23

VM ¡Management ¡issues ¡

  • Reset ¡vulnerabiliEes ¡

– We ¡saw ¡crypto/RNG ¡related ¡vulnerabilites ¡a ¡few ¡ weeks ¡ago ¡(reuse ¡of ¡randomness) ¡ – Guest ¡OS ¡and ¡applicaEon ¡quiescing ¡

  • Lack ¡of ¡diversity ¡ ¡
  • IdenEty ¡management ¡/ ¡credenEals ¡
slide-24
SLIDE 24

Amazon ¡Machine ¡Images ¡(AMIs) ¡

  • Users ¡set ¡up ¡volume ¡snapshots ¡/ ¡checkpoints ¡

that ¡can ¡then ¡be ¡run ¡on ¡the ¡ElasEc ¡Compute ¡ Cloud ¡(EC2) ¡

  • Can ¡be ¡marked ¡as ¡public ¡and ¡anyone ¡can ¡use ¡

your ¡AMI ¡

Storage ¡service ¡

slide-25
SLIDE 25

!"

#$%$& '()&*(&+*&,-./0' 1,)&.23+&, #,4$&,.25*((,6

/(*78)+)

#,)37&)

9$5*7.25*((,6 /0')

:;7$*-.<.=>,53&, 25*( !*&* '()&*(5+*&,./0' ?@,5A.9$B+( ?6,-,(&+*7)

C37(,6*%+7+&8 ?$(D+B36*&+$(

Balduzzi ¡et ¡al. ¡“A ¡Security ¡Analysis ¡of ¡Amazon’s ¡ElasEc ¡ ¡ Compute ¡Cloud ¡Service ¡– ¡Long ¡Version ¡–”, ¡2011 ¡ See ¡also ¡Bugiel ¡et ¡al., ¡“AmazonIA: ¡When ¡ElasEcity ¡Snaps ¡Back”, ¡2011 ¡

5,303 ¡AMIs ¡analyzed ¡(Linux ¡and ¡Windows) ¡

slide-26
SLIDE 26

! " # $ %% %& %# %' "! "" "( ") &! && &# &' &$ *% *& *# *' #% #& ## #' #$ (% (# (' ($ '( '$ )& $! $& $$ %!& %!) %"# ! " #! #" $! $" %!

&'()'*+,-./012,23.4 & ' ( ) ' 5 6 7 4

% ' %& %$ "# &% &' *& *$ ## (% (' '& '$ )# $% $' %!& * %! %( "" ") &* *! *( #" #) (* '! '( )" )) $* %!! ! "! #!! #"! $!! $"! %!! %"!

&'()'*+,-./012,23.4 & ' ( ) ' 5 6 7 4

Linux ¡AMIs ¡

Also: ¡Malware ¡found ¡on ¡a ¡couple ¡AMIs ¡

slide-27
SLIDE 27

Balduzzi ¡et ¡al. ¡analysis ¡

  • Backdoors ¡

– AMIs ¡include ¡SSH ¡public ¡keys ¡within ¡ authorized_keys ¡ – Password-­‑based ¡backdoors ¡

East West EU Asia Total AMIs (%) 34.8 8.4 9.8 6.3 21.8 With Passwd 67 10 22 2 101 With SSH keys 794 53 86 32 965 With Both 71 6 9 4 90 Superuser Priv. 783 57 105 26 971 User Priv. 149 12 12 12 185 Table 2: Left credentials per AMI

slide-28
SLIDE 28

Balduzzi ¡et ¡al. ¡analysis ¡

  • CredenEals ¡for ¡other ¡systems ¡

– AWS ¡secret ¡keys ¡(to ¡control ¡EC2 ¡services ¡of ¡an ¡ account): ¡67 ¡found ¡ – Passwords ¡/ ¡secret ¡keys ¡for ¡other ¡systems: ¡56 ¡ found ¡

Finding Total Image Remote Amazon RDS 4 4 dDNS 1 1 SQL 7 6 1 MySql 58 45 13 WebApp 3 2 1 VNC 1 1 Total 74 54 20 Table 3: Credentials in history files

slide-29
SLIDE 29

Balduzzi ¡et ¡al. ¡analysis ¡

  • Deleted ¡files ¡

– One ¡AMI ¡creaEon ¡method ¡does ¡block-­‑level ¡ copying ¡

Type # Home files (/home, /root) 33,011 Images (min. 800x600) 1,085 Microsoft Office documents 336 Amazon AWS certificates and access keys 293 SSH private keys 232 PGP/GPG private keys 151 PDF documents 141 Password file (/etc/shadow) 106 Table 5: Recovered data from deleted files

slide-30
SLIDE 30

Response ¡

“They ¡told ¡me ¡it’s ¡not ¡their ¡concern, ¡they ¡just ¡provide ¡ ¡ compuEng ¡power,” ¡Balduzzi ¡says. ¡“It’s ¡like ¡if ¡you ¡upload ¡naked ¡ ¡ pictures ¡to ¡Facebook. ¡It’s ¡not ¡a ¡good ¡pracEce, ¡but ¡it’s ¡not ¡ ¡ Facebook’s ¡problem.” ¡

h9p://www.forbes.com/sites/andygreenberg/2011/11/08/ ¡ researchers-­‑find-­‑amazon-­‑cloud-­‑servers-­‑teeming-­‑with-­‑backdoors-­‑and-­‑other-­‑peoples-­‑data/ ¡

  • Amazon ¡noEfied ¡customers ¡with ¡vulnerable ¡AMIs ¡
  • Made ¡private ¡AMIs ¡of ¡non-­‑responsive ¡customers ¡
  • New ¡tutorials ¡for ¡bundling ¡systems ¡
  • Working ¡on ¡undelete ¡issues… ¡
slide-31
SLIDE 31

Lessons ¡

  • New ¡soqware ¡management ¡pracEces ¡needed ¡

with ¡VM ¡snapshots ¡

  • Discussion: ¡

– New ¡tool ¡support? ¡ ¡ – How ¡much ¡worse ¡is ¡this ¡than ¡non-­‑cloud ¡server ¡ deployments? ¡

  • We ¡have ¡about ¡~1600 ¡AMIs ¡downloaded ¡
  • urselves. ¡Research ¡project ¡ideas? ¡