Skip to content

CMP-4429: Add per-VirtualMachine CEL rules for CIS OCP-Virt 2.1/3.2/3.3 - #14918

Open
Vincent056 wants to merge 3 commits into
ComplianceAsCode:masterfrom
Vincent056:cmp-4429-vm-cel-rules
Open

CMP-4429: Add per-VirtualMachine CEL rules for CIS OCP-Virt 2.1/3.2/3.3#14918
Vincent056 wants to merge 3 commits into
ComplianceAsCode:masterfrom
Vincent056:cmp-4429-vm-cel-rules

Conversation

@Vincent056

Copy link
Copy Markdown
Contributor

Summary

Adds three CEL rules that evaluate every VirtualMachine individually, one commit per Jira:

Commit CIS Rule
CMP-4429 2.1 kubevirt-no-vm-device-passthrough — no GPU/host-device passthrough
CMP-4430 3.2 kubevirt-no-shareable-disks — no disk with shareable: true
CMP-4431 3.3 kubevirt-disk-error-policy-not-ignore — no disk with errorPolicy: ignore

All three consume the virtualmachines List (vms.items.all(...), the scanner's List-binding semantics). Scanner RBAC merged in ComplianceAsCode/compliance-operator#1293. Rules added to the cis-vm-extension profile selections.

Testing

Each rule ships cel/tests/cases.yaml fixtures with compliant and non-compliant cases, evaluated through celctl (the compliance-operator scanner engine):

🤖 Generated with Claude Code

Vincent056 and others added 3 commits July 23, 2026 00:25
…t 2.1)

Automated check that no VirtualMachine requests GPU or host-device
passthrough (.spec.template.spec.domain.devices.gpus / .hostDevices).
Passthrough gives guests direct access to host hardware, bypassing
hypervisor isolation. Iterates the virtualmachines List with .items.all
(scanner List-binding semantics); RBAC ships with compliance-operator#1293
(merged).

Fixtures: 5 cases via celctl - 5/5 pass; lint OK; live on OCP 4.22 + CNV
with running VMs: PASS. Added to cis-vm-extension profile.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Automated check that no VirtualMachine disk sets shareable: true. Shared
writable disks create a data path between VMs that bypasses network
controls and namespace isolation.

Fixtures: 4 cases via celctl - 4/4 pass; lint OK; live on OCP 4.22 + CNV
with running VMs: PASS. Added to cis-vm-extension profile.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…-Virt 3.3)

Automated check that no VirtualMachine disk sets errorPolicy: ignore, which
suppresses I/O errors and risks silent data corruption in guests.

Fixtures: 4 cases via celctl - 4/4 pass; lint OK; live on OCP 4.22 + CNV
with running VMs: PASS. Added to cis-vm-extension profile.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@openshift-ci

openshift-ci Bot commented Jul 23, 2026

Copy link
Copy Markdown

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Used by openshift-ci bot. label Jul 23, 2026
@Vincent056
Vincent056 marked this pull request as ready for review July 24, 2026 06:29
@openshift-ci openshift-ci Bot removed the do-not-merge/work-in-progress Used by openshift-ci bot. label Jul 24, 2026
@openshift-ci

openshift-ci Bot commented Jul 24, 2026

Copy link
Copy Markdown

@Vincent056: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-aws-openshift-platform-compliance 7743a0d link true /test e2e-aws-openshift-platform-compliance
ci/prow/e2e-aws-openshift-node-compliance 7743a0d link true /test e2e-aws-openshift-node-compliance

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@jan-cerny jan-cerny added the OpenShift OpenShift product related. label Jul 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

OpenShift OpenShift product related.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants