Introduction to SELinux concepts w/pictures

RHEL 7 SELinux User's & Administrator's Guide

This is great. You should read at least the 1st and 10th chapter of it.

Targeted KCS Solutions

Solutions to specific problems.

Man pages

Checking enforcing/permissive/disabled status

SELinux can be globally disabled via /etc/default/selinux or the kernel cmdline, requiring a reboot. SELinux can be put into permissive mode in the same way, but that can also be done on the fly without a reboot.

Permissive domains

Instead of using setenforce 0 on the whole system when you suspect a problem, switch a particular process domain into permissive mode.

File labels

Every file gets a label. Policy determines what a process domain can do to files of each label.

Network port labels

Policy must explicitly allow confined services specific access to certain network port labels; however, the labels can be changed just as easily as file labels.

Boolean on/off switches

There are many commonly-used configurations that require opening up the default SELinux policy a little, e.g.: allowing webservers to send email or read content from NFS. This can always be done by flipping simple toggles.

Inspect audit AVC records

All SELinux AVC denials get logged by the kernel to audit (assuming auditd is running) and thus show up in /var/log/audit/audit.log by default. These can be inspected directly or with ausearch & aureport.

Leverage setroubleshoot to get recommendations

There's an optional setroubleshoot-server package that will automatically translate audit AVC records into more human-readable syslog messages with actionable recommendations.

Confining users

In the standard targeted policy, all users are unconfined; however, you can easily change that. You can start simple with preset users but of course you can get as granular as you want.

Fix SELinux denials by allowing requested access

This should be a last resort ... done sparingly & with care. The vast majority of problems can be solved by setting proper file labels or tweaking booleans or figuring out that the application/admin is doing something wrong.