TMAegisBeta
Više pravila za vmware

VMware ESXi

TMA-ESXI9-7.21

Virtual machines must deactivate virtual disk shrinking operations

SrednjaNivo 1Automatskavmware

Opis

Disabling virtual disk shrinking on virtual machines prevents potential disk unavailability issues. This operation is usually restricted for non-administrative users within the guest environment. The parameter governing this behavior is isolation.tools.diskShrink.disable with a recommended setting of TRUE or Undefined. Expected: isolation.tools.diskShrink.disable = "TRUE". The audit parses every .vmx file under /vmfs/volumes/ on the host and lists the VMs that do not comply; it passes when none are found (or no VMs exist). Runs in the ESXi Shell (busybox sh) as root.

Kako se proverava

Metod provere: Komanda ljuske

shell
command -v find >/dev/null 2>&1 || exit 1
out=$(find /vmfs/volumes/ -maxdepth 3 -type f -name '*.vmx' 2>/dev/null | while IFS= read -r f; do
  awk -v KEYRE='^isolation[.]tools[.]diskshrink[.]disable$' -v MODE='eq' -v VAL='TRUE' 'BEGIN { re = tolower(KEYRE) }
{ line = $0; sub(/^[ \t]+/, "", line); i = index(line, "="); if (i == 0) next
  k = tolower(substr(line, 1, i - 1)); sub(/[ \t]+$/, "", k)
  v = substr(line, i + 1); sub(/^[ \t]*"?/, "", v); sub(/"?[ \t\r]*$/, "", v); v = tolower(v)
  if (k ~ re) { seen = 1; if (MODE == "not" && v == tolower(VAL)) bad = bad " " k "=" v
                else if (MODE != "not" && MODE != "ge" && v != tolower(VAL)) bad = bad " " k "=" v
                else if (MODE == "ge" && (v + 0) < (VAL + 0)) bad = bad " " k "=" v } }
END { if ((MODE == "eq" || MODE == "ge") && !seen) bad = " " KEYRE " not set"
      if (bad != "") print FILENAME ":" bad }' "$f"
done)
[ -z "$out" ] && echo compliant || printf '%s\n' "$out" | head -n 25
Očekivani izlaz
compliant

Kako se ispravlja

Metod ispravke: Smernica ili zakrpa infrastrukture

To set this configuration utilize the vSphere interface as follows: 1. Select the VM then select Actions followed by Edit Settings. 2. Click on the VM Options tab then expand Advanced. 3. Click on EDIT CONFIGURATION. 4. Click on ADD CONFIGURATION PARAMS then input isolation.tools.diskShrink.disable with a value of TRUE. 5. Click OK, then OK again. To implement the recommended configuration state, run the following PowerCLI command: # Add the setting to all VMs Get-VM | New-AdvancedSetting -Name "isolation.tools.diskShrink.disable" -value $true

Svojstva

Operativni sistemi
Bilo koji
Oznake
vmwareesxivirtual-machine
Referenca
CIS VMware ESXi 9.0 Benchmark v1.0.0 - 7.21 Virtual machines must deactivate virtual disk shrinking operations

Proverite ovaj računar

Pokrenite ovo na računaru za koji imate dozvolu za proveru. Skeniranje radi u režimu samo za čitanje.

shell
tmaegis scan --target vmware