SELinux Flashcards
What are the modes for SELinux?
Enabled
Passive
Disabled
Where is SELinux configured?
/etc/sysconfig/selinux
/etc/selinux/config
What is a boolean in SELinux?
A runtime configuration modification of the context SELinux policy
What are useful man pages for SELinux?
booleans
selinux
getsebool
How do you get SELinux status?
setatus
getenforce
How do you set SELinux so permissive mode via command line?
setenforce 0
How do you set SELinux to enforcing mode via command line?
setenforce 1
How do you do a listing with SELinux contexts?
ls -Z
How do you view SELinux contexts?
semanage fcontext -l
How do you view processes will their SELinux contexts?
ps -auxZ
How do you restore an SELinux context inheriting the parent directory?
restorecon
How do you relabel the filesystem for SELinux?
touch /.autorelabel
Reboot
*this is done also when SELinux is enabled for first time
How do you apply an SELinux context to a directory with inheritance?
semanage fcontext -a -t ‘/directory(/.*)?’
restorecon -Rv /directory
How do you remove an SELinux context from a directory with inheritance?
semanage fcontext -d ‘/directory(/.*)?’
restorecon -Rv /directory
How do you list the current status of boolean values on a system?
getsebool -a