Implementing Mandatory Access Control with SELinux
SELinux (short for Security-Enhanced Linux), is a flexible Mandatory Access Control (MAC) devised to overcome the limitations of standard ugo/rwx permissions and ACLs.
Getting ready
In most Linux distributions, such as CentOS and Redhat, SELinux is by default incorporated in the kernel. However, if we are working on any other distribution, such as Debian, we may have to install and configure SELinux on the system:
- First, we have to get the basic set of SELinux utilities and default policies by running the following command:

- Once the installation has completed, run the following command to configure GRUB and PAM, and to create
/autorelabel
:

After this, you have to reboot the system to label the filesystems on boot.
- After reboot, when the system starts, you may get the following warning:

Now, we have a working SELinux system.
How to do it...
Once we have a working SELinux system, we can choose how to use it:
- SELinux can operate in two different ways...