For AI agents: A markdown version of this page is available at https://docs.datadoghq.com/security/default_rules/agi-95m-4vt.md. A documentation index is available at /llms.txt.

The docker.service file ownership and group should be set to root

docker

Classification:

compliance

Framework:

cis-docker

Control:

3.1

Description

The docker.service unit file should be owned by user root and group root.

Rationale

The docker.service unit sets the command line and the environment of the Docker daemon. Its owner can change it, so the owner and group should be root only.

Audit

Find the unit file that systemd uses, then show its owner and group:

systemctl show -p FragmentPath docker.service
stat -c '%U:%G' /usr/lib/systemd/system/docker.service

Datadog checks docker.service in /etc/systemd/system, /run/systemd/system, /usr/local/lib/systemd/system, /usr/lib/systemd/system, or /lib/systemd/system. It passes the rule when every copy found belongs to root:root, fails it when one belongs to another user or group, and reports it not applicable when there is none.

Remediation

Set the owner and group of the unit file that systemd uses:

chown root:root /usr/lib/systemd/system/docker.service

Impact

None.

Default value

The Docker packages install the unit files in /usr/lib/systemd/system with owner root:root and mode 644.