Skip to content

Commit 48c6988

Browse files
authored
Merge pull request #13969 from rhmdnd/CMP-3580
CMP-3580: Implement checks for unsupported API server configs
2 parents 3a10fed + aa80d2f commit 48c6988

File tree

4 files changed

+99
-3
lines changed

4 files changed

+99
-3
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
title: Ensure No Unsupported Configuration Overrides are Used
2+
3+
platform: not ocp4-on-hypershift-hosted
4+
5+
description: |-
6+
Kubernetes API servers should not use unsupported configuration overrides that
7+
can potentially compromise the security and stability of the cluster. This
8+
rule checks that no unsupported configuration overrides are present in the
9+
cluster API server configurations.
10+
11+
rationale: |-
12+
Unsupported configuration overrides can introduce security vulnerabilities,
13+
performance issues, and unexpected behaviors in the cluster. They bypass the
14+
standard configuration mechanisms and can potentially weaken the cluster's
15+
security posture or introduce instability.
16+
17+
severity: medium
18+
19+
identifiers:
20+
cce@ocp4: CCE-89304-0
21+
22+
references:
23+
cis@ocp4: 1.2.31
24+
25+
{{% set jqfilter = '[.items[] | select(.spec.unsupportedConfigOverrides != null and .spec.unsupportedConfigOverrides != {}) | .metadata.name]' %}}
26+
27+
ocil_clause: 'Unsupported Kubernetes API server configuration overrides are detected'
28+
29+
ocil: |-
30+
Run the following commands to check for unsupported configuration overrides:
31+
<pre>$ oc get kubeapiserver/cluster -o jsonpath='{.spec.unsupportedConfigOverrides}'</pre>
32+
Verify that these commands return an empty object or no output.
33+
34+
warnings:
35+
- general: |-
36+
{{{ openshift_filtered_cluster_setting({'/apis/operator.openshift.io/v1/kubeapiservers': jqfilter}) | indent(4) }}}
37+
38+
template:
39+
name: yamlfile_value
40+
vars:
41+
ocp_data: "true"
42+
filepath: {{{ openshift_filtered_path('/apis/operator.openshift.io/v1/kubeapiservers', jqfilter) }}}
43+
yamlpath: "[:]"
44+
check_existence: "none_exist"
45+
entity_check: "all"
46+
values:
47+
- value: "(.*?)"
48+
operation: "pattern match"
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
title: Ensure No Unsupported Configuration Overrides are Used
2+
3+
platform: not ocp4-on-hypershift-hosted
4+
5+
description: |-
6+
OpenShift API servers should not use unsupported configuration overrides that
7+
can potentially compromise the security and stability of the cluster. This
8+
rule checks that no unsupported configuration overrides are present in the
9+
cluster API server configurations.
10+
11+
rationale: |-
12+
Unsupported configuration overrides can introduce security vulnerabilities,
13+
performance issues, and unexpected behaviors in the cluster. They bypass the
14+
standard configuration mechanisms and can potentially weaken the cluster's
15+
security posture or introduce instability.
16+
17+
severity: medium
18+
19+
identifiers:
20+
cce@ocp4: CCE-89950-0
21+
22+
references:
23+
cis@ocp4: 1.2.31
24+
25+
{{% set jqfilter = '[.items[] | select(.spec.unsupportedConfigOverrides != null and .spec.unsupportedConfigOverrides != {}) | .metadata.name]' %}}
26+
27+
ocil_clause: 'Unsupported OpenShift API server configuration overrides are detected'
28+
29+
ocil: |-
30+
Run the following commands to check for unsupported configuration overrides:
31+
<pre>$ oc get openshiftapiserver/cluster -o jsonpath='{.spec.unsupportedConfigOverrides}'</pre>
32+
Verify that these commands return an empty object or no output.
33+
34+
warnings:
35+
- general: |-
36+
{{{ openshift_filtered_cluster_setting({'/apis/operator.openshift.io/v1/openshiftapiservers': jqfilter}) | indent(4) }}}
37+
38+
template:
39+
name: yamlfile_value
40+
vars:
41+
ocp_data: "true"
42+
filepath: {{{ openshift_filtered_path('/apis/operator.openshift.io/v1/openshiftapiservers', jqfilter) }}}
43+
yamlpath: "[:]"
44+
check_existence: "none_exist"
45+
entity_check: "all"
46+
values:
47+
- value: "(.*?)"
48+
operation: "pattern match"

controls/cis_ocp/section-1.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,9 @@ controls:
461461
- id: 1.2.33
462462
title: Ensure unsupported configuration overrides are not used
463463
status: pending
464-
rules: []
464+
rules:
465+
- api_server_no_unsupported_config_overrides
466+
- api_server_kube_no_unsupported_config_overrides
465467
levels:
466468
- level_1
467469
- id: '1.3'

shared/references/cce-redhat-avail.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1559,7 +1559,6 @@ CCE-89293-5
15591559
CCE-89294-3
15601560
CCE-89295-0
15611561
CCE-89303-2
1562-
CCE-89304-0
15631562
CCE-89305-7
15641563
CCE-89308-1
15651564
CCE-89310-7
@@ -1984,7 +1983,6 @@ CCE-89943-5
19841983
CCE-89946-8
19851984
CCE-89948-4
19861985
CCE-89949-2
1987-
CCE-89950-0
19881986
CCE-89951-8
19891987
CCE-89953-4
19901988
CCE-89954-2

0 commit comments

Comments
 (0)