Configure Systemd Timesyncd Servers
An XCCDF Rule
Description
systemd-timesyncd
is a daemon that has been added for synchronizing the system clock
across the network. The systemd-timesyncd
daemon implements:
- Implements an SNTP client
- Runs with minimal privileges
- Saves the current clock to disk every time a new NTP sync has been acquired
- Is hooked up with networkd to only operate when network connectivity is available
Add or edit server or pool lines to /etc/systemd/timesyncd.conf
as appropriate:
server <remote-server>Multiple servers may be configured.
Rationale
Configuring systemd-timesyncd
ensures time synchronization is working properly.
- ID
- xccdf_org.ssgproject.content_rule_service_timesyncd_configured
- Severity
- Medium
- References
- Updated
Remediation - Ansible
- name: Gather the package facts
package_facts:
manager: auto
tags:
- CCE-92374-8
- PCI-DSS-Req-10.4.3
Remediation - Shell Script
# Remediation is applicable only in certain platforms
if rpm --quiet -q kernel-default && { rpm --quiet -q systemd; }; then
var_multiple_time_servers='<xccdf-1.2:sub xmlns:xccdf-1.2="http://checklists.nist.gov/xccdf/1.2" idref="xccdf_org.ssgproject.content_value_var_multiple_time_servers" use="legacy"/>'
IFS=',' read -r -a time_servers_array <<< "$var_multiple_time_servers"