Troubleshoot an SELinux Denial
A service that worked when its developer ran it by hand refuses to start under systemd, and the permissions are fine. Find the AVC record, read who was refused what, decide on the right repair and get the service running with SELinux still enforcing.
Skill labintermediate~30 minPro
What you'll do
- ✓Tell an SELinux denial from a Unix permission problem
- ✓Find an AVC record in the audit log and read scontext, tcontext, tclass and the permission
- ✓Decide between resetting a label and adding a file-context rule, and reject permissive mode and generated policy modules
- ✓Reset labels with restorecon and audit a directory tree for wrong labels
- ✓Prove a service works with SELinux enforcing
Lab outline
- 01Read the evidence
- 02Fix the label
- 03Leave nothing behind
Before you start
- Repair SELinux File Contexts
- Operate systemd Services
Every lab runs on a real machine of your own in the browser — no installs, nothing to clean up — and checks your work automatically as you go.