-
Notifications
You must be signed in to change notification settings - Fork 743
OCPBUGS-53041: Fix multi-platform support for OVS rules #13201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
/test |
@rhmdnd: The
Use
In response to this:
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. |
/test e2e-aws-ocp4-cis-node |
Both of the following rules pass on
Specifically the |
applications/openshift/master/file_groupowner_ovs_conf_db_lock_not_s390x/rule.yml
Outdated
Show resolved
Hide resolved
applications/openshift/master/file_groupowner_ovs_conf_db_s390x/rule.yml
Outdated
Show resolved
Hide resolved
applications/openshift/master/file_groupowner_ovs_conf_db_x86/rule.yml
Outdated
Show resolved
Hide resolved
applications/openshift/master/file_groupowner_ovs_conf_db_x86/rule.yml
Outdated
Show resolved
Hide resolved
c504136
to
b69553d
Compare
/test e2e-aws-ocp4-cis-node |
@@ -0,0 +1,37 @@ | |||
documentation_complete: true | |||
|
|||
platform: ocp4-node and aarch64_arch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strange - this rule isn't even getting reported in the results:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Grab the html report from the ARF results and see why this failed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
platform: ocp4-node and aarch64_arch | |
platforms: | |
- ocp4-node | |
- aarch64_arch |
There is an issue with the filter_rules where when the platforms is defined within a single line the comparison will fail thinking that ocp4-node is not part of the platforms, like this:
>>> platforms = {'ocp4-node and aarch64_arch'}
>>> "ocp4-node" in platforms
False
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😮💨 thanks for the help, that worked!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One thing I noticed with this is that it works for running the rule on aarch64. But, if I apply the same technique to other rules intended for x86 or s390x, they will still get selected and run in the profile:
$ oc get ccr | grep ovs-conf-db-
upstream-ocp4-cis-node-master-file-groupowner-ovs-conf-db-aarch64 PASS medium
upstream-ocp4-cis-node-master-file-groupowner-ovs-conf-db-s390x PASS medium
upstream-ocp4-cis-node-master-file-groupowner-ovs-conf-db-x86-64 FAIL medium
upstream-ocp4-cis-node-worker-file-groupowner-ovs-conf-db-aarch64 PASS medium
upstream-ocp4-cis-node-worker-file-groupowner-ovs-conf-db-s390x PASS medium
upstream-ocp4-cis-node-worker-file-groupowner-ovs-conf-db-x86-64 FAIL medium
It appears the x86 and s390x rules are not filtered out at run time, which is interesting because I think we do something similar with ocp4-node-on-sdn
and ocp4-node-on-ovs
for example.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ovs and sdn filters are leveraged in https://github.com/ComplianceAsCode/content/blob/master/products/ocp4/profiles/cis-node-1-7.profile#L26
applications/openshift/master/file_groupowner_ovs_conf_db_s390x/rule.yml
Outdated
Show resolved
Hide resolved
utils/build_ds_container.py
Outdated
@@ -143,7 +143,7 @@ def build_container_image(): | |||
REPO_PATH, '/Dockerfiles/compliance_operator_content.Dockerfile') | |||
command = [ | |||
'podman', 'build', '-f', dockerfile_path, '-t', | |||
'localcontentbuild:latest', '.'] | |||
'localcontentbuild:latest', '--platform', 'linux/arm64', '.'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should pull this out into its own change.
unique-cces is failing |
/test e2e-aws-ocp4-cis-node |
Latest testing shows the current PR is pulling in rules it shouldn't be on aarch64:
|
/test e2e-aws-ocp4-cis-node |
1 similar comment
/test e2e-aws-ocp4-cis-node |
ci/prow/e2e-aws-ocp4-cis-node
ci/prow/e2e-aws-ocp4-cis-node-arm
it looks like the test is working as expected |
/test e2e-aws-ocp4-cis-node |
controls/nist_ocp4.yml
Outdated
@@ -1092,14 +1092,14 @@ controls: | |||
- id: AC-6(8) | |||
status: supported | |||
notes: |- | |||
Red Hat OpenShift provides security context constraints (SCC) [1] that control permissions for actions that a pod can perform and what resources a pod can access. | |||
Red Hat OpenShift provides security context constraints (SCC) [1] that control permissions for actions that a pod can perform and what resources a pod can access. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixing all these random whitespace issues in #13261
/test |
@rhmdnd: The
Use
In response to this:
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. |
/test e2e-aws-ocp4-moderate-node-arm |
applications/openshift/master/file_groupowner_ovs_conf_db_lock_openvswitch/rule.yml
Outdated
Show resolved
Hide resolved
applications/openshift/master/file_groupowner_ovs_conf_db_openvswitch/rule.yml
Outdated
Show resolved
Hide resolved
/test e2e-aws-ocp4-cis-node |
The approach we're using with OVAL to select rules based on conditions doesn't work for multi-arch checks. Instead, the rule always passes even when it's checking a platform that has `openvswitch` for the group owner instead of `hugetlbfs`. This commit attempts to simplify the rule by removing the complexity of OVAL and relying on individual rules, one for checking group ownership for openvswitch and the other for hugetlbfs. It also uses the platform consistently, instead of using platforms, which expects a list of conditions. Using platform is more straightforward, and incorporates the architecture CPE into the evaluation at runtime.
Code Climate has analyzed commit 8e54261 and detected 0 issues on this pull request. The test coverage on the diff in this pull request is 100.0% (50% is the threshold). This pull request will bring the total coverage in the repository to 61.9% (0.0% change). View more on Code Climate. |
/test e2e-aws-ocp4-cis-node |
Rerunning testing farm because of the following timeouts:
Which seems unrelated to this change. @Mab879 are you seeing this crop up in other patches? |
Verified on a x86 clsuter + 4.19.0-0.nightly-2025-03-31-174812 + content from #13201:
For ARM, checked below test result form e2e-aws-ocp4-cis-node-arm job, which is expected:
|
/lgtm |
There were added initially in ComplianceAsCode#13201 but were added for the platform profiles in addition to the node profiles.
There were added initially in ComplianceAsCode#13201 but were added for the platform profiles in addition to the node profiles.
No description provided.