-
Notifications
You must be signed in to change notification settings - Fork 710
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
NTP related rules for CIS on Ubuntu 20.04 and 22.04 #10344
Conversation
This datastream diff is auto generated by the check Click here to see the full diffbash remediation for rule 'xccdf_org.ssgproject.content_rule_service_chronyd_enabled' differs.
--- xccdf_org.ssgproject.content_rule_service_chronyd_enabled
+++ xccdf_org.ssgproject.content_rule_service_chronyd_enabled
@@ -1,5 +1,5 @@
# Remediation is applicable only in certain platforms
-if [ ! -f /.dockerenv ] && [ ! -f /run/.containerenv ]; then
+if [ ! -f /.dockerenv ] && [ ! -f /run/.containerenv ] && { rpm --quiet -q chrony; }; then
SYSTEMCTL_EXEC='/usr/bin/systemctl'
"$SYSTEMCTL_EXEC" unmask 'chronyd.service'
ansible remediation for rule 'xccdf_org.ssgproject.content_rule_service_chronyd_enabled' differs.
--- xccdf_org.ssgproject.content_rule_service_chronyd_enabled
+++ xccdf_org.ssgproject.content_rule_service_chronyd_enabled
@@ -1,3 +1,14 @@
+- name: Gather the package facts
+ package_facts:
+ manager: auto
+ tags:
+ - enable_strategy
+ - low_complexity
+ - low_disruption
+ - medium_severity
+ - no_reboot_needed
+ - service_chronyd_enabled
+
- name: Enable service chronyd
block:
@@ -13,7 +24,9 @@
masked: 'no'
when:
- '"chrony" in ansible_facts.packages'
- when: ansible_virtualization_type not in ["docker", "lxc", "openvz", "podman", "container"]
+ when:
+ - ansible_virtualization_type not in ["docker", "lxc", "openvz", "podman", "container"]
+ - '"chrony" in ansible_facts.packages'
tags:
- enable_strategy
- low_complexity
bash remediation for rule 'xccdf_org.ssgproject.content_rule_service_ntp_enabled' differs.
--- xccdf_org.ssgproject.content_rule_service_ntp_enabled
+++ xccdf_org.ssgproject.content_rule_service_ntp_enabled
@@ -1,5 +1,5 @@
# Remediation is applicable only in certain platforms
-if [ ! -f /.dockerenv ] && [ ! -f /run/.containerenv ]; then
+if [ ! -f /.dockerenv ] && [ ! -f /run/.containerenv ] && { rpm --quiet -q ntp; }; then
SYSTEMCTL_EXEC='/usr/bin/systemctl'
"$SYSTEMCTL_EXEC" unmask 'ntp.service'
ansible remediation for rule 'xccdf_org.ssgproject.content_rule_service_ntp_enabled' differs.
--- xccdf_org.ssgproject.content_rule_service_ntp_enabled
+++ xccdf_org.ssgproject.content_rule_service_ntp_enabled
@@ -1,3 +1,18 @@
+- name: Gather the package facts
+ package_facts:
+ manager: auto
+ tags:
+ - CCE-91657-7
+ - NIST-800-53-AU-8(1)(a)
+ - NIST-800-53-CM-6(a)
+ - PCI-DSS-Req-10.4
+ - enable_strategy
+ - high_severity
+ - low_complexity
+ - low_disruption
+ - no_reboot_needed
+ - service_ntp_enabled
+
- name: Enable service ntp
block:
@@ -13,7 +28,9 @@
masked: 'no'
when:
- '"ntp" in ansible_facts.packages'
- when: ansible_virtualization_type not in ["docker", "lxc", "openvz", "podman", "container"]
+ when:
+ - ansible_virtualization_type not in ["docker", "lxc", "openvz", "podman", "container"]
+ - '"ntp" in ansible_facts.packages'
tags:
- CCE-91657-7
- NIST-800-53-AU-8(1)(a)
bash remediation for rule 'xccdf_org.ssgproject.content_rule_service_timesyncd_enabled' differs.
--- xccdf_org.ssgproject.content_rule_service_timesyncd_enabled
+++ xccdf_org.ssgproject.content_rule_service_timesyncd_enabled
@@ -1,5 +1,5 @@
# Remediation is applicable only in certain platforms
-if [ ! -f /.dockerenv ] && [ ! -f /run/.containerenv ]; then
+if [ ! -f /.dockerenv ] && [ ! -f /run/.containerenv ] && { ( ! ( rpm --quiet -q chrony ) && ! ( rpm --quiet -q ntp ) ); }; then
SYSTEMCTL_EXEC='/usr/bin/systemctl'
"$SYSTEMCTL_EXEC" unmask 'systemd-timesyncd.service'
ansible remediation for rule 'xccdf_org.ssgproject.content_rule_service_timesyncd_enabled' differs.
--- xccdf_org.ssgproject.content_rule_service_timesyncd_enabled
+++ xccdf_org.ssgproject.content_rule_service_timesyncd_enabled
@@ -1,3 +1,18 @@
+- name: Gather the package facts
+ package_facts:
+ manager: auto
+ tags:
+ - CCE-91659-3
+ - NIST-800-53-AU-8(1)(a)
+ - NIST-800-53-CM-6(a)
+ - PCI-DSS-Req-10.4
+ - enable_strategy
+ - high_severity
+ - low_complexity
+ - low_disruption
+ - no_reboot_needed
+ - service_timesyncd_enabled
+
- name: Enable service systemd-timesyncd
block:
@@ -13,7 +28,10 @@
masked: 'no'
when:
- '"systemd" in ansible_facts.packages'
- when: ansible_virtualization_type not in ["docker", "lxc", "openvz", "podman", "container"]
+ when:
+ - ansible_virtualization_type not in ["docker", "lxc", "openvz", "podman", "container"]
+ - ( not ( "chrony" in ansible_facts.packages ) and not ( "ntp" in ansible_facts.packages
+ ) )
tags:
- CCE-91659-3
- NIST-800-53-AU-8(1)(a) |
Code Climate has analyzed commit af5be42 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.8% (0.0% change). View more on Code Climate. |
/retest |
1 similar comment
/retest |
@dodys: The following tests 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.
Thanks for the PR. Automatus failures are expected due to the prodtypes of the rules that where changed and the nature of NTP. Waving the CODEOWNERS as @dodys cannot merge his own PRs.
Description:
platform: not package[chrony] and not package[ntp]
to service_timesyncd_enabledplatform: package[ntp]
to service_ntp_enabledplatform: package[chrony]
in service_chrony_enabled. Let me know if this should be anand
insteadRationale: