Skip to content
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

[Stabilization] revert modifications to file_groupownership template and respective rules #10683

Conversation

vojtapolasek
Copy link
Collaborator

@vojtapolasek vojtapolasek commented Jun 5, 2023

Description:

Rationale:

Review Hints:

Try to reproduce the fixed issue #10655

@vojtapolasek vojtapolasek added this to the 0.1.68 milestone Jun 5, 2023
@vojtapolasek vojtapolasek requested a review from a team as a code owner June 5, 2023 12:51
@github-actions
Copy link

github-actions bot commented Jun 5, 2023

Start a new ephemeral environment with changes proposed in this pull request:

Fedora Environment
Open in Gitpod

Oracle Linux 8 Environment
Open in Gitpod

@vojtapolasek vojtapolasek marked this pull request as draft June 5, 2023 12:54
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Used by openshift-ci bot. label Jun 5, 2023
@jan-cerny jan-cerny self-assigned this Jun 5, 2023
@vojtapolasek vojtapolasek force-pushed the stabilization_revert_ssh_key_rules branch 2 times, most recently from c5dc5b3 to ab0a8f2 Compare June 5, 2023 14:37
@vojtapolasek vojtapolasek marked this pull request as ready for review June 5, 2023 14:41
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Used by openshift-ci bot. label Jun 5, 2023
@ggbecker
Copy link
Member

ggbecker commented Jun 5, 2023

I believe the ids from dedicated_ssh_keyowner attribute can be removed as they are not used anywhere.

@Mab879 Mab879 added the bugfix Fixes to reported bugs. label Jun 5, 2023
@vojtapolasek vojtapolasek force-pushed the stabilization_revert_ssh_key_rules branch from ab0a8f2 to 90c31c2 Compare June 6, 2023 07:44
@vojtapolasek vojtapolasek force-pushed the stabilization_revert_ssh_key_rules branch from 90c31c2 to ca91455 Compare June 6, 2023 07:45
@vojtapolasek
Copy link
Collaborator Author

@ggbecker thank you, I was not sure. I modified the branch.

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.

I tried to run a scan of the RHEL 7.9 virtual machine where previously I reproduced the issue and I have seen that the problematic error message doesn't appear with this patch.

[root@localhost ~]# rpm -q openscap
openscap-1.2.17-11.el7.x86_64
[root@localhost ~]# oscap xccdf eval --profile '(all)' --rule xccdf_org.ssgproject.content_rule_file_groupowner_var_log_syslog ./ssg-rhel7-ds.xml 
WARNING: Datastream component 'scap_org.open-scap_cref_security-data-oval-com.redhat.rhsa-RHEL7.xml.bz2' points out to the remote 'https://access.redhat.com/security/data/oval/com.redhat.rhsa-RHEL7.xml.bz2'. Use '--fetch-remote-resources' option to download it.
WARNING: Skipping 'https://access.redhat.com/security/data/oval/com.redhat.rhsa-RHEL7.xml.bz2' file which is referenced from datastream
W: oscap: File ssg-rhel7-cpe-oval.xml has already been registered in Source DataStream session: ./ssg-rhel7-ds.xml
WARNING: Skipping ./security-data-oval-com.redhat.rhsa-RHEL7.xml.bz2 file which is referenced from XCCDF content
Title   Verify Group Who Owns /var/log/syslog File
Rule    xccdf_org.ssgproject.content_rule_file_groupowner_var_log_syslog
Result  pass

[root@localhost ~]# 

The rule has passed its test scenarios

[jcerny@thinkpad scap-security-guide{pr/10683}]$ python3 tests/automatus.py rule --libvirt qemu:///system ssgts_rhel7 file_groupowner_var_log_syslog
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-2023-06-06-1103/test_suite.log
INFO - xccdf_org.ssgproject.content_rule_file_groupowner_var_log_syslog
INFO - Script correct_groupowner.pass.sh using profile (all) OK
INFO - Script missing_file_test.pass.sh using profile (all) OK
INFO - Script incorrect_groupowner.fail.sh using profile (all) OK
[jcerny@thinkpad scap-security-guide{pr/10683}]$ python3 tests/automatus.py rule --libvirt qemu:///system ssgts_rhel7 --remediate-using ansible file_groupowner_var_log_syslog
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-2023-06-06-1108/test_suite.log
INFO - xccdf_org.ssgproject.content_rule_file_groupowner_var_log_syslog
INFO - Script correct_groupowner.pass.sh using profile (all) OK
INFO - Script missing_file_test.pass.sh using profile (all) OK
INFO - Script incorrect_groupowner.fail.sh using profile (all) OK
[jcerny@thinkpad scap-security-guide{pr/10683}]$ 

@jan-cerny
Copy link
Collaborator

The CI fail on Rawhide isn't related to the contents of this PR because it's a fail in dnf update -y.

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.

I have run TSs for some other rules that use the file_groupowner template and they pass.

@jan-cerny jan-cerny merged commit 5d417c3 into ComplianceAsCode:stabilization-v0.1.68 Jun 6, 2023
25 of 26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix Fixes to reported bugs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants