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
Open
CMP-4429: Add per-VirtualMachine CEL rules for CIS OCP-Virt 2.1/3.2/3.3#14918Vincent056 wants to merge 3 commits into
Vincent056 wants to merge 3 commits into
Conversation
…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>
|
Skipping CI for Draft Pull Request. |
Vincent056
marked this pull request as ready for review
July 24, 2026 06:29
|
@Vincent056: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds three CEL rules that evaluate every VirtualMachine individually, one commit per Jira:
kubevirt-no-vm-device-passthrough— no GPU/host-device passthroughkubevirt-no-shareable-disks— no disk withshareable: truekubevirt-disk-error-policy-not-ignore— no disk witherrorPolicy: ignoreAll three consume the
virtualmachinesList (vms.items.all(...), the scanner's List-binding semantics). Scanner RBAC merged in ComplianceAsCode/compliance-operator#1293. Rules added to thecis-vm-extensionprofile selections.Testing
Each rule ships
cel/tests/cases.yamlfixtures with compliant and non-compliant cases, evaluated throughcelctl(the compliance-operator scanner engine):celctl cac lint+cac test: 13/13 cases passcac liveAND a full operator scan (ProfileBundle with celContentFile → ScanSettingBinding, collector granted the [BugFix] Substitue the refenced remediation functions only one (via one <xccdf:sub idref=> element) #1293 RBAC) — all three rules PASS against real VirtualMachine objects🤖 Generated with Claude Code