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.
| Result | When | What it means |
|---|---|---|
| SKIP | No running containers | Nothing was verified. No container's seccomp setting was read, either because the daemon could not be reached or because nothing was running. |
| FAIL | 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. |
| PASS | None disable it | No 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 withstrace/gdb, Chrome/Puppeteer containers (the browser sandbox needsclone/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.jsonwithdefaultAction: SCMP_ACT_ALLOW) passes this check but offers no protection. Review custom profiles. --privilegedimplies unconfined seccomp without settingSecurityOpt; that case is covered by Privileged Containers.- Rootless and userns containers still get the default profile.
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'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 lineAdd 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 -cagainst 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.jsonRecreate 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
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)- 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 psas the audit user, thensudo docker ps. If both fail, the daemon is unreachable: checksystemctl 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 theunconfinedstring, or the host kernel lacks seccomp support. Checkdocker inspect -f '{{.HostConfig.Privileged}}'anddocker 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/unsharein old glibc or Java; the modern default profile handles these. Try removingunconfinedand testing before assuming it is still needed.
