Skip to content

0307-docker-socket-priv: docker.socket file permissions are not set to 644 or more restrictive

Rule ID

  • 0307-docker-socket-priv

Category

  • Container

Level

  • warn

Compatible Versions

  • Linux

Description

  • If Docker is used on a computer managed by systemd, verify that the docker.socket file ownership and group ownership are correctly set to root.

Scan Frequency

  • 0 */30 * * *

Rationale

  • The docker.socket file contains sensitive parameters that can alter the behavior of the Docker remote API. Therefore, it should be writable only by root to maintain file integrity.

Risk Item

  • Container Security

Audit Method

  • Execute the following command to verify that the file permissions are correctly set to 644 or stricter:
stat -c %a /usr/lib/systemd/system/docker.socket

The above command should return nothing.

Remediation

  • Execute the following command:
#> chmod 644 /usr/lib/systemd/system/docker.socket

This sets the file permissions of this file to 644.

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 file permissions are correctly set to 644.

References

CIS Controls

  • None

Feedback

Is this page helpful?