-
Notifications
You must be signed in to change notification settings - Fork 758
CMP-3916: Add runtime SSHD config checking for OpenShift #14118
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
base: master
Are you sure you want to change the base?
Conversation
b6e4613 to
73abb36
Compare
Add runtime SSHD config checking for OpenShift compliance operatorThe compliance operator fetches runtime SSHD config from the cluster andfeeds it to the scanner before scans. Adds `sshd_runtime_check` option(default: false, true for RHCOS4), updates OVAL macros, and sets default
73abb36 to
22e46de
Compare
Enhance the SSHD runtime configuration checking by updating the path for the compliance operator's runtime effective config file to a temp file. Modify the OVAL macros to conditionally adjust the criteria operator based on the runtime check status, ensuring accurate compliance checks.
|
I was able to get this running in a cluster using: diff --git a/shared/macros/10-oval.jinja b/shared/macros/10-oval.jinja
index da83eefd2b..6ab2b0f245 100644
--- a/shared/macros/10-oval.jinja
+++ b/shared/macros/10-oval.jinja
@@ -1036,7 +1036,7 @@ Generates the :code:`<affected>` tag for OVAL check using correct product platfo
{{%- macro sshd_oval_check(parameter, value, missing_parameter_pass, config_is_distributed, runtime_check="false", xccdf_variable="", datatype="", rule_id=None, rule_title=None) -%}}
{{%- set sshd_config_path = "/etc/ssh/sshd_config" %}}
{{%- set sshd_config_dir = "/etc/ssh/sshd_config.d" -%}}
-{{%- set sshd_runtime_path = "/tmp/runtime/sshd_effective_config" -%}}
+{{%- set sshd_runtime_path = "/runtime/sshd_config" -%}}
{{%- if xccdf_variable -%}}
{{%- set description = "Ensure '" ~ parameter ~ "' is configured with value configured in " ~ xccdf_variable ~ " variable in " ~ sshd_config_path %}}
{{%- else -%}}But - after applying the GSS api authentication remediation, the rule still fails. |
This is a new parameter, that defaults to false. Update the test data so that it's included in product stability.
edeb792 to
f3038dd
Compare
Co-authored-by: Watson Yuuma Sato <[email protected]>
…iguration check to a fixed "AND" instead of conditionally based on the runtime check status. This change simplifies the logic and ensures consistent behavior in compliance checks.
Mab879
left a comment
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.
Based on my testing it seems that RHEL is fine. Once other reviewer's comments are addressed I can provide my approval.
dodys
left a comment
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.
lgtm, thanks!
|
@Vincent056: The following test failed, say
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
left a comment
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.
/lgtm
Description:
Add runtime SSHD config checking for OpenShift compliance operator
The compliance operator fetches runtime SSHD config from the cluster and feeds it to the scanner before scans. Adds
sshd_runtime_checkoption(default: false, true for RHCOS4), updates OVAL macros, and sets defaultRationale:
Fixs CMP-3916
Review Hints: