2.0

Table Of Contents
VMware, Inc. 159
Chapter 6 Setting and Using Policies and Customizing VMware Player
AllscriptsruneachtimetheenduserlaunchesVMwarePlayerorresetsthevirtual
machine.Somemayrunmoreoften.Forexample,anexpirationscriptisrunonceeach
24hours.
Thesamplescriptspresentedin“SampleScripts”onpage139areinstalledwith
VMwarePlayer.Thedefaultlocationis
C:\Program Files\VMware\VMware
Player\Samples.
Thefollowingdescriptionsgivetheformatfortheoutputthatyourscriptsmustwrite
toStdOuttocontrolvariouspolicies.
Authentication Scripts
Table62outlinesthebasicinformationyouneedtowriteauthenticationscripts.
Table 6-2. Writing Authentication Scripts
Question Explanation
Whendoesthisscriptexecute? Thisscriptexecuteswhenthevirtualmachineisopened.
Whatrelevantenvironment
variablesareavailabletothe
script?
Noauthenticationspecificenvironmentvariablesare
available,butVMWARE_PROJ_IDand
VMWARE_MVM_IDgivesomecontext,indicatingwhat
virtualmachinetheuseristryingtoopen.
Whatistheexpectedoutput? Theoutput
ofthisscriptishashedtocreateakeytoencrypt
anddecryptvirtualmachinefiles.Thefirsttimethisscript
isrun,theoutputishashedtoencryptthevirtualmachine.
Whenavirtualmachineisdecrypted,thescriptmustreturn
thesamevalue.Ifthescriptreturnsa
differentvalue,the
virtualmachineisnotdecryptedandtheuserseesanerror
message.
Thescriptmayreturnanyvalue.Toensurebestsecurity,a
valuethatincludesonlyprintablecharactersshouldbeat
least32byteslong.Forbinarydata,thevalueshouldbeat
least16byteslong
toensureproperentropy.
WhatcanIdowiththisscript? Thescriptshoulddooneofthefollowing:
Iftheuseristobegrantedaccesstothevirtualmachine,
generatethedatausedtocreatethekeyforthisuser
andsenditasoutput.Thedatashouldbeuniquefor
eachuser.
Iftheuseristobedeniedaccesstothevirtualmachine,
thescriptshouldexitwithanonzeroexitcode.
Note:Thisisareferencetotheexitcode,nottheoutput
value.