/run/containerd should be audited

docker

Classification:

compliance

Framework:

cis-docker

Control:

1.1.4

Description

The /run/containerd directory should carry an audit rule, so that the audit log records every change to it and every use of it.

Rationale

containerd keeps the runtime state of every container in /run/containerd. An audit rule on it records who read, changed, or ran it, and when. An investigation of a compromise needs this record.

Audit

List the loaded audit rules and look for /run/containerd or /var/run/containerd:

auditctl -l | grep /run/containerd

Datadog passes the rule when a loaded audit rule watches /run/containerd or /var/run/containerd, fails it when one of these paths exists and none is watched, and reports it not applicable when none exists.

Remediation

Add a watch for the path to a file in /etc/audit/rules.d, then load the rules:

echo "-w /run/containerd -k docker" >> /etc/audit/rules.d/docker.rules
augenrules --load

Impact

Every use or change of the path adds a record to the audit log, which needs rotation and room of its own.

Default value

A new installation leaves the audit rules to the administrator, and the rule fails until the watch is added.

References

  1. https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/8/html/system_design_guide/auditing-the-system_system-design-guide