0% found this document useful (0 votes)
15 views

OS Security - an Introduction

The document discusses key concepts in information security and privacy, focusing on operating system security and the Internet's infrastructure. It covers topics such as process management, protection mechanisms, and the exponential growth of the Internet, highlighting the importance of cybersecurity. Additionally, it references laws governing technological advancements and the need for security measures in an increasingly connected world.

Uploaded by

ravimittals6217
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views

OS Security - an Introduction

The document discusses key concepts in information security and privacy, focusing on operating system security and the Internet's infrastructure. It covers topics such as process management, protection mechanisms, and the exponential growth of the Internet, highlighting the importance of cybersecurity. Additionally, it references laws governing technological advancements and the need for security measures in an increasingly connected world.

Uploaded by

ravimittals6217
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 72

Information Security and Privacy

OS Security + Introduction to the Internet

Ravi Mittal
Cryptography is usually not the problem

"Using encryption on the Internet is the equivalent of arranging


an armored car to deliver credit card information from
someone living in a cardboard box to someone living on a
park bench."

-- Gene Spafford

2
3
Reading

⚫ Presentation, Introduction to Networking, Lecture 25, CS161,


Univ of California, Berkeley, Fall 2021
⚫ Text Book: Computer Security, Chapter on Network Security,
CS 161, University of California, Berkeley
⚫ Computer Networking: A Top-Down Approach, Book, J Kurose
and K Ross
⚫ Lectures by Prof Scott Shenker, Sylvia Ratnasamy, CS 168,
Univ of California, Berkeley, CS168.io

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

⚫ Processes provide protection and isolation


⚫ Reliability: bugs can only overwrite memory of process they are in
⚫ Security and privacy: malicious or compromised process can’t read or
write other process’ data

⚫ 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

Process 1 Process 2 Process n

Solution: Virtual Memory


Address Space Translation

⚫ Program operates in an address space that is distinct from the


physical memory space of the machine

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?

⚫ Dual Mode of Operation


⚫ User Mode and Kernel Mode

User Mode
interrupt exception
syscall

rtn rfi
exit
exec Kernel Mode

Limited HW access Full HW access

18
https://drravimittal.github.io/teaching/2021%20Operating%20Systems
User → Kernel Mode Transfer

⚫ System Call (Syscalls)


⚫ User Process requests a system service
⚫ Open or delete a file, read/write data into files, create a new user process,
establish a connection to web server etc
⚫ Interrupt
⚫ External asynchronous event, independent of the process
⚫ e.g., Timer, I/O device
⚫ Processor Exception (trap)
⚫ Hardware event caused by user program behavior that causes context
switch
⚫ E.g., Divide by zero, bad memory access (segmentation fault)
User Mode to Kernel Mode
⚫ Limited Entry to the Kernel
⚫ Only limited places in OS are entry points
⚫ Provides security
⚫ Hardware support – Mode bit
⚫ Provides ability to distinguish when system is running user code or kernel code
⚫ Some instructions designated as privileged, only executable in kernel mode
⚫ System call changes mode to kernel, return from call resets it to user

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

Hardware x86 PowerPC ARM


PCI

Ethernet (1Gbs/10Gbs) 802.11 a/g/n/ac SCSI Graphics Thunderbolt


21
Popular Syscalls in Linux (for self reading)

⚫ fork()
⚫ exit()
⚫ exec()
⚫ Open()
⚫ Read()
⚫ Write()
⚫ Close()
⚫ Pipe()
⚫ Getpid()
⚫ Alarm()
⚫ Sleep()
22
OS security topics – Will cover later if time permits

⚫ Memory protection, Supervisory Mode, Accountability


⚫ The reference monitor, Access Matrix
⚫ Access Control List, Capabilities
⚫ Object permissions and file based access control
⚫ Setuid bit and effective userid (eUID)
⚫ Directory permissions
⚫ Role based and mandatory Access Control

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

⚫ Use of Cryptographic tools and techniques


⚫ Encryption, Decryption, MAC, Hash, etc
⚫ Security Polity
⚫ Intrusion prevention
⚫ Detect intrusion attempt or successful intrusion
⚫ Initiate appropriate response

25
System Security - Summary

⚫ Safe computing practices


⚫ Passwords: Don’t share passwords, Use long and strong passwords
⚫ Aware of social engineering threats
⚫ Avoid phishing attacks
⚫ Don’t click on mail attachments or links from unknown sources
⚫ Authenticate that a request is legitimate
⚫ Use secure communication protocols that use encryption
⚫ https
⚫ Configure OS to minimize the attack surface
⚫ Disable all unused services
⚫ Configure system parameters properly, check permissions
⚫ Keep system and software updated with patches
26
Security in an isolated Island
28
What kind of security you need when you
are in an Island without any contact with the
outside world ?
More connections ➔ Less Security
Almost exponential growth of the Internet

Why?
Nielsen's Law of Internet Bandwidth

⚫ Users' bandwidth grows by 50% per year


⚫ 10% less than Moore's Law for computer speed
⚫ The new law fits data from 1983 to 2019
What has caused Internet bandwidth growth?

⚫ Rapid advances in communication technologies


⚫ Use of Fibers instead of copper
⚫ An strand of fiber can carry 100s of GBs per second
⚫ Optical switching of signals
⚫ Advances in Switches and Routers
⚫ Advances in processor technology – 5 nm technology
⚫ Reduced cost of processors and switches
⚫ Bandwidth hungry applications
⚫ Simplicity and flexibility of the Internet technology
⚫ Adaption by all → popularity → low cost → increase in BW

33
Moore’s Law

⚫ The number of transistors on a chip doubles about every


18-24 months
⚫ Gordon Moore, co-founder of Intel, 1965
⚫ True for 50+ years
What makes Moore’s law possible?

⚫ Transistors are getting smaller in each generation


⚫ 70% in each dimension compared to previous generation
⚫ Current transistor dimension: 5nm - 20nm
⚫ Recently released Apple’s M1 chip uses 5nm technology
⚫ 16 Billion transistors
Evolution of
Processor
Technology
Metcalfe’s Law
Robert Metcalfe,
Inventor of Ethernet
(HIGH SPEED INTERNET)

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?

Over 43 Billion devices running the Internet

40
ADVANCES IN NETWORKING WOULD NOT HAVE BEEN POSSIBLE
WITHOUT
ADVANCES IN PROCESSOR TECHNOLOGY

BOTH GREW EXPONENTIALLY IN CAPACITY

41
Combined Effect of Moore’s,
Nielsen’s and Metcalfe’s laws
Moore’s law

⚫ Computing has become powerful and cheaper


⚫ Every device can have computer/processor attached to it
⚫ For enhanced functionality, Control and Maintainability
Decreasing Prices of Bandwidth

⚫ User’s bandwidth is increasing → due to the fact that


bandwidth pricing is deceasing and connections are increasing
Combined Effect of Moore’s, Nilesen’s and Metcalfe’s law

⚫ The Internet has become very popular


⚫ The de facto communication technology
⚫ Affordable to everyone
⚫ A significant part of world’s population has access to the
Internet
⚫ Connected world → improving lives of people
⚫ Support of millions of applications
⚫ Many others

45
Cyber Security of the Internet – Why?
Cyber Security Threats

⚫ It greatly extends our overall attack surface


⚫ Today, Networking = the Internet

47
What can go wrong in the Network (Internet)?

Cutting of Cables, Routers/Equipment stolen, Cable Splicing


Wiretap, Physical disconnection, Eavesdrop, Data Interception,
Packet Sniffing, Phishing
Radiation (electrical impulses), shoulder Surfing
Insertion attacks, Replay attacks, Denial of Service, Port
scanning, Layer 2 attacks, Wrong Source Id, Wrong destination
Id, WiFi data stealing, IV Vector collision, No authentication,
Packet flooding, MITM attacks, Blocked Access, Access Failures,
Teardrop attack, Denial of Service, DDOS, DNS Spoofing,
Rerouting, DNS Cache poisoning, Zero-day Exploits, Backdoors,
Worms, Rootkit, Botnet, Diversion of traffic, Website hacking,
Malicious Bots, Ransomware attacks, Hacking of websites,
Malicious Software, etc…
48
Internet is like a Pipe (Analogy)
⚫ Pipes can carry anything as long as it is fluid (0s and 1s)
⚫ At any speed
⚫ Any end machine that has an IP address and that supports IP
protocol suit (IP/TCP/UDP) and associated protocols, can be
part of the global Internet

⚫ The intelligence lies at the end devices – they decide what to


do with bits
⚫ Pipe has no intelligence
The Internet does not provide any security
of its own.

→ You must provide security in


End devices
End-to-end protocols

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

Mobile Backhaul , The Internet


Base Station

IP Routers and Switches Data Center Network


Mobile Backhaul

Access Network
Metro Ethernet
Core
Network

Mobile Network Fixed Network Enterprise Network

Workgroup switches
edge routers,
connectivity
Broadband
GPON, EPON, DSL,
DSLAMs, CABLE
Internet structure: a Network of Networks

⚫ Hosts connect to Internet via


access Internet Service
Providers (ISPs) mobile network
national or global ISP

⚫ Access ISPs in turn must be


interconnected
⚫ So that any two hosts (anywhere!)
local or
can send packets to each other regional
ISP
⚫ Resulting network of networks home network content
provider
is very complex network datacenter
network

⚫ Evolution driven by economics,


enterprise
national policies network

Adapted from the book: computer Networking: A top down design by Kurose and Ross
Internet structure: a Network of Networks

Question: Given millions of access ISPs, how to connect them together?

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”

Question: Given millions of access ISPs, how to connect them together?

access access
net net
access
net
access
access net
net
access
access net
net

connecting each access ISP to


each other directly doesn’t
access
access
net scale: O(N2) connections. 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

But if one global ISP is viable business, there will be competitors ….

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

… and regional networks may arise to connect access nets to ISPs

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

… and content provider networks (e.g., Google, Microsoft, Akamai) may


run their own network, to bring services, content close to end users

access access
net net
access
net
access
access net
net
IXP access
access net
net ISP A

Content provider network


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

Tier 1 ISP Tier 1 ISP Google


IXP IXP IXP
Regional ISP Regional ISP

access access access access access access access access


ISP ISP ISP ISP ISP ISP ISP ISP

At “center”: small # of well-connected large networks


▪ “tier-1” commercial ISPs (e.g., Level 3, Sprint, AT&T, NTT), national & international coverage
▪ content provider networks (e.g., Google, Facebook): private network that connects its
data centers to Internet, often bypassing tier-1, regional ISPs

Adapted from the book: computer Networking: A top down design by Kurose and Ross
What does the Internet provide?
What does the Internet Provide?

⚫ Connectivity to various types of Networks


⚫ Unique address (identifier) to each communicating station
⚫ Routing of Information (Packets)
⚫ Filling up of information in Packet (as packet payload)
⚫ It carries information in terms of 0s and 1s
⚫ These 0s and 1s can represent any type of information
⚫ Data
⚫ Voice
⚫ Video
⚫ Etc
⚫ Compare this with PSTN Telephone – which can carry only analog
Voice
The beauty of the Internet !

⚫ Any thing that can be converted to data (digital 0s and 1s) can
be transported over the Internet..

⚫ Wow!

⚫ That means millions of asset forms can be transported over


the Internet
⚫ Books, Newspapers, Magazines, Movies, Songs, Videos,
⚫ Transaction data
⚫ Phone calls (voice as data), Video calls (voice + Pics as data)
It’s main characteristics

⚫ 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

⚫ The Internet is the de facto networking standard


⚫ Extremely popular data transmission technology
⚫ Independent of applications
⚫ It provides a simple pipe that transmits bits
⚫ The Internet provides global connectivity
⚫ Connects billions of devices
⚫ This implies huge attack surface
⚫ Supports millions of applications
⚫ The bandwidth of the Internet is increasing 50% per year
⚫ Nielsen’s law
⚫ It has no intelligence – flat pipe analogy
⚫ Basic internet doesn’t provide any security!!
⚫ Security has to be provided in the end devices
72

You might also like