Skip to content

Conversation

@rhmdnd
Copy link
Collaborator

@rhmdnd rhmdnd commented Oct 2, 2025

CIS has guidance that recommends checking Kubernetes and OpenShift API
servers for any unsupported configuration options (control 1.2.33 in
newer versions and 1.2.31 in recent versions). This commit adds two new
rules to check the API servers for unsupported configs so that users
have some automated way of checking this control, even though OpenShift
doesn't use this feature by default.

@rhmdnd
Copy link
Collaborator Author

rhmdnd commented Oct 2, 2025

/test 4.18-e2e-aws-ocp4-cis

@jan-cerny jan-cerny added the OpenShift OpenShift product related. label Oct 2, 2025
rules: []
rules:
- api_server_no_unsupported_config_overrides
- api_server_kube_no_unsupported_config_overrides
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strange - these didn't get picked up in the OCP4 cis testing.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding in the platform.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The rule still didn't show up in the test's artifacts.
Could it be that it is still not using the PR sources to build? Although I see the following in the logs:

2025/10/02 14:00:23 Using content image: registry.build09.ci.openshift.org/ci-op-pcld3z78/pipeline@sha256:4e75e0a42dd7be2834916360232767bee51f2b9d5af9f06b7e492c31c1ba0502

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The rule is getting build and put in the datastream, but it still doesn't seem to run in CI.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rhmdnd component doesn't seem to be used anywhere. Regardless, --content-image=$CONTENT_IMAGE seems correct.
From the logs:

+ go test . '-run=^TestPlatformCompliance$' -test-type=platform -content-image=registry.build11.ci.openshift.org/ci-op-mv6gph1y/pipeline@sha256:01d6114df7283f8cb722b017747c4de25eb5f42baa6d761eb34b6de17d0793f8 -content-directory=/go/src/github.com/ComplianceAsCode/content

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR looks good to me, @rhmdnd
But would you like to use this PR as testing grounds to understand why it doesn't show up in the tests?

@rhmdnd
Copy link
Collaborator Author

rhmdnd commented Oct 2, 2025

/test 4.18-e2e-aws-ocp4-cis

@yuumasato yuumasato self-assigned this Oct 2, 2025
@yuumasato yuumasato added this to the 0.1.79 milestone Oct 2, 2025
@yuumasato
Copy link
Member

@rhmdnd On an OCP 4.20 the rule is falling. When I probe manually I get this:

$ oc get kubeapiserver cluster -o yaml | grep unsupported 
  unsupportedConfigOverrides: null
$  oc get kubeapiserver cluster -o jsonpath={.spec.unsupportedConfigOverrides}
null

So the key seems to exist, its value is null though.

@yuumasato
Copy link
Member

I get the same unsupportedConfigOverrides: null result on OCP 4.19.

@yuumasato
Copy link
Member

This is what I get in the logs:

14926 D: oscap: Message received. [oscap(3):oscap(7fc023377940):oval_probe_ext.c:579:oval_probe_comm]
14927 D: oscap: name=(null), value=0x7fbfbc01ea10 [oscap(3):oscap(7fc023377940):seap-message.c:71:SEAP_msg_free]
14928 I: oscap: Test 'oval:ssg-test_file_for_api_server_kube_no_unsupported_config_overrides:tst:1' requires that only one object defined by 'oval:ssg-object_file_for_api_server_kube_no_unsupported_config_overrides:obj:1' exists on the system. [oscap(3):oscap(7fc023377940):oval_resultTest.c:912:_oval_result_test_evaluate_items]
14929 I: oscap: 0 objects defined by 'oval:ssg-object_file_for_api_server_kube_no_unsupported_config_overrides:obj:1' exist on the system. [oscap(3):oscap(7fc023377940):oval_resultTest.c:918:_oval_result_test_evaluate_items]
14930 I: oscap: Test 'oval:ssg-test_file_for_api_server_kube_no_unsupported_config_overrides:tst:1' does not contain any state to compare object with. [oscap(3):oscap(7fc023377940):oval_resultTest.c:920:_oval_result_test_evaluate_items]
14931 I: oscap: No item matching object 'oval:ssg-object_file_for_api_server_kube_no_unsupported_config_overrides:obj:1' was found on the system. (flag=does not exist) [oscap(3):oscap(7fc023377940):oval_resultTest.c:954:_oval_result_test_evaluate_items]
14932 I: oscap: Test 'oval:ssg-test_file_for_api_server_kube_no_unsupported_config_overrides:tst:1' evaluated as false. [oscap(3):oscap(7fc023377940):oval_resultTest.c:1164:oval_result_test_eval]
14933 I: oscap: Definition 'oval:ssg-api_server_kube_no_unsupported_config_overrides:def:1' evaluated as false. [oscap(3):oscap(7fc023377940):oval_resultDefinition.c:170:oval_result_definition_eval]
14934 Result^M    fail

CIS has guidance that recommends checking Kubernetes and OpenShift API
servers for any unsupported configuration options (control 1.2.33 in
newer versions and 1.2.31 in recent versions). This commit adds two new
rules to check the API servers for unsupported configs so that users
have some automated way of checking this control, even though OpenShift
doesn't use this feature by default.
@rhmdnd
Copy link
Collaborator Author

rhmdnd commented Oct 14, 2025

/test 4.18-e2e-aws-ocp4-cis

@openshift-ci
Copy link

openshift-ci bot commented Oct 14, 2025

@rhmdnd: 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/4.18-e2e-aws-ocp4-cis aa80d2f link true /test 4.18-e2e-aws-ocp4-cis
ci/prow/e2e-aws-openshift-node-compliance aa80d2f link true /test e2e-aws-openshift-node-compliance

Full PR test history. Your PR dashboard.

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.

@yuumasato
Copy link
Member

yuumasato commented Oct 15, 2025

Rules are passing when tested manually.
But the ocp4-cis and platform-compliance tests are still not showing the new unsupported-override rules.

@yuumasato yuumasato merged commit 48c6988 into ComplianceAsCode:master Oct 15, 2025
134 of 137 checks passed
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.

3 participants