VMware, Inc. 425
Chapter 19 Setting and Using Policies and Customizing VMware Player
Examples of Policy Scripts
Examplesincludeanauthenticationscript,ahosttoguestdatascript,andapower‐on
hookscript.
SamplescriptsareinstalledwithVMwarePlayerinthefollowinglocation:
C:\Program Files\VMware\VMware Player\Samples
Example of an Authentication Script
Thisscriptexampleincludesthebasic elementsrequiredforanyauthenticationscript.
Thepurposeofanauthenticationscriptistodooneofthefollowing:
Iftheuseristobegrantedaccesstothevirtualmachine,generatethedatausedto
createthekeyforthisuserandsenditasoutput.Thedatamustbeuniqueforeach
user.Ifaccessisgranted,theexitcodeis0.
Iftheuseristobedeniedaccesstothevirtualmachine,thescriptexitswitha
non‐zeroexitcode.Thisisareferencetotheexitcode,nottheoutputvalue.
Theoutputofthescriptishashedtocreateakeytoencryptanddecryptvirtualmachine
files.Thefirsttimethissc
riptis
run,theoutputishashedtoencryptthevirtualmachine.
Whenavirtualmachineisdecrypted,thescriptmustreturnthesamevalue.Ifthescript
returnsadifferentvalue,thevirtualmachineisnotdecryptedandtheuserseesanerror
message.
Thescriptmayreturnanyva
lue.Toensurebestsecurity,avaluethatincludesonly
printablecharactersshouldbeatleast32byteslong.Forbinarydata,thevalueshould
beatleast16byteslongtoensureproperentropy.TheoutputissenttotheStdOutfile.
ThefollowingexampleiswritteninPe
rl.ItisinstalledbyWo
rkstationas
sample_auth.pl.CompileitwithaPerlinterpretertorunit.
#
# VMware Sample Script
#
# Sample script for ACE script authentication
#
# Description:
# This sample script looks up the user as defined in the environment
# variable TEST_USERNAME and returns seed data that is used to make a key
# for authenticationpurposes.
#
# It assumes that the username is defined in the environment variable
# TEST_USERNAME (a ficticious environment variable used for this sample)
# and returns the seed data from a harcoded map of username to seed data.
#
# Input to script:
Comentarios a estos manuales