32
Performance Implications of Anti- Virus Execution on a Virtual Platform Derek Uluski Micha Moffie David Kaeli Institute for Information Assurance @ NU

Performance Implications of Anti- Virus Execution on a ... · mov edx, dword ptr 0xb0[ebp] inc ecx add eax, 0xc cmp ecx, edx mov dword ptr 0xd4[ebp], ecx jl 0xf45cc81a PC-Cillin mov

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Performance Implications of Anti- Virus Execution on a ... · mov edx, dword ptr 0xb0[ebp] inc ecx add eax, 0xc cmp ecx, edx mov dword ptr 0xd4[ebp], ecx jl 0xf45cc81a PC-Cillin mov

Performance Implications of Anti-Virus Execution on a Virtual Platform

Derek UluskiMicha MoffieDavid Kaeli

Institute for Information Assurance @ NU

Page 2: Performance Implications of Anti- Virus Execution on a ... · mov edx, dword ptr 0xb0[ebp] inc ecx add eax, 0xc cmp ecx, edx mov dword ptr 0xd4[ebp], ecx jl 0xf45cc81a PC-Cillin mov

Institute for Information Assurance @ NU

Anti-Virus Security MechanismsSignature Matching

Program will refer to a dictionary of “signatures” or sequences of code known to be part of a malicious fileIf a signature is found in the file in question, it is marked as a virusDisadvantages:

Requires continuous updatesCannot detect “zero-day attacks”

HeuristicsSet of rules that program will apply to detection mechanism

For example, if the file contains self-modifying codeIf the file in question violates any of the given rules, it is marked as a virusDisadvantages:

Generates false positives

Page 3: Performance Implications of Anti- Virus Execution on a ... · mov edx, dword ptr 0xb0[ebp] inc ecx add eax, 0xc cmp ecx, edx mov dword ptr 0xd4[ebp], ecx jl 0xf45cc81a PC-Cillin mov

Institute for Information Assurance @ NU

Anti-Virus Security Mechanisms

SandboxingProgram will emulate the operating system environmentMonitor and analyze program executionAfter completed, the resulting environment is analyzed for changes indicating the presence of a virusDisadvantages:

Consumes significant amount of resourcesConsequently, cannot be run “on-access”

Page 4: Performance Implications of Anti- Virus Execution on a ... · mov edx, dword ptr 0xb0[ebp] inc ecx add eax, 0xc cmp ecx, edx mov dword ptr 0xd4[ebp], ecx jl 0xf45cc81a PC-Cillin mov

Institute for Information Assurance @ NU

A/V Characterization StudiesAVTest.org 2002 Windows XP Test

System Degradation, copying a file (based on time trial – relative time increase consumed compared to copy without anti-virus software present)

F-Prot: 54%Norton: 118%McAfee: 77%PC-Cillin: 34%Kaspersky: 116%AntiVir PE: 51%

Page 5: Performance Implications of Anti- Virus Execution on a ... · mov edx, dword ptr 0xb0[ebp] inc ecx add eax, 0xc cmp ecx, edx mov dword ptr 0xd4[ebp], ecx jl 0xf45cc81a PC-Cillin mov

Institute for Information Assurance @ NU

A/V Characterization Studies

Colby-Sawyer College AV software comparison study

Included accuracy results from virus bulletin

Package Memory Consumed While Idle (MB)

Panda 55.5

F-Secure 31.5

Etrust 31

McAfee 31

PC-Cillin 28

RAV 26.5

Norman 26

Kaspersky 23.5

Norton 23

Bit Defender 17

Nod32 13.5

F-Prot 7

Page 6: Performance Implications of Anti- Virus Execution on a ... · mov edx, dword ptr 0xb0[ebp] inc ecx add eax, 0xc cmp ecx, edx mov dword ptr 0xd4[ebp], ecx jl 0xf45cc81a PC-Cillin mov

Institute for Information Assurance @ NU

MotivationCopy/Execution of “Hello, world” Application

0

5

10

15

20

25

30

35

40

Base Cillin F-Prot McAfee Norton

# D

ynam

ic In

stru

ctio

ns (M

illio

ns)

Copy (total)

Copy (Freq. AV code)

Execute (total)

Execute (Freq. AV code)

Page 7: Performance Implications of Anti- Virus Execution on a ... · mov edx, dword ptr 0xb0[ebp] inc ecx add eax, 0xc cmp ecx, edx mov dword ptr 0xd4[ebp], ecx jl 0xf45cc81a PC-Cillin mov

Institute for Information Assurance @ NU

Outline

IntroductionExperimentation MethodologyPerformance DegradationVirtualization Layer ProposalConclusions

Page 8: Performance Implications of Anti- Virus Execution on a ... · mov edx, dword ptr 0xb0[ebp] inc ecx add eax, 0xc cmp ecx, edx mov dword ptr 0xd4[ebp], ecx jl 0xf45cc81a PC-Cillin mov

Institute for Information Assurance @ NU

IntroductionAV software execution degrades application performance

Why?Files need to be scanned for specific sequences

instruction sequences in a executable binaryVB code sequences in Office documents

Not only generates many extra instructions, but also places pressure on the memory systemOn access vs. on demand

Page 9: Performance Implications of Anti- Virus Execution on a ... · mov edx, dword ptr 0xb0[ebp] inc ecx add eax, 0xc cmp ecx, edx mov dword ptr 0xd4[ebp], ecx jl 0xf45cc81a PC-Cillin mov

Institute for Information Assurance @ NU

Experimentation Methodology

256 MBMemory

512 KBL2 Cache

8 KBL1 Data Cache

12 KBL1 Ins. Cache

2 GHzOperating Frequency

Intel Pentium 4 2.0A

ProcessorVirtutech Simics

Architecture simulator for uniprocessor and multiprocessor machinesSystem-level instruction set simulator

Models interfaces to buses, interrupt controllers, disks, and video controllersModels in-order CPU instruction execution

Architectural Model

Page 10: Performance Implications of Anti- Virus Execution on a ... · mov edx, dword ptr 0xb0[ebp] inc ecx add eax, 0xc cmp ecx, edx mov dword ptr 0xd4[ebp], ecx jl 0xf45cc81a PC-Cillin mov

Institute for Information Assurance @ NU

Experimentation Methodology

Dell Precision 650 P4 Xeon (Host)

WinXP

Copy/ExecuteProcess

AntiVirusProcess

Simulated Micro-architecture

L2 cache

L1 instcache

L1 datacache

Inst stream

Simulated architecture(Dredd)

Simics Simulation Environment

Page 11: Performance Implications of Anti- Virus Execution on a ... · mov edx, dword ptr 0xb0[ebp] inc ecx add eax, 0xc cmp ecx, edx mov dword ptr 0xd4[ebp], ecx jl 0xf45cc81a PC-Cillin mov

Institute for Information Assurance @ NU

Experimentation MethodologyMethodology

MagicBreakpoint

On-Access Scanning Execution Program Execution

Begin Tracing

MagicBreakpoint

End Tracing

Tracing Progress

Page 12: Performance Implications of Anti- Virus Execution on a ... · mov edx, dword ptr 0xb0[ebp] inc ecx add eax, 0xc cmp ecx, edx mov dword ptr 0xd4[ebp], ecx jl 0xf45cc81a PC-Cillin mov

Institute for Information Assurance @ NU

Experimentation MethodologyCustom Tracing Tools

Print-instruction: sequentially decoded instructionsVa-profile: frequency of each virtual address accessedInst-mix: frequency of decoded instructionsPrint-data: sequentially accessed data addressesData-pattern: starting address with linear data accessesTimer: executed instruction counterOpcode: sequential VA and instruction opcodePid-Trace: Same as opcode with PID tagData-access: number of memory transactions resulting from the execution of an instruction @ given virtual address

Page 13: Performance Implications of Anti- Virus Execution on a ... · mov edx, dword ptr 0xb0[ebp] inc ecx add eax, 0xc cmp ecx, edx mov dword ptr 0xd4[ebp], ecx jl 0xf45cc81a PC-Cillin mov

Institute for Information Assurance @ NU

Example

Postprocessing: Determining Hot codeCollect frequencies of virtual addresses (using va-profile tool) and examine potential blocks

In given example, we see 3 different instruction sequences that may be hot codeNote: high virtual addresses help to identify DLL or system service

VA Freq.0xf6a13e00 949270xf6a13dfd 949270xf6a13df9 949270xf6a13df7 949270xf6a13df5 949270xf6a13df3 949270xf6a13df0 949270xf6a13de9 949270xf6a13de6 949270xf6a0ee2c 942550xf6a0ee29 942550xf6a0ee27 942550xf6a0ee24 942550xf6a0ee36 942360xf6a0ee33 942360xf6a0ee31 942360xf6a0ee2e 94236

Page 14: Performance Implications of Anti- Virus Execution on a ... · mov edx, dword ptr 0xb0[ebp] inc ecx add eax, 0xc cmp ecx, edx mov dword ptr 0xd4[ebp], ecx jl 0xf45cc81a PC-Cillin mov

Institute for Information Assurance @ NU

Example

Drill-DownTake a closer look at potential block by using breakpoints and trace module

Page 15: Performance Implications of Anti- Virus Execution on a ... · mov edx, dword ptr 0xb0[ebp] inc ecx add eax, 0xc cmp ecx, edx mov dword ptr 0xd4[ebp], ecx jl 0xf45cc81a PC-Cillin mov

Institute for Information Assurance @ NU

Example

VerificationProcedure

Verify sequence of code originates from Anti-Virus Binary

Repeat search and verification process for all significant possibilities for basic blocks

This process is done to ensure that the data collected is from the anti-virus software package and not from external execution streams (such as operating system)

Page 16: Performance Implications of Anti- Virus Execution on a ... · mov edx, dword ptr 0xb0[ebp] inc ecx add eax, 0xc cmp ecx, edx mov dword ptr 0xd4[ebp], ecx jl 0xf45cc81a PC-Cillin mov

Institute for Information Assurance @ NU

Experimentation Methodology Anti-Virus Software Packages

AV software packages evaluatedTrend Micro PC-Cillin 11.0.0.1253FRisk F-Prot 3.14bMcAFee Anti-Virus 8.0.20Norton Anti-Virus 2004 10.0.0.109

The most prominent packages in the U.S. market at the beginning of 2004

Page 17: Performance Implications of Anti- Virus Execution on a ... · mov edx, dword ptr 0xb0[ebp] inc ecx add eax, 0xc cmp ecx, edx mov dword ptr 0xd4[ebp], ecx jl 0xf45cc81a PC-Cillin mov

Institute for Information Assurance @ NU

Experimentation MethodologyFrequent “Hot” Code Examples

mov edx, dword ptr 0xb0[ebp]inc ecxadd eax, 0xccmp ecx, edxmov dword ptr 0xd4[ebp], ecxjl 0xf45cc81a

PC-Cillinmov exc, dword ptr 0x8[ebp]mov cl, byte ptr[ecx]cmp cl, byte ptr 0xc[ebp]je 0xf76a713

F-Prot

xor edi, edimov ecx dword ptr 0x8[ebp]mov al, byte ptr 0x1[ebx]lea edx,[edi][ecx]mov cl, byte ptr [edi][ecx]cmp al, cljne 0x1203c028

McAfeemovzx edi, aximul edi,dword ptr 0xcfc[edx] mov ebx,dword ptr 0x10[ebp]add edi,ecxcmp ebx,dword ptr [edi]je 0xf6a13e02

Norton

Frequent code exhibits similar structure

Page 18: Performance Implications of Anti- Virus Execution on a ... · mov edx, dword ptr 0xb0[ebp] inc ecx add eax, 0xc cmp ecx, edx mov dword ptr 0xd4[ebp], ecx jl 0xf45cc81a PC-Cillin mov

Institute for Information Assurance @ NU

Anti-virus Execution OverheadSimulated Micro architecture modeling P4 – Relative # cyclescopy (CDROM to disk), executing calc.exe, executing wordpad.exe

0%

50%

100%

150%

200%

250%

300%

350%

400%

450%

Cillin F-Prot McAfee Norton

percent degradation

copycalcwordpad

Page 19: Performance Implications of Anti- Virus Execution on a ... · mov edx, dword ptr 0xb0[ebp] inc ecx add eax, 0xc cmp ecx, edx mov dword ptr 0xd4[ebp], ecx jl 0xf45cc81a PC-Cillin mov

Institute for Information Assurance @ NU

Performance Degradationcopy (CDROM to disk)

0

10

20

30

40

50

60

Base Cillin F-Prot McAfee Norton

# Dynamic Instructions

(Millions)

Non-Frequent AV Code

Frequent AV Code

Copy Process

Page 20: Performance Implications of Anti- Virus Execution on a ... · mov edx, dword ptr 0xb0[ebp] inc ecx add eax, 0xc cmp ecx, edx mov dword ptr 0xd4[ebp], ecx jl 0xf45cc81a PC-Cillin mov

Institute for Information Assurance @ NU

Performance DegradationComparing File Types (Copy file, 128kb)

0

10

20

30

40

50

60

70

.dll .doc .exe .html .jpg .mp3 .sys .xls

Num Dynamic Inst.Millions

File Type (Extension)

Base (total)

Cillin (total)

F-Prot (total)

McAfee (total)

Norton (total)

Page 21: Performance Implications of Anti- Virus Execution on a ... · mov edx, dword ptr 0xb0[ebp] inc ecx add eax, 0xc cmp ecx, edx mov dword ptr 0xd4[ebp], ecx jl 0xf45cc81a PC-Cillin mov

Institute for Information Assurance @ NU

Performance DegradationMemory Implications – Cache Accesses

Wordpad Test Memory Statistics

0

20

40

60

80

100

120

140

160

180

200

Base Cillin F-Prot McAfee Norton

# A

cces

ses

(Mill

ions

)

IC accessesDC accessesL2 accesses

Copy Test Memory Statistics

0

5

10

15

20

25

30

35

40

45

50

Base Cillin F-Prot McAfee Norton

# A

cces

ses

(Mill

ions

)

IC accessesDC accessesL2 accesses

Page 22: Performance Implications of Anti- Virus Execution on a ... · mov edx, dword ptr 0xb0[ebp] inc ecx add eax, 0xc cmp ecx, edx mov dword ptr 0xd4[ebp], ecx jl 0xf45cc81a PC-Cillin mov

Institute for Information Assurance @ NU

Performance DegradationAnti-virus workload impact

PerformanceOn-Access contributes up to 400% overhead

Memory Traffic OverheadIC: ~750%DC:~500%L2: ~350%

Growing Problem: Input data set grows as more viruses are created

Page 23: Performance Implications of Anti- Virus Execution on a ... · mov edx, dword ptr 0xb0[ebp] inc ecx add eax, 0xc cmp ecx, edx mov dword ptr 0xd4[ebp], ecx jl 0xf45cc81a PC-Cillin mov

Institute for Information Assurance @ NU

Performance DegradationPossible Solutions

Independent “AntiVirus Co-Processor”Processor linked to hard disk to perform real-time scanning dutiesAlleviate overhead on instruction basis for main CPU

Memory overhead still existsMemory Controller Enhancement

Designed in a filter modelScan instructions and data as they are fetched

Transparent to userHigh maintenance involved

Time to update hardware

Page 24: Performance Implications of Anti- Virus Execution on a ... · mov edx, dword ptr 0xb0[ebp] inc ecx add eax, 0xc cmp ecx, edx mov dword ptr 0xd4[ebp], ecx jl 0xf45cc81a PC-Cillin mov

Institute for Information Assurance @ NU

Performance DegradationPossible Solutions

x86 ISA EnhancementsAnalysis

Fuse Instruction Example: mov, cmp, jmpCillin: 12.77%F-Prot: 21.2%McAfee: 3.7%Norton: 8.8%

Execute “anti-virus server” scanning mechanism in physical Environment for multiple Virtual Machines

Page 25: Performance Implications of Anti- Virus Execution on a ... · mov edx, dword ptr 0xb0[ebp] inc ecx add eax, 0xc cmp ecx, edx mov dword ptr 0xd4[ebp], ecx jl 0xf45cc81a PC-Cillin mov

Institute for Information Assurance @ NU

Virtualization Layer ProposalProblem Description

Multiple virtual Windows clients need anti-virus protection

Each client will generate it’s own overhead from A/V servicesThis results in more pressure on the physical host

Page 26: Performance Implications of Anti- Virus Execution on a ... · mov edx, dword ptr 0xb0[ebp] inc ecx add eax, 0xc cmp ecx, edx mov dword ptr 0xd4[ebp], ecx jl 0xf45cc81a PC-Cillin mov

Institute for Information Assurance @ NU

Virtualization Layer ProposalProposed Solution

Logically parallel On-Access A/V Scanning

One On-Access process running on the hostCalled whenever

input data passes through the host to a VM (or back)

Network

A (virtual) system call is made to create or read a file

File System

A/V Server Call

A/V Server

Call

A/V

Se r

ver

Cal

l

A/V Server Call

A/V Server Call

Page 27: Performance Implications of Anti- Virus Execution on a ... · mov edx, dword ptr 0xb0[ebp] inc ecx add eax, 0xc cmp ecx, edx mov dword ptr 0xd4[ebp], ecx jl 0xf45cc81a PC-Cillin mov

Institute for Information Assurance @ NU

Virtualization Layer Proposal

One “Host A/V” process would behave similar to a E-Mail A/V Gateway

ESX Server performs data filtration testingImplementation involves signature matchingInvolves only one database of signatures as well as only maintaining a single signature database

Page 28: Performance Implications of Anti- Virus Execution on a ... · mov edx, dword ptr 0xb0[ebp] inc ecx add eax, 0xc cmp ecx, edx mov dword ptr 0xd4[ebp], ecx jl 0xf45cc81a PC-Cillin mov

Institute for Information Assurance @ NU

Virtualization Layer Proposal

ImplementationOn ESX platform, run an internal daemon similar to hostDCommunicate with daemon using VMware tools

VMware tools has similar behavior to real-time a/v scanning processSend data stream for signature matching

System calls to read a fileSystem calls to create a file

Page 29: Performance Implications of Anti- Virus Execution on a ... · mov edx, dword ptr 0xb0[ebp] inc ecx add eax, 0xc cmp ecx, edx mov dword ptr 0xd4[ebp], ecx jl 0xf45cc81a PC-Cillin mov

Institute for Information Assurance @ NU

Virtualization Layer ProposalCommunicate with daemon using VMware tools

Virtual system uses message passing interface to host A/V daemonIf data stream returns positive identification message to VM

VMware tools interrupt the system and alerts the user

Interface to A/V host daemon

Virtual Center control panelAllows updates to signature databaseStatistics: files scanned, viruses found, VM A/V utilization

Page 30: Performance Implications of Anti- Virus Execution on a ... · mov edx, dword ptr 0xb0[ebp] inc ecx add eax, 0xc cmp ecx, edx mov dword ptr 0xd4[ebp], ecx jl 0xf45cc81a PC-Cillin mov

Institute for Information Assurance @ NU

Conclusions

Anti-Virus impactCPU and memory overheadOverhead will only increase

Presents issues for VMsGenerates significant load on the host to manage multiple AV filters

Page 31: Performance Implications of Anti- Virus Execution on a ... · mov edx, dword ptr 0xb0[ebp] inc ecx add eax, 0xc cmp ecx, edx mov dword ptr 0xd4[ebp], ecx jl 0xf45cc81a PC-Cillin mov

Institute for Information Assurance @ NU

Conclusions

Virtualization Layer Anti-VirusAdvantages

Reduce the overhead of invoking all A/V functionality on individual machines

Still will place overhead of accessing data on machines

Consumes less physical system memoryLess software to maintain on VM systems

Page 32: Performance Implications of Anti- Virus Execution on a ... · mov edx, dword ptr 0xb0[ebp] inc ecx add eax, 0xc cmp ecx, edx mov dword ptr 0xd4[ebp], ecx jl 0xf45cc81a PC-Cillin mov

Institute for Information Assurance @ NU

AcknowledgementsThis work was supported by the National Science Foundation award CISE CSA-0310891 and the Institute of Information AssuranceNUCAR Website

http://www.ece.neu.edu/groups/nucar/research/antivirusSecurity Related NUCAR Papers

Dong Ye, Micha Moffie and David Kaeli. A Benchmark Suite for Behavior-Based Security Mechanisms, Proceedings of the Workshop on Software Security Assurance Tools, Techniques, and Metrics (SSATTM '05)Micha Moffie and David Kaeli. ASM: An Application Security Monitor, Proceedings of the Workshop on Binary Instrumentation and Applications (WBIA '05)Dong Ye and David Kaeli. A Reliable Return Address Stack: Microarchitectural Features to Defeat Stack Smashing, Proceedings of the 1st Workshop on Architectural Support for Security and Antivirus(WASSA '04)Derek Uluski, Micha Moffie and David Kaeli. Antivirus Workload Execution, Proceedings of the 1st Workshop on Architectural Support for Security and Antivirus (WASSA '04)