Skip to main content
InterviewHubPRO
Section Overview
Q28

Question 28 of 50

Part 3: Advanced Internals, Scale & Production Security (Senior / Lead)

56%
Docker & Containers (50 Qs)•Part 3: Advanced Internals, Scale & Production Security (Senior / Lead)

Linux Capabilities and Seccomp Profiles: Dropping Privileges and Syscall Filtering.

senior LevelCode ExampleSecurity & Auth

In Simple Words: Traditional Unix has a binary permission model: either a process is unprivileged (UID > 0) or all-powerful root (UID 0). Linux Capabilities divide root privileges into ~40 granular permissions.

1. Dropping Unnecessary Capabilities:

bash
# Drop ALL capabilities, re-add only what is strictly necessary
docker run --cap-drop=ALL --cap-add=NET_BIND_SERVICE my-app

Common dangerous capabilities to drop: CAP_SYS_ADMIN (near-root control), CAP_NET_RAW (packet sniffing/spoofing), CAP_SYS_PTRACE (debugging other processes).

2. Seccomp (Secure Computing Mode):

Seccomp filters which Linux system calls (syscalls) a container process can execute. Docker applies a default seccomp profile blocking over 40 dangerous syscalls (such as reboot, sys_chroot, kexec_load). Custom profiles can block socket creations or ptrace attempts.