5.2 Ensure that, if applicable, SELinux security options are set

Warning! Audit Deprecated

This audit has been deprecated and will be removed in a future update.

View Next Audit Version

Information

SELinux is an effective and easy-to-use Linux application security system. It is available by default on some distributions such as Red Hat and Fedora.

Rationale:

SELinux provides a Mandatory Access Control (MAC) system that greatly augments the default Discretionary Access Control (DAC) model. You can therefore add an extra layer of safety to your containers by enabling SELinux on your Linux host.

Impact:

Any restrictions defined in the SELinux policy will be applied to your containers. It should be noted that if your SELinux policy is misconfigured, this may have an impact on the correct operation of the affected containers.

Solution

If SELinux is applicable for your Linux OS, you should use it.

Set the SELinux State.

Set the SELinux Policy.

Create or import a SELinux policy template for Docker containers.

Start Docker in daemon mode with SELinux enabled. For example:

docker daemon --selinux-enabled

or by adding the following to the daemon.json configuration file:

{
'selinux-enabled': true
}

Start your Docker container using the security options. For example,

docker run --interactive --tty --security-opt label=level:TopSecret centos /bin/bash

Default Value:

By default, no SELinux security options are applied on containers.

See Also

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