Skip to content

Fix file_groupowner_etc_chrony_keys OVAL check #13248

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

svet-se
Copy link
Contributor

@svet-se svet-se commented Mar 28, 2025

Description:

  • Fix file_groupowner_etc_chrony_keys OVAL check

Rationale:

  • improved the pattern match

@openshift-ci openshift-ci bot added the needs-ok-to-test Used by openshift-ci bot. label Mar 28, 2025
Copy link

openshift-ci bot commented Mar 28, 2025

Hi @svet-se. Thanks for your PR.

I'm waiting for a ComplianceAsCode member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@jan-cerny jan-cerny added this to the 0.1.77 milestone Mar 28, 2025
@jan-cerny jan-cerny self-assigned this Mar 28, 2025
@jan-cerny jan-cerny added the OVAL OVAL update. Related to the systems assessments. label Mar 28, 2025
Copy link
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.

Please add a test scenario covering the situation that is fixed by this PR.

@svet-se
Copy link
Contributor Author

svet-se commented Mar 28, 2025

Please add a test scenario covering the situation that is fixed by this PR.

Hey @jan-cerny,
The rule itself works as expected. I want to cover just the case if there is a "chrony:!:470" for example, in the group file, because the "!" symbol is not covered by "\w".

- add tests scpecific for file_groupowner_etc_chrony_keys rule as they require chrony package
- add a test for the change introduced in ComplianceAsCode#13248 so we will test also locked groups
Copy link

codeclimate bot commented Mar 31, 2025

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

View more on Code Climate.

Copy link
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.

thanks for adding the tests!

jcerny@fedora:~/work/git/scap-security-guide (pr/13248)$ python3 tests/automatus.py rule --libvirt qemu:///system ssgts_rhel9 file_groupowner_etc_chrony_keys
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-04-01-0850/test_suite.log
INFO - xccdf_org.ssgproject.content_rule_file_groupowner_etc_chrony_keys
INFO - Script correct_chrony_keys_groupowner.pass.sh using profile (all) OK
INFO - Script correct_chrony_keys_locked_groupowner.pass.sh using profile (all) OK
INFO - Script incorrect_chrony_keys_groupowner.fail.sh using profile (all) OK
jcerny@fedora:~/work/git/scap-security-guide (pr/13248)$ python3 tests/automatus.py rule --libvirt qemu:///system ssgts_rhel9 --remediate-using ansible file_groupowner_etc_chrony_keys
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-04-01-0853/test_suite.log
INFO - xccdf_org.ssgproject.content_rule_file_groupowner_etc_chrony_keys
INFO - Script correct_chrony_keys_groupowner.pass.sh using profile (all) OK
INFO - Script correct_chrony_keys_locked_groupowner.pass.sh using profile (all) OK
INFO - Script incorrect_chrony_keys_groupowner.fail.sh using profile (all) OK

@jan-cerny jan-cerny merged commit 043f3eb into ComplianceAsCode:master Apr 1, 2025
96 of 101 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-ok-to-test Used by openshift-ci bot. OVAL OVAL update. Related to the systems assessments.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants