Container Security

Security rules for Docker Compose services

10
Security Rules

Run All Container Security Rules

pathfinder scan --ruleset cpf/docker-compose/security

Rules

Dangerous Capability Added

high

Detects services that add dangerous Linux capabilities like SYS_ADMIN, SYS_MODULE, or SYS_PTRACE which can be used for container escape or privilege escalation.

docker-composesecuritycapabilitiesprivilege-escalationcontainer-escape
CWE-250
Updated 2024-12-19

Docker Socket Exposed to Container

critical

Detects services that mount the Docker socket, giving the container full control over the Docker daemon, equivalent to unrestricted root access to the host.

docker-composesecuritydocker-socketprivilege-escalationcontainer-escapecritical
CWE-250
Updated 2024-12-19

Using Host IPC Mode

medium

Detects services using host IPC namespace, allowing the container to share shared memory segments, semaphores, and message queues with the host system.

docker-composesecurityipcnamespaceisolation
CWE-250
Updated 2024-12-19

Using Host Network Mode

high

Detects services using host network mode, which disables network isolation and makes the container share the host's network stack, bypassing Docker's network isolation.

docker-composesecuritynetworknamespaceisolation
CWE-250
Updated 2024-12-19

Using Host PID Mode

high

Detects services using host PID namespace, allowing the container to see and interact with all processes running on the host system.

docker-composesecuritypidnamespaceisolationprocess
CWE-250
Updated 2024-12-19

Service Running in Privileged Mode

critical

Detects services configured with privileged mode, which disables almost all container security features and grants nearly all capabilities of the host machine.

docker-composesecurityprivilegedcontainer-escapecriticalroot
CWE-250
Updated 2024-12-19

Seccomp Confinement Disabled

high

Detects services with seccomp disabled, allowing containers to use all system calls and significantly increasing the attack surface.

docker-composesecurityseccompsyscallsconfinement
CWE-284
Updated 2024-12-19

Container Filesystem is Writable

low

Detects services without read-only filesystem, which allows attackers to modify binaries, install malware, or persist backdoors within the container.

docker-composesecurityfilesystemimmutabilitybest-practice
CWE-732
Updated 2024-12-19

Missing no-new-privileges Security Option

medium

Detects services without no-new-privileges security option, which allows processes to gain additional privileges via setuid/setgid binaries.

docker-composesecurityprivilege-escalationsetuidno-new-privileges
CWE-732
Updated 2024-12-19

SELinux Separation Disabled

medium

Detects services that explicitly disable SELinux separation, removing a critical mandatory access control security layer.

docker-composesecurityselinuxmacconfinement
CWE-732
Updated 2024-12-19