CIS Containerd Benchmark

Security configuration benchmark for Containerd container runtime

v1.0.0 03-2025

Overview

▶

This benchmark provides prescriptive guidance for establishing a secure configuration posture for Containerd. It covers runtime configuration, cgroup drivers, seccomp profiles, registry TLS, gRPC socket permissions, logging, namespace isolation, storage drivers, file system permissions, image source restrictions, and resource limits.

14Recommendations
7Sections
2Profile Levels
SectionAreaFocus
1Installation & ConfigurationVersion, config file generation
2Runtime & Security ProfilesCgroup driver, seccomp
3Network & Socket SecurityRegistry TLS, gRPC socket
4Logging & MonitoringService logs, container logs
5Namespace & StorageNamespace isolation, snapshotters
6File System SecurityData directory, config permissions
7Hardening & LimitsTrusted registries, resource limits

Profile Definitions

▶
ProfileDescriptionIntended Use
L1Level 1 — StandardEssential security for all Containerd deployments; minimal performance impact.
L2Level 2 — HardenedAdvanced hardening for PCI-DSS, HIPAA, or high-security environments.

1 — Installation & Configuration

▶

1.1 Version & Config File

▶
1.1.1 Ensure Containerd is running the latest stable version (Manual)
L1 Manual
Description

This recommendation verifies that Containerd is running the latest stable version on the Containerd container runtime. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to implement this control may leave the Containerd container runtime vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
# Check containerd version
containerd --version
ctr version
Remediation
# Update containerd
apt-get update && apt-get install -y containerd.io
systemctl restart containerd
1.1.2 Ensure the configuration file is generated and customized (Automated)
L1 Auto
Description

This recommendation verifies that the configuration file is generated and customized on the Containerd container runtime. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to implement this control may leave the Containerd container runtime vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
# Check containerd configuration
containerd config dump | head -40
ls -la /etc/containerd/config.toml
Remediation
# Generate and customize default config
containerd config default > /etc/containerd/config.toml
# Edit /etc/containerd/config.toml as needed
systemctl restart containerd

2 — Runtime & Security Profiles

▶

2.1 Cgroup & Seccomp

▶
2.1.1 Ensure systemd cgroup driver is configured (Automated)
L1 Auto
Description

This recommendation verifies that systemd cgroup driver is configured on the Containerd container runtime. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to implement this control may leave the Containerd container runtime vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
# Check default runtime configuration
containerd config dump | grep -A5 'default_runtime'
containerd config dump | grep 'SystemdCgroup'
Remediation
# Configure systemd cgroup driver
# In /etc/containerd/config.toml:
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc.options]
  SystemdCgroup = true
# Restart:
systemctl restart containerd
2.1.2 Ensure default seccomp/AppArmor profiles are enabled (Automated)
L1 Auto
Description

This recommendation verifies that default seccomp/AppArmor profiles are enabled on the Containerd container runtime. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to implement this control may leave the Containerd container runtime vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
# Check AppArmor / seccomp profiles
ctr containers list | head -5
containerd config dump | grep -i 'seccomp\|apparmor'
Remediation
# Enable default seccomp profile
# In /etc/containerd/config.toml:
[plugins."io.containerd.grpc.v1.cri"]
  enable_selinux = false
  sandbox_image = "registry.k8s.io/pause:3.9"
[plugins."io.containerd.grpc.v1.cri".containerd]
  default_runtime_name = "runc"
  # Seccomp enforced by Kubernetes PSS or pod spec

3 — Network & Socket Security

▶

3.1 TLS & gRPC

▶
3.1.1 Ensure TLS is configured for private registries (Automated)
L1 Auto
Description

This recommendation verifies that TLS is configured for private registries on the Containerd container runtime. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to implement this control may leave the Containerd container runtime vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
# Check TLS for private registries
containerd config dump | grep -A10 'registry.mirrors'
Remediation
# Configure TLS for registry
# In /etc/containerd/config.toml:
[plugins."io.containerd.grpc.v1.cri".registry.configs."registry.example.com".tls]
  ca_file   = "/etc/containerd/certs.d/ca.pem"
  cert_file = "/etc/containerd/certs.d/client.pem"
  key_file  = "/etc/containerd/certs.d/client-key.pem"
systemctl restart containerd
3.1.2 Ensure gRPC socket permissions are restricted (Automated)
L1 Auto
Description

This setting ensures that gRPC socket permissions are restricted on the Containerd container runtime. Restricting this capability limits potential abuse and enforces the principle of least privilege across the environment.

Rationale

Unrestricted access to this capability could allow unauthorized users or processes to perform actions beyond their intended scope. Applying least-privilege principles to the Containerd container runtime is essential for defense in depth.

Audit
# Check gRPC socket permissions
stat -c '%a %U %G' /run/containerd/containerd.sock
ls -la /run/containerd/
Remediation
# Restrict gRPC socket access
chmod 660 /run/containerd/containerd.sock
chown root:containerd /run/containerd/containerd.sock
# Add authorized users to containerd group only

4 — Logging & Monitoring

▶

4.1 Service & Container Logs

▶
4.1.1 Ensure containerd service logging is configured (Automated)
L1 Auto
Description

This recommendation verifies that containerd service logging is configured on the Containerd container runtime. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to implement this control may leave the Containerd container runtime vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
# Check containerd logging
journalctl -u containerd --no-pager | tail -20
containerd config dump | grep 'level'
Remediation
# Configure logging level
# In /etc/containerd/config.toml (root level):
# [debug]
#   level = "info"
# Forward containerd logs:
cat > /etc/rsyslog.d/containerd.conf << 'EOF'
if $programname == 'containerd' then /var/log/containerd.log
& stop
EOF
systemctl restart rsyslog
4.1.2 Ensure container log limits and rotation are configured (Automated)
L1 Auto
Description

This recommendation verifies that container log limits and rotation are configured on the Containerd container runtime. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to implement this control may leave the Containerd container runtime vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
# Check container log configuration
containerd config dump | grep -i 'max_container_log'
Remediation
# Configure container log limits
# In /etc/containerd/config.toml:
[plugins."io.containerd.grpc.v1.cri"]
  max_container_log_line_size = 16384
# Configure logrotate for containerd:
cat > /etc/logrotate.d/containerd << 'EOF'
/var/log/containerd.log {
    daily
    rotate 30
    compress
    missingok
    notifempty
}
EOF

5 — Namespace & Storage

▶

5.1 Isolation & Snapshotters

▶
5.1.1 Ensure containerd namespaces are used for isolation (Manual)
L1 Manual
Description

This recommendation verifies that containerd namespaces are used for isolation on the Containerd container runtime. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to implement this control may leave the Containerd container runtime vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
# Check namespace isolation
ctr namespaces list
ctr -n k8s.io containers list | head -5
Remediation
# Use separate namespaces
# Containerd namespaces isolate workloads:
ctr namespaces create prod
ctr namespaces create dev
# Avoid running user workloads in default namespace
# Kubernetes uses k8s.io namespace automatically
5.1.2 Ensure overlay snapshotter is configured (Automated)
L1 Auto
Description

This recommendation verifies that overlay snapshotter is configured on the Containerd container runtime. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to implement this control may leave the Containerd container runtime vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
# Check storage driver & snapshotter
containerd config dump | grep snapshotter
Remediation
# Configure overlay snapshotter
# In /etc/containerd/config.toml:
[plugins."io.containerd.grpc.v1.cri".containerd]
  snapshotter = "overlayfs"
# Verify kernel module:
modprobe overlay
lsmod | grep overlay

6 — File System Security

▶

6.1 Data & Config Permissions

▶
6.1.1 Ensure data directory permissions are restricted (Automated)
L1 Auto
Description

This setting ensures that data directory permissions are restricted on the Containerd container runtime. Restricting this capability limits potential abuse and enforces the principle of least privilege across the environment.

Rationale

Unrestricted access to this capability could allow unauthorized users or processes to perform actions beyond their intended scope. Applying least-privilege principles to the Containerd container runtime is essential for defense in depth.

Audit
# Check data directory permissions
stat -c '%a %U %G' /var/lib/containerd
find /var/lib/containerd -maxdepth 1 -type d -exec stat -c '%a %n' {} \;
Remediation
# Restrict data directory
chown root:root /var/lib/containerd
chmod 710 /var/lib/containerd
chmod 700 /var/lib/containerd/io.containerd.snapshotter.v1.overlayfs
6.1.2 Ensure configuration file permissions are restricted (Automated)
L1 Auto
Description

This setting ensures that configuration file permissions are restricted on the Containerd container runtime. Restricting this capability limits potential abuse and enforces the principle of least privilege across the environment.

Rationale

Unrestricted access to this capability could allow unauthorized users or processes to perform actions beyond their intended scope. Applying least-privilege principles to the Containerd container runtime is essential for defense in depth.

Audit
# Check config file permissions
stat -c '%a %U %G' /etc/containerd/config.toml
find /etc/containerd -type f -exec stat -c '%a %n' {} \;
Remediation
# Restrict configuration files
chown root:root /etc/containerd/config.toml
chmod 600 /etc/containerd/config.toml
chmod 700 /etc/containerd

7 — Hardening & Limits

▶

7.1 Images & Resources

▶
7.1.1 Ensure image sources are restricted to trusted registries (Manual)
L1 Manual
Description

This setting ensures that image sources are restricted to trusted registries on the Containerd container runtime. Restricting this capability limits potential abuse and enforces the principle of least privilege across the environment.

Rationale

Unrestricted access to this capability could allow unauthorized users or processes to perform actions beyond their intended scope. Applying least-privilege principles to the Containerd container runtime is essential for defense in depth.

Audit
# Check image pull settings
containerd config dump | grep -A5 'registry'
Remediation
# Restrict image sources
# In /etc/containerd/config.toml:
[plugins."io.containerd.grpc.v1.cri".registry.mirrors."docker.io"]
  endpoint = ["https://registry.example.com"]
# Use allowlisted registries only
# Enable image verification with cosign/notation
7.1.2 Ensure resource limits are configured for the containerd service (Automated)
L1 Auto
Description

This recommendation verifies that resource limits are configured for the containerd service on the Containerd container runtime. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to implement this control may leave the Containerd container runtime vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
# Check resource limits for containerd
systemctl show containerd | grep -i limit
cat /etc/systemd/system/containerd.service.d/override.conf 2>/dev/null
Remediation
# Configure resource limits
mkdir -p /etc/systemd/system/containerd.service.d
cat > /etc/systemd/system/containerd.service.d/override.conf << 'EOF'
[Service]
LimitNOFILE=1048576
LimitNPROC=infinity
LimitCORE=infinity
OOMScoreAdjust=-999
EOF
systemctl daemon-reload
systemctl restart containerd