CS5460: Operating Systems Lecture 24: Security CS 5460: Operating - - PowerPoint PPT Presentation

cs5460 operating systems lecture 24 security cs 5460
SMART_READER_LITE
LIVE PREVIEW

CS5460: Operating Systems Lecture 24: Security CS 5460: Operating - - PowerPoint PPT Presentation

CS5460: Operating Systems Lecture 24: Security CS 5460: Operating Systems Once upon a time, this patch was made to Linuxs wait4() system call: + if ((options == (__WCLONE|__WALL)) && (current->uid = 0)) +


slide-1
SLIDE 1

CS 5460: Operating Systems

CS5460: Operating Systems

Lecture 24: Security

slide-2
SLIDE 2

 Once upon a time, this patch was made to Linux’s

wait4() system call:

+ if ((options == (__WCLONE|__WALL)) && (current->uid = 0))

  • + retval = -EINVAL;

 The commit came from one of the most active kernel

developers

 What is its effect?

CS 5460: Operating Systems

slide-3
SLIDE 3

What’s Computer Security All About?

 Cryptography  Network security  Writing secure code  Secure hardware  Secure operating systems  Etc…

CS 5460: Operating Systems

Lecture 25

slide-4
SLIDE 4

Today

 OS security basics  UNIX security  Multilevel security  Secure operating systems  Integrity and auditing

CS 5460: Operating Systems

slide-5
SLIDE 5

High-Level Security Goals

 Privacy / Confidentiality – Information only available

to authorized users

 Integrity – Information retains intended content and

semantics

 Availability – Information retains access and

presence

 There is tension between these goals  Real systems must make difficult choices between

them

slide-6
SLIDE 6

How Do We Approach Security?

 Devise a security policy – Implements a security model – Boils down to a collection of rules  Next, we try to follow the rules – It’s hard to write large programs that follow security rules – It’s hard to get humans to follow security rules  There are many things that can go wrong

CS 5460: Operating Systems

slide-7
SLIDE 7

Users

 UNIX user -> username -> uid

– uid is the system’s real name for user – integer 0 ... 65536 (varies in some systems) – mapping is in /etc/passwd regehr:x:1000:1000:John Regehr,,,:/mnt/z:/bin/bash

 More than one username may map to a uid

– Desired for some system purposes (program tracking) – Problem for ordinary users (confused file ownership) – Security problem (hacker makes duplicate uid account)

 Command to change uid temporarily: su

slide-8
SLIDE 8

Unix Groups

 A user is in one or more groups  A group contains zero or more users – Groups are used to give better file access control – Defined by /etc/groups and network sharing software – ypcat group.byname – CS department has 961 groups – gid - integer system name for group (generally unique)  Listed for individual users with “groups”  Change group of file with “chgrp” – chgrp newgroup myfile

slide-9
SLIDE 9

Unix File Security

 Each file has owner and group  Permissions set by owner – Read, write, execute – Owner, group, other – Represented by vector of four octal values  Only owner, root can change permissions – This privilege cannot be delegated or shared  Setid bits – Discuss in a few slides rwx rwx rwx

  • wnr grp othr

setid

slide-10
SLIDE 10

UNIX Permissions Practice

16 lab3-1:~> ls –l drwx------+ 2 regehr csprof 2 Sep 8 11:02 Desktop drwx------+ 2 regehr csprof 6 Oct 3 21:23 bin

  • rw-------+ 1 regehr csprof 25524 Nov 24 11:54 blkdev.h
  • rw-r--r--+ 1 regehr csprof 63507 Sep 11 23:02 clang-113697.patch
  • rwxrwx---+ 1 regehr csprof 411 Oct 5 18:11 copy_sat_ops.pl

CS 5460: Operating Systems

slide-11
SLIDE 11

SETUID and SETGID

 Special mechanisms: temporarily use a uid

  • r gid during the execution of a program

 Part of mode bits

– s in user x field - setuid – s in group x field - setgid

 To be effective, both s and x must be set

– chmod a+x myprog – chmod u+s myprog – chmod 4755 myprog

 WARNING: It’s hard to use this correctly

slide-12
SLIDE 12

Handin on CADE

 Directory listing for the “handin” backend:

  • rwsrwxr-x 1 root tty 24715 Nov 24 1999 rcvhandin

 Now tell me how handin works – What happens when you run it? – How would you use handin to read another student’s files?

CS 5460: Operating Systems

slide-13
SLIDE 13

Unix Summary

 Good things – Some protection from most users – Flexible enough to make things possible  Main bad thing: it’s not very expressive – For example, can’t easily just let a single user mount a CDROM or add users to the system – Too tempting to use root privileges

slide-14
SLIDE 14

Multilevel Security

 Users with different “needs to know” share a

computer or network

 If don’t need to know – shouldn’t even be able to

determine if information exists

 Should be able to filter functionality based on

allowable information

slide-15
SLIDE 15

Military Security Model

 Information is ranked:

– Unclassified – Confidential – Secret – Top Secret

 Least Privilege: Subject should have access

to fewest objects needed for successful work

– The system backup program may be allowed to bypass read restrictions on files, but it would not have the ability to modify files. – “Need to Know”

slide-16
SLIDE 16

Compartmentalization

Information may belong to one or more compartments Compartments are used to enforce need-to- know.

 Classification of Information:

<rank; compartments>

 Clearance: <rank; compartments>

– an indication of a level of trust

 A subject can access an object only if

– The clearance level of the subject is at least as high as that of the information. – The subject has a need to know about all compartments for which the information is classified.

slide-17
SLIDE 17

Information Flow Models

 Acts as an filter to control the transfer of

information permitted by access to a particular

  • bject

 Information flow analysis can assure that operating

system modules that have access to sensitive data cannot leak that data to calling modules

slide-18
SLIDE 18

Bell-LaPadula Model

 A formal description of the allowable paths

  • f information flow in a secure system

– Applies only to privacy (not availability or integrity) – Identifies paths that could lead to inappropriate disclosures – Is used as the basis for the design of systems that handle data of multiple levels – Includes both discretionary and mandatory access rules

slide-19
SLIDE 19

Bell-LaPadula Mandatory Controls

 Fixed security classes for each subject and each

  • bject

 Security classes ordered by a relation  Simple Security Property: – Subject may have read access only if object classified at same level or lower.  * - Property: – Subject may have write access only if all objects read are at same level or higher than object to be written.  Summary: “No read up, no write down”  Trusted subjects may violate the *-property

slide-20
SLIDE 20

Picture: Confidentiality

S

Public Proprietary Read below, write above

S

Public Proprietary Read above, write below

slide-21
SLIDE 21

Biba Model

 Concerned with integrity rather than privacy  Defines integrity levels much like sensitivity levels – Fixed integrity classes for each subject and each object – Ordered integrity classes

slide-22
SLIDE 22

Biba Properties

 Simple Integrity Property:

– Subject can modify object only if integrity class at least as high as the object. (untrusted subjects reduce integrity class when writing)

 * - Property:

– Subjects may have write access only if the integrity of

  • bjects they are reading is at least as high as the
  • bject to be written. (untrusted sources reduce

integrity of results)

slide-23
SLIDE 23

Integrity Preservation

 A high integrity file is one whose contents

are created by high-integrity processes.

– high-integrity file cannot be contaminated by information from low-integrity processes. – high-integrity process cannot be subverted by low integrity processes or data.

 The integrity class label on a file guarantees

that the contents came only from sources of at least that degree of integrity.

slide-24
SLIDE 24

Picture: Integrity

S

Public Proprietary Read above, write below

S

Public Proprietary Read below, write above

slide-25
SLIDE 25

Problem: Models are contradictory

 Bell-LaPadula Confidentiality – Read down, write up  Biba Integrity – Read up, write down  Want both confidentiality and integrity – Only way to satisfy both models is only allow read and write at same classification

In reality: Bell-LaPadula used more than Biba model Example: Common Criteria

slide-26
SLIDE 26

Sample Features of a Secure OS

 Mandatory access control

– MAC not under user control

 Object reuse protection

– Write over old data when file space is allocated

 Complete mediation

– Prevent any access that circumvents monitor

 Audit support  Intrusion detection

– Anomaly detection

» Learn normal activity, Report abnormal actions

– Attack detection

» Recognize patterns associated with known attacks

slide-27
SLIDE 27

Basic Design Principles

 Least privilege - fewest possible privileges for

user

 Economy of mechanism - small, simple,

straight forward

 Open design  Complete mediation - check every access  Permission based - default is denial of access  Separation of privilege - no single super user  Least common mechanism - avoid shared

  • bjects

 Easy to use

slide-28
SLIDE 28

Monitor Model

 General idea:

– Take user's request – Consult access control information – Allow or disallow request

 Advantages

– Easy to implement – Easy to understand

 Disadvantages

– Bottleneck in system – Controls only direct accesses (not inferences)

slide-29
SLIDE 29

Security Kernel

 Responsible for implementing the security

mechanisms of the entire operating system.

 Provides the security interfaces among the

hardware, the operating system, and the other parts of the computing system.

 Implementation of a security kernel: – May degrade system performance (one more layer). – May be large. – No guarantees.  Designing a security kernel is hard – Linux, MacOS, and Windows do not have one – Virtual machine managers act as security kernels

slide-30
SLIDE 30

Security Enhanced Linux

 Developed by NSA – Partly based on work done at Utah!  Enforces separation of information based on

confidentiality and integrity requirements

 Mandatory access control incorporated into the

major subsystems of the kernel

– Limit tampering and bypassing of application security mechanisms – Confine damage caused by malicious applications

http://www.nsa.gov/research/selinux/

slide-31
SLIDE 31

SELinux Security Abstractions

 Type enforcement – Each process has an associated domain – Each object has an associated type – Configuration files specify

» How domains are allowed to access types » Allowable interactions and transitions between domains

 Role-based access control – Each process has an associated role

» Separate system and user processes

– configuration files specify

» Set of domains that may be entered by each role

 Security model is complicated and powerful – Hard to get right, too

slide-32
SLIDE 32

SELinux

 Open source – Already subject to public review

» This by itself does not guarantee security …

– NSA can review source, modify and extend – Hope to encourage additional operating system security research – Released under the same terms and conditions as the original sources.

» includes documentation and source code

 Bad about SELinux: – Hard to use – Policies are very large and complex – Makes it harder to exploit kernel bugs, but doesn’t eliminate them – Any device driver can simply disable SELinux!

slide-33
SLIDE 33

CS 5460: Operating Systems

Questions?

(This lecture is derived from material by Tim Shimeall at CMU and John Mitchell at Stanford)