2.7 Ensure the default ulimit is configured appropriately

Information

Set the default ulimit options as appropriate in your environment.
Rationale:
ulimit provides control over the resources available to the shell and to processes started by it. Setting system resource limits judiciously saves you from many disasters such as a fork bomb. Sometimes, even friendly users and legitimate processes can overuse system resources and in-turn can make the system unusable.
Setting default ulimit for the Docker daemon would enforce the ulimit for all container instances. You would not need to setup ulimit for each container instance. However, the default ulimit can be overridden during container runtime, if needed. Hence, to control the system resources, define a default ulimit as needed in your environment.

Solution

Run the docker in daemon mode and pass --default-ulimit as argument with respective ulimits as appropriate in your environment.
For Example,
dockerd --default-ulimit nproc=1024:2048 --default-ulimit nofile=100:200
Impact:
If the ulimits are not set properly, the desired resource control might not be achieved and might even make the system unusable.
Default Value:
By default, no ulimit is set.

See Also

https://workbench.cisecurity.org/files/1726

Item Details

Category: SYSTEM AND COMMUNICATIONS PROTECTION

References: 800-53|SC-6, CSCv6|18

Plugin: Unix

Control ID: 1149e258ecc8e36edcbb6991d441fffd3e3ab3cce61d309641e8a754ef1bb5ea