Linux - SELinux
Commands
Globals
Display SELinux status:
To see the current status of SELinux, run the following command:
The current SELinux status can also be changed with the following command:
Configuration file:
At any point in time, you can generate a report from your SELinux audit logs. This report will contain all information regarding any potential event that has been blocked by SELinux and also how you can allow the blocked event(s) if needed:
Permission
The permissions of a standard file/directory can be viewed by using the following command:
To change the context, use the chcon command. To make the changes recursively use with the -R switch:
Get SELinux boolean value(s):
setsebool is used to toggle policy booleans on or off:
Note
If you want the Boolean values to be persistant, use the -P option along with setsebool command. The –P option will make pending values be written to the policy file on disk.
Policy
The policy modules of SELinux can be viewed by running the following command:
Link
- https://searchdatacenter.techtarget.com/tip/SELinux-tutorial-Commands-and-management