These security controls provide a baseline set of virtual machine security best practices. They are structured in a way that explains the benefits and tradeoffs of implementing the control. To change advanced system settings, you can use either the PowerCLI provided, or the vSphere Client (Host > Configure > System > Advanced System Settings).

Variable Used

The PowerCLI commands in this section use the following variable:

  • $VM = "virtual_machine_name"

mks.enable3d

Deactivates 3D graphics features on virtual machines that do not need them to reduce potential attack vectors, enhancing overall system security.

Values
Installation Default Value: False
Baseline Suggested Value: False
Action Needed
Audit the installation default value.
Potential Functional Impact if Default Value Is Changed
None
PowerCLI Command Assessment
Get-VM -Name $VM | Get-AdvancedSetting mks.enable3d
PowerCLI Command Remediation Example
Get-VM -Name $VM | Get-AdvancedSetting mks.enable3d | Set-AdvancedSetting -Value FALSE

ethernet*.filter*.name

Limits access to virtual machines through the "dvFilter" network API.

The dvFilter interface is used by tools like NSX to filter and inspect network traffic. Other tools might use it, too. Ensure that those tools are authorized.

Values
Installation Default Value: Not present
Baseline Suggested Value: Not present
Action Needed
Audit the installation default value.
Potential Functional Impact if Default Value Is Changed
Legitimate network tools, including NSX, might require this functionality.
PowerCLI Command Assessment
Get-VM -Name $VM | Get-AdvancedSetting "ethernet*.filter*.name*"
PowerCLI Command Remediation Example
Get-VM -Name $VM | Get-AdvancedSetting "ethernet*.filter*.name*" | Remove-AdvancedSetting

Prevent Virtual Machines Booting from Unauthorized Sources

Virtual machines must prevent booting from unauthorized sources.

Unauthorized access to a virtual machine might occur when its primary boot volume is unavailable, and the EFI firmware seeks alternative boot sources, such as network boot. This can be mitigated through network controls, as well as with the advanced parameters bios.bootDeviceClasses, bios.bootOrder, and bios.hddOrder.

bios.bootDeviceClasses has the format "allow:XXXX" or "deny:XXXX," where XXXX is a comma-delimited list of boot classes. Boot classes are net (network PXE boot), usb (from attached USB devices); pcmcia (PCMCIA expansion cards, not used at present); cd (from attached virtual CD/DVD devices); hd (from attached virtual hard disks); fd (from attached virtual floppy devices); reserved (from unknown devices); efishell (into the EFI shell); and all, or any (same as all).

Use of allow or deny also implicitly states the opposite. For example:
  • deny:all disallows all boot classes
  • deny:net disallows network boot but allows all others
  • allow:hd allows only hd boot and denies all others
  • allow:hd,cd allows hd then cd device boot and denies all others

New virtual machines might require CD/DVD boot, and some dynamic environments, such as labs, might use network boot. Set those environments accordingly and document your rationale.

Values
Installation Default Value: allow:all
Baseline Suggested Value: allow:hd (once the guest operating system is installed)
Action Needed
Modify the installation default value.
Potential Functional Impact if Default Value Is Changed
The virtual machine can no longer boot from unspecified sources, which might negatively impact situations where PXE boot or recovery media is required. However, the parameter is easily changed at scale through PowerCLI. An alternate approach is to specify denied methods, such as "deny:net".
PowerCLI Command Assessment
Get-VM -Name $VM | Get-AdvancedSetting bios.bootDeviceClasses
PowerCLI Command Remediation Example
Get-VM -Name $VM | Get-AdvancedSetting bios.bootDeviceClasses | Set-AdvancedSetting -Value "allow:hd"

RemoteDisplay.maxConnections

Limits the number of console connections to a virtual machine.

Limiting virtual machine console sharing to one user prevents multiple observers, thus enhancing security. However, this might inadvertently create a potential pathway for service denial.

Values
Installation Default Value: -1
Baseline Suggested Value: 1
Action Needed
Modify the installation default value.
Potential Functional Impact if Default Value Is Changed
Might create a denial-of-service condition where the console is unusable because the one user is connected, or a disconnected console session persists. Other products, such as VMware Cloud Director, might require that you set this option to a greater value.
PowerCLI Command Assessment
Get-VM -Name $VM | Get-AdvancedSetting RemoteDisplay.maxConnections
PowerCLI Command Remediation Example
Get-VM -Name $VM | Get-AdvancedSetting RemoteDisplay.maxConnections | Set-AdvancedSetting -Value 1

Limit PCI Device Passthrough Functionality

Virtual machines must limit PCI device passthrough functionality.

DirectPath I/O features enable virtual machines to directly access system hardware, impacting risk mitigation tools like vMotion, DRS, and High Availability. DirectPath I/O features also potentially give attackers privileged hardware access. Ensure that only necessary virtual machines have this privilege, compensating with guest operating system security controls.

Values
Installation Default Value: Not present
Baseline Suggested Value: Not present
Action Needed
Audit
Potential Functional Impact if Default Value Is Changed
Passthrough devices, such as GPUs, would be negatively affected if they are disconnected. Audit and document the business need for these virtual machines.
PowerCLI Command Assessment
Get-VM -Name $VM | Get-PassthroughDevice
PowerCLI Command Remediation Example
Get-VM -Name $VM | Get-PassthroughDevice | Remove-PassthroughDevice

Remove Unnecessary Virtual Machine Virtual Hardware Devices

Virtual machines must remove unnecessary virtual hardware.

To reduce potential attack surfaces, eliminate unnecessary virtual hardware from virtual machines. Rarely-used ports, temporary CD/DVD drives, and hardware introduced by migrations could be vulnerable. Removing these decreases the risk of software introduction or data exfiltration from a protected environment.

Values
Installation Default Value: Configured
Baseline Suggested Value: Not present
Action Needed
Modify the installation default value.
Potential Functional Impact if Default Value Is Changed
Removing the CD-ROM device might impact VMware Tools installation and maintenance. Removing XHCI controllers might impact console keyboard and mouse connectivity for some guest operating systems.
PowerCLI Command Assessment
$VMview = Get-VM -Name $VM | Get-View
$UnnecessaryHardware = "VirtualUSBController|VirtualUSBXHCIController|VirtualParallelPort|VirtualFloppy|VirtualSerialPort|VirtualHdAudioCard|VirtualAHCIController|VirtualEnsoniq1371|VirtualCdrom"

$VMview.Config.Hardware.Device | Where-Object {$_.GetType().Name -match $UnnecessaryHardware} | Foreach-Object {
	$devname = $_.GetType().Name
	Write-Host "$VM`: [WARNING] VM has a $devname device. Please evaluate and consider removing." -ForegroundColor Yellow
}
PowerCLI Command Remediation Example
N/A
Setting Location in the vSphere Client
Virtual machine > Edit Settings > Virtual Hardware

tools.guestlib.enableHostInfo

Prevents virtual machines from obtaining host information about the hypervisor.

Preventing virtual machines from obtaining host information about the hypervisor mitigates risk of advanced attacks, as it denies adversaries crucial details about the physical host.

Values
Installation Default Value: False
Baseline Suggested Value: False or undefined
Action Needed
Audit the installation default value.
Potential Functional Impact if Default Value Is Changed
None
PowerCLI Command Assessment
Get-VM -Name $VM | Get-AdvancedSetting tools.guestlib.enableHostInfo
PowerCLI Command Remediation Example
Get-VM -Name $VM | Get-AdvancedSetting tools.guestlib.enableHostInfo | Remove-AdvancedSetting
Setting Location in the vSphere Client
N/A. This is a VMX file setting.

Set Encryption for Fault Tolerance

Virtual machines must require encryption for Fault Tolerance.

Requiring encryption for Fault Tolerance in virtual machines ensures secure data transmission. While the default 'opportunistic' encryption likely results in encryption due to ubiquitous AES-NI support in vSphere-compatible hardware, enforcing 'required' encryption guarantees no unencrypted operations.

Values
Installation Default Value: ftEncryptionOpportunistic
Baseline Suggested Value: ftEncryptionRequired
Action Needed
Modify the installation default value.
Potential Functional Impact if Default Value Is Changed
None
PowerCLI Command Assessment
(Get-VM -Name $VM).ExtensionData.Config.FtEncryptionMode
PowerCLI Command Remediation Example
$VMview = Get-VM -Name $VM | Get-View 
$ConfigSpec = New-Object VMware.Vim.VirtualMachineConfigSpec
$ConfigSpec.FtEncryptionMode = New-object VMware.Vim.VirtualMachineConfigSpecEncryptedFtModes
$ConfigSpec.FtEncryptionMode = "ftEncryptionRequired" 
$VMview.ReconfigVM_Task($ConfigSpec)
Setting Location in the vSphere Client
Virtual machine > Edit Settings > VM Options > Encryption

isolation.tools.copy.disable

Deactivates console copy operations on virtual machines.

Deactivating console copy operations on virtual machines prevents data copying between the virtual machine and the local client, regardless of whether the user is accessing through the Web Console, VMRC, or another method.

Values
Installation Default Value: True
Baseline Suggested Value: True or Undefined
Action Needed
Audit the installation default value.
Potential Functional Impact if Default Value Is Changed
None
PowerCLI Command Assessment
Get-VM -Name $VM | Get-AdvancedSetting isolation.tools.copy.disable
PowerCLI Command Remediation Example
Get-VM -Name $VM | Get-AdvancedSetting isolation.tools.copy.disable | Remove-AdvancedSetting

isolation.tools.paste.disable

Deactivates console paste operations on virtual machines.

By disabling console paste operations on virtual machines, data transfer from the local client to the virtual machine is blocked, whether the user is using the Web Console, VMRC, or another console.

Values
Installation Default Value: True
Baseline Suggested Value: True or Undefined
Action Needed
Audit the installation default value.
Potential Functional Impact if Default Value Is Changed
None
PowerCLI Command Assessment
Get-VM -Name $VM | Get-AdvancedSetting isolation.tools.paste.disable
PowerCLI Command Remediation Example
Get-VM -Name $VM | Get-AdvancedSetting isolation.tools.paste.disable | Remove-AdvancedSetting

isolation.tools.diskShrink.disable

Deactivates virtual disk shrinking on virtual machines.

Disabling virtual disk shrinking on virtual machines helps avoid disk unavailability issues. The ability to perform this operation is typically limited for non-administrative users in the guest environment.

Values
Installation Default Value: True
Baseline Suggested Value: True or Undefined
Action Needed
Audit the installation default value.
Potential Functional Impact if Default Value Is Changed
None
PowerCLI Command Assessment
Get-VM -Name $VM | Get-AdvancedSetting isolation.tools.diskShrink.disable
PowerCLI Command Remediation Example
Get-VM -Name $VM | Get-AdvancedSetting isolation.tools.diskShrink.disable | Remove-AdvancedSetting

isolation.tools.diskWiper.disable

Deactivates virtual disk wiping operations on virtual machines.

Disabling virtual disk wiping on virtual machines helps avoid disk unavailability issues. The ability to perform this operation is typically limited for non-administrative users in the guest environment.

Values
Installation Default Value: True
Baseline Suggested Value: True or Undefined
Action Needed
Audit the installation default value.
Potential Functional Impact if Default Value Is Changed
None
PowerCLI Command Assessment
Get-VM -Name $VM | Get-AdvancedSetting isolation.tools.diskWiper.disable
PowerCLI Command Remediation Example
Get-VM -Name $VM | Get-AdvancedSetting isolation.tools.diskWiper.disable | Remove-AdvancedSetting

isolation.device.connectable.disable

Prevents virtual machines from unauthorized removal, connection, and modification of devices.

Preventing unauthorized device modifications in virtual machines blocks non-administrative users or processes from connecting, disconnecting, or adjusting device settings. This measure curbs unauthorized access and operation disruption, reducing denial of service risks, as well as some avenues for exfiltrating data.

Values
Installation Default Value: True
Baseline Suggested Value: True or Undefined
Action Needed
Audit the installation default value.
Potential Functional Impact if Default Value Is Changed
None
PowerCLI Command Assessment
Get-VM -Name $VM | Get-AdvancedSetting isolation.device.connectable.disable
PowerCLI Command Remediation Example
Get-VM -Name $VM | Get-AdvancedSetting isolation.device.connectable.disable | Remove-AdvancedSetting

isolation.tools.dnd.disable

Deactivates drag and drop operations on virtual machine consoles.

Deactivating drag and drop operations in the console of a virtual machine stops users from transferring data between the virtual machine and the local client, regardless of the console type, thus enhancing data security.

Values
Installation Default Value: True
Baseline Suggested Value: True or Undefined
Action Needed
Audit the installation default value.
Potential Functional Impact if Default Value Is Changed
None
PowerCLI Command Assessment
Get-VM -Name $VM | Get-AdvancedSetting isolation.tools.dnd.disable
PowerCLI Command Remediation Example
Get-VM -Name $VM | Get-AdvancedSetting isolation.tools.dnd.disable | Remove-AdvancedSetting

tools.setInfo.sizeLimit

Limits the informational messages passed from the virtual machine to the VMX file.

Limiting virtual machine informational messages to the VMX file prevents it from exceeding its default size of 1 MB. This option prevents potential denial of service situations that could arise if the datastore becomes full.

Values
Installation Default Value: 1048576
Baseline Suggested Value: 1048576 or Undefined
Action Needed
Audit the installation default value.
Potential Functional Impact if Default Value Is Changed
None
PowerCLI Command Assessment
Get-VM -Name $VM | Get-AdvancedSetting tools.setInfo.sizeLimit
PowerCLI Command Remediation Example
Get-VM -Name $VM | Get-AdvancedSetting tools.setInfo.sizeLimit | Remove-AdvancedSetting

Activate Logging

Virtual machines must activate diagnostic logging.

Diagnostic logging for virtual machines helps with forensics and troubleshooting.

Values
Installation Default Value: True
Baseline Suggested Value: True
Action Needed
Audit the installation default value.
Potential Functional Impact if Default Value Is Changed
None
PowerCLI Command Assessment
Get-VM -Name $VM | Where {$_.ExtensionData.Config.Flags.EnableLogging -ne "True"}
PowerCLI Command Remediation Example
$VMview = Get-VM -Name $VM | Get-View 
$ConfigSpec = New-Object VMware.Vim.VirtualMachineConfigSpec
$ConfigSpec.Flags = New-Object VMware.Vim.VirtualMachineFlagInfo
$ConfigSpec.Flags.EnableLogging = $true
$VMview.ReconfigVM_Task($ConfigSpec)

log.keepOld

Limits the number of retained virtual machine diagnostic logs.

By restricting the quantity of retained diagnostic logs, you avoid filling up the datastore without compromising diagnostic functionality.

Values
Installation Default Value: 10
Baseline Suggested Value: 10 or Undefined
Action Needed
Audit the installation default value.
Potential Functional Impact if Default Value Is Changed
None
PowerCLI Command Assessment
Get-VM -Name $VM | Get-AdvancedSetting log.keepOld
PowerCLI Command Remediation Example
Get-VM -Name $VM | Get-AdvancedSetting log.keepOld | Remove-AdvancedSetting

log.rotateSize

Limits the size of virtual machine diagnostic logs.

Limiting the size of diagnostic logs on virtual machines prevents excessive space consumption, particularly on long-running virtual machines. The recommended minimum limit is 2 MB.

Values
Installation Default Value: 2048000
Baseline Suggested Value: 2048000 or Undefined
Action Needed
Audit the installation default value.
Potential Functional Impact if Default Value Is Changed
None
PowerCLI Command Assessment
Get-VM -Name $VM | Get-AdvancedSetting log.rotateSize
PowerCLI Command Remediation Example
Get-VM -Name $VM | Get-AdvancedSetting log.rotateSize | Remove-AdvancedSetting

tools.guestlib.enableHostInfo

Deactivates the ability to send host information to guests.

By configuring a virtual machine to get detailed information about the physical host, an adversary could potentially use this information to inform further attacks on the host. As the default is the desired state, you can audit by verifying that this setting is either unset, or if it is set, that it is set to False.

Values
Installation Default Value: False
Baseline Suggested Value: False or Undefined
Action Needed
Audit the installation default value.
Potential Functional Impact if Default Value Is Changed
Inability to retrieve performance information about the host from inside the guest operating system could hamper troubleshooting.
PowerCLI Command Assessment
Get-VM -Name $VM | Get-AdvancedSetting tools.guestlib.enableHostInfo
PowerCLI Command Remediation Example
Get-VM -Name $VM | Get-AdvancedSetting tools.guestlib.enableHostInfo | Remove-AdvancedSetting

tools.guest.desktop.autolock

Locks the virtual machine guest session when the remote console is disconnected.

Locking virtual machines when the last console connection closes can prevent potential unauthorized access from attackers exploiting logged-in console sessions.

Values
Installation Default Value: False
Baseline Suggested Value: True
Action Needed
Modify the installation default value.
Potential Functional Impact if Default Value Is Changed
None
PowerCLI Command Assessment
Get-VM -Name $VM | Get-AdvancedSetting tools.guest.desktop.autolock
PowerCLI Command Remediation Example
Get-VM -Name $VM | Get-AdvancedSetting tools.guest.desktop.autolock | Remove-AdvancedSetting

Activate Encryption for vMotion

Virtual machines must require encryption for vMotion.

Requiring encryption for vMotion in virtual machines guarantees secure data transfer. The default 'opportunistic' encryption likely results in encryption due to widespread AES-NI support in vSphere-compatible hardware. However, enforcing 'required' encryption prevents any unencrypted operations.

Values
Installation Default Value: Opportunistic
Baseline Suggested Value: Required
Action Needed
Modify the installation default value.
Potential Functional Impact if Default Value Is Changed
None
PowerCLI Command Assessment
(Get-VM -Name $VM).ExtensionData.Config.MigrateEncryption
PowerCLI Command Remediation Example
$VMview = Get-VM -Name $VM | Get-View 
$ConfigSpec = New-Object VMware.Vim.VirtualMachineConfigSpec
$ConfigSpec.MigrateEncryption = New-Object VMware.Vim.VirtualMachineConfigSpecEncryptedVMotionModes
$ConfigSpec.MigrateEncryption = "required"
$VMview.ReconfigVM_Task($ConfigSpec)