File tree Expand file tree Collapse file tree 3 files changed +45
-0
lines changed
config/samples/custom-rules/openshift-virtualization Expand file tree Collapse file tree 3 files changed +45
-0
lines changed Original file line number Diff line number Diff line change 1+ apiVersion : compliance.openshift.io/v1alpha1
2+ kind : CustomRule
3+ metadata :
4+ name : kubevirt-no-vms-overcommitting-guest-memory
5+ namespace : openshift-compliance
6+ spec :
7+ title : " VMs Must Not Overcommit Guests Memory"
8+ id : kubevirt_no_vms_overcommitting_guest_memory
9+ description : |-
10+ The overcommitGuestOverhead configuration option enables the request for
11+ additional virtual machine management memory inside the virt-launcher pod.
12+ The overcommit feature is used to increase virtual machine density on the
13+ node, as long as the virtual machine doesn’t request all the memory that it
14+ would need if fully loaded. However, if the VM were to use all of the
15+ memory it could, this would lead to the OpenShift Scheduler killing the
16+ workload.
17+ failureReason : |-
18+ The '.spec.template.spec.domain.recources.overcommitGuestOverhead' field exists and is
19+ set to "true" in the 'VirtualMachineInstance' resource, allowing VMs to
20+ overcommit KubeVirt's memory which may lead to guests crashing and
21+ interrupting workloads causing malfunctions.
22+ severity : Medium
23+ checkType : Platform
24+ scannerType : CEL
25+ inputs :
26+ - name : vms
27+ kubernetesInputSpec :
28+ apiVersion : kubevirt.io/v1
29+ resource : VirtualMachine
30+ expression : |
31+ vms.all(h,
32+ !has(h.spec.template.spec.domain.resources) ||
33+ !has(h.spec.template.spec.domain.resources.overcommitGuestOverhead) ||
34+ (has(h.spec.template.spec.domain.resources.overcommitGuestOverhead) &&
35+ h.spec.template.spec.domain.resources.overcommitGuestOverhead == false)
36+ )
Original file line number Diff line number Diff line change @@ -4,5 +4,6 @@ resources:
44 - kubevirt-nonroot-feature-gate-is-enabled.yaml
55 - kubevirt-no-permitted-host-devices.yaml
66 - kubevirt-persistent-reservation-disabled.yaml
7+ - kubevirt-no-vms-overcommiting-guest-memory
78 - tailored-profile.yaml
89 - scan-setting-binding.yaml
Original file line number Diff line number Diff line change 2828 explicitly required. This feature allows VMs to claim exclusive access
2929 to storage resources, potentially impacting availability and enabling
3030 resource manipulation outside normal access controls.
31+ - kind : CustomRule
32+ name : kubevirt-no-vms-overcommiting-guest-memory
33+ rationale : |-
34+ This is a hypervisor-level feature that allows nodes to host more
35+ virtual machines than would normally be allowed by KubeVirt’s
36+ scheduling algorithms. If the VM consumes the entire memory might
37+ cause the guest to crash with workload interruptions and guest
38+ malfunctioning.
3139 title : Platform checks for OpenShift Virtualization
You can’t perform that action at this time.
0 commit comments