You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CEL (Common Expression Language) rules provide native Kubernetes resource evaluation without requiring shell access or OVAL checks. CEL rules are used by the compliance-operator for Kubernetes and OpenShift compliance scanning.
164
+
165
+
**Important:** CEL rules are **excluded** from XCCDF/OVAL DataStreams and are generated as a separate `${PRODUCT}-cel-content.yaml` file.
166
+
167
+
### Required Fields for CEL Rules
168
+
169
+
```yaml
170
+
documentation_complete: true
171
+
172
+
title: 'Rule Title'
173
+
174
+
description: |-
175
+
Description of what the rule checks.
176
+
177
+
rationale: |-
178
+
Why this rule matters.
179
+
180
+
severity: medium
181
+
182
+
scannerType: CEL # REQUIRED: Marks this as a CEL rule
183
+
184
+
checkType: Platform # Usually Platform for K8s checks
185
+
186
+
expression: |- # REQUIRED: CEL expression (must evaluate to boolean)
187
+
resource.spec.enabled == true
188
+
189
+
inputs: # REQUIRED: Kubernetes resources to evaluate
190
+
- name: resource
191
+
kubernetesInputSpec:
192
+
apiVersion: v1
193
+
resource: pods
194
+
resourceName: my-pod # Optional: specific resource
195
+
resourceNamespace: default # Optional: specific namespace
Copy file name to clipboardExpand all lines: docs/manual/developer/07_understanding_build_system.md
+96Lines changed: 96 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -83,6 +83,7 @@ of occurrence:
83
83
- Load resolved rules, profiles, groups, collected remediations and the unlinked OVAL document and generate XCCDF, OVAL and OCIL documents from this data.
84
84
- Generate CPE OVAL and CPE dictionary.
85
85
- Combining the OVAL, OCIL, CPE and XCCDF documents into a single SCAP source data stream.
86
+
- Generate CEL content YAML for Kubernetes/OpenShift compliance checks (if enabled for the product).
86
87
- Generate content for derived products (such as CentOS and Scientific Linux).
87
88
- Generate HTML tables, Bash scripts, Ansible Playbooks and other secondary artifacts.
88
89
@@ -93,6 +94,9 @@ refer to their help text for more information and usage:
93
94
94
95
-`build_all_guides.py` -- generates separate HTML guides for every profile
95
96
in an XCCDF document.
97
+
-`build_cel_content.py` -- generates CEL (Common Expression Language) content
98
+
YAML for Kubernetes/OpenShift compliance checks. See [CEL Content](12_cel_content.md)
99
+
for detailed information about CEL rules and profiles.
96
100
-`build_rule_playbooks.py` -- generates per-rule per-profile playbooks in
97
101
Ansible content.
98
102
-`build_sce.py` -- outputs SCE content and combined metadata.
@@ -167,3 +171,95 @@ Steps to link an OVAL document to an XCCDF document:
167
171
8. The OVAL Document object is stored as an XML file `build/ssg-${PRODUCT}-oval.xml`.
168
172
9. For each XCCDF rule, a minimal OVAL Documents document is generated as an artifact
169
173
10. For each reference of OVAL check in XCCDF, a link to the `check-content` and a `check-export` element is added.
174
+
175
+
## How CEL Content is Built
176
+
177
+
CEL (Common Expression Language) content provides an alternative scanning mechanism to OVAL specifically designed for Kubernetes and OpenShift API resource evaluation. Unlike OVAL which requires shell access and evaluates system state, CEL rules evaluate Kubernetes resources directly through the API server.
178
+
179
+
CEL content generation is optional and must be explicitly enabled for each product.
180
+
181
+
### Enabling CEL Content
182
+
183
+
CEL content generation is enabled by setting `PRODUCT_CEL_ENABLED` in the product's `CMakeLists.txt`:
0 commit comments