5.18 Override default ulimit at runtime only if needed

Information

The default ulimit is set at the Docker daemon level. However, you may override the default
ulimit setting, if needed, during container runtime.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.The default ulimit set at the Docker daemon level should be honored. If the default ulimit
settings are not appropriate for a particular container instance, you may override them as
an exception. But, do not make this a practice. If most of the container instances are
overriding default ulimit settings, consider changing the default ulimit settings to
something that is appropriate for your needs.

Solution

Only override the default ulimit settings if needed.For example, to override default ulimit settings start a container as below-docker run --ulimit nofile=1024-1024 --interactive --tty centos /bin/bashImpact-If the ulimits are not set properly, the desired resource control might not be achieved and
might even make the system unusable.
Default Value-Container instances inherit the default ulimit settings set at the Docker daemon level.

See Also

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

Item Details

Category: SYSTEM AND COMMUNICATIONS PROTECTION

References: 800-53|SC-6

Plugin: Unix

Control ID: 688504e50c11b2c7d2c3063a15ff801f490db7a372a2260d06c07885a78ec2cf