Seccomp Profiles (Filtering Linux System Calls)
Filter syscalls with seccomp profiles to shrink the kernel attack surface.
In plain words
Keep the Docker default, record observed syscall failures and remove only the deny needed by a measured workload.
Think of it like…
Seccomp is the service counter’s menu of allowed requests; names not on the menu never reach the kernel clerk.
Where you’ve seen it
In practice, docker run --security-opt seccomp=./seccomp-api.json --cap-drop=ALL ghcr.io/acme/api:2.1 is the concrete move for this job: filter syscalls with seccomp profiles to shrink the kernel attack surface. The release is not accepted until inspect Seccomp:2 and NoNewPrivs in /proc/1/status, then trigger a denied test syscall and capture its errno in CI confirms the result.
Words you’ll hear
- seccomp
- The implementation control in
docker run --security-opt seccomp=./seccomp-api.json --cap-drop=ALL ghcr.io/acme/api:2.1for filter syscalls with seccomp profiles to shrink the kernel attack surface. - Syscalls
- The result to observe with
inspect Seccomp:2 and NoNewPrivs in /proc/1/status, then trigger a denied test syscall and capture its errno in CI, rather than infer from a successful command alone. - Profiles
- The production boundary exposed when using seccomp=unconfined to troubleshoot a transient library bug, or copying an old profile without tracing the current runtime.
Visual diagram
Theory & deep dive
seccomp control path
The concrete mechanism is docker run --security-opt seccomp=./seccomp-api.json --cap-drop=ALL ghcr.io/acme/api:2.1. The observable result is inspect Seccomp:2 and NoNewPrivs in /proc/1/status, then trigger a denied test syscall and capture its errno in CI; if those disagree, inspect the runtime evidence before changing unrelated settings.
Filter syscalls with seccomp profiles to shrink the kernel attack surface. Keep seccomp, Syscalls and Profiles in the same deployment record so the intent and the observed state cannot drift apart.
docker run --security-opt seccomp=./seccomp-api.json --cap-drop=ALL ghcr.io/acme/api:2.1
inspect Seccomp:2 and NoNewPrivs in /proc/1/status, then trigger a denied test syscall and capture its errno in CI, not with command success alone.Profiles failure boundary
Unconfined seccomp discards an important kernel attack-surface reduction. A custom profile that simply allows all modern calls is false assurance, while denying clone, mount or keyring APIs can break runtimes unpredictably across libc/kernel versions. The narrow failure to design for is using seccomp=unconfined to troubleshoot a transient library bug, or copying an old profile without tracing the current runtime.
Accept this compromise explicitly: The default profile is broad and maintainable; custom profiles reduce attack surface but need syscall telemetry and kernel-specific testing. The controlled check-inspect Seccomp:2 and NoNewPrivs in /proc/1/status, then trigger a denied test syscall and capture its errno in CI-also identifies the point where a different design is safer.
Exercise this failure safely: using seccomp=unconfined to troubleshoot a transient library bug, or copying an old profile without tracing the current runtime.
How it works, step by step
Step 1 of 41. State the boundary
Write down why the workload needs this: Unconfined seccomp discards an important kernel attack-surface reduction. A custom profile that simply allows all modern calls is false assurance, while denying clone, mount or keyring APIs can break runtimes unpredictably across libc/kernel versions.
- Intent
- seccomp
When to use it & trade-offs
What it is
Seccomp filters a process’s Linux system calls using a kernel BPF program. Docker applies a default profile, and a JSON custom profile can deny or allow named calls with a defined action, errno or syscall-argument rule.
Why it matters: Unconfined seccomp discards an important kernel attack-surface reduction. A custom profile that simply allows all modern calls is false assurance, while denying clone, mount or keyring APIs can break runtimes unpredictably across libc/kernel versions.
When to reach for it
- The fit is strongest for this job: filter syscalls with seccomp profiles to shrink the kernel attack surface. Pair it with
inspect Seccomp:2 and NoNewPrivs in /proc/1/status, then trigger a denied test syscall and capture its errno in CIin the runbook. - Production seccomp changes should make Syscalls observable through
docker run --security-opt seccomp=./seccomp-api.json --cap-drop=ALL ghcr.io/acme/api:2.1, rather than trusting the runtime default. - Keep a rollback example for the case where using seccomp=unconfined to troubleshoot a transient library bug, or copying an old profile without tracing the current runtime.
When to avoid or be careful
- Do not accept command success while the system can still fail by using seccomp=unconfined to troubleshoot a transient library bug, or copying an old profile without tracing the current runtime.
- Avoid erasing Profiles protection merely to dodge this cost: “The default profile is broad and maintainable; custom profiles reduce attack surface but need syscall telemetry and kernel-specific testing”.
- Do not replace the evidence path-
inspect Seccomp:2 and NoNewPrivs in /proc/1/status, then trigger a denied test syscall and capture its errno in CI-with a screenshot or a mutable tag.
docker run --security-opt seccomp=./seccomp-api.json --cap-drop=ALL ghcr.io/acme/api:2.1: practical choices
Strengths: Seccomp filters a process’s Linux system calls using a kernel BPF program. Docker applies a default profile, and a JSON custom profile can deny or allow named calls with a defined action, errno or syscall-argument rule.
Watch out: The default profile is broad and maintainable; custom profiles reduce attack surface but need syscall telemetry and kernel-specific testing.
Strengths: It can begin with docker run --security-opt seccomp=./seccomp-api.json --cap-drop=ALL ghcr.io/acme/api:2.1 and fewer surrounding controls.
Watch out: It silently accepts using seccomp=unconfined to troubleshoot a transient library bug, or copying an old profile without tracing the current runtime, which makes the result hard to reproduce after promotion.
Strengths: Unconfined seccomp discards an important kernel attack-surface reduction. A custom profile that simply allows all modern calls is false assurance, while denying clone, mount or keyring APIs can break runtimes unpredictably across libc/kernel versions.
Watch out: The platform adds an ownership and debugging layer; retain inspect Seccomp:2 and NoNewPrivs in /proc/1/status, then trigger a denied test syscall and capture its errno in CI as the direct check.
Interview signals & numbers to know
When this topic comes up
- docker run --security-opt seccomp=./seccomp-api.json --cap-drop=ALL ghcr.io/acme/api:2.1
- inspect Seccomp:2 and NoNewPrivs in /proc/1/status, then trigger a denied test syscall and capture its errno in CI
- Failure signature: using seccomp=unconfined to troubleshoot a transient library bug, or copying an old profile without tracing the current runtime
- Trade-off: The default profile is broad and maintainable; custom profiles reduce attack surface but need syscall telemetry and kernel-specific testing.
Benchmarks & rules of thumb
- 2 profile scopes
- default broad filter or JSON workload policy
- 1 action
- allow, errno, log or trap depends on the rule
- Seccomp:2
- process status mode indicating filter active
Common mistakes & follow-ups
Common interview mistakes
- Treating a successful
docker run --security-opt seccomp=./seccomp-api.json --cap-drop=ALL ghcr.io/acme/api:2.1as proof and skippinginspect Seccomp:2 and NoNewPrivs in /proc/1/status, then trigger a denied test syscall and capture its errno in CI. - Using seccomp=unconfined to troubleshoot a transient library bug, or copying an old profile without tracing the current runtime
- Optimizing seccomp without accepting that the default profile is broad and maintainable; custom profiles reduce attack surface but need syscall telemetry and kernel-specific testing.
Likely interviewer follow-ups
- Why does
docker run --security-opt seccomp=./seccomp-api.json --cap-drop=ALL ghcr.io/acme/api:2.1address seccomp here rather than through application code? - How would you distinguish healthy Syscalls from the failure “using seccomp=unconfined to troubleshoot a transient library bug, or copying an old profile without tracing the current runtime” using
inspect Seccomp:2 and NoNewPrivs in /proc/1/status, then trigger a denied test syscall and capture its errno in CI? - When would this trade-off-“The default profile is broad and maintainable; custom profiles reduce attack surface but need syscall telemetry and kernel-specific testing”-justify a different Profiles design?
docker run --security-opt seccomp=./seccomp-api.json --cap-drop=ALL ghcr.io/acme/api:2.1-and one proof-inspect Seccomp:2 and NoNewPrivs in /proc/1/status, then trigger a denied test syscall and capture its errno in CI. Then name the boundary: using seccomp=unconfined to troubleshoot a transient library bug, or copying an old profile without tracing the current runtime.Knowledge check
Put it into practice
Practice related interview Q&A
Apply Seccomp Profiles (Filtering Linux System Calls) with generative AI interview Q&A and hands-on practice.