Skip to content

Sshd rekey limit update OVAL#13687

Merged
jan-cerny merged 6 commits into
ComplianceAsCode:masterfrom
Xeicker:sshd_rekey_limit
Jul 15, 2025
Merged

Sshd rekey limit update OVAL#13687
jan-cerny merged 6 commits into
ComplianceAsCode:masterfrom
Xeicker:sshd_rekey_limit

Conversation

@Xeicker
Copy link
Copy Markdown
Contributor

@Xeicker Xeicker commented Jul 10, 2025

Description:

  • Update OVAL in sshd_rekey_limit. Make OVAL fail if a drop-in file overrides wrongly the main file configuration. Allow it to pass if the main file contains a wrong configuration but it is overridden correctly in a drop in file, because those have precedence

Rationale:

-Current OVAL allows non compliant scenarios to pass

Review Hints:

  • New automatus tests reflect the new behavior

Edgar Aguilar added 3 commits July 10, 2025 11:24
reflect precedence of dropin files

Signed-off-by: Edgar Aguilar <edgar.aguilar@oracle.com>
Signed-off-by: Edgar Aguilar <edgar.aguilar@oracle.com>
Signed-off-by: Edgar Aguilar <edgar.aguilar@oracle.com>
Signed-off-by: Edgar Aguilar <edgar.aguilar@oracle.com>
@Xeicker Xeicker requested a review from a team as a code owner July 10, 2025 20:12
@Xeicker Xeicker added the OVAL OVAL update. Related to the systems assessments. label Jul 10, 2025
@Xeicker Xeicker added this to the 0.1.78 milestone Jul 10, 2025
Comment thread linux_os/guide/services/ssh/ssh_server/sshd_rekey_limit/oval/shared.xml Outdated
sed -i "/^\s*${SSHD_PARAM}.*/Id" /etc/ssh/sshd_config /etc/ssh/sshd_config.d/*
fi

echo "${SSHD_PARAM} 512M 1h" >> /etc/ssh/sshd_config /etc/ssh/sshd_config.d/good_config.conf
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

there needs to be just one file in the command, this doesn't add anything to the good_config.conf

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

what a curious mistake hahaha. Fixed it

Copy link
Copy Markdown
Collaborator

@jan-cerny jan-cerny left a comment

Choose a reason for hiding this comment

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

.

Xeicker and others added 2 commits July 11, 2025 10:16
…hared.xml

Co-authored-by: Jan Černý <jcerny@redhat.com>
Remove an unnecesary file mention

Signed-off-by: Edgar Aguilar <edgar.aguilar@oracle.com>
@qlty-cloud-legacy
Copy link
Copy Markdown

Code Climate has analyzed commit bfe9ba0 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.7% (0.0% change).

View more on Code Climate.

@Mab879 Mab879 assigned Mab879, mrkanon and jan-cerny and unassigned Mab879 Jul 14, 2025
Copy link
Copy Markdown
Collaborator

@jan-cerny jan-cerny left a comment

Choose a reason for hiding this comment

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

jcerny@fedora:~/work/git/scap-security-guide (pr/13687)$ python3 tests/automatus.py rule --libvirt qemu:///system ssgts_rhel9 sshd_rekey_limit
Setting console output to log level INFO
INFO - The base image option has not been specified, choosing libvirt-based test environment.
INFO - Logging into /home/jcerny/work/git/scap-security-guide/logs/rule-custom-2025-07-15-0802/test_suite.log
INFO - xccdf_org.ssgproject.content_rule_sshd_rekey_limit
INFO - Script duplicated_param.pass.sh using profile (all) OK
INFO - Script param_conflict.fail.sh using profile (all) OK
INFO - Script bad_size.fail.sh using profile (all) OK
INFO - Script bad_size_directory.fail.sh using profile (all) OK
INFO - Script bad_time.fail.sh using profile (all) OK
INFO - Script bad_time_directory.fail.sh using profile (all) OK
INFO - Script correct_value.pass.sh using profile (all) OK
INFO - Script no_line.fail.sh using profile (all) OK
INFO - Script no_line_directory.fail.sh using profile (all) OK
INFO - Script rhel8_ospp_ok.pass.sh using profile xccdf_org.ssgproject.content_profile_ospp OK
INFO - Script rhel9_ospp_ok.pass.sh using profile xccdf_org.ssgproject.content_profile_ospp OK
INFO - Script correct_main_file_wrong_directory.fail.sh using profile (all) OK
INFO - Script correct_value_directory.pass.sh using profile (all) OK
INFO - Script param_conflict_directory.fail.sh using profile (all) OK
INFO - Script wrong_main_file_correct_directory.pass.sh using profile (all) OK
jcerny@fedora:~/work/git/scap-security-guide (pr/13687)$ python3 tests/automatus.py rule --libvirt qemu:///system ssgts_rhel9 --remediate-using ansible sshd_rekey_limit
Setting console output to log level INFO
INFO - The base image option has not been specified, choosing libvirt-based test environment.
INFO - Logging into /home/jcerny/work/git/scap-security-guide/logs/rule-custom-2025-07-15-0812/test_suite.log
INFO - xccdf_org.ssgproject.content_rule_sshd_rekey_limit
INFO - Script duplicated_param.pass.sh using profile (all) OK
INFO - Script param_conflict.fail.sh using profile (all) OK
INFO - Script bad_size.fail.sh using profile (all) OK
INFO - Script bad_size_directory.fail.sh using profile (all) OK
INFO - Script bad_time.fail.sh using profile (all) OK
INFO - Script bad_time_directory.fail.sh using profile (all) OK
INFO - Script correct_value.pass.sh using profile (all) OK
INFO - Script no_line.fail.sh using profile (all) OK
INFO - Script no_line_directory.fail.sh using profile (all) OK
INFO - Script rhel8_ospp_ok.pass.sh using profile xccdf_org.ssgproject.content_profile_ospp OK
INFO - Script rhel9_ospp_ok.pass.sh using profile xccdf_org.ssgproject.content_profile_ospp OK
INFO - Script correct_main_file_wrong_directory.fail.sh using profile (all) OK
INFO - Script correct_value_directory.pass.sh using profile (all) OK
INFO - Script param_conflict_directory.fail.sh using profile (all) OK
INFO - Script wrong_main_file_correct_directory.pass.sh using profile (all) OK

@jan-cerny jan-cerny merged commit 4fb2ef4 into ComplianceAsCode:master Jul 15, 2025
130 of 133 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

OVAL OVAL update. Related to the systems assessments.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants