Enforcing
Cheat sheet · https://pcornel.dk/topic.php?topic=2855
Answer
Enforcing mode applies the SELinux policy: denied operations are blocked and logged as AVC denials. It is the default and intended mode on RHEL.
Remember
Check both the running mode (getenforce) and the configured boot mode (/etc/selinux/config). Per-domain permissive (semanage permissive -a <domain>) is a narrower alternative to global permissive.
First checks
getenforce / sestatus— mode and policyls -Z <path>— file contextps -eZ | grep <proc>— process contextausearch -m AVC -ts recent— recent denialssemanage fcontext -l | grep <path>— context rules for a path
Verify in this order
policy loaded → enforcing → every access checked → denials blocked and logged
Where it usually breaks
First mismatch in identity/group resolution → Unix mode/ACL/capability → mount/sandbox constraint → SELinux/AppArmor policy → credential/TLS trust → protected operation; preserve identity/native diagnostic/pre-state before mutation.
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=2855