8.7.2 Limit number of VM log files

Information

Configure VM settings to prevent uncontrolled logging.

*Rationale*

You can use log settings to limit the total size and number of log files. Normally a new log
file is created only when a host is rebooted, so the file can grow to be quite large. You can
ensure that new log files are created more frequently by limiting the maximum size of the
log files. If you want to restrict the total size of logging data, VMware recommends saving
10 log files, each one limited to 1,000KB. Datastores are likely to be formatted with a block
size of 2MB or 4MB, so a size limit too far below this size would result in unnecessary
storage utilization. Each time an entry is written to the log, the size of the log is checked; if
it is over the limit, the next entry is written to a new log. If the maximum number of log files
already exists, when a new one is created, the oldest log file is deleted. A denial-of-service
attack that avoids these limits might be attempted by writing an enormous log entry. But
each log entry is limited to 4KB, so no log files are ever more than 4KB larger than the
configured limit. A second option is to disable logging for the virtual machine. Disabling
logging for a virtual machine makes troubleshooting challenging and support difficult. You
should not consider disabling logging unless the log file rotation approach proves
insufficient. Uncontrolled logging can lead to denial of service due to the datastore's being
filled.

Solution

To implement the recommended configuration state, run the following PowerCLI
command-# Add the setting to all VMs
Get-VM | New-AdvancedSetting -Name 'log.keepOld' -value '10'

Impact-A more extreme strategy is to disable logging altogether for the virtual machine. Disabling
logging makes troubleshooting challenging and support difficult. Do not consider disabling
logging unless the log file rotation approach proves insufficient.

Default Value-The prescribed state is not the default state.

See Also

https://workbench.cisecurity.org/files/145

Item Details

Category: AUDIT AND ACCOUNTABILITY

References: 800-53|AU-4, CSCv6|6.3

Plugin: VMware

Control ID: 10a095b271ac71e6e6ed94b92687bbfdb93114591b9be84f5b865aea0b7b2611