Skip to content

0308-docker-env-ownership-Docker environment file ownership not set to root:root


Rule ID

  • 0308-docker-env-ownership

Category

  • container

Severity

  • warn

Compatible Versions

  • Linux

Description

  • The Docker daemon uses Docker environment files to set the runtime environment for the Docker daemon. On computers that use systemd to manage services, the file is /etc/sysconfig/docker. On other systems, the environment file is /etc/default/docker. Verify that the environment file ownership and group ownership are correctly set to root.

Scan Frequency

  • 0 */30 * * *

Rationale

  • The Docker environment file contains sensitive parameters that may alter the behavior of the Docker daemon at runtime. Therefore, it should be owned by root and the group should be root to maintain file integrity.

Risk

  • Container Security

Audit Procedure

  • Execute the following command to verify that the environment file is owned by root and its group is root:
stat -c %U:%G /etc/sysconfig/docker | grep -v root:root

The above command should return no output.

Remediation

  • Execute the following command:
#> chown root:root /etc/sysconfig/docker

This will set the ownership and group ownership of the environment file to root.

Impact

  • None

Default Value

  • By default, the ownership and group ownership of this file are correctly set to root.

References

CIS Controls

  • None

Feedback

Is this page helpful?