Milestone 9 SELinux Deepdive SEC‐440 - DefiantCoder/Tech-Journals GitHub Wiki
Deliverable 1
- Here is the new index page for web01
Web01 setup
- Add the following users:
- regularuser
- switcheduser
- guestuser
- restrictedduser
Deliverable 2
ps -efZ | grep sshd
- The process domain is as shown:
Deliverable 3
- The SELinux type for our index.html is
httpd_sys_content_t
Deliverable 4
Deliverable 5
- The original context type of redhat-release was :
etc_t
while the copy in /var/www/html is:httpd_sys_content_t
. Using this we can conclude that the context type changes based on the location of the file as the purpose is different.
Deliverable 6
6a the SELinux type is user_home_t
6b the selinux context remains the same when you move the file
- Permission is denied due to moving the file instead of copying it. This leads to SELinux location and permissions not matching up with the new location which raises flags and is denied by SELinux
Deliverable 7
- I found the following log showing permission denied when attempting to access userhost.txt
- By running
ls -Z
and specifying the file we can see the location issue of user_home and usingrestorecon -rv
and specifying the file we can update the SELinux context to the new location now allowing it to properly funcion
Deliverable 8
- First navigate to
/etc/httpd/conf.d/userdir.conf
- enable UserDir
- uncomment
UserDir public_html_
- Proof of home directory index
Deliverable 9
SSH port change + SELinux allow guide
Deliverable 10
Deliverable 11
sudo semanage login -a -s guest_u guestuser
sudo semanage login -m -s guest_u guestuser
sudo semanage login -l