| name | cis-docker-v170-1.1.5 |
| description | Ensure auditing is configured for Docker files and directories - /var/lib/docker |
| category | cis-docker |
| version | 1.7.0 |
| author | cyberstrike-official |
| tags | ["cis","docker","host-configuration","auditing","filesystem"] |
| cis_id | 1.1.5 |
| cis_benchmark | CIS Docker Benchmark v1.7.0 |
| tech_stack | ["docker","linux","auditd"] |
| cwe_ids | [] |
| chains_with | [] |
| prerequisites | [] |
| severity_boost | {} |
CIS Docker Benchmark v1.7.0 - Control 1.1.5
Profile
- Level: 1 - Docker - Linux
- Assessment Status: Manual
Description
Audit /var/lib/docker.
Rationale
As well as auditing the normal Linux file system and system calls, you should also audit all Docker related files and directories. The Docker daemon runs with root privileges and its behaviour depends on some key files and directories. /var/lib/docker is one such directory. As it holds all the information about containers it should be audited.
Impact
Auditing can generate large log files. You should ensure that these are rotated and archived periodically. A separate partition should also be created for audit logs to avoid filling up any other critical partition.
Audit Procedure
You should verify that there is an audit rule applied to the /var/lib/docker directory.
For example, you could execute the command below:
auditctl -l | grep /var/lib/docker
This should list a rule for the /var/lib/docker directory.
Remediation
You should add a rule for the /var/lib/docker directory.
Adding exclusions for /var/lib/docker/overlay2 & /var/lib/docker/volumes reduces the audit messages to a more manageable level.
For example,
Add the line as below to the /etc/audit/rules.d/audit.rules file:
-a exit,always -F path=/var/lib/docker -F perm=war -k docker
-a exit,never -F dir=/var/lib/docker/volumes
-a exit,never -F dir=/var/lib/docker/overlay2
or for systems with namespace-remapping enabled
-a exit,always -F path=/var/lib/docker -F perm=war -k docker
-a exit,never -F dir=/var/lib/docker/165536.165536/volumes
-a exit,never -F dir=/var/lib/docker/165536.165536/overlay2
Then, restart the audit daemon using the following command
systemctl restart auditd
Default Value
By default, Docker related files and directories are not audited.