TMAegis
More rules for docker

TMA-DOCKER-3.7

Ensure that registry certificate file ownership is set to root:root

HighLevel 1Automateddocker

Description

Registry certificate files under /etc/docker/certs.d must be owned by root:root so that they cannot be replaced by unprivileged users. The audit lists files under /etc/docker/certs.d not owned by root:root; not applicable when /etc/docker/certs.d does not exist.

How it is checked

Audit method: Shell command

shell
out=$(find /etc/docker/certs.d -type f \( ! -user root -o ! -group root \) 2>/dev/null) || exit 1; [ -z "$out" ] && echo compliant || printf '%s\n' "$out"
Expected output
compliant

How it is fixed

Fix method: Shell command

shell
find /etc/docker/certs.d -type f -exec chown root:root {} +

Properties

Operating systems
Any
Tags
dockerpermissionstls
Reference
CIS Docker Benchmark v1.9.0 - 3.7 Ensure that registry certificate file ownership is set to root:root

Check this host

Run this on a machine you are allowed to audit. The scan is read-only.

shell
tmaegis scan --target docker