cs 423 operating system design: the linux reference monitor · cs 423: operating systems design...

27
CS 423: Operating Systems Design CS 423 Operating System Design: The Linux Reference Monitor Professor Adam Bates

Upload: others

Post on 09-Jul-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: CS 423 Operating System Design: The Linux Reference Monitor · CS 423: Operating Systems Design Conclusions 25 • Access Control is supported in operating systems through the “Reference

CS 423: Operating Systems Design

CS 423 Operating System Design:

The Linux Reference Monitor

Professor Adam Bates

Page 2: CS 423 Operating System Design: The Linux Reference Monitor · CS 423: Operating Systems Design Conclusions 25 • Access Control is supported in operating systems through the “Reference

CS 423: Operating Systems Design

All the Access Controls

2

• Basic Access Matrix • UNIX, ACL, various capability systems

• Aggregated Access Matrix • TE, RBAC, groups and attributes, parameterized

• Plus Domain Transitions • DTE, SELinux, Java

• Lattice Access Control Models • Bell-LaPadula, Biba, Denning

• Predicate Models • ASL, OASIS, domain-specific models, many others

• Safety Models • Take-grant, Schematic Protection Model, Typed Access Matrix

Page 3: CS 423 Operating System Design: The Linux Reference Monitor · CS 423: Operating Systems Design Conclusions 25 • Access Control is supported in operating systems through the “Reference

CS 423: Operating Systems Design 3

System Interface

Entry Points

Monitor Policy

Access Hook

Access Hook

Access Hook

Security-sensitive Operation

Security-sensitive Operation

Security-sensitive Operation

Authorize Request?

Yes/No

Cool. But how do we implement these models in an operating system?

Reference Monitor

Page 4: CS 423 Operating System Design: The Linux Reference Monitor · CS 423: Operating Systems Design Conclusions 25 • Access Control is supported in operating systems through the “Reference

CS 423: Operating Systems Design

Reference Monitor

4

• Where to make access control decisions? (Mediation)

• Which access control decisions to make? (Authorization)

• Decision function: Compute decision based on request and the active security policy

• Reference Monitor Concept (i.e., Goals):

• Complete Mediation

• Tamper Proof

• Verifiable

Page 5: CS 423 Operating System Design: The Linux Reference Monitor · CS 423: Operating Systems Design Conclusions 25 • Access Control is supported in operating systems through the “Reference

CS 423: Operating Systems Design

SELinux

5

• Designed by the NSA

• A more flexible solution than MLS

• SELinux Policies are comprised of 3 components:

• Labeling State defines security contexts for every file (object) and user (subject).

• Protection State defines the permitted <subject,object,operation> tuples.

• Transition State permits ways for subjects and objects to move between security contexts.

• Enforcement mechanism designed to satisfy reference monitor concept

Page 6: CS 423 Operating System Design: The Linux Reference Monitor · CS 423: Operating Systems Design Conclusions 25 • Access Control is supported in operating systems through the “Reference

CS 423: Operating Systems Design

SELinux Labeling State

6

• Files and users on the system at boot-time must are associated with their security labels (contexts)

• Map file paths to labels via regular expressions

• Map users to labels by names by name

• User labels pass on to their initial processes

• How are new files labeled? Processes?

Page 7: CS 423 Operating System Design: The Linux Reference Monitor · CS 423: Operating Systems Design Conclusions 25 • Access Control is supported in operating systems through the “Reference

CS 423: Operating Systems Design

SELinux Protection State

7

• MAC Policy based on Type Enforcement

• Access Matrix Policy

• Processes with subject label…

• Can access file of object label

• If operations in matrix cell allow

• Focus: Least Privilege

• Only provide permissions necessary

Page 8: CS 423 Operating System Design: The Linux Reference Monitor · CS 423: Operating Systems Design Conclusions 25 • Access Control is supported in operating systems through the “Reference

CS 423: Operating Systems Design 8

• Permissions in SELinux can be produced with runtime analysis.

• Step 1: Run programs in a controlled (no attacker) environment without any enforcement.

• Step 2: Audit all of the permissions used during normal operation.

• Step 3: Generate policy file description

• Assign subject and object labels associated with program

• Encode all permissions used into access rules

SELinux Protection State

Page 9: CS 423 Operating System Design: The Linux Reference Monitor · CS 423: Operating Systems Design Conclusions 25 • Access Control is supported in operating systems through the “Reference

CS 423: Operating Systems Design

SELinux Transition State

9

• Premise: Processes don’t need to run in the same protection state all of the time.

• Borrows concepts from Role-Based Access Control

• Example: passwd starts in user context, transitions to privileged context to update /etc/passwd, transitions back to user.

Page 10: CS 423 Operating System Design: The Linux Reference Monitor · CS 423: Operating Systems Design Conclusions 25 • Access Control is supported in operating systems through the “Reference

CS 423: Operating Systems Design

@ 2001 Linux Kernel Summit…

10

Include SELinux inLinux 2.5!

Page 11: CS 423 Operating System Design: The Linux Reference Monitor · CS 423: Operating Systems Design Conclusions 25 • Access Control is supported in operating systems through the “Reference

CS 423: Operating Systems Design

@ 2001 Linux Kernel Summit…

11

Include SELinux inLinux 2.5!

I’m just not that into you…

Page 12: CS 423 Operating System Design: The Linux Reference Monitor · CS 423: Operating Systems Design Conclusions 25 • Access Control is supported in operating systems through the “Reference

CS 423: Operating Systems Design

Linux Security circa 2000

12

Page 13: CS 423 Operating System Design: The Linux Reference Monitor · CS 423: Operating Systems Design Conclusions 25 • Access Control is supported in operating systems through the “Reference

CS 423: Operating Systems Design

Linus’s Dilemma

13

Page 14: CS 423 Operating System Design: The Linux Reference Monitor · CS 423: Operating Systems Design Conclusions 25 • Access Control is supported in operating systems through the “Reference

CS 423: Operating Systems Design

Linus’s Dilemma

14

The answer to all computer science problems…

add another layer of abstraction!

Page 15: CS 423 Operating System Design: The Linux Reference Monitor · CS 423: Operating Systems Design Conclusions 25 • Access Control is supported in operating systems through the “Reference

CS 423: Operating Systems Design

Linux Security Models

15

Page 16: CS 423 Operating System Design: The Linux Reference Monitor · CS 423: Operating Systems Design Conclusions 25 • Access Control is supported in operating systems through the “Reference

CS 423: Operating Systems Design

Linux Security Modules

16

Page 17: CS 423 Operating System Design: The Linux Reference Monitor · CS 423: Operating Systems Design Conclusions 25 • Access Control is supported in operating systems through the “Reference

CS 423: Operating Systems Design

LSM Requirements

17

Page 18: CS 423 Operating System Design: The Linux Reference Monitor · CS 423: Operating Systems Design Conclusions 25 • Access Control is supported in operating systems through the “Reference

CS 423: Operating Systems Design

LSM Architecture

18

Page 19: CS 423 Operating System Design: The Linux Reference Monitor · CS 423: Operating Systems Design Conclusions 25 • Access Control is supported in operating systems through the “Reference

CS 423: Operating Systems Design

Opaque Security Fiels

19

Page 20: CS 423 Operating System Design: The Linux Reference Monitor · CS 423: Operating Systems Design Conclusions 25 • Access Control is supported in operating systems through the “Reference

CS 423: Operating Systems Design

Security Hooks

20

Page 21: CS 423 Operating System Design: The Linux Reference Monitor · CS 423: Operating Systems Design Conclusions 25 • Access Control is supported in operating systems through the “Reference

CS 423: Operating Systems Design

Security Hooks

21

Page 22: CS 423 Operating System Design: The Linux Reference Monitor · CS 423: Operating Systems Design Conclusions 25 • Access Control is supported in operating systems through the “Reference

CS 423: Operating Systems Design 22

Security Hook Details

Page 23: CS 423 Operating System Design: The Linux Reference Monitor · CS 423: Operating Systems Design Conclusions 25 • Access Control is supported in operating systems through the “Reference

CS 423: Operating Systems Design 23

LSM Hook Architecture

Page 24: CS 423 Operating System Design: The Linux Reference Monitor · CS 423: Operating Systems Design Conclusions 25 • Access Control is supported in operating systems through the “Reference

CS 423: Operating Systems Design 24

Process

open System

Call

Lookup inode

Process file path down to inode

(resolving directories/links)

DAC checks

LSM hook LSM Policy Engine

"Is user_process allowed to perform

operation on inode?"Access inode

User Space

Kernel Space

LSM Hook Architecture

Page 25: CS 423 Operating System Design: The Linux Reference Monitor · CS 423: Operating Systems Design Conclusions 25 • Access Control is supported in operating systems through the “Reference

CS 423: Operating Systems Design

Conclusions

25

• Access Control is supported in operating systems through the “Reference Monitor” concept

• LSM is a framework for designing reference monitors

• Today, many security modules exist• Must define authorization hooks to mediate access

• Must expose a policy framework for specifying which accesses to authorize

• Policy Challenges• Is language expressive enough to capture the goals of the user?

• Is language simple/intuitive enough for ease of use?

• Policy misconfiguration breaks security!!

Page 26: CS 423 Operating System Design: The Linux Reference Monitor · CS 423: Operating Systems Design Conclusions 25 • Access Control is supported in operating systems through the “Reference

CS 423: Operating Systems Design

LSM Performance

26

Page 27: CS 423 Operating System Design: The Linux Reference Monitor · CS 423: Operating Systems Design Conclusions 25 • Access Control is supported in operating systems through the “Reference

CS 423: Operating Systems Design

LSM Use

27