-
Notifications
You must be signed in to change notification settings - Fork 698
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
Add new rule socket_systemd-journal-remote_disabled #10210
Add new rule socket_systemd-journal-remote_disabled #10210
Conversation
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.
Hello, thank you for the new rule. See my comments. But here is the main question:
Are you aiming at disabling ONLY the socket as stated in CIS benchmark?
If yes, the you should know that themplate you are using disables the service unit as well as the socket unit.
linux_os/guide/system/logging/journald/service_systemd-journal-remote_disabled/rule.yml
Outdated
Show resolved
Hide resolved
linux_os/guide/system/logging/journald/service_systemd-journal-remote_disabled/rule.yml
Outdated
Show resolved
Hide resolved
/retest |
/retest |
@dodys are you planing to add test scenarios as well? How about Ansible remediation? |
Just pushed tests for it. |
This datastream diff is auto generated by the check Click here to see the full diffbash remediation for rule 'xccdf_org.ssgproject.content_rule_smartcard_auth' differs.
--- xccdf_org.ssgproject.content_rule_smartcard_auth
+++ xccdf_org.ssgproject.content_rule_smartcard_auth
@@ -15,7 +15,9 @@
# The service may not be running because it has been started and failed,
# so let's reset the state so OVAL checks pass.
# Service should be 'inactive', not 'failed' after reboot though.
-/usr/bin/systemctl reset-failed "pcscd.socket"
+if /usr/bin/systemctl --failed | grep -q "pcscd.socket"; then
+ /usr/bin/systemctl reset-failed "pcscd.socket"
+fi
# Configure the expected /etc/pam.d/system-auth{,-ac} settings directly
#
bash remediation for rule 'xccdf_org.ssgproject.content_rule_service_chronyd_or_ntpd_enabled' differs.
--- xccdf_org.ssgproject.content_rule_service_chronyd_or_ntpd_enabled
+++ xccdf_org.ssgproject.content_rule_service_chronyd_or_ntpd_enabled
@@ -8,7 +8,9 @@
# The service may not be running because it has been started and failed,
# so let's reset the state so OVAL checks pass.
# Service should be 'inactive', not 'failed' after reboot though.
- /usr/bin/systemctl reset-failed "chronyd"
+ if /usr/bin/systemctl --failed | grep -q "chronyd"; then
+ /usr/bin/systemctl reset-failed "chronyd"
+ fi
fi
elif rpm --quiet -q "ntp" ; then
/usr/bin/systemctl enable "ntpd"
@@ -16,7 +18,9 @@
# The service may not be running because it has been started and failed,
# so let's reset the state so OVAL checks pass.
# Service should be 'inactive', not 'failed' after reboot though.
- /usr/bin/systemctl reset-failed "ntpd"
+ if /usr/bin/systemctl --failed | grep -q "ntpd"; then
+ /usr/bin/systemctl reset-failed "ntpd"
+ fi
else
if ! rpm -q --quiet "chrony" ; then
yum install -y "chrony"
@@ -26,7 +30,9 @@
# The service may not be running because it has been started and failed,
# so let's reset the state so OVAL checks pass.
# Service should be 'inactive', not 'failed' after reboot though.
- /usr/bin/systemctl reset-failed "chronyd"
+ if /usr/bin/systemctl --failed | grep -q "chronyd"; then
+ /usr/bin/systemctl reset-failed "chronyd"
+ fi
fi
else |
ba31a9e
to
7a0f2e0
Compare
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.
Hello,
thank you for updates. It wil need few more changes, see comments.
linux_os/guide/system/logging/journald/socket_systemd-journal-remote_disabled/bash/shared.sh
Outdated
Show resolved
Hide resolved
linux_os/guide/system/logging/journald/socket_systemd-journal-remote_disabled/rule.yml
Show resolved
Hide resolved
linux_os/guide/system/logging/journald/socket_systemd-journal-remote_disabled/rule.yml
Outdated
Show resolved
Hide resolved
linux_os/guide/system/logging/journald/socket_systemd-journal-remote_disabled/rule.yml
Outdated
Show resolved
Hide resolved
linux_os/guide/system/logging/journald/socket_systemd-journal-remote_disabled/rule.yml
Outdated
Show resolved
Hide resolved
7a0f2e0
to
195192b
Compare
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.
Hello, thank you for improvements. Just two more things and I think we are ready to merge it.
linux_os/guide/system/logging/journald/socket_systemd-journal-remote_disabled/rule.yml
Show resolved
Hide resolved
linux_os/guide/system/logging/journald/socket_systemd-journal-remote_disabled/bash/shared.sh
Outdated
Show resolved
Hide resolved
Code Climate has analyzed commit 1ca3238 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 51.7% (0.0% change). View more on Code Climate. |
@dodys: 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/test-infra repository. I understand the commands that are listed here. |
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.
Looks good now.
automatus tests are failing because during the PR development, there were added test scenarios (which passed), but later it was decided to restrict the rule to Ubuntu2204 prodtype. I think it does not make sense to remove those tests - it is possible that the rule will be eventually reused in RHEL since it is from CIS profile.
@vojtapolasek no I cannot approve PRs that I'm the author. @marcusburghardt can you help us here? |
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.
Thanks for this rule. It will also be useful for other distros. I will be happy to include the Ansible remediation for it.
Automatus CS8, CS9 and Fedora are failing because the rule is restricted to |
Overriding CODEOWNERS since @dodys can't approve his own PR. |
Description:
systemd-journal-remote.socket
Rationale: