Safeguard
Security Guides•

Which Docker run settings weaken container isolation?

Privileged mode, unconfined seccomp, host networking, writable bind mounts and added capabilities each remove a layer. Use this table to audit them.

Safeguard Security Team
4 min read

Six settings do most of the damage: privileged mode, added capabilities, unconfined seccomp or system paths, host networking, writable bind mounts, and a mounted Docker socket. Each removes a layer of the isolation Docker applies by default. Search for them before you run any container you did not write.

The audit table

SettingWhat it changesWhere to look
privilegedGives all capabilities and access to all devicesdocker run commands, Compose files, dev container settings
cap-addAdds capabilities that are off by defaultSame places
seccomp=unconfinedTurns off seccomp filteringsecurity-opt entries
systempaths=unconfinedTurns off confinement of masked and read only system pathssecurity-opt entries
network hostContainer shares the host network stacknetwork settings
bind mount of a host pathContainer can write to host files by defaultvolume and mount entries
Docker socket mountContainer can control the daemonvolume entries

Every row comes from Docker's own reference pages. None of them is forbidden, and some are needed for real work. The point is that each one needs a stated reason.

Why each one matters

Privileged. By default, Docker says, containers are unprivileged and cannot access devices. A privileged container is given all capabilities and access to all devices on the host. It is a different security posture, not a small tweak. For more, read the privileged mode risks.

Capabilities. Docker starts containers with a default list and documents a longer list that is not granted by default and may be added. One of the entries on that second list is SYS_ADMIN, which the Linux manual calls an overloaded capability. Adding it is rarely a small request.

Unconfined settings. The security option reference lists switches that turn off label confinement, seccomp and system path confinement, and one that swaps the AppArmor profile. Each is a single flag, which is why they spread by copy and paste.

Host networking. In host mode the container does not get its own IP address and shares the host's network namespace. Docker's examples show a host service reachable from the container on localhost. Published port flags are ignored.

Bind mounts. Docker states that bind mounts have write access to host files by default, so a process in the container can create, modify or delete important files on the host. The read only option prevents this.

The socket. Docker's own example mounts the Docker socket into a container. Whoever controls that socket controls the daemon. See why that is root on the host.

A five minute audit

  1. Search the repository and CI configuration for the names in the table.
  2. List each hit with the file, the setting and the person who added it.
  3. Ask whether a narrower option exists: a single added capability instead of privileged, a read only mount instead of a writable one, a custom seccomp profile instead of unconfined.
  4. Remove what has no owner or no reason.
  5. Re-run the audit when dependencies or base images change.

What the audit does not tell you

It looks at configuration, not behavior. A container with every setting at default can still contain vulnerable packages, and a container with a reasonable exception can still be fine. Pair this review with image and dependency scanning, and with a clear view of which workloads handle untrusted input.

Safeguard scans container images and dependencies and can gate on policy. You can try the free scan at gold.safeguard.sh/scan.

Quick check

Is a read only bind mount enough to make a mount safe?

It stops the container writing to that path, but the container can still read everything in it. Mount only the folder the workload needs.

Does Docker Desktop change any of this?

Docker says the daemon runs inside a Linux VM on Docker Desktop and handles host path sharing for you. The settings above still decide what a container can reach.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.