Skip to main content
InterviewHubPRO
Section Overview
Q41

Question 41 of 50

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

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

Container Security Hardening: Non-Root, Read-Only, and Dropping Capabilities.

senior LevelSecurity & AuthDocker & Containers

In Simple Words: Three golden rules to prevent container breakout exploits:

  1. Run as Non-Root: USER 10001:10001. A compromised process cannot modify host files.
  2. Read-Only Root Filesystem (--read-only): Prevents attackers from downloading malicious scripts, web shells, or cryptocurrency miners into /tmp or /app. Use --tmpfs /tmp for temporary files.
  3. Drop Capabilities (--cap-drop=ALL): Linux divides superuser privileges into discrete capabilities. Dropping all capabilities strips raw socket manipulation, kernel module loading, and chroot powers.