Map OCP Virtualization rules to STIG controls and add stig-virt CEL profile - #15043
Map OCP Virtualization rules to STIG controls and add stig-virt CEL profile#15043yuumasato wants to merge 14 commits into
Conversation
Map 4 OpenShift Virtualization rules to CNTR-OS-000090 (RBAC access controls) per DISA STIG V2R6 which added OCP Virt checks for seccomp profile permissions, cache directory permissions, migration tools RBAC, and nested virtualization. Rules added: - kubevirt-restrict-migration-tools-access (manual) - kubevirt-nested-virtualization-disabled (OVAL, node) - kubevirt-seccomp-profile-permissions (file_permissions, node) - kubevirt-cache-directory-permissions (file_permissions, node) Closes: CMP-4294, CMP-4295, CMP-4296, CMP-4297 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Map 2 OpenShift Virtualization rules to CNTR-OS-000100 (network policy enforcement) per DISA STIG V2R6 which added OCP Virt checks for SR-IOV spoofchk and Bridge CNI MAC-spoof filtering. Rules added: - kubevirt-sriov-spoofchk-on (CEL) - kubevirt-bridge-mac-spoof-filtering (CEL) Closes: CMP-4298 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Map OpenShift Virtualization rule to CNTR-OS-000110 (approved authorizations for information flow) per DISA STIG V2R6 which added a check that downward metrics must be disabled on HyperConverged CR. Rules added: - kubevirt-downward-metrics-disabled (CEL) Closes: CMP-4299, CMP-4300 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Map OpenShift Virtualization rule to CNTR-OS-000150 (audit records for auditable events) per DISA STIG V2R6 which added a check that VM disk errorPolicy must not be set to "ignore". Rules added: - kubevirt-disk-error-policy-not-ignore (CEL) Closes: CMP-4301 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Map OpenShift Virtualization rule to CNTR-OS-000400 (disable root and terminate network connections) per DISA STIG V2R6 which added a check that the nonRoot feature gate must be enabled on HyperConverged CR. Rules added: - kubevirt-nonroot-feature-gate-is-enabled (CEL) Closes: CMP-4302 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Map OpenShift Virtualization rule to CNTR-OS-000500 (separate user functionality from management) per DISA STIG V2R6 which added a check to restrict VNC access via token.kubevirt.io:generate rolebinding. Rules added: - kubevirt-restrict-vnc-access-to-workloads (manual) Closes: CMP-4303 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Map 3 OpenShift Virtualization rules to CNTR-OS-000560 (prevent unauthorized info transfer via shared resources) per DISA STIG V2R6 which added checks for persistent reservation, shareable disks, and KSM. Rules added: - kubevirt-persistent-reservation-disabled (CEL) - kubevirt-no-shareable-disks (CEL) - kubevirt-ksm-disabled (CEL) Closes: CMP-4304, CMP-4305, CMP-4306 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Map OpenShift Virtualization rule to CNTR-OS-000740 (prevent installation of unverified patches) per DISA STIG V2R6 which added a check for jsonpatch annotations on HyperConverged CR. Rules added: - kubevirt-no-jsonpatch-annotations (CEL) Closes: CMP-4307 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Map OpenShift Virtualization rule to CNTR-OS-001020 (disable USB storage kernel module) per DISA STIG V2R6 which added a check that no permitted host devices are configured on HyperConverged CR. Rules added: - kubevirt-no-permitted-host-devices (CEL) Closes: CMP-4308 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Creates a new profile that selects all kubevirt rules from the STIG control file using filter_rules, following the same pattern as the existing stig/stig-node profile split. The scanner_type: CEL ensures this profile is excluded from XCCDF data streams and only appears in CEL content output. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Rules with only CEL checks (cel/shared.yml, no OVAL or template) are excluded from the XCCDF rule tree but can still be selected by XCCDF profiles via control files. get_variables_of_rules() crashed with TypeError because dict.get() returned None for these rules. Default to an empty set since CEL-only rules have no XCCDF variables. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Validated this end to end: built the branch ( One design issue to resolve: the three node rules end up MANUAL in this CEL profile. Suggestion: either add a companion |
Node kubevirt rules are already automated in the stig-node XCCDF profile, so exclude them from the stig-virt CEL profile to avoid showing them as manual. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
3f33ef6 to
f2b319d
Compare
|
Thanks for the thorough validation, @Vincent056! This is addressed now — the The 3 node rules ( |
Split stig-virt into a versioned snapshot (stig-virt-v2r6) with the actual selections and filter, and a tip profile (stig-virt) that extends it. Follows the same pattern as the stig/stig-node platform split. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Maybe this profile should be named stig-vm-extension?
To follow same pattern as cis-vm-extension?
There was a problem hiding this comment.
Should maybe be renamed to stig-vm-extension-v2r6?
|
@yuumasato: The following test 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. |
Rename to align with the CIS VM extension profile naming convention (cis-vm-extension).
Summary
CMP-4294, CMP-4295, CMP-4296, CMP-4297, CMP-4298, CMP-4299, CMP-4300, CMP-4301, CMP-4302, CMP-4303, CMP-4304, CMP-4305, CMP-4306, CMP-4307, CMP-4308
controls/stig_ocp4.ymlstig-virt.profile— a CEL profile that selects kubevirt rules from the STIG control file usingfilter_rulesstig-virt— those are automated in thestig-nodeXCCDF profileget_variables_of_rulesdefaulting to empty set)STIG control mappings
kubevirt-restrict-migration-tools-access,kubevirt-nested-virtualization-disabled,kubevirt-seccomp-profile-permissions,kubevirt-cache-directory-permissionskubevirt-sriov-spoofchk-on,kubevirt-bridge-mac-spoof-filteringkubevirt-downward-metrics-disabledkubevirt-disk-error-policy-not-ignorekubevirt-nonroot-feature-gate-is-enabledkubevirt-restrict-vnc-access-to-workloadskubevirt-persistent-reservation-disabled,kubevirt-no-shareable-disks,kubevirt-ksm-disabledkubevirt-no-jsonpatch-annotationskubevirt-no-permitted-host-devicesstig-virt profile
Uses the control file as single source of truth (same pattern as the existing stig/stig-node platform split):
stig-nodeXCCDF)Build system fix
ssg/build_yaml.pyline 701:rules_and_variables_dict.get(rule)→rules_and_variables_dict.get(rule, set()).CEL-only rules are excluded from the XCCDF rule tree but can still be selected by XCCDF profiles via control files. Without the default,
set.update(None)raisesTypeError.Note on profile filters
Kubevirt
filter_rulesfor pre-V2R6 and RHCOS profiles are in #15042 (version bump PR). This PR only adds thestig-virtprofile filter.Test plan
./build_product ocp4 --datastream --cel-content=ocp4succeedsstig-virtCEL profile contains 12 kubevirt rules (10 CEL + 2 manual), no node rules🤖 Generated with Claude Code