8000 [ubuntu2404] Add ubuntu specific configuration path by alanmcanonical · Pull Request #13096 · ComplianceAsCode/content · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[ubuntu2404] Add ubuntu specific configuration path #13096

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

Merged
merged 1 commit into from
Feb 25, 2025

Conversation

alanmcanonical
Copy link
Contributor
@alanmcanonical alanmcanonical commented Feb 24, 2025

Description:

  • correct the configuration path on ubuntu

Rationale:

  • Satisfy the rule 2.3.2.1 Ensure systemd-timesyncd configured with authorized timeserver

@openshift-ci openshift-ci bot added the needs-ok-to-test Used by openshift-ci bot. label Feb 24, 2025
Copy link
openshift-ci bot commented Feb 24, 2025

Hi @alanmcanonical. 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.

Copy link

This datastream diff is auto generated by the check Compare DS/Generate Diff

Click here to see the full diff
bash remediation for rule 'xccdf_org.ssgproject.content_rule_service_timesyncd_configured' differs.
--- xccdf_org.ssgproject.content_rule_service_timesyncd_configured
+++ xccdf_org.ssgproject.content_rule_service_timesyncd_configured
@@ -9,8 +9,10 @@
 fallback_ntp_servers_array=("${time_servers_array[@]:2}")
 fallback_ntp_servers=$( echo "${fallback_ntp_servers_array[@]}"|sed -e 's/\s\+/,/g' )
 
-IFS=" " mapfile -t current_cfg_arr < <(ls -1 /etc/systemd/timesyncd.d/* 2>/dev/null)
+IFS=" " mapfile -t current_cfg_arr < <(ls -1 /etc/systemd/timesyncd.d/* /etc/systemd/timesyncd.conf.d/* 2>/dev/null)
+
 config_file="/etc/systemd/timesyncd.d/oscap-remedy.conf"
+
 current_cfg_arr+=( "/etc/systemd/timesyncd.conf" )
 # Comment existing NTP FallbackNTP settings
 for current_cfg in "${current_cfg_arr[@]}"
@@ -18,11 +20,14 @@
     sed -i 's/^NTP/#&/g' "$current_cfg"
     sed -i 's/^FallbackNTP/#&/g' "$current_cfg"
 done
+
 # Create /etc/systemd/timesyncd.d if it doesn't exist
 if [ ! -d "/etc/systemd/timesyncd.d" ]
 then 
     mkdir /etc/systemd/timesyncd.d
 fi
+
+
 # Set primary fallback NTP servers in drop-in configuration
 echo "NTP=$preferred_ntp_servers" >> "$config_file"
 echo "FallbackNTP=$fallback_ntp_servers" >> "$config_file"

Copy link
codeclimate bot commented Feb 24, 2025

Code Climate has analyzed commit ab2388a and detected 0 issues 8000 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.

@dodys dodys requested a review from a team February 24, 2025 13:59
@dodys dodys self-assigned this Feb 24, 2025
@dodys dodys added Ubuntu Ubuntu product related. Update Rule Issues or pull requests related to Rules updates. CIS CIS Benchmark related. labels Feb 24, 2025
@dodys dodys added this to the 0.1.77 milestone Feb 24, 2025
@alanmcanonical
Copy link
Contributor Author

Here is dumped log on kvm

am@am-ThinkPad-X1-Carbon-Gen-9:~/dev/cac/content$ test_cac_rule sec-noble-amd64 ubuntu2404 cis_level2_workstation service_timesyncd_configured
Copying build/ssg-ubuntu2404-ds.xml file to /tmp
Unselecting rules listed in the /tmp/tmp.ygQpHmaL3o from the /tmp/ssg-ubuntu2404-ds.xml
Done
Diff of original and modified datastream file:
1242c1242
<         <xccdf-1.2:select idref="xccdf_org.ssgproject.content_rule_sshd_disable_root_login" selected="true"/>
---
>         <xccdf-1.2:select idref="xccdf_org.ssgproject.content_rule_sshd_disable_root_login" selected="false"/>
1714c1714
<         <xccdf-1.2:select idref="xccdf_org.ssgproject.content_rule_sshd_disable_root_login" selected="true"/>
---
>         <xccdf-1.2:select idref="xccdf_org.ssgproject.content_rule_sshd_disable_root_login" selected="false"/>
2298c2298
<         <xccdf-1.2:select idref="xccdf_org.ssgproject.content_rule_sshd_disable_root_login" selected="true"/>
---
>         <xccdf-1.2:select idref="xccdf_org.ssgproject.content_rule_sshd_disable_root_login" selected="false"/>
2870c2870
<         <xccdf-1.2:select idref="xccdf_org.ssgproject.content_rule_sshd_disable_root_login" selected="true"/>
---
>         <xccdf-1.2:select idref="xccdf_org.ssgproject.content_rule_sshd_disable_root_login" selected="false"/>
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/am/dev/cac/content/logs/rule-custom-2025-02-24-2223/test_suite.log
libvirt: QEMU Driver error : argument unsupported: QEMU guest agent is not configured
INFO - xccdf_org.ssgproject.content_rule_service_timesyncd_configured
INFO - Script dropin_config.pass.sh using profile (all) OK
INFO - Script empty_config.fail.sh using profile (all) OK
INFO - Script timesyncd_config.pass.sh using profile (all) OK
removed '/tmp/ssg-ubuntu2404-ds.xml'
removed '/tmp/tmp.ygQpHmaL3o'

Copy link
Contributor
@mpurg mpurg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, thanks!

Copy link
Contributor
@dodys dodys left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, thanks!

@dodys dodys merged commit 47b568b into ComplianceAsCode:master Feb 25, 2025
96 of 102 checks passed
@alanmcanonical alanmcanonical deleted the timesync_path branch April 24, 2025 07:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CIS CIS Benchmark related. needs-ok-to-test Used by openshift-ci bot. Ubuntu Ubuntu product related. Update Rule Issues or pull requests related to Rules updates.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0