CSE 513 I ntroduction to Operating Systems Class 10 - Security J - - PowerPoint PPT Presentation

cse 513 i ntroduction to operating systems class 10
SMART_READER_LITE
LIVE PREVIEW

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


slide-1
SLIDE 1

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

slide-2
SLIDE 2

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

slide-3
SLIDE 3

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!

slide-4
SLIDE 4

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
slide-5
SLIDE 5

I ntroduction to Cryptography Tools

slide-6
SLIDE 6

Basics of Cryptography

Relationship between the plaintext and the ciphertext

slide-7
SLIDE 7

Cryptography: conf identiality and integrity

slide-8
SLIDE 8

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

slide-9
SLIDE 9

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

slide-10
SLIDE 10

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

slide-11
SLIDE 11

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?

slide-12
SLIDE 12

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?

slide-13
SLIDE 13

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

slide-14
SLIDE 14

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
slide-15
SLIDE 15

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
slide-16
SLIDE 16

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

slide-17
SLIDE 17

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
slide-18
SLIDE 18

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

slide-19
SLIDE 19

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

slide-20
SLIDE 20

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))

slide-21
SLIDE 21

Per round processing in MD5

  • The 16 iterations during the f irst round in a phase of

MD5 using f unction F

slide-22
SLIDE 22

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

slide-23
SLIDE 23

Digital signatures

Computing a signature block What the receiver gets

(b)

slide-24
SLIDE 24

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 −

slide-25
SLIDE 25

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 −

slide-26
SLIDE 26

Protection Domains

slide-27
SLIDE 27

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

slide-28
SLIDE 28

A protection matrix

slide-29
SLIDE 29

Protection matrix with domains as objects

Domain

slide-30
SLIDE 30

Protection Mechanisms

slide-31
SLIDE 31

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

slide-32
SLIDE 32

Access control lists f or f ile access

slide-33
SLIDE 33

Access Control Lists (2)

Two access control lists with user names and

roles (groups)

slide-34
SLIDE 34

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

slide-35
SLIDE 35

Capabilities associated with processes

Each process has a capability list

slide-36
SLIDE 36
  • 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

slide-37
SLIDE 37

User Authentication

slide-38
SLIDE 38

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 !
slide-39
SLIDE 39

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

slide-40
SLIDE 40

Problems with pre- set values

How a cracker broke into LBL

a U.S. Dept . of Ener gy r esear ch lab

slide-41
SLIDE 41

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

, , , ,

slide-42
SLIDE 42

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

slide-43
SLIDE 43

Authentication using biometrics

A device f or measuring f inger length.

slide-44
SLIDE 44

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)
slide-45
SLIDE 45

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

slide-46
SLIDE 46

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

slide-47
SLIDE 47

Verif ying the user is a person

slide-48
SLIDE 48

I nternal Attacks

slide-49
SLIDE 49

Login spoof ing

(a) Correct login screen (b) Phony login screen

slide-50
SLIDE 50

Which would you rather log into?

slide-51
SLIDE 51

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

slide-52
SLIDE 52

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”

slide-53
SLIDE 53

Trap doors

(a) Normal code. (b) Code with a trapdoor inserted

slide-54
SLIDE 54

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

slide-55
SLIDE 55

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

slide-56
SLIDE 56

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

slide-57
SLIDE 57

Famous security f laws

(a) (b) (c)

The TENEX password problem

r equir es 128n t r ies inst ead of 128n

slide-58
SLIDE 58

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!

slide-59
SLIDE 59

External Attacks

slide-60
SLIDE 60

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

slide-61
SLIDE 61

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

slide-62
SLIDE 62

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”

slide-63
SLIDE 63

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

slide-64
SLIDE 64

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
slide-65
SLIDE 65

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

slide-66
SLIDE 66

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

slide-67
SLIDE 67

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

slide-68
SLIDE 68

Anti- antivirus techniques

Examples of a polymorphic virus

All of t hese examples do t he same t hing

slide-69
SLIDE 69

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?

slide-70
SLIDE 70

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

slide-71
SLIDE 71

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

slide-72
SLIDE 72

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

slide-73
SLIDE 73

Security Approaches f or Mobile Code

slide-74
SLIDE 74

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

slide-75
SLIDE 75

I nterpretation

Applets can be interpreted by a Web browser

slide-76
SLIDE 76

Code signing

How code signing works

slide-77
SLIDE 77

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
slide-78
SLIDE 78

Java security

Examples of specif ied protection with JDK 1. 2

slide-79
SLIDE 79

Covert Channels

slide-80
SLIDE 80

Covert channels

Client , server and collaborat or processes Encapsulat ed server can st ill leak t o collaborat or via covert channels

slide-81
SLIDE 81

Locking as a covert channel

A covert channel using f ile locking

slide-82
SLIDE 82

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

slide-83
SLIDE 83

Spare Slides

slide-84
SLIDE 84

Trusted Systems and Formal Models

slide-85
SLIDE 85

Trusted Systems

Trusted Computing Base

A ref erence monitor

slide-86
SLIDE 86

Formal Models of Secure Systems

(a) An authorized state (b) An unauthorized state

slide-87
SLIDE 87

Multilevel Security (1)

The Bell- La Padula multilevel security model

slide-88
SLIDE 88

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
slide-89
SLIDE 89

Orange Book Security (1)

  • Symbol X means new requirements
  • Symbol - > requirements f rom next lower category apply

here also

slide-90
SLIDE 90

Orange Book Security (2)