1.3 KiB
1.3 KiB
Linux+ 3.3.3: SELinux
The classic moved-file problem with a web server, reading the denial, and a boolean. Keep SELinux enforcing throughout.
Before you start
RHEL family only. SELinux must be enforcing. The web server isn't
installed or started by the lab: that's task 1. The lab sets the boolean
httpd_enable_homedirs off. Write answers to the files in
/root/lab-answers/.
Tasks
- Look around (
sestatus,ls -Zd,ps -eZ,getsebool -a). Installhttpd, and enable and start it. - As your normal user, create
~/moved.htmlwith the textmoved, andsudo mvit into/var/www/html/.curl http://127.0.0.1/moved.htmlreturns 403. Read the denial, fix the file's label, and see the page served. Then trychcon -t user_home_ton it and seerestoreconundo that too. - Write the SELinux type the moved file had before you fixed it to
/root/lab-answers/3. - Turn the boolean
httpd_enable_homedirson, persistently. (The chapter turns it off again afterward; leave it on until you've checked.)
Hints
dnf install httpd,systemctl enable --now.ls -Z,ausearch -m AVC -ts recent;sealert -a /var/log/audit/audit.logneeds thesetroubleshoot-serverpackage;restorecon -v.- The type is the third field of the label.
setsebool -P,getsebool.