Skip to content

0302-docker-service-ownership-docker.service file ownership not set to root:root


Rule ID

  • 0302-docker-service-ownership

Category

  • system

Level

  • warn

Supported Versions

  • Linux

Description

  • If Docker is used on a system where services are managed by systemd, verify that the Docker.service file ownership and group ownership are correctly set to root.

Scan Frequency

  • 0 */30 * * *

Rationale

  • The docker.service file contains sensitive parameters that could alter the behavior of the Docker daemon. Therefore, it should be owned by root and the group should be root to maintain file integrity.

Risk Item

  • Container Security

Audit Method

  • Execute the following command to verify that the file and group are owned by root:
stat -c %U:%G /usr/lib/systemd/system/docker.service | grep -v root:root

The above command should return nothing.

Remediation

  • Execute the following command:
#> chown root:root /usr/lib/systemd/system/docker.service

This sets the file ownership and group ownership to root.

Impact

  • None

Default Value

  • This file may not exist on the system. In that case, this recommendation does not apply. By default, if the file exists, its ownership and group ownership are correctly set to root.

References

CIS Controls

  • None

Feedback

Is this page helpful?