OS Security - an Introduction
OS Security - an Introduction
Ravi Mittal
Cryptography is usually not the problem
-- Gene Spafford
2
3
Reading
4
Contents
⚫ OS Concepts
⚫ Program → Process
⚫ Address Space
⚫ OS Security
⚫ Security in an isolated Island
⚫ Almost Exponential growth of the Internet
⚫ Nielsen’s law, Moore’s law, Metcalfe’s law
⚫ Why cyber security of the Internet?
⚫ What is the Internet?
⚫ Lecture Summary
5
OS Concepts
Program → Process
⚫ Compiler
⚫ converts the code into machine instructions and stores them into a file
– executable image
⚫ Also defines any static data that the program needs along with its
initial values – include them in the executable image
⚫ To Run the program
⚫ OS copies the instructions and data from the executable image into
physical memory
⚫ OS also sets aside a memory region for execution stack – that hold
local variables during execution and a memory region called heap - to
hold any dynamically allocated data structures
⚫ Note that the OS must already be in the memory so that it can
copy executable file into the memory
⚫ With its own stack and heap
Recall: Process Creation
⚫ OS allocates memory and
creates memory image
⚫ Loads code, static data from disk
executable (eg a.out)
⚫ Creates and initialized runtime
stack
⚫ Creates heap
⚫ Opens basic files
⚫ Standard Input, Output, Error
⚫ Standard Input Output let programs
read input from terminal and print
output to screen
⚫ Initializes CPU registers
⚫ PC points to first instruction
Protection and Isolation
⚫ Mechanisms:
⚫ Address translation: address space only contains its own data
Address Space
⚫ Address space the set of accessible
addresses + state associated with them:
⚫ For 32-bit processor: 232 = 4 billion (109) 0xFFF…
Stack
addresses
⚫ For 64-bit processor: 264 = 18 quintillion (1018)
addresses Heap
⚫ The address space of a process contains all Static Data
of the memory state of the running program
⚫ What happens when you read or write to an Code
0x000…
address?
⚫ Acts like regular memory
⚫ Causes I/O operation
⚫ (Memory-mapped I/O)
⚫ Perhaps causes exception (fault)
⚫ Communicates with another program
Each process can have the same address spac
0x000…
Processor Memory
translator
Registers
0xFFF…
Operating System Security
Operating system security
OS Attacker
wants to Control
malicious files and
applications
Alice
Threat Model
⚫ User processes may be malicious
⚫ Attackers may have terminal access to the computer
⚫ Attackers may be able to access computers over the Internet
⚫ Software may be malicious
⚫ Malware: Virus, Worm etc
⚫ Third party applications may pose risks
⚫ May contain malware
⚫ May contain security bugs
⚫ Permissions are wrongly set for users, files, and directories
⚫ Capabilities (what users can do or can’t do) are wrongly set
⚫ Principle of least privileges
⚫ Buffer Overflow problems are not fixed
⚫ Network attacks 15
Four layer Model of security
16
How does an OS protects itself from
malicious processes ?
How does the OS protects itself from untrusted user Applications?
User Mode
interrupt exception
syscall
rtn rfi
exit
exec Kernel Mode
18
https://drravimittal.github.io/teaching/2021%20Operating%20Systems
User → Kernel Mode Transfer
20
User Application access to Kernel
⚫ Privileged instructions which can only be executed in kernel mode
⚫ System calls used to transfer control between user and kernel code
Word Processing
Compilers Web Browsers
Email
Databases Web Servers
Application / Service
Portable OS Library OS
User
System Call
Interface
System
Portable OS Kernel
Software Platform support, Device Drivers
⚫ fork()
⚫ exit()
⚫ exec()
⚫ Open()
⚫ Read()
⚫ Write()
⚫ Close()
⚫ Pipe()
⚫ Getpid()
⚫ Alarm()
⚫ Sleep()
22
OS security topics – Will cover later if time permits
23
OS Security - Summary
⚫ Address spaces
⚫ Does not allow one process to access other processes data / code
⚫ Access Control
⚫ Passwords, Biometrics, Multifactor authentication
⚫ Reference Monitor
⚫ Provides complete mediation / monitoring of all access requests to
resources
⚫ Protection from stack overflow (stack protector)
⚫ Address space layout (ALSR) randomizer and other techniques
⚫ Use of antivirus software
⚫ Permissions – Proper use, proper defaults
⚫ Capabilities
⚫ Each user has a certain set of permissions that they can do
24
OS Security - Summary
25
System Security - Summary
Why?
Nielsen's Law of Internet Bandwidth
33
Moore’s Law
Made prediction
and It became VERY
true!!!
(METCALFE’S LAW OF CONNECTIVITY)
Metcalfe’s Law of
Connectivity
That the power/value of a network
increases in proportion to the square of
the number of nodes on the network.
2 Computers = 1 connection
3 Computers = 3 connections
4 Computers = 6 connections
5 Computers = 10 connections
10 Computers = 45 connections
12 Computers = 66 connections
This is what connections from 20 computer
looks like! Image what a billion looks like!
So, the more that
join the internet
the more useful
the internet
becomes
exponentially!!!
IMAGINE HOW POWERFUL THE INTERNET IS?
40
ADVANCES IN NETWORKING WOULD NOT HAVE BEEN POSSIBLE
WITHOUT
ADVANCES IN PROCESSOR TECHNOLOGY
41
Combined Effect of Moore’s,
Nielsen’s and Metcalfe’s laws
Moore’s law
45
Cyber Security of the Internet – Why?
Cyber Security Threats
47
What can go wrong in the Network (Internet)?
51
What is the Internet?
The Internet – to glue different type of Networks
The Internet – to glue different types of Networks
Servers
Top of Rack
Agg. Switches
Access Network
Metro Ethernet
Core
Network
Workgroup switches
edge routers,
connectivity
Broadband
GPON, EPON, DSL,
DSLAMs, CABLE
Internet structure: a Network of Networks
Adapted from the book: computer Networking: A top down design by Kurose and Ross
Internet structure: a Network of Networks
access access
net net
access
net
access
access net
net
access
access net
net
access access
net net
access
net
access
net
access
net
access
net
access access
net access net
net
Internet structure: a Network of Networks”
access access
net net
access
net
access
access net
net
access
access net
net
access
net
access
net
access
net
access
net
access access
net access net
net
Not a Solution
Adapted from the book: computer Networking: A top down design by Kurose and Ross
Internet structure: a Network of Networks
Option: connect each access ISP to one global transit ISP?
Customer and provider ISPs have economic agreement.
access access
net net
access
net
access
access net
net
access
access net
net
global
access
net
ISP access
net
access
net
access
net
access
net
access
net
access access
net access net
net
Adapted from the book: computer Networking: A top down design by Kurose and Ross
Internet structure: a Network of Networks
access access
net net
access
net
access
access net
net
access
access net
net ISP A
access
net
ISP B access
net
access ISP C
net
access
net
access
net
access
net
access access
net access net
net
Adapted from the book: computer Networking: A top down design by Kurose and Ross
Internet structure: a Network of Networks
But if one global ISP is viable business, there will be competitors …. who will
want to be connected
Internet exchange point
access access
net net
access
net
access
access net
net
IXP access
access net
net ISP A
access
net
IXP ISP B access
net
access ISP C
net
access
net
access
net
peering link
access
net
access access
net access net
net
Adapted from the book: computer Networking: A top down design by Kurose and Ross
Internet structure: a Network of Networks
access access
net net
access
net
access
access net
net
IXP access
access net
net ISP A
access
net
IXP ISP B access
net
access ISP C
net
access
net
access
net regional ISP access
net
access access
net access net
net
Adapted from the book: computer Networking: A top down design by Kurose and Ross
Internet structure: a Network of Networks
access access
net net
access
net
access
access net
net
IXP access
access net
net ISP A
access ISP C
net
access
net
access
net regional ISP access
net
access access
net access net
net
Adapted from the book: computer Networking: A top down design by Kurose and Ross
Internet structure: a Network of Networks
Adapted from the book: computer Networking: A top down design by Kurose and Ross
What does the Internet provide?
What does the Internet Provide?
⚫ Any thing that can be converted to data (digital 0s and 1s) can
be transported over the Internet..
⚫ Wow!
⚫ Extremely Flexible
⚫ Can work when bandwidth is low and high .. Kbps – Gbps
⚫ Extremely Fault Tolerant
⚫ Can work when a part of the network is faulty
⚫ Fast recovery from faults
⚫ End-to-End Principle
⚫ Internet provides almost flat pipe – with almost no built-in intelligence
⚫ Anything you put at one end appears at the other end
⚫ It’s main purpose is to transport bits (inside a packet)
⚫ No restriction on application types: millions of applications at
the end points
⚫ Each application can have it’s own uniqueness
It can carry data for any application!
and
Any application can be coded in terms of 0s and 1s
Voice over IP
Video Conferencing over IP
And Millions of applications!
Lecture Summary