OpenShift Virtualization
TMA-OPENSHIFT-VIRT-1.4
Disable downwardMetrics feature gate
MediumLevel 1Automatedopenshift-virt
Description
The downwardMetrics feature allows users to collect and monitor additional metrics related to host and virtual machine performance. Audit: Passes when .spec.featureGates.downwardMetrics is false or unset (the default is disabled). Requires oc logged in to the cluster with read access.
How it is checked
Audit method: Shell command
shell
command -v oc >/dev/null 2>&1 || exit 1; v=$(oc get hyperconverged kubevirt-hyperconverged -n openshift-cnv -o jsonpath='{.spec.featureGates.downwardMetrics}') || exit 1; [ "$v" = true ] && echo noncompliant || echo compliant- Expected output
compliant
How it is fixed
Fix method: Guidance or infrastructure patch
Set downwardMetrics to False $ oc patch hyperconverged kubevirt-hyperconverged - n openshift - cnv --type='json' -p='[ {"op": "replace", "path": "/spec/featureGates/downwardMetrics", "value": false }, ]'
Properties
- Operating systems
- Any
- Tags
- openshift-virtfeature-gates
- Reference
- CIS Red Hat OpenShift Virtual Machine Extension Benchmark v1.0.0 - 1.4 Disable downwardMetrics feature gate
Check this host
Run this on a machine you are allowed to audit. The scan is read-only.
shell
tmaegis scan --target openshift-virt