Configure Systemd Timesyncd Root Distance Servers
An XCCDF Rule
Description
systemd-timesyncd
server configuration should have RootDistanceMaxSec is
listed in accordance with local policy. This setting describes the maximum estimated
time required for a packet to travel to the server connected.
Rationale
Configuring systemd-timesyncd
RootDistanceMaxSec ensures time synchronization
is using servers that are close enough to the client.
- ID
- xccdf_org.ssgproject.content_rule_service_timesyncd_root_distance_configured
- Severity
- Medium
- References
- Updated
Remediation - Ansible
- name: Gather the package facts
package_facts:
manager: auto
tags:
- CCE-92514-9
- PCI-DSS-Req-10.4.3
Remediation - Shell Script
# Remediation is applicable only in certain platforms
if [ ! -f /.dockerenv ] && [ ! -f /run/.containerenv ] && { rpm --quiet -q systemd; }; then
config_file="/etc/systemd/timesyncd.d/oscap-remedy.conf"
IFS=" " mapfile -t current_cfg_arr < <(ls -1 /etc/systemd/timesyncd.d/* 2>/dev/null)
current_cfg_arr+=( "/etc/systemd/timesyncd.conf" )