ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 161 - DCA discussion

Report
Export

Which docker run' flag lifts cgroup limitations?

A.

'docker run -privileged

Answers
A.

'docker run -privileged

B.

'docker run -cpu-period

Answers
B.

'docker run -cpu-period

C.

'docker run -isolation

Answers
C.

'docker run -isolation

D.

'docker run -cap-drop

Answers
D.

'docker run -cap-drop

Suggested answer: A

Explanation:

The --privileged flag lifts all the cgroup limitations for a container, as well as other security restrictions imposed by the Docker daemon1. This gives the container full access to the host's devices, resources, and capabilities, as if it was running directly on the host2. This can be useful for certain use cases that require elevated privileges, such as running Docker-in-Docker or debugging system issues3. However, using the --privileged flag also poses a security risk, as it exposes the host to potential attacks or damages from the container4. Therefore, it is not recommended to use the --privileged flag unless absolutely necessary, and only with trusted images and containers.

The other options are not correct because they do not lift all the cgroup limitations for a container, but only affect specific aspects of the container's resource allocation or isolation:

* The --cpu-period flag sets the CPU CFS (Completely Fair Scheduler) period for a container, which is the length of a CPU cycle in microseconds. This flag can be used in conjunction with the --cpu-quota flag to limit the CPU time allocated to a container. However, this flag does not affect other cgroup limitations, such as memory, disk, or network.

* The --isolation flag sets the isolation technology for a container, which is the mechanism that separates the container from the host or other containers. This flag is only available on Windows containers, and can be used to choose between process, hyperv, or process-isolated modes. However, this flag does not affect the cgroup limitations for a container, but only the level of isolation from the host or other containers.

* The --cap-drop flag drops one or more Linux capabilities for a container, which are the privileges that a process can use to perform certain actions on the system. This flag can be used to reduce the attack surface of a container by removing unnecessary or dangerous capabilities. However, this flag does not affect the cgroup limitations for a container, but only the capabilities granted to the container by the Docker daemon.

* Runtime privilege and Linux capabilities

* Docker Security: Using Containers Safely in Production

* Docker run reference

* Docker Security: Are Your Containers Tightly Secured to the Ship? SlideShare

* [Secure Engine]

* [Configure a Pod to Use a Limited Amount of CPU]

* [Limit a container's resources]

* [Managing Container Resources]

* [Isolation modes]

* [Windows Container Isolation Modes]

* [Windows Container Version Compatibility]

* [Docker and Linux Containers]

* [Docker Security Cheat Sheet]

* [Docker Security: Using Containers Safely in Production]

asked 08/11/2024
Kazi Basit
41 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first