Skip to content

Docker audit fix · Runtime & Resources

How to Configure Seccomp Profiles in Docker Containers

Docker applies a default seccomp profile that blocks roughly 44 dangerous system calls, and starting a container with seccomp=unconfined removes that filter. Keep the default, or supply a custom profile that adds only the calls the app needs.

Hiren KalariyaHiren KalariyaLast reviewed seccomp-profile
CtrlOpsSeccomp ProfileMEDIUM

What did your audit say?

FAIL · when the audit printed

Any container disables seccomp

At least one running container has the syscall filter switched off and the message names it, so it can call anything the kernel offers.

Severity
Medium
Needs root or sudo
Yes
Results it can return
FAIL · SKIP · PASS
Check in this audit
1 of 6

Every threshold on this page is transcribed from the docker-security-runtime-resources audit script that CtrlOps runs, and a build check fails if the two ever disagree. See all 6 Runtime & Resources checks, or how the audit runs.

The check walks the ids returned by docker ps -q and reads one field per container, .HostConfig.SecurityOpt, through docker inspect --format '{{.HostConfig.SecurityOpt}}'. It greps that value for the literal strings seccomp=unconfined and seccomp:unconfined, and records the container's .Name when either matches. A single matching container is enough to FAIL; an empty match list is the PASS. Nothing else is read, so a profile that is applied is never opened or judged.

Needs a reachable daemon and at least one running container; otherwise SKIP. It matches the literal strings seccomp=unconfined / seccomp:unconfined in .HostConfig.SecurityOpt. That is a narrow test with two consequences: a container running a custom seccomp profile (--security-opt seccomp=/path/profile.json) passes without the profile being examined at all, and a container running --privileged, which disables seccomp implicitly without the string appearing, also passes here. Privileged containers are covered separately by the Privileged Containers check. Containers on a host with seccomp unavailable in the kernel are likewise not distinguished.

What each result means
ResultWhenWhat it means
SKIPNo running containersNothing was verified. No container's seccomp setting was read, either because the daemon could not be reached or because nothing was running.
FAILAny container disables seccompAt least one running container has the syscall filter switched off and the message names it, so it can call anything the kernel offers.
PASSNone disable itNo running container carries the unconfined string, so each keeps whichever seccomp profile Docker applied to it.

Docker applies a default seccomp profile that blocks roughly 44 of 300+ syscalls (mount, reboot, kexec_load, ptrace on older kernels, unshare with CLONE_NEWUSER, BPF, keyctl, and others) which are the usual building blocks of kernel exploits and escapes. Disabling it removes that layer. Docker docs "Seccomp security profiles for Docker"; OWASP Docker Cheat Sheet Rule #6 "Use Linux Security Module (seccomp, AppArmor, or SELinux)"; CIS Docker 5.21 "Ensure the default seccomp profile is not Disabled"; NIST SP 800-190 4.4.

  • Typical reasons for unconfined: debugging with strace/gdb, Chrome/Puppeteer containers (the browser sandbox needs clone/unshare; Puppeteer's Docker guide uses a custom seccomp profile that allows them rather than switching the filter off), and some build tooling.
  • A custom permissive profile (seccomp=/path/permissive.json with defaultAction: SCMP_ACT_ALLOW) passes this check but offers no protection. Review custom profiles.
  • --privileged implies unconfined seccomp without setting SecurityOpt; that case is covered by Privileged Containers.
  • Rootless and userns containers still get the default profile.
  1. Find the unconfined containers

    The FAIL message names them. To see every container's security options at once:

    sh
    docker inspect -f '{{.Name}} {{.HostConfig.SecurityOpt}}' $(docker ps -q) | grep -i 'seccomp[=:]unconfined'

  2. Remove seccomp=unconfined

    Delete the option so the container falls back to Docker's default profile.

    sh
    # Beforedocker run --security-opt seccomp=unconfined ...# Afterdocker run ...

    In Compose, remove the entry from security_opt:

    yaml
    security_opt:  - seccomp=unconfined   # delete this line

  3. Add a custom profile only where it is needed

    If the workload genuinely fails under the default profile, start from Docker's default profile JSON and add only the missing syscalls. strace -f -c against the process, or Inspektor Gadget's seccomp advisor, shows which calls it makes.

    sh
    docker run --security-opt seccomp=/etc/docker/app-seccomp.json ...

    yaml
    security_opt:  - seccomp=/etc/docker/app-seccomp.json

  4. Recreate the container

    Security options are applied when the container is created, so a running container keeps its old setting until it is replaced.

    sh
    docker compose up -d --force-recreate

sh
docker inspect -f '{{.Name}} {{.HostConfig.SecurityOpt}}' $(docker ps -q)# expected: no seccomp=unconfined# The kernel's own view, per container - the authoritative check:docker exec <name> grep Seccomp /proc/1/status# expected: Seccomp: 2 (filter mode). 0 means no filtering at all.# Confirm seccomp is available on the host:docker info --format '{{.SecurityOptions}}'   # expected: includes name=seccompgrep -i seccomp /boot/config-$(uname -r)

Debugging

  • This one message covers two different cases: the audit could not reach the Docker daemon, or it reached it and nothing was running. Run docker ps as the audit user, then sudo docker ps. If both fail, the daemon is unreachable: check systemctl status docker, then run the audit as root or give the account sudo. If they work but list nothing, there is genuinely nothing to evaluate, and a stopped container is never checked. The Docker Inventory check reports the two cases separately, so its result tells you which one you hit.
  • Do not leave it unconfined. Start from Docker's default profile, add the specific syscalls, and pass it with --security-opt seccomp=/path/custom.json. The check then passes, and you keep the other ~44 blocked syscalls.
  • The container is --privileged, which disables seccomp without setting the unconfined string, or the host kernel lacks seccomp support. Check docker inspect -f '{{.HostConfig.Privileged}}' and docker info.
  • The check confirms only that seccomp is not disabled; it never inspects the profile's contents. A permissive custom profile passes exactly like the hardened default. Review the JSON yourself.
  • The classic case was clone/unshare in old glibc or Java; the modern default profile handles these. Try removing unconfined and testing before assuming it is still needed.

Sources

Next

Re-run the Runtime & Resources audit after applying the fix and confirm this check moves to PASS. CtrlOps runs all 6 checks over your existing SSH connection and scores the result, so the change is visible without reading another config file.

Download for MacDownload for WindowsAll 6 Runtime & Resources fixes

14-day free trial, no credit card required.

Explore article with AI tools

Written by

Hiren Kalariya

Co-Founder & CEO, TST Technology

Hiren Kalariya is the Co-Founder and CEO of TST Technology and the product lead behind CtrlOps, a local-first desktop app that makes Linux server management fast and easy for developers and DevOps teams. Over the past five years he has shipped 60+ production systems, and he still tests every tool he writes about on real servers.

Stop juggling tools. Start managing fleets.

PuTTY
Termius
MobaXterm
WinSCP
SecureCRT
Royal TS
Warp
CtrlOps14 tools left
Webmin
aaPanel
RunCloud
Dokploy
IP spreadsheet
bash (2)
sticky notes

One app. All your servers. No context switching. Free to start, free to leave.

Start instantly · No credit card · Cancel anytime

Your privacy preferences. We use product analytics to improve CtrlOps. Google Analytics cookies and live chat stay off until you allow them. Cookie policy