CSE 513 I ntroduction to Operating Systems Class 10 - Security J - - PowerPoint PPT Presentation
CSE 513 I ntroduction to Operating Systems Class 10 - Security J - - PowerPoint PPT Presentation
CSE 513 I ntroduction to Operating Systems Class 10 - Security J onat han Walpole Dept . of Comp. Sci. and Eng. Oregon Healt h and Science Universit y Overview I ntro to cryptography tools one-way f unct ions, public vs pr ivat e key
Overview
I ntro to cryptography tools
- ne-way f unct ions, public vs pr ivat e key encr ypt ion,
hash f unct ions, and digit al signat ur es
Protection domains and protection mechanisms User authentication I nternal attacks
Tr oj an hor ses, spoof ing, logic bombs, t r ap door s,
buf f er over f low at t acks
External attacks
Vir uses, wor ms, mobile code, sand boxing,
int er pr et at ion
Security overview
- Security f lavors
Conf ident ialit y - Abilit y t o prot ect secret s I nt egrit y -Abilit y t o prot ect t he dat a cont ent s Availabilit y - Abilit y t o cont inue t o operat e
- Know thy enemy!
User st upidit y (bad def ault set t ings f rom companies) I nsider snooping Out sider snooping Blat ant at t acks (viruses and worms) Bot s!
Accidental data loss
- Acts of God
- f ires, f loods, wars
- Hardware or sof tware errors
- CP
U malf unct ion, bad disk, program bugs
- Human errors
- dat a ent ry, wrong t ape mount ed
- “you” are probably t he biggest t hreat you’ll ever f ace
I ntroduction to Cryptography Tools
Basics of Cryptography
Relationship between the plaintext and the ciphertext
Cryptography: conf identiality and integrity
Example: mono- alphabetic substitution
Plaint ext : ABCDEFGHIJKLMNOPQRSTUVWXYZ Cypher t ext : QWERTYUIOPASDFGHJKLZXCVBNM
Given the encryption key (QWERTYUI OPASDFGHJKLZXCVBNM),
easy t o f ind decr ypt ion key using st at ist ical
pr oper t ies of nat ur al language (common let t er s and digr ams)
…
despit e size of sear ch space of 26! possible keys
Function should be more complex and search
space very large.
Secret- key cryptography
Symmetric cryptography: DES
- DES operates on 64- bit blocks of data
- init ial permut at ion
- 16 rounds of t ransf ormat ions each using a dif f erent encrypt ion key
Mangler f unction
Per- round key generation in DES
- Each key derived f rom a 56- bit master by mangling f unction
based on splitting, rotating, bit extraction and combination
Symmetric (secret) key cryptography
Fast f or encryption and decryption Dif f icult to break analytically Subject to brute f orce attacks
as comput er s get f ast er must incr ease t he number
- f r ounds and lengt h of keys
Main problem
how t o dist r ibut e t he keys in t he f ir st place?
Public- key cryptography
Use dif f erent keys f or encryption and decryption Knowing the encryption key doesn’t help you decrypt
t he encr ypt ion key can be made public encr ypt ion key is given t o sender decr ypt ion key is held pr ivat ely by t he r eceiver
But how does it work?
Public- key cryptography
Asymmetric (one- way) f unctions
given f unct ion f it is easy t o evaluat e y = f (x) but given y it s comput at ionally inf easible t o f ind x
Trivial example of an asymmetric f unction
encr ypt ion: y = x 2 decr ypt ion: x = squar er oot (y)
Challenge
f inding a f unct ion wit h st r ong secur it y pr oper t ies but
ef f icient encr ypt ion and decr ypt ion
Public- key cryptography: RSA
- RSA (Rivest, Shamir, Adleman)
- encr ypt ion involves mult iplying lar ge pr ime number s
- cr acking involves f inding pr ime f act or s of a lar ge number
- Steps to generate encryption key (e ) and decryption
key (d )
- Choose t wo ver y lar ge pr ime number s, p and q
- Comput e n = p x q and z = (p – 1) x (q – 1)
- Choose a number d t hat is r elat ively pr ime t o z
- Comput e t he number e such t hat e x d = 1 mod z
Public- key cryptography: RSA
- Messages split into f ixed length blocks of bits
- int er pr et ed as number s wit h value 0 <
= mi < n
- Encryption
ci = mi
e (mod n)
- r equir es t hat you have n and encr ypt ion key e
- Decryption
mi = ci
d (mod n)
- r equir es t hat you have n and decr ypt ion key d
RSA vs DES
RSA is more secure than DES RSA requires 100- 1000 times more computation
than DES to encrypt and decrypt
RSA can be used to exchange private DES keys DES can be used f or message contents
Secure hash f unctions
Hash f unctions h = H(m) are one way f unctions
can’t f ind input m f r om out put h easy t o comput e h f r om m
Weak collision resistance
given m and h = H(m) dif f icult t o f ind dif f er ent
input m’ such t hat H(m) = H(m’)
Strong collision resistance
given H it is dif f icult t o f ind any t wo dif f er ent input
values m and m’ such t hat H(m) = H(m’)
They typically generate a short f ixed length
- utput string f rom arbitrary length input string
Example secure hash f unctions
MD5 - (Message Digest)
pr oduces a 16 byt e r esult
SHA - (Secure Hash Algorithm)
pr oduces a 20 byt e r esult
Secure hash f unctions : MD5
The structure of MD5
pr oduces a 128-bit digest f r om a set of 512-bit blocks k block digest s r equir e k phases of pr ocessing each wit h
f our r ounds of pr ocessing t o pr oduce one message digest
Per phase processing in MD5
Each phase involves f or rounds of processing
F (x,y,z) = (x AND y) OR ((NOT x) AND z) G (x,y,z) = (x AND z) OR (y AND (NOT z)) H (x,y,z) = x XOR y XOR z I (x,y,z) = y XOR (x OR (NOT z))
Per round processing in MD5
- The 16 iterations during the f irst round in a phase of
MD5 using f unction F
What can you use a hash f unction f or?
To verif y the integrity of data
if t he dat a has changed t he hash will change (weak
and st r ong collision r esist ance pr oper t ies)
To “sign” or “certif y” data or sof tware
Digital signatures
Computing a signature block What the receiver gets
(b)
Digital signatures using a message digest
Private key of A Public key of A Secret key shared by A and B KA, B Descr ipt ion Not at ion K
A +
K
A −
Digital signatures with public- key cryptography
Private key of A Public key of A Secret key shared by A and B KA, B Descr ipt ion Not at ion K
A +
K
A −
Protection Domains
Protection domains
Every process executes in some protection domain
det er mined by it s cr eat or , aut hent icat ed at login t ime
OS mechanisms f or switching protection domains
syst em calls set UI D capabilit y on execut able f ile r e-aut hent icat ing user
A protection matrix
Protection matrix with domains as objects
Domain
Protection Mechanisms
Access control lists (ACLs)
Domain
Domain matrix is typically large and sparse
inef f icient t o st or e t he whole t hing st or e occupied columns only, wit h t he r esour ce? - ACLs st or e occupied r ows only, wit h t he domain? - Capabilit ies
Access control lists f or f ile access
Access Control Lists (2)
Two access control lists with user names and
roles (groups)
Capabilities
Domain
Domain matrix is typically large and sparse
inef f icient t o st or e t he whole t hing st or e occupied columns only, wit h t he r esour ce? - ACLs st or e occupied r ows only, wit h t he domain? - Capabilit ies
Capabilities associated with processes
Each process has a capability list
- Cryptographically- protected capability can be
held in user space
- Generic Rights
- Copy capabilit y
- Copy obj ect
- Remove capabilit y
- Dest r oy obj ect
Cryptographically- protected capabilities
f (Objects, Rights, Check) Rights Object Server
User Authentication
User authentication
- Basic Principles. Authentication must identif y:
- Somet hing t he user knows
- Somet hing t he user has
- Somet hing t he user is
- This is done bef ore user can use the system !
Authentication using passwords
(a) A successf ul login (b) Login rejected af ter name entered (easier to crack) (c) Login rejected af ter name and password typed
Problems with pre- set values
How a cracker broke into LBL
a U.S. Dept . of Ener gy r esear ch lab
Authentication using passwords and salt
The use of salt to def eat precomputation of
encrypted passwords
salt changes each t ime passwor d changes incr eases t he size of t he sear ch space
Salt Password
, , , ,
Authentication using a physical object
Magnetic cards
magnet ic st r ipe car ds chip car ds: st or ed value car ds, smar t car ds
Authentication using biometrics
A device f or measuring f inger length.
Attacks on the authentication process
Authentication - making sure the user is the user Attacks include
Placement of passwor ds in t he clear
- Written on desk, included in a network packet etc…
Net wor k packet snif f ers
- Listen to the network and record login sessions
Snooping
- observing key strokes
Aut omat ed bot s
- Try a password every minute (don’t get greedy)
Counter- measures to combat attackers
Limiting times when someone can log in Automatic callback at number prespecif ied Limited number of login tries Keep a database of all logins Honey pot
leave simple login name/ passwor d as a t r ap secur it y per sonnel not if ied when at t acker bit es
More counter- measures
Better passwords
No dict ionar y wor ds, special char act er s, longer
Don’t give up inf ormation
Login pr ompt s or any ot her t ime
One time passwords
Sat ellit e dr iven secur it y car ds
Limited- time passwords
Annoying but ef f ect ive
Challenge- response pairs
Ask quest ions
Physical authentication combined with passwords
Verif ying the user is a person
I nternal Attacks
Login spoof ing
(a) Correct login screen (b) Phony login screen
Which would you rather log into?
Trojan horses
Free program made available to unsuspecting user
Act ually cont ains code t o do har m
Place altered version of utility program on victim' s
computer
t r ick user int o r unning t hat pr ogr am example, ls at t ack
Trick the user into executing something they
shouldn’t
Logic bombs
Revenge driven attack Company programmer writes program
pot ent ial t o do har m OK as long as he/ she ent er s passwor d daily if pr ogr ammer f ir ed, no passwor d and bomb “explodes”
Trap doors
(a) Normal code. (b) Code with a trapdoor inserted
Buf f er overf low attacks
(a) Situation when main program is running (b) Af ter program A called (c) Buf f er overf low shown in gray
Buf f er overf low attacks
The basic idea
exploit lack of bounds checking t o over wr it e r et ur n
addr ess and t o inser t new r et ur n addr ess and code at t hat addr ess
exploit lack of separ at ion bet ween st ack and code
(abilit y t o execut e bot h)
allows user (at t acker ) code t o be placed in a set
UI D r oot pr ocess and hence execut ed in a mor e pr ivileged pr ot ect ion domain
Other generic security attacks
Request memory, disk space, tapes and just read Try illegal system calls Start a login and hit DEL, RUBOUT, or BREAK Try modif ying complex OS structures Try to do specif ied DO NOTs Convince a system programmer to add a trap door Beg someone with access to help a poor user who
f orgot their password
Famous security f laws
(a) (b) (c)
The TENEX password problem
r equir es 128n t r ies inst ead of 128n
Design principles f or security
- System design should be public
- Def ault should be no access
- Check f or current authority
- Give each process least privilege possible
- Protection mechanism should be
- simple
- unif orm
- in lowest layers of syst em
- Scheme should be psychologically acceptable
And … keep it simple!
External Attacks
External threats and viruses
External threat
code t r ansmit t ed t o t ar get machine code execut ed t her e, doing damage may ut ilize an int er nal at t ack t o gain mor e pr ivilege
(ie. Buf f er over f low)
Goals of virus writer
quickly spr eading vir us dif f icult t o det ect har d t o get r id of
Virus = program that can reproduce itself
at t ach it s code t o anot her pr ogr am
Virus damage scenarios
Blackmail Denial of service as long as virus runs Permanently damage hardware Target a competitor' s computer
do har m espionage
I ntra- corporate dirty tricks
sabot age anot her cor por at e of f icer ' s f iles
How viruses work
Virus written in assembly language I nserted into another program
use t ool called a “dropper”
Virus dormant until program executed
t hen inf ect s ot her programs event ually execut es it s “payload”
Searching f or executable f iles to inf ect
Recursive procedure that f inds executable f iles on a UNI X system Virus could inf ect them all
How viruses hide
- An executable program
- Virus at the f ront (program shif ted, size increased)
- Virus at the end (size increased)
- With a virus spread over f ree space within program
- less easy t o spot , size may not increase
Viruses that capture interrupt vectors
- Af ter virus has captured interrupt, trap vectors
- Af ter OS has retaken printer interrupt vector
- Af ter virus has noticed loss of printer interrupt vector and
recaptured it
How viruses spread
Virus placed where likely to be copied or
executed
When it arrives at a new machine
inf ect s pr ogr ams on har d dr ive, f loppy may t r y t o spr ead over LAN
Attach to innocent looking email
when it r uns, use mailing list t o r eplicat e f ur t her
Antivirus and anti- antivirus techniques
(a) A program (b) I nf ected program (c) Compressed inf ected program (d) Encrypted virus (e) Compressed virus with encrypted compression code
Anti- antivirus techniques
Examples of a polymorphic virus
All of t hese examples do t he same t hing
Antivirus sof tware
I ntegrity checkers
use checksums on execut able f iles hide checksums t o pr event t amper ing? encr ypt checksums and keep key pr ivat e
Behavioral checkers
cat ch syst em calls and check f or suspicious act ivit y what does “nor mal” act ivit y look like?
Virus avoidance and recovery
Virus avoidance
good OS inst all only shr ink-wr apped sof t war e use ant ivir us sof t war e do not click on at t achment s t o email f r equent backups
Recovery f rom virus attack
halt comput er , r eboot f r om saf e disk, r un ant ivir us
The I nternet worm
Robert Morris constructed the f irst I nternet
worm
Consist ed of t wo pr ogr ams
- bootstrap to upload worm and the worm itself
Wor m f ir st hid it s exist ence t hen r eplicat ed it self
- n new machines
Focused on t hr ee f laws in UNI X
- rsh – exploit local trusted machines
- f ingerd – buf f er overf low attack
- sendmail – debug problem
I t was too aggressive and he was caught
Availability and denial of service attacks
Denial of service (DoS) attacks
Examples of known at t acks
- Breaking end systems
– Ping of death – large ping packets – Teardrop – overlapping I P segments
- SYN f loods
- UDP f loods
- Window bombs (in browsers)
Usually prevented by some sort of f irewall but
not always ef f ective
Security Approaches f or Mobile Code
Sandboxing
(a) Memory divided into 1- MB sandboxes
each applet has t wo sandboxed f or code and dat a some st at ic checking of addresses
(b) Code inserted f or runtime checking of dynamic target addresses
I nterpretation
Applets can be interpreted by a Web browser
Code signing
How code signing works
Type saf e languages
- A type saf e language
- compiler r ej ect s at t empt s t o misuse var iables
- Checks include …
- At t empt s t o f or ge point er s
- Violat ion of access r est r ict ions on pr ivat e class
member s
- Misuse of var iables by t ype
- Gener at ion of st ack over / under f lows
- I llegal conver sion of var iables t o anot her t ype
Java security
Examples of specif ied protection with JDK 1. 2
Covert Channels
Covert channels
Client , server and collaborat or processes Encapsulat ed server can st ill leak t o collaborat or via covert channels
Locking as a covert channel
A covert channel using f ile locking
Covert channels
Pictures appear the same Picture on right has text of 5 Shakespeare plays
encrypt ed, insert ed int o low order bit s of color values
Zebras Hamlet , Macbet h, J ulius Caesar Merchant of Venice, King Lear
Spare Slides
Trusted Systems and Formal Models
Trusted Systems
Trusted Computing Base
A ref erence monitor
Formal Models of Secure Systems
(a) An authorized state (b) An unauthorized state
Multilevel Security (1)
The Bell- La Padula multilevel security model
Multilevel Security (2)
The Biba Model
- Principles to guarantee integrity of data
- Simple integrity principle
- process can writ e only obj ect s at it s securit y level or lower
- The integrity * property
- process can read only obj ect s at it s securit y level or higher
Orange Book Security (1)
- Symbol X means new requirements
- Symbol - > requirements f rom next lower category apply
here also