305-300 practice question 8 of 15

What is the purpose of capabilities in the context of container virtualization?

Full set: 121 questions
Answer options
A: Map potentially dangerous system calls to an emulation layer provided by the container virtualization.
B: Restrict the disk space a container can consume.
C: Enable memory deduplication to cache files which exist in multiple containers.
D: Allow regular users to start containers with elevated permissions.
E: Prevent processes from performing actions which might infringe the container. Correct answer
Correct Answer:
E. Prevent processes from performing actions which might infringe the container.
Explanation

Linux capabilities divide the extensive power of the root user into distinct, granular units. In the context of container virtualization, this mechanism is fundamental for security and isolation. Container runtimes, by default, drop most capabilities for processes running inside a container. This ensures that even if a process gains root privileges (UID 0) within the container's namespace, it cannot perform privileged operations that could affect the host system or other containers. For example, a container process is typically denied capabilities like CAPSYSADMIN (perform system administration tasks) or CAPSYSMODULE (load kernel modules), thereby preventing it from infringing upon the isolation boundary.

Why Incorrect

A. This describes the function of seccomp (Secure Computing Mode), which filters system calls, rather than capabilities, which manage process privileges.
B. This is a function of control groups (cgroups) or storage quotas, which are designed to manage and limit resource consumption like disk I/O and space.
C. This describes features of copy-on-write filesystems (e.g., OverlayFS) or kernel memory management like Kernel Same-page Merging (KSM), not process capabilities.
D. This is primarily achieved through user namespaces, which map a range of UIDs on the host to a privileged range inside the container, allowing a non-root user to appear as root within that container.

References

1. Official Linux Programmer's Manual (man pages): The capabilities(7) man page is the canonical source. It states, "Linux divides the privileges traditionally associated with the superuser into distinct units, known as capabilities... This allows a process to be granted only the specific capabilities it needs for its work." This underpins the principle of least privilege used by containers.

Source: capabilities(7) — Linux manual page. Section: "Capabilities and execution of programs by root".

2. Official Docker Documentation: The documentation for the docker run command explicitly details how capabilities are used for security. It notes, "By default, Docker drops all capabilities except those needed... This prevents the container from having excessive privileges, enhancing security."

Source: Docker Docs, docker run reference, section "Runtime privilege and Linux capabilities".

3. Red Hat Enterprise Linux Documentation: In the guide for "Building, running, and managing containers," Red Hat explains the security layers. It states, "By default, container engines such as Podman or Docker run containers with a limited set of capabilities. This prevents the processes inside the container from doing things that could harm the host."

Source: Red Hat Enterprise Linux 8 Documentation, "Building, running, and managing containers", Chapter 10. "Securing containers", Section 10.3. "Understanding container security".

Scroll to Top