<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://homeostasis.scs.carleton.ca/wiki/index.php?action=history&amp;feed=atom&amp;title=Operating_Systems_2019F_Lecture_20</id>
	<title>Operating Systems 2019F Lecture 20 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://homeostasis.scs.carleton.ca/wiki/index.php?action=history&amp;feed=atom&amp;title=Operating_Systems_2019F_Lecture_20"/>
	<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2019F_Lecture_20&amp;action=history"/>
	<updated>2026-06-03T01:19:42Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.42.1</generator>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2019F_Lecture_20&amp;diff=22542&amp;oldid=prev</id>
		<title>Soma: Created page with &quot;==Video==  The video for the lecture given on November 20, 2019 [https://homeostasis.scs.carleton.ca/~soma/os-2019f/lectures/comp3000-2019f-lec20-20191120.m4v is now available...&quot;</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2019F_Lecture_20&amp;diff=22542&amp;oldid=prev"/>
		<updated>2020-03-20T02:10:22Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;==Video==  The video for the lecture given on November 20, 2019 [https://homeostasis.scs.carleton.ca/~soma/os-2019f/lectures/comp3000-2019f-lec20-20191120.m4v is now available...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Video==&lt;br /&gt;
&lt;br /&gt;
The video for the lecture given on November 20, 2019 [https://homeostasis.scs.carleton.ca/~soma/os-2019f/lectures/comp3000-2019f-lec20-20191120.m4v is now available].&lt;br /&gt;
&lt;br /&gt;
==Notes==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Lecture 20&lt;br /&gt;
----------&lt;br /&gt;
Assignment 3 is now due Nov. 24th, not the 22nd&lt;br /&gt;
&lt;br /&gt;
operating system security&lt;br /&gt;
&lt;br /&gt;
What does it mean to keep an operating system secure?&lt;br /&gt;
&lt;br /&gt;
Conventionally, it means&lt;br /&gt;
 - prevent the operating system code from being compromised&lt;br /&gt;
   (controlled by an unauthorized party)&lt;br /&gt;
 - enforce system security policy (e.g., follow access contro policy)&lt;br /&gt;
&lt;br /&gt;
Security policy in practice is not that variable, and really we should be more specific in our operating system security requirements (and newer systems are more specific)&lt;br /&gt;
&lt;br /&gt;
TCB = trusted computing base&lt;br /&gt;
      portion of a system that enforces security policy&lt;br /&gt;
      as long as it stays secure, policy is enforced&lt;br /&gt;
&lt;br /&gt;
Classic OS design says we need a &amp;quot;minimal&amp;quot; TCB&lt;br /&gt;
 - so we can check it and make sure it doesn&amp;#039;t have any bugs&lt;br /&gt;
&lt;br /&gt;
What is the TCB for UNIX/Linux?&lt;br /&gt;
 - not so clear...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What do you need to &amp;quot;lock down&amp;quot; to make sure a Linux system stays secure?  How can each be compromised?&lt;br /&gt;
&lt;br /&gt;
1. kernel (running in supervisor mode on the CPU)&lt;br /&gt;
   - normally, hard to get to since userspace programs can&amp;#039;t directly do anything to it, including code running as root&lt;br /&gt;
   - but, if you have module support, it is possible to load arbitrary code&lt;br /&gt;
     into the kernel&lt;br /&gt;
   - system calls may have coding flaws&lt;br /&gt;
   - CPU may have privilege separation flaws&lt;br /&gt;
   - defenses: signed kernel modules, vulnerability analysis of kernel,&lt;br /&gt;
     CPU firmware updates&lt;br /&gt;
&lt;br /&gt;
2. common libraries (e.g. C library)&lt;br /&gt;
   - included in many programs, including ones running as root&lt;br /&gt;
   - if compromised, can do anything as the user running the program&lt;br /&gt;
   - defenses: signed libraries, vulnerability analysis of library&lt;br /&gt;
&lt;br /&gt;
3. system daemons (background processes)&lt;br /&gt;
   - provide critical functions, run with high privilege&lt;br /&gt;
   - can sign, do vuln analysis&lt;br /&gt;
&lt;br /&gt;
4. setuid binaries&lt;br /&gt;
   - provide critical functions, run with high privilege&lt;br /&gt;
   - can sign, do vuln analysis&lt;br /&gt;
&lt;br /&gt;
5. common applications (web browsers)&lt;br /&gt;
   - everyone runs them! so can compromise arbitrary users&lt;br /&gt;
   - sign, vuln analysis&lt;br /&gt;
&lt;br /&gt;
TCB of a Linux system is almost everything installed&lt;br /&gt;
   - you can compromise someone even with ls or whoami&lt;br /&gt;
&lt;br /&gt;
Some systems limit the privileges of root, such as SELinux and AppArmor&lt;br /&gt;
 - known as mandatory access control (MAC)&lt;br /&gt;
 - means root can&amp;#039;t change security policy&lt;br /&gt;
 - have to reboot to change policy, go into special mode&lt;br /&gt;
 - not so good for developer workstations, but may be good for&lt;br /&gt;
   embedded systems or servers&lt;br /&gt;
&lt;br /&gt;
classic Linux has discretionary access control (DAC), meaning root can change it at any time.&lt;br /&gt;
&lt;br /&gt;
What are systems that you use that are really &amp;quot;locked down&amp;quot; - you can&amp;#039;t make them run arbitrary code, they can only run code authorized by the manufacturers.&lt;br /&gt;
 * iOS, Android devices&lt;br /&gt;
 * game consoles&lt;br /&gt;
 * many IoT devices&lt;br /&gt;
 * cars&lt;br /&gt;
&lt;br /&gt;
Most of this &amp;quot;locking down&amp;quot; happens through code signing, but it is very elaborate.&lt;br /&gt;
 - &amp;quot;trusted computing&amp;quot; - code is verified from first boot, and every subsequent program is also checked so you get a chain of trust from the bootloader to the application&lt;br /&gt;
    - necessary because any untrusted code in this chain can mess everything up&lt;br /&gt;
&lt;br /&gt;
 - &amp;quot;locked bootloader&amp;quot; -&amp;gt; trusted computing, code signing&lt;br /&gt;
&lt;br /&gt;
When an iOS device is &amp;quot;jailbroken&amp;quot; it is made so arbitrary code can be run on it, not just code authorized by Apple.&lt;br /&gt;
  - but the term means something more&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Modern OS and application security is based around another key concept&lt;br /&gt;
**sandboxing**&lt;br /&gt;
&lt;br /&gt;
A sandbox for code isolates the code from the rest of the system&lt;br /&gt;
 - limits its access&lt;br /&gt;
 - allows for running untrusted code safely&lt;br /&gt;
&lt;br /&gt;
BSD has application &amp;quot;jails&amp;quot;&lt;br /&gt;
 - processes in a jail can&amp;#039;t escape, they can only access resources inside of the jail&lt;br /&gt;
&lt;br /&gt;
By default, on iOS all applications run inside jails.&lt;br /&gt;
 - this is why applications on iOS are limited in their functionality&lt;br /&gt;
&lt;br /&gt;
Android doesn&amp;#039;t do jails, instead they have fine-grained application permissions&lt;br /&gt;
 - system applications just have more privileges&lt;br /&gt;
 - this approach is inherently more flexible and less secure&lt;br /&gt;
&lt;br /&gt;
Jails provide analogous functionality to the JavaScript sandbox for web pages, but the implementation is completely different&lt;br /&gt;
 - enforced by hardware, OS kernel rather than web browser, language runtime&lt;br /&gt;
&lt;br /&gt;
Language-level sandboxes are inherently safer than OS-level jails&lt;br /&gt;
 - see the restrictions on app stores versus the openness of the web&lt;br /&gt;
&lt;br /&gt;
WebAssembly may bridge this gap&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Rootkits&lt;br /&gt;
--------&lt;br /&gt;
 - code designed to hide attacker behavior from regular users and even&lt;br /&gt;
   administrators of a system&lt;br /&gt;
 - if a rootkit is installed, you can never trust the system because&lt;br /&gt;
   you can&amp;#039;t trust anything it does - it will lie to you&lt;br /&gt;
 - you fix by reinstalling, but if they compromised firmware you may&lt;br /&gt;
   have to throw the computer out&lt;br /&gt;
&lt;br /&gt;
Key goals&lt;br /&gt;
 - hide processes&lt;br /&gt;
 - hide files&lt;br /&gt;
 - ensure access&lt;br /&gt;
&lt;br /&gt;
One aspect of a rootkit is a &amp;quot;back door&amp;quot; - an unauthorized way to gain access to a system&lt;br /&gt;
 - e.g. Joshua from WarGames&lt;br /&gt;
 - classic: special password that always work&lt;br /&gt;
&lt;br /&gt;
Rootkits don&amp;#039;t compromise a system, they are used after a compromise.&lt;br /&gt;
&lt;br /&gt;
You can do a pure userspace rootkit&lt;br /&gt;
 - change ls, ps, other utilities&lt;br /&gt;
 - but it is a pain to truly hide things&lt;br /&gt;
&lt;br /&gt;
normally, need to run code as root to truly hide things&lt;br /&gt;
 - so you do it with a kernel module or similar mechanism&lt;br /&gt;
 - change how system calls work&lt;br /&gt;
   - hide files, processes normally&lt;br /&gt;
   - show hidden files &amp;amp; processes when given special arguments&lt;br /&gt;
&lt;br /&gt;
Not a rootkit, but gives you an idea: fakeroot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Soma</name></author>
	</entry>
</feed>