Outline Operating System Security Introduction CS 239 Memory - - PDF document

outline operating system security
SMART_READER_LITE
LIVE PREVIEW

Outline Operating System Security Introduction CS 239 Memory - - PDF document

Outline Operating System Security Introduction CS 239 Memory protection Interprocess communications protection Security for Networks and File protection System Software Authentication May 20, 2002 Lecture 13 Lecture


slide-1
SLIDE 1

1

Lecture 13 Page 1 CS 239, Spring 2002

Operating System Security CS 239 Security for Networks and System Software May 20, 2002

Lecture 13 Page 2 CS 239, Spring 2002

Outline

  • Introduction
  • Memory protection
  • Interprocess communications protection
  • File protection
  • Authentication

Lecture 13 Page 3 CS 239, Spring 2002

Introduction

  • Threats to single machines are of the

same character as threats to network communications

  • But very different in their mechanisms

and solutions

Lecture 13 Page 4 CS 239, Spring 2002

Single User Vs. Multiple User Machines

  • The majority of today’s computers usually

support a single user – Sometimes one at a time – Sometimes only one ever

  • Some computers are still multi-user

– Mainframes – Servers – Network-of-workstation machines

Lecture 13 Page 5 CS 239, Spring 2002

Server Machines Vs. General Purpose Machines

  • Most server machines provide only limited

services – Web page access – File access – DNS lookup

  • Security problems are simpler for them
  • Some machines still provide completely

general service, though

Lecture 13 Page 6 CS 239, Spring 2002

Embedded Systems

  • An increasingly large number of
  • bjects contain embedded computers

–With limited capabilities and access

  • The future will undoubtedly see

security problems for them –First for embedded processors in security systems, probably

slide-2
SLIDE 2

2

Lecture 13 Page 7 CS 239, Spring 2002

Downloadable Code and Single User Machines

  • Applets and other downloaded code

should run in a limited mode

  • Using access control on a finer

granularity than the user

  • Essentially the same protection

problem as multiple users

Lecture 13 Page 8 CS 239, Spring 2002

Mechanisms for Secure Operating Systems

  • Most operating system security is

based on separation –Keep the bad guys away from the good stuff –Since you don’t know who’s bad, separate most things

Lecture 13 Page 9 CS 239, Spring 2002

Separation Methods

  • Physical separation

– Different machines

  • Temporal separation

– Same machine, different times

  • Logical separation

– HW/software enforcement

  • Cryptographic separation

Lecture 13 Page 10 CS 239, Spring 2002

The Problem of Sharing

  • Separating stuff is actually pretty easy
  • The hard problem is allowing

controlled sharing

  • How can the OS allow users to share

exactly what they intend to share? –In exactly the ways they intend

Lecture 13 Page 11 CS 239, Spring 2002

Levels of Sharing Protection

  • None
  • Isolation
  • All or nothing
  • Access limitations
  • Limited use of an object

Lecture 13 Page 12 CS 239, Spring 2002

Protecting Memory

  • Most general purpose systems provide some

memory protection – Logical separation of processes that run concurrently

  • Usually through virtual memory methods
  • Originally arose mostly for error

containment, not security

slide-3
SLIDE 3

3

Lecture 13 Page 13 CS 239, Spring 2002

Security Aspects of Paging

  • Main memory is divided into page frames
  • Every process has an address space divided

into logical pages

  • For a process to use a page, it must reside in

a page frame

  • If multiple processes are running, how do

we protect their frames?

Lecture 13 Page 14 CS 239, Spring 2002

Protection of Pages

  • Each process is given a page table

– Translation of logical addresses into physical locations

  • All addressing goes through page table

– At unavoidable hardware level

  • If the OS is careful about filling in the page

tables, a process can’t even name other processes’ pages

Lecture 13 Page 15 CS 239, Spring 2002

Security Issues of Page Frame Reuse

  • A common set of page frames is shared by

all processes

  • The OS switches ownership of page frames

as necessary

  • When a process acquires a new page frame,

it used to belong to another process – Can the new process read the old data?

Lecture 13 Page 16 CS 239, Spring 2002

Special Interfaces to Memory

  • Some systems provide a special interface to

memory

  • If the interface accesses physical memory,

– And doesn’t go through page table protections,

  • Attackers can read the physical memory

– Then figure out what’s there and find what they’re looking for

Lecture 13 Page 17 CS 239, Spring 2002

Protecting Interprocess Communications

  • Operating systems provide various kinds of

interprocess communications – Messages – Semaphores – Shared memory – Sockets

  • How can we be sure they’re used properly?

Lecture 13 Page 18 CS 239, Spring 2002

IPC Protection Issues

  • How hard it is depends on what you’re

worried about

  • For the moment, let’s say we’re worried

about one process improperly using IPC to get info from another – Process A wants to steal information from process B

  • How would process A do that?
slide-4
SLIDE 4

4

Lecture 13 Page 19 CS 239, Spring 2002

Message Security

Process A Process B Can process B use message- based IPC to steal the secret?

Gimme your secret

That’s probably not going to work

Lecture 13 Page 20 CS 239, Spring 2002

How Can B Get the Secret?

  • He can convince the system he’s A

– A problem for authentication

  • He can break into A’s memory

– That doesn’t use message IPC – And is handled by page tables

  • He can forge a message from someone else

to get the secret

  • He can “eavesdrop” on someone else who

gets the secret

Lecture 13 Page 21 CS 239, Spring 2002

Forging An Identity

Process A Process B Process C

I’m C, gimme your secret

Will A know B is lying?

Lecture 13 Page 22 CS 239, Spring 2002

Operating System Protections

  • The operating system knows who each

process belongs to

  • It can tag the message with the identity
  • f the sender
  • If the receiver cares, he can know the

identity

Lecture 13 Page 23 CS 239, Spring 2002

How About Eavesdropping?

Process A Process B Process C

I’m C, gimme your secret

Can process B “listen in” on this message?

Lecture 13 Page 24 CS 239, Spring 2002

What’s Really Going on Here?

  • On a single machine, what is a message

send, really?

  • A message is copied from a process buffer

to an OS buffer – Then from the OS buffer to another process’ buffer

  • If attacker can’t get at processes’ internal

buffers and can’t get at OS buffers, he can’t “eavesdrop”

slide-5
SLIDE 5

5

Lecture 13 Page 25 CS 239, Spring 2002

Other Forms of IPC

  • Semaphores, sockets, shared memory, RPC
  • Pretty much all the same

– Need system call to perform them – System call to get access belongs to some process – Process belongs to some principal – OS can check principal against access control permissions at syscall time

Lecture 13 Page 26 CS 239, Spring 2002

So When’s It Hard?

  • What if the OS has to prevent

cooperating processes from sharing information?

Lecture 13 Page 27 CS 239, Spring 2002

The Hard Case

Process A Process B Process A wants to tell the secret to process B But the OS has been instructed to prevent that Can the OS prevent A and B from colluding to get the secret to B?

Lecture 13 Page 28 CS 239, Spring 2002

File Protection

  • How do we apply these access protection

mechanisms to a real system resource?

  • Files are a common example of a typically

shared resource

  • If an OS supports multiple users, it needs to

address the question of file protection

Lecture 13 Page 29 CS 239, Spring 2002

Unix File Protection

  • A model for protecting files developed

in the 1970s

  • Still in very wide use today

–With relatively few modifications

  • But not very flexible

Lecture 13 Page 30 CS 239, Spring 2002

Unix File Protection Philosophy

  • Essentially, Unix uses a limited ACL
  • Only three subjects per file

– Owner – Group – Other

  • Limited set of rights specifiable

– Read, write, execute – Special meanings for some file types

slide-6
SLIDE 6

6

Lecture 13 Page 31 CS 239, Spring 2002

Unix Groups

  • A set of Unix users can be joined into a

group

  • All users in that group receive common

privileges – Except file owners always get the owner privileges

  • A user can be in multiple groups
  • But a file has only one group

Lecture 13 Page 32 CS 239, Spring 2002

Setuid and Setgid

  • Unix mechanisms for changing your user

identity and group identity

  • Either for a long time or for the run of a

single program

  • Created to deal with inflexibilities of the

Unix access control model

  • But the source of endless security problems

Lecture 13 Page 33 CS 239, Spring 2002

Why Are Setuid Programs Necessary?

  • The print queue is essentially a file
  • Someone must own that file
  • How will other people put stuff in the print

queue? – Without making the print queue writeable for all purposes

  • Typical Unix answer is run the printing

program setuid – To the owner of the print queue

Lecture 13 Page 34 CS 239, Spring 2002

Why Are Setuid Programs Dangerous?

  • Essentially, setuid programs expand a

user’s security domain

  • In an encapsulated way

–Abilities of the program limit the

  • perations in that domain
  • Need to be damn sure that the

program’s abilities are limited

Lecture 13 Page 35 CS 239, Spring 2002

Some Examples of Setuid Dangers

  • Setuid programs that allow forking of a new

shell

  • Setuid programs with powerful debugging

modes

  • Setuid programs with interesting side

effects – E.g., lpr options that allow file deletion

Lecture 13 Page 36 CS 239, Spring 2002

Unix File Access Control and Complete Mediation

  • Unix doesn’t offer complete mediation
  • File access is checked on open to a file

– For the requested modes of access

  • Opening program can use the file in the
  • pen mode for as long as it wants

– Even if the file’s access permissions change

  • Substantially cheaper in performance
slide-7
SLIDE 7

7

Lecture 13 Page 37 CS 239, Spring 2002

Physical Implementation of Unix Access Control

  • Effectively, requires 9 bits per file

–Setuid and setgid adds two bits

  • Stored in the file’s inode

–Possible because they’re so small

  • Checking them again requires re-

examining the inode

Lecture 13 Page 38 CS 239, Spring 2002

Pros and Cons of Unix File Protection Model

+ Low cost + Simple and easy to understand + Time tested – Lacking in flexibility

  • In granularity of control

–Subject and object

  • In what controls are possible

Lecture 13 Page 39 CS 239, Spring 2002

Access Control Lists for File Systems

  • The file system access control

mechanism of choice in modern

  • perating systems
  • Used in many systems -

–Andrew –Windows NT –Solaris 2.5

Lecture 13 Page 40 CS 239, Spring 2002

Solaris 2.5 ACLs for Files

  • In addition to the standard Unix

permissions

  • Allows ACL-style listing of users and

groups –With separate permissions for each

  • Does not expand set of allowable

permissions

Lecture 13 Page 41 CS 239, Spring 2002

Windows NT ACLs for Files

  • Integrated into the overall NT access

control mechanism

  • Uses NT concept of security

descriptors –Specifying objects

  • And security IDs

–Specifying subjects

Lecture 13 Page 42 CS 239, Spring 2002

More On Windows NT File ACLs

  • The NT model also allows creation of

groups –With their own security IDs

  • The security model is object-based

–So the types of permissions that can be granted are flexible and extensible

slide-8
SLIDE 8

8

Lecture 13 Page 43 CS 239, Spring 2002

Authentication in Single Machine Systems

  • Most single machine system security

mechanisms are based on controlling access

  • Access control only works if you have

good authentication

  • Various means are used to provide

authentication in operating systems

Lecture 13 Page 44 CS 239, Spring 2002

Process Authentication

  • Memory protection is based on process

identity –Only the owning process can name its own virtual memory pages

  • Because VM is completely in OS

control, pretty easy to ensure that processes can’t fake identities

Lecture 13 Page 45 CS 239, Spring 2002

How the OS Authenticates Processes

  • System calls are issued by a particular

process

  • The OS securely ties a process control

block to the process –Not under user control

  • Thus, the ID in the process control

block can be trusted

Lecture 13 Page 46 CS 239, Spring 2002

How Do Processes Originally Obtain Access Permission?

  • Most OS resources need access control

based on user identity or role – Other than virtual memory pages and

  • ther transient resources
  • How does a process get properly tagged

with its owning user or role?

  • Security is worthless if OS carefully

controls access on a bogus user ID

Lecture 13 Page 47 CS 239, Spring 2002

Users and Roles

  • In most systems, OS assigns each potential

user an ID

  • More sophisticated systems recognize that

the same user works in different roles – Effectively, each role requires its own ID – And secure methods of setting roles

Lecture 13 Page 48 CS 239, Spring 2002

Securely Identifying Users and Roles

  • Passwords
  • Identification devices
  • Challenge/response systems
  • Physical verification of the user
slide-9
SLIDE 9

9

Lecture 13 Page 49 CS 239, Spring 2002

Passwords

  • Authentication by what you know
  • One of the oldest and most commonly used

security mechanisms

  • Authenticate the user by requiring him to

produce a secret – Known only to him and to the authenticator – Or, if one-way encryption used, known

  • nly to him

Lecture 13 Page 50 CS 239, Spring 2002

Problems With Passwords

  • They have to be unguessable

–Yet easy for people to remember

  • If networks connect terminals to

computers, susceptible to password sniffers

  • Unless fairly long, brute force attacks
  • ften work on them

Lecture 13 Page 51 CS 239, Spring 2002

Proper Use of Passwords

  • Select good ones
  • Change them often
  • Never write them down
  • Never tell anyone else

Lecture 13 Page 52 CS 239, Spring 2002

Handling Passwords

  • The OS must be able to check

passwords when users log in

  • So must the OS store passwords?
  • Not really

–It can store an encrypted version

  • Encrypt the offered password and

compare it to the stored version

Lecture 13 Page 53 CS 239, Spring 2002

Standard Password Handling

Login: Groucho

We6/d02,

password: swordfish Harpo 2st6’sG0 Zeppo G>I5{as3 Chico w*-;sddw Karl sY(34,ee, Groucho We6/d02, The Marx Brot hers’ Family Machine

Lecture 13 Page 54 CS 239, Spring 2002

Is Encrypting the Password File Enough?

  • What if an attacker gets a copy of your

password file?

  • No problem, the passwords are

encrypted –Right?

  • Yes, but . . .
slide-10
SLIDE 10

10

Lecture 13 Page 55 CS 239, Spring 2002

Dictionary Attacks on the Encrypted Password File

Harpo 2st6’sG0 Zeppo G>I5{as3 Chico w*-;sddw Karl sY(34,ee, Groucho We6/d02, D ic tio n ary

aardvark 340jafg; aardwolf K]ds+3a, abaca sY(34,ee sY(34,ee

Rats!!!!

Now you can hack the Communist Manifesto!

Lecture 13 Page 56 CS 239, Spring 2002

A Serious Issue

  • All Linux machines use the same one-

way function to encrypt passwords

  • If someone runs the entire dictionary

through that function, –Will they have a complete list of all encrypted dictionary passwords?

Lecture 13 Page 57 CS 239, Spring 2002

Illustrating the Problem

beard ^*eP6la- beard ^*eP6la-

aardvark 340jafg; aardwolf K[ds+3a, abaca sY(34,ee

. . .

beard ^*eP61a-

Lecture 13 Page 58 CS 239, Spring 2002

The Real Problem

  • Not that Darwin and Marx chose the same

password

  • But that anyone who chose that password

got the same encrypted result

  • So the attacker need only encrypt every

possible password once

  • And then she has a complete dictionary

usable against anyone

Lecture 13 Page 59 CS 239, Spring 2002

Salted Passwords

  • Combine the plaintext password with a

random number –Then run it through the one-way function

  • The random number need not be secret
  • It just has to be different for different

users

Lecture 13 Page 60 CS 239, Spring 2002

Did It Fix Our Problem?

beard beard D0Cls6& )#4,doa8

aardvark 340jafg; aardwolf K[ds+3a, abaca sY(34,ee

. . .

beard ^*eP61a-

slide-11
SLIDE 11

11

Lecture 13 Page 61 CS 239, Spring 2002

Identification Devices

  • Authentication by what you have
  • A smart card or other hardware device

that is readable by the computer

  • Authenticate by providing the device

to the computer

Lecture 13 Page 62 CS 239, Spring 2002

Problems With Identification Devices

  • If lost or stolen, you can’t authenticate

yourself – And someone else can – Often combined with passwords to avoid this problem

  • Unless cleverly done, susceptible to sniffing

attacks

  • Requires special hardware

Lecture 13 Page 63 CS 239, Spring 2002

Challenge/Response Authentication

  • Authentication by what questions you

can answer correctly

  • The system asks the user to provide

some information

  • If it’s provided correctly, the user is

authenticated

Lecture 13 Page 64 CS 239, Spring 2002

Differences From Passwords

  • Challenge/response systems ask for

different information every time

  • Or at least the questions come from a large

set

  • Best security achieved by requiring what

amounts to encryption of the challenge – But that requires special hardware – Essentially, a smart card

Lecture 13 Page 65 CS 239, Spring 2002

Problems With Authentication Through Challenge/Response

  • Either the question is too hard to answer

without special hardware

  • Or the question is too easy for intruders to

spoof

  • Still, commonly used in real-world

situations – E.g., authenticating you by asking your mother’s maiden name

Lecture 13 Page 66 CS 239, Spring 2002

Authentication Through Physical Verification

  • Authentication based on who you are
  • Things like fingerprints, voice patterns,

retinal patterns, etc.

  • To authenticate to the system, let it

measure the appropriate physical characteristics

slide-12
SLIDE 12

12

Lecture 13 Page 67 CS 239, Spring 2002

Problems With Physical Verification

  • Requires very special hardware

– Possibly excepting systems that examine typing patterns

  • May not be as foolproof as you think
  • Many characteristics vary too much for

practical use

  • Generally not helpful for authenticating

programs or roles