Description
get_service_file
looks for $SERVICE
in these directories:
/etc/systemd/system/
/lib/systemd/system/
/usr/lib/systemd/system/
As well as looks at systemctl's FragmentPath
property.
Reference:
docker-bench-security/functions/helper_lib.sh
Lines 132 to 148 in 820abe9
CIS test 1.1.8 throws INFO
and remediation has a blank recommendation because containerd.sock
is not found in any of those directories or via FP.
[INFO] 1.1.8 - Ensure auditing is configured for Docker files and directories - containerd.sock (Automated)
[INFO] * File not found
...
[INFO] 1.1.8 - Install auditd. Add -w -k docker to the /etc/audit/rules.d/audit.rules file. Then restart the audit daemon using command service auditd restart. Remediation Impact: Audit can generate large log files. So you need to make sure that they are rotated and archived periodically. Create a separate partition for audit logs to avoid filling up other critical partitions.
Note the extra space between -w
and -k
above.
Instead, when docker runs with active containers, it's only found at /run/containerd/containerd.sock
.
# find / -name "containerd.sock"
/run/containerd/containerd.sock
This has been observed with Docker v20.10.25 on Amazon Linux 2 and v25.0.3 on Amazon Linux 2023.
● docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
Active: active (running) since Thu 2024-04-11 13:06:55 UTC; 1h 31min ago
Docs: https://docs.docker.com
Main PID: 5089 (dockerd)
Tasks: 62
Memory: 644.9M
CGroup: /system.slice/docker.service
├─5089 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock --default-ulimit nofile=32768:65536
...
Note --containerd
points to /run/containerd/containerd.sock
.
I checked CIS Docker Benchmark v1.6.0 and it does not specify the location of containerd.sock, only that you find it and monitor it.
Can the tests be updated to check /run
as well?