-
Notifications
You must be signed in to change notification settings - Fork 706
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
Improve template macros for grub command line #10989
Improve template macros for grub command line #10989
Conversation
Cover the case where default grub file has the GRUB_CMDLINE_LINUX line but it is commented or the case where no such line exists
@teacup-on-rockingchair It would be great to add a test scenario that would test this situation. |
@@ -0,0 +1,5 @@ | |||
#!/bin/bas |
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.
missing h
@@ -0,0 +1,5 @@ | |||
#!/bin/bas |
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.
missing h
#!/bin/bas | ||
# platform = Red Hat Enterprise Linux 7,sle12,sle15 | ||
|
||
# Removes kernel command line in /etc/default/grub |
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.
It doesn't exactly remove it, instead, it comments it out.
@@ -0,0 +1,5 @@ | |||
#!/bin/bas | |||
# platform = Red Hat Enterprise Linux 7,sle12,sle15 |
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.
You can't use the short IDs, you should use full names:
# platform = Red Hat Enterprise Linux 7,Oracle Linux 7,SUSE Linux Enterprise 12,SUSE Linux Enterprise 15
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.
used a multi_platform_sle instead , anyways that was the idea
@@ -0,0 +1,5 @@ | |||
#!/bin/bas | |||
# platform = Red Hat Enterprise Linux 7,sle12,sle15 |
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.
You can't use the short IDs, you should use full names
7e47f53
to
2634ce2
Compare
2634ce2
to
a2d4a97
Compare
Code Climate has analyzed commit a2d4a97 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 53.3% (0.0% change). View more on Code Climate. |
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.
When the tests are executed on a virtual machine backend, they're OK:
[jcerny@fedora scap-security-guide{pr/10989}]$ python3 tests/automatus.py rule --libvirt qemu:///system ssgts_rhel7 --datastream build/ssg-rhel7-ds.xml grub2_ipv6_disable_argument
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-08-21-0946/test_suite.log
WARNING - Script arg_not_there_grubenv.fail.sh is not applicable on given platform
WARNING - Script wrong_value_entries.fail.sh is not applicable on given platform
WARNING - Script wrong_value.fail.sh is not applicable on given platform
WARNING - Script invalid_rescue.pass.sh is not applicable on given platform
WARNING - Script arg_not_there_rhel8.fail.sh is not applicable on given platform
WARNING - Script correct_grubenv.pass.sh is not applicable on given platform
WARNING - Script wrong_value_rhel8.fail.sh is not applicable on given platform
WARNING - Script arg_not_there_rhel9.fail.sh is not applicable on given platform
WARNING - Script wrong_value_rhel9.fail.sh is not applicable on given platform
INFO - xccdf_org.ssgproject.content_rule_grub2_ipv6_disable_argument
INFO - Script arg_not_there_etcdefaultgrub.fail.sh using profile (all) OK
INFO - Script arg_not_there_etcdefaultgrub_recovery_disabled.fail.sh using profile (all) OK
INFO - Script arg_not_there_rhel7.fail.sh using profile (all) OK
INFO - Script correct_grubby.pass.sh using profile (all) OK
INFO - Script correct_recovery_disabled.pass.sh using profile (all) OK
INFO - Script correct_value.pass.sh using profile (all) OK
INFO - Script wrong_value_etcdefaultgrub.fail.sh using profile (all) OK
INFO - Script wrong_value_etcdefaultgrub_recovery_disabled.fail.sh using profile (all) OK
INFO - Script wrong_value_rhel7.fail.sh using profile (all) OK
INFO - Script cmd_line_commented_etcdefaultgrub.fail.sh using profile (all) OK
INFO - Script cmd_line_not_there_etcdefaultgrub.fail.sh using profile (all) OK
[jcerny@fedora scap-security-guide{pr/10989}]$ python3 tests/automatus.py rule --libvirt qemu:///system ssgts_rhel7 --remediate-using ansible --datastream build/ssg-rhel7-ds.xml grub2_ipv6_disable_argument
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-08-21-0957/test_suite.log
WARNING - Script arg_not_there_grubenv.fail.sh is not applicable on given platform
WARNING - Script invalid_rescue.pass.sh is not applicable on given platform
WARNING - Script wrong_value_entries.fail.sh is not applicable on given platform
WARNING - Script wrong_value.fail.sh is not applicable on given platform
WARNING - Script arg_not_there_rhel8.fail.sh is not applicable on given platform
WARNING - Script correct_grubenv.pass.sh is not applicable on given platform
WARNING - Script wrong_value_rhel8.fail.sh is not applicable on given platform
WARNING - Script arg_not_there_rhel9.fail.sh is not applicable on given platform
WARNING - Script wrong_value_rhel9.fail.sh is not applicable on given platform
INFO - xccdf_org.ssgproject.content_rule_grub2_ipv6_disable_argument
INFO - Script arg_not_there_etcdefaultgrub.fail.sh using profile (all) OK
INFO - Script arg_not_there_etcdefaultgrub_recovery_disabled.fail.sh using profile (all) OK
INFO - Script arg_not_there_rhel7.fail.sh using profile (all) OK
INFO - Script correct_grubby.pass.sh using profile (all) OK
INFO - Script correct_recovery_disabled.pass.sh using profile (all) OK
INFO - Script correct_value.pass.sh using profile (all) OK
INFO - Script wrong_value_etcdefaultgrub.fail.sh using profile (all) OK
INFO - Script wrong_value_etcdefaultgrub_recovery_disabled.fail.sh using profile (all) OK
INFO - Script wrong_value_rhel7.fail.sh using profile (all) OK
INFO - Script cmd_line_commented_etcdefaultgrub.fail.sh using profile (all) OK
INFO - Script cmd_line_not_there_etcdefaultgrub.fail.sh using profile (all) OK
The CI fail on Rawhide is caused by missing dnf, the fail of testing farm on c8s is tracked in #10978, both fails aren't caused by the changes in this pull request. |
Description:
/etc/default/grub
file revealed some minor issues with current remediationsRationale: