virtualization in software development and qadownload3.vmware.com/vmworld/2006/dvt0082.pdf ·...

36
Virtualization In Software Development And QA Marcelo Picorelli Quality Assurance Analyst

Upload: others

Post on 10-Aug-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: VIRTUALIZATION IN SOFTWARE DEVELOPMENT AND QAdownload3.vmware.com/vmworld/2006/dvt0082.pdf · Introduction-cont. Exploit code provides an interface that was not intended to exist

Virtualization In Software Development And QA

Marcelo Picorelli

Quality Assurance Analyst

Page 2: VIRTUALIZATION IN SOFTWARE DEVELOPMENT AND QAdownload3.vmware.com/vmworld/2006/dvt0082.pdf · Introduction-cont. Exploit code provides an interface that was not intended to exist

What This Talk is About

It is about why we need to use VMware for our testing processIt is about the problems we found and the solutions we triedIt is not about how you have to do it; it’s just about our own experience

Page 3: VIRTUALIZATION IN SOFTWARE DEVELOPMENT AND QAdownload3.vmware.com/vmworld/2006/dvt0082.pdf · Introduction-cont. Exploit code provides an interface that was not intended to exist

Introduction – Application description

CORE IMPACTThe first automated comprehensive penetration testing productSafely exploits vulnerabilities in your network infrastructure• Targets several popular Operating Systems

• Windows• Linux• Solaris• AIX• OS X• BSD

• and their applicationsExploits allow an attacker to take control of the target systemSystems under our control are used as stepping stones for further pentesting

Page 4: VIRTUALIZATION IN SOFTWARE DEVELOPMENT AND QAdownload3.vmware.com/vmworld/2006/dvt0082.pdf · Introduction-cont. Exploit code provides an interface that was not intended to exist

Introduction-cont.

Exploit code provides an interface that was not intended to exist in thetarget

Prone to functionality and reliabilty problemsMay render the target system unusable

Thorough testing is needed to assess and minimize the risk

Page 5: VIRTUALIZATION IN SOFTWARE DEVELOPMENT AND QAdownload3.vmware.com/vmworld/2006/dvt0082.pdf · Introduction-cont. Exploit code provides an interface that was not intended to exist

Introduction – Testing – three years ago

Manual testingEach exploit is manually tested to guarantee its reliability

Growing number of exploitsDaily tests cannot be performed• Not enough hardware resources

• Small lab• Understaffed, 3 people

Automatic testing is needed

Page 6: VIRTUALIZATION IN SOFTWARE DEVELOPMENT AND QAdownload3.vmware.com/vmworld/2006/dvt0082.pdf · Introduction-cont. Exploit code provides an interface that was not intended to exist

Automatic testing

Testing types:Smoke testRegression testThorough test

Product is tested daily

Page 7: VIRTUALIZATION IN SOFTWARE DEVELOPMENT AND QAdownload3.vmware.com/vmworld/2006/dvt0082.pdf · Introduction-cont. Exploit code provides an interface that was not intended to exist

Automatic testing – test types

Smoke testQuickly finds coarse errors• Misplaced files• Wrong CVS commits• Typos in code, sefl instead of self

Regression testFinds more subtle errors• Verifies that what worked yesterday works today

Thorough testTests every single exploit with every default parameter combination

Page 8: VIRTUALIZATION IN SOFTWARE DEVELOPMENT AND QAdownload3.vmware.com/vmworld/2006/dvt0082.pdf · Introduction-cont. Exploit code provides an interface that was not intended to exist

Automatic testing – in the beginning

Had to be done in python languageEvery module in IMPACT is python based, except for the GUI

Had to be done within 24hsRisk of error propagation increases with time

Had to be done with low budget hardwareIn ancient times we couldn’t afford new hardware

Development of PoC tools• First milestone: 10 automated tests

Page 9: VIRTUALIZATION IN SOFTWARE DEVELOPMENT AND QAdownload3.vmware.com/vmworld/2006/dvt0082.pdf · Introduction-cont. Exploit code provides an interface that was not intended to exist

In the beginning - Hardware

Small company, small budgetOnly spare hardware available• AMD 800Mhz 512Mb 80GB HDD• Linux based

Was my old and previous desktop PC, “empowered” by salvagingspare parts

Page 10: VIRTUALIZATION IN SOFTWARE DEVELOPMENT AND QAdownload3.vmware.com/vmworld/2006/dvt0082.pdf · Introduction-cont. Exploit code provides an interface that was not intended to exist

In the beginning - PoC

PoC must run inside CORE IMPACTIt is like any other moduleNo VMware API available in python• Wrapped VMCom API

• Python win32api extensions

First PoC runs fairly well

New milestone18 thorough tests

Page 11: VIRTUALIZATION IN SOFTWARE DEVELOPMENT AND QAdownload3.vmware.com/vmworld/2006/dvt0082.pdf · Introduction-cont. Exploit code provides an interface that was not intended to exist

What is a thorough test?

A thorough test in our context isOne exploit executed against:• All the available platforms• All the available applications

Using all default parameters• Exploits are parameterizable• Usually using at least three possible connection methods:

• Connect To• Connect From• Reuse connection

Page 12: VIRTUALIZATION IN SOFTWARE DEVELOPMENT AND QAdownload3.vmware.com/vmworld/2006/dvt0082.pdf · Introduction-cont. Exploit code provides an interface that was not intended to exist

What is a thorough test? cont.

Minimal testOne platform (Windows 2000)One applicationOne parameter (connect to)Rarely used

Typical testSeveral platforms (Windows 2000, XP)One applicationThree connection parameter values (to, from, reuse)Summing up 6 runsUsually this is the real “minimal” test

Page 13: VIRTUALIZATION IN SOFTWARE DEVELOPMENT AND QAdownload3.vmware.com/vmworld/2006/dvt0082.pdf · Introduction-cont. Exploit code provides an interface that was not intended to exist

First stage

18 Tests goalRoughly 60 runs

Needed supportVMImages information• Platform• Installed applications• Image location (for start up)XML used as repository• Standard• Quick and flexible for explorative development

Page 14: VIRTUALIZATION IN SOFTWARE DEVELOPMENT AND QAdownload3.vmware.com/vmworld/2006/dvt0082.pdf · Introduction-cont. Exploit code provides an interface that was not intended to exist

First stage - XML Files

Page 15: VIRTUALIZATION IN SOFTWARE DEVELOPMENT AND QAdownload3.vmware.com/vmworld/2006/dvt0082.pdf · Introduction-cont. Exploit code provides an interface that was not intended to exist

First stage - XML Files

Page 16: VIRTUALIZATION IN SOFTWARE DEVELOPMENT AND QAdownload3.vmware.com/vmworld/2006/dvt0082.pdf · Introduction-cont. Exploit code provides an interface that was not intended to exist

First Stage – Problems - IPs

Exploits need target IPImages cannot have fixed IP addresses• Old and internal constraint (now gone)

VMTools used to retrieve IPs for almost all images, except:• Windows NT4 pre SP6• OpenBSD

Solved using a RARP like script• Vmimages allow custom MAC address• Internal repository keeps info about those images

Page 17: VIRTUALIZATION IN SOFTWARE DEVELOPMENT AND QAdownload3.vmware.com/vmworld/2006/dvt0082.pdf · Introduction-cont. Exploit code provides an interface that was not intended to exist

First Stage – Problems – mutual exclusion

Automatic tests shut down images after use

GSX shared between automatic tools and testersUnhappy testers

Simple locking mechanismDo not start up image if in use by human testerRefcounting of images (when used by multiple automatic tests)Last one turns image off

Page 18: VIRTUALIZATION IN SOFTWARE DEVELOPMENT AND QAdownload3.vmware.com/vmworld/2006/dvt0082.pdf · Introduction-cont. Exploit code provides an interface that was not intended to exist

First Stage – Problems - Perfomance

One-shot exploitsSome exploits are considered one-shotNo matter if they succeeded or not, machine/service becomesunreliable or unavailable• Requires additionals restarts between runs

Virtual machines power on/off accounts for 85% of testing time

Memory shortage512Mb allow for 3 or 4 simultaneus images• Staff is growing and resources became critical

Page 19: VIRTUALIZATION IN SOFTWARE DEVELOPMENT AND QAdownload3.vmware.com/vmworld/2006/dvt0082.pdf · Introduction-cont. Exploit code provides an interface that was not intended to exist

First Stage - achieved

Milestone is achievedAutomatic test process is considered very promisingPlanning starts for second stageAt this time there are 60 exploits

All must be included and executed dailyAutomatic testing tool named ITeSu

Page 20: VIRTUALIZATION IN SOFTWARE DEVELOPMENT AND QAdownload3.vmware.com/vmworld/2006/dvt0082.pdf · Introduction-cont. Exploit code provides an interface that was not intended to exist

First Stage - Infrastructure

GSX 2.5

Testers ITeSu

Page 21: VIRTUALIZATION IN SOFTWARE DEVELOPMENT AND QAdownload3.vmware.com/vmworld/2006/dvt0082.pdf · Introduction-cont. Exploit code provides an interface that was not intended to exist

Second stage

New hardware is acquired2 AMD Sempron 2800+ 2Gb RAM Linux based

One GSX dedicated to manual testsOne GSX dedicated to automatic tests

Mutual exclusion problems “solved” this way (no more criticalresources)

New problemsImage desynchronisationHDD Space shortage

Page 22: VIRTUALIZATION IN SOFTWARE DEVELOPMENT AND QAdownload3.vmware.com/vmworld/2006/dvt0082.pdf · Introduction-cont. Exploit code provides an interface that was not intended to exist

Second stage - Infrastructure

GSX 2.5

Testers ITeSu

GSX 2.5

Page 23: VIRTUALIZATION IN SOFTWARE DEVELOPMENT AND QAdownload3.vmware.com/vmworld/2006/dvt0082.pdf · Introduction-cont. Exploit code provides an interface that was not intended to exist

Image desynchronisation

Both GSX started as exact copiesAs time goes by, subtle differences are introducedGoing further gross differences are introducedImpossible to switch between one GSX and the other, too manydifferencesProblem: Too many people in a small place

Page 24: VIRTUALIZATION IN SOFTWARE DEVELOPMENT AND QAdownload3.vmware.com/vmworld/2006/dvt0082.pdf · Introduction-cont. Exploit code provides an interface that was not intended to exist

HDD Space shortage

GivenThe success of automatic testsQA team growthExploits growthClients growth

Images are added at a very quick rate

Soon HDD space is almost goneNeed for temporal space growthsTesting becomes problematic

Page 25: VIRTUALIZATION IN SOFTWARE DEVELOPMENT AND QAdownload3.vmware.com/vmworld/2006/dvt0082.pdf · Introduction-cont. Exploit code provides an interface that was not intended to exist

Desynch. and HDD shortage solution

Images are cleaned upUnnecesary applications removed Similar (non conflicting) images merged

File system is splitHalf of the images are stored in one GSX, the rest in the other one

Images are shared between systems via NFSNow there is only one copy of each image, (impossible todesynchronise)Each HDD at 50%+ of its capacity

DrawbackIf one server goes down, 50% images are unavailable

Page 26: VIRTUALIZATION IN SOFTWARE DEVELOPMENT AND QAdownload3.vmware.com/vmworld/2006/dvt0082.pdf · Introduction-cont. Exploit code provides an interface that was not intended to exist

Second stage - Infrastructure

Testers ITeSu

NFS

Page 27: VIRTUALIZATION IN SOFTWARE DEVELOPMENT AND QAdownload3.vmware.com/vmworld/2006/dvt0082.pdf · Introduction-cont. Exploit code provides an interface that was not intended to exist

Desynch. and HDD shortage solution (didn’t last)

Eventually image quantity and content grew as the product evolved

Temporal space exhausted again

Hardware problems made GSX sporadically unavailable, 50% imagesgone

Page 28: VIRTUALIZATION IN SOFTWARE DEVELOPMENT AND QAdownload3.vmware.com/vmworld/2006/dvt0082.pdf · Introduction-cont. Exploit code provides an interface that was not intended to exist

Desynch. and HDD shortage solution II - The revenge

New hardware is acquiredUsed as file repository

HDD with hardware RAIDPlenty of space, “640k should be enough for anybody”

No space problems since then

Page 29: VIRTUALIZATION IN SOFTWARE DEVELOPMENT AND QAdownload3.vmware.com/vmworld/2006/dvt0082.pdf · Introduction-cont. Exploit code provides an interface that was not intended to exist

Second stage - Infrastructure

Testers ITeSu

NFS NFS

File StorageGSX 2.5 GSX 2.5

Page 30: VIRTUALIZATION IN SOFTWARE DEVELOPMENT AND QAdownload3.vmware.com/vmworld/2006/dvt0082.pdf · Introduction-cont. Exploit code provides an interface that was not intended to exist

Second stage – approaching limits

Plenty of HDD space achievedThis is a problem

More than 100 vmimages installedRoughly 60 modules included in daily tests

Accounting for 200+ runsMinimum running time 18 hours

Start up / shut down times raising• More services in each image, boot times increase

Still lots of exploits to be includedEstimated time when completed is far beyond 24hs

IMPACT is more complex every timeMore tests and test types are needed

Page 31: VIRTUALIZATION IN SOFTWARE DEVELOPMENT AND QAdownload3.vmware.com/vmworld/2006/dvt0082.pdf · Introduction-cont. Exploit code provides an interface that was not intended to exist

Third stage

GSX 3.2 migrationUse of snapshotsSupport for (so far) unsupported platforms

Windows 2003Mandrake 10

Improved performance

Page 32: VIRTUALIZATION IN SOFTWARE DEVELOPMENT AND QAdownload3.vmware.com/vmworld/2006/dvt0082.pdf · Introduction-cont. Exploit code provides an interface that was not intended to exist

GSX3.2 - Snapshots

THE solution to our praysOr not?

Lack of API snapshot supportThere is no way to use snapshotsSnapshots restart by themselves (revert to snapshot when power off)Snapshots cannot be HARD powered off, lots of broken images

Page 33: VIRTUALIZATION IN SOFTWARE DEVELOPMENT AND QAdownload3.vmware.com/vmworld/2006/dvt0082.pdf · Introduction-cont. Exploit code provides an interface that was not intended to exist

GSX3.2 – Snapshots cont.

VMware console sniffedSomehow console was able to use snapshots

Custom “snapshot” commandImages configured to revert to snapshot on power off• Power on -> shut down• Power off, wait to power on• Power on, suspend

It works

Page 34: VIRTUALIZATION IN SOFTWARE DEVELOPMENT AND QAdownload3.vmware.com/vmworld/2006/dvt0082.pdf · Introduction-cont. Exploit code provides an interface that was not intended to exist

GSX 3.2 – snapshots – sniff detail

Page 35: VIRTUALIZATION IN SOFTWARE DEVELOPMENT AND QAdownload3.vmware.com/vmworld/2006/dvt0082.pdf · Introduction-cont. Exploit code provides an interface that was not intended to exist

Third stage – current status

Testing time dramatically decreasedImages are now 183Included exploits 170Total runs 700Running time 7 hours

Page 36: VIRTUALIZATION IN SOFTWARE DEVELOPMENT AND QAdownload3.vmware.com/vmworld/2006/dvt0082.pdf · Introduction-cont. Exploit code provides an interface that was not intended to exist

That’s all

Questions?