
SELinux is a layer of Security but it’s not the all-in-one security solution
- SELinux policy rules define how processes interact with files, as well as how processes interact with each other. Access is only allowed if an SELinux policy rule exists that specifically allows it.
- It enforces data confidentiality and integrity, as well as protecting processes from untrusted inputs and gives a fine-grained access control.
- But.., SELinux can only enhance existing security solutions, not replace them. Even when running SELinux, it is important to continue to follow good security practices, such as keeping software up-to-date, password complexity, and firewalls.
Use the setenforce utility to change between enforcing and permissive mode
Changes made with setenforce do not persist across reboots. To change to enforcing mode, enter the setenforce 1 command as the Linux root user. To change to permissive mode, enter the setenforce 0 command. Use the getenforce utility to view the current SELinux mode as below.
# getenforce
Enforcing# setenforce 0# getenforce
Permissive# setenforce 1# getenforce
Enforcing