Lab 4 Processes security

docx

School

Herzing College *

*We aren’t endorsed by this school

Course

03

Subject

Computer Science

Date

Jan 9, 2024

Type

docx

Pages

4

Uploaded by CountRock12930

Report
Program: CS Course: Unix Security Lab 4: Processes security Name: ___________________________________ Import the VM provided in Debian-Server.ova into Virtual Box. Then, respond to all questions in your own words, providing screenshots of your work to support it. NOTE: If you are using a previously imported VM, it is recommendable to create a snapshot before making any modifications requested in this lab. After finishing, you can restore the snapshot to get to the original state. Part A: The /proc special filesystem Resource: https://www.redhat.com/sysadmin/linux-proc-filesystem 1. Log in as herzing . Move to /proc . Long list the directory filtering by your username. All files that are numbers represent a Process ID (PID). Pick a random number from the list. Compare it with “ ps -ef | grep PID ”. Show all your commands. 2. List the directory for this process with “ ls -l PID ”. This contains information about the live process. For instance, “ ls -l PID/map_files ” will show opened files by this process. Use head to show the status of this process. 3. You can see information about other user’s processes. Try to check the status of a process belonging to root with head as well. 4. You can check as well information about the system. What command would show you information about the CPU? 5. The kernel parameters can also be obtained from /proc . For instance, /proc/sys/net/ipv4/icmp_echo_ignore_all can be configured with 0 or 1. What is the actual value of this configuration? What does it mean? Check the permissions of this special file. Who can modify it?
Program: CS Course: Unix Security Lab 4: Processes security 6. Become root . Execute “ ping -c 1 127.0.0.1 ”, which should work. Then, enable this setting and try the ping again. 7. Check the setting but this time use the command “ sysctl PATH_TO_SETTING ”, specifying the path to the setting you want to check (the one you just changed), but instead of a slash (/), use a dot (.) to separate the directories. Hint: do not include proc and sys in the path. 8. This tool allows to modify the kernel settings. Change back the value of icmp_echo_ignore_all so it is disabled and pings work again. Show how you did it and a ping working. 9. Enable once more this setting and reboot. Then, check its value. How can you permanently enable the setting to ignore pings even if the machine is restarted? Part B: Process isolation Some systems require additional security measures to isolate processes from each other, specially when they belong to different applications. This is the case of, for instance, containers. Resource: https://www.nginx.com/blog/what-are-namespaces-cgroups-how-do-they-work/ 10. As root , remount the proc special filesystem with the option hidepid=2 . Then, back to herzing ’s session, try to see processes from other users. Show the commands you used and explain what happens. 11. Remount it again with hidepid=0 , so you get back to the original options. Then, still as root , list the properties of the webserver Apache2 by executing “ systemctl show apache2 ”. What is the value of the property MemoryLimit ? What does it mean?
Program: CS Course: Unix Security Lab 4: Processes security 12. We are going to set a limit on Apache2 of 1% the total RAM for the system. Execute systemctl set-property apache2 PROPERTY=VALUE ” with the appropriate property and value. Then, use grep to filter this property in the list. 13. A file, shown in the list of properties, has been created under /etc/systemd . Show its content and explain what the number is. 14. Set a memory usage of 1MB for Apache2, which would be ridiculous in a real-world scenario and has only an educational purpose here. Explain what happens. 15. Explain a use case for memory and CPU limits for certain processes. Part C: AppArmor Tutorial: https://debian-handbook.info/browse/stable/sect.apparmor.html Reference: https://ubuntu.com/server/docs/security-apparmor 16. Working as root , execute “ aa-status | grep profiles ”. How many profiles are loaded and how many of them are being actively used by processes? 17. Move to /etc/apparmor.d and check the profile for the traceroute command. The process traceroute has some permissions over the file traceroute.db . What permissions? What they mean collectively? 18. What are the two main modes a profile can have? 19. What command would you use to enforce the profile for /usr/sbin/traceroute ?
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Program: CS Course: Unix Security Lab 4: Processes security 20. Check the permissions that the Samba smbd daemon has in AppArmor. What can the daemon do with home directories?