Top Banner
Toward Automated Authorization Policy Enforcement Vinod Ganapathy [email protected] Trent Jaeger [email protected]. edu Somesh Jha [email protected] u March 1 st , 2006 Second Annual Security-enhanced Linux Symposium Baltimore, Maryland
39
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Toward Automated Authorization Policy Enforcement Vinod Ganapathy vg@cs.wisc.edu Trent Jaeger tjaeger@cse.psu.edu Somesh Jha jha@cs.wisc.edu March 1 st,

Toward Automated Authorization Policy Enforcement

Vinod [email protected]

Trent [email protected]

Somesh [email protected]

March 1st, 2006Second Annual Security-enhanced Linux Symposium

Baltimore, Maryland

Page 2: Toward Automated Authorization Policy Enforcement Vinod Ganapathy vg@cs.wisc.edu Trent Jaeger tjaeger@cse.psu.edu Somesh Jha jha@cs.wisc.edu March 1 st,

SELinux 2006 Ganapathy/Jaeger/Jha: Toward Automated Authorization Policy Enforcement 2

Introduction

• SELinux helps meet information-flow goals

• Expressive access-control policy language

• Security-enhanced operating system

Request Allowed?

Yes/NoYes/NoUserApp

Page 3: Toward Automated Authorization Policy Enforcement Vinod Ganapathy vg@cs.wisc.edu Trent Jaeger tjaeger@cse.psu.edu Somesh Jha jha@cs.wisc.edu March 1 st,

SELinux 2006 Ganapathy/Jaeger/Jha: Toward Automated Authorization Policy Enforcement 3

Security-aware Applications

• Need for security-aware applications

• Can we build applications that can enforce mandatory access control policies?

Request Allowed?

Yes/NoYes/NoUserApp

Page 4: Toward Automated Authorization Policy Enforcement Vinod Ganapathy vg@cs.wisc.edu Trent Jaeger tjaeger@cse.psu.edu Somesh Jha jha@cs.wisc.edu March 1 st,

SELinux 2006 Ganapathy/Jaeger/Jha: Toward Automated Authorization Policy Enforcement 4

Security-aware Applications

• Need for security-aware applications

Request Allowed?

Yes/NoYes/NoClientServer

Allowed?

Yes/No

Page 5: Toward Automated Authorization Policy Enforcement Vinod Ganapathy vg@cs.wisc.edu Trent Jaeger tjaeger@cse.psu.edu Somesh Jha jha@cs.wisc.edu March 1 st,

SELinux 2006 Ganapathy/Jaeger/Jha: Toward Automated Authorization Policy Enforcement 5

Security-aware Applications

• Need for security-aware applications

• Our work: How to build security-aware applications?

• Focus is on mechanism, not policy

Request Allowed?

Yes/NoYes/NoClient Server

Page 6: Toward Automated Authorization Policy Enforcement Vinod Ganapathy vg@cs.wisc.edu Trent Jaeger tjaeger@cse.psu.edu Somesh Jha jha@cs.wisc.edu March 1 st,

SELinux 2006 Ganapathy/Jaeger/Jha: Toward Automated Authorization Policy Enforcement 6

Motivating Example Remote Client: Alice

Alice

Local

X Server

Page 7: Toward Automated Authorization Policy Enforcement Vinod Ganapathy vg@cs.wisc.edu Trent Jaeger tjaeger@cse.psu.edu Somesh Jha jha@cs.wisc.edu March 1 st,

SELinux 2006 Ganapathy/Jaeger/Jha: Toward Automated Authorization Policy Enforcement 7

Motivating ExampleRemote Client: Alice

Alice

X Server

Remote Client: Bob

Bob

Page 8: Toward Automated Authorization Policy Enforcement Vinod Ganapathy vg@cs.wisc.edu Trent Jaeger tjaeger@cse.psu.edu Somesh Jha jha@cs.wisc.edu March 1 st,

SELinux 2006 Ganapathy/Jaeger/Jha: Toward Automated Authorization Policy Enforcement 8

Motivating ExampleRemote Client: Alice

X Server

Remote Client: BobRemote Client: Alice

Alice

Keyboard inputMalicious client can snoop on input

violating Alice’s confidentiality

Page 9: Toward Automated Authorization Policy Enforcement Vinod Ganapathy vg@cs.wisc.edu Trent Jaeger tjaeger@cse.psu.edu Somesh Jha jha@cs.wisc.edu March 1 st,

SELinux 2006 Ganapathy/Jaeger/Jha: Toward Automated Authorization Policy Enforcement 9

Motivating ExampleRemote Client: Alice

X Server

Remote Client: BobRemote Client: Alice

Alice

Malicious client can alter settings on other client windows

Page 10: Toward Automated Authorization Policy Enforcement Vinod Ganapathy vg@cs.wisc.edu Trent Jaeger tjaeger@cse.psu.edu Somesh Jha jha@cs.wisc.edu March 1 st,

SELinux 2006 Ganapathy/Jaeger/Jha: Toward Automated Authorization Policy Enforcement 10

Motivating ExampleRemote Client: Alice

X Server

Remote Client: BobRemote Client: Alice

Alice

No mechanism to enforce authorization policies on client interactions

Page 11: Toward Automated Authorization Policy Enforcement Vinod Ganapathy vg@cs.wisc.edu Trent Jaeger tjaeger@cse.psu.edu Somesh Jha jha@cs.wisc.edu March 1 st,

SELinux 2006 Ganapathy/Jaeger/Jha: Toward Automated Authorization Policy Enforcement 11

Motivating ExampleRemote Client: Alice

X Server

Remote Client: BobRemote Client: Alice

Alice

Keyboard input

Input Request

Disallowed

Goal of the Security enhanced X server project [Kilpatrick et al., 2003]

Page 12: Toward Automated Authorization Policy Enforcement Vinod Ganapathy vg@cs.wisc.edu Trent Jaeger tjaeger@cse.psu.edu Somesh Jha jha@cs.wisc.edu March 1 st,

SELinux 2006 Ganapathy/Jaeger/Jha: Toward Automated Authorization Policy Enforcement 12

Need for Security-awareness

• More examples: user-space servers– Samba– Web servers– Proxy and cache servers– Middleware

• Common features– Manage multiple clients simultaneously– Offer shared resources to clients– Perform services on behalf of their clients

Page 13: Toward Automated Authorization Policy Enforcement Vinod Ganapathy vg@cs.wisc.edu Trent Jaeger tjaeger@cse.psu.edu Somesh Jha jha@cs.wisc.edu March 1 st,

SELinux 2006 Ganapathy/Jaeger/Jha: Toward Automated Authorization Policy Enforcement 13

Main Claim

To effectively meet security-goals,all applications managing shared

resources must be made security-aware

Page 14: Toward Automated Authorization Policy Enforcement Vinod Ganapathy vg@cs.wisc.edu Trent Jaeger tjaeger@cse.psu.edu Somesh Jha jha@cs.wisc.edu March 1 st,

SELinux 2006 Ganapathy/Jaeger/Jha: Toward Automated Authorization Policy Enforcement 14

Focus of our work

• How to build security-aware applications?

• Focus is on mechanism, not policy– Can use tools like Tresys’ SELinux Policy

Management Toolkit

Request Allowed?

Yes/NoYes/NoClient Server

Page 15: Toward Automated Authorization Policy Enforcement Vinod Ganapathy vg@cs.wisc.edu Trent Jaeger tjaeger@cse.psu.edu Somesh Jha jha@cs.wisc.edu March 1 st,

SELinux 2006 Ganapathy/Jaeger/Jha: Toward Automated Authorization Policy Enforcement 15

Security-aware Applications

• How to build security-aware applications?

• Proactively design code for security– MULTICS project [Corbato et al., 1965]

– Postfix mail server [Venema]

• Retrofit existing, legacy code– Linux Security Modules project [Wright et al., 2002]

– Security-enhanced X project [Kilpatrick et al., 2003]

– Privilege separated OpenSSH [Provos et al., 2003]

Our work:Tool support to retrofit legacy serversfor authorization policy enforcement

Page 16: Toward Automated Authorization Policy Enforcement Vinod Ganapathy vg@cs.wisc.edu Trent Jaeger tjaeger@cse.psu.edu Somesh Jha jha@cs.wisc.edu March 1 st,

SELinux 2006 Ganapathy/Jaeger/Jha: Toward Automated Authorization Policy Enforcement 16

Our Work

• Tools to analyze and retrofit legacy code

• Two case studies:– Retrofitting the X server [IEEE S&P 2006]

– Retrofitting Linux [ACM CCS 2005]

Legacy server

Security-awareserver

Page 17: Toward Automated Authorization Policy Enforcement Vinod Ganapathy vg@cs.wisc.edu Trent Jaeger tjaeger@cse.psu.edu Somesh Jha jha@cs.wisc.edu March 1 st,

SELinux 2006 Ganapathy/Jaeger/Jha: Toward Automated Authorization Policy Enforcement 17

Main Goal

• Tool support to add reference monitoring to user-space servers

Reference Monitor

Security-Event

Yes/No

Server

Main challenge: Where to place reference monitor hooks?

Page 18: Toward Automated Authorization Policy Enforcement Vinod Ganapathy vg@cs.wisc.edu Trent Jaeger tjaeger@cse.psu.edu Somesh Jha jha@cs.wisc.edu March 1 st,

SELinux 2006 Ganapathy/Jaeger/Jha: Toward Automated Authorization Policy Enforcement 18

Authorization Policies

• Access-control matrix [Lampson’71]

• Three entities: ‹subject, object, operation›– Subject (user or process)– Object (resource, such as file or socket)– Security-sensitive operation (access vectors)

/etc/passwd /usr/vg/a.out /var/log

root r/w r/w/x r/wvg r/w/x r

Page 19: Toward Automated Authorization Policy Enforcement Vinod Ganapathy vg@cs.wisc.edu Trent Jaeger tjaeger@cse.psu.edu Somesh Jha jha@cs.wisc.edu March 1 st,

SELinux 2006 Ganapathy/Jaeger/Jha: Toward Automated Authorization Policy Enforcement 19

Main Goal

• Analysis techniques to find where server performs security-sensitive operations

Reference Monitor

Security-Event

Yes/No

Server

Page 20: Toward Automated Authorization Policy Enforcement Vinod Ganapathy vg@cs.wisc.edu Trent Jaeger tjaeger@cse.psu.edu Somesh Jha jha@cs.wisc.edu March 1 st,

SELinux 2006 Ganapathy/Jaeger/Jha: Toward Automated Authorization Policy Enforcement 20

Key Insight: Fingerprints

• Each security-sensitive operation has a fingerprint

• Intuition: Denotes key code-level steps to achieve the operation

Page 21: Toward Automated Authorization Policy Enforcement Vinod Ganapathy vg@cs.wisc.edu Trent Jaeger tjaeger@cse.psu.edu Somesh Jha jha@cs.wisc.edu March 1 st,

SELinux 2006 Ganapathy/Jaeger/Jha: Toward Automated Authorization Policy Enforcement 21

Examples of Fingerprints

• Three access vectors from SELinux• DIR_WRITE :-

– Set inode->i_ctime & – Call address_space_ops->prepare_write()

• DIR_RMDIR :- – Set inode->i_size TO 0 & – Decrement inode->i_nlink

• SOCKET_BIND :-– Call socket->proto_ops->bind()

Page 22: Toward Automated Authorization Policy Enforcement Vinod Ganapathy vg@cs.wisc.edu Trent Jaeger tjaeger@cse.psu.edu Somesh Jha jha@cs.wisc.edu March 1 st,

SELinux 2006 Ganapathy/Jaeger/Jha: Toward Automated Authorization Policy Enforcement 22

Examples of Fingerprints

• Access vectors for the X server• WINDOW_MAP:-

– Set WindowPtr->mapped TO TRUE &– Set xEvent->type TO MapNotify

• WINDOW_ENUMERATE:-– Read WindowPtr->firstChild &– Read WindowPtr->nextSib &– Compare WindowPtr ≠ 0

Page 23: Toward Automated Authorization Policy Enforcement Vinod Ganapathy vg@cs.wisc.edu Trent Jaeger tjaeger@cse.psu.edu Somesh Jha jha@cs.wisc.edu March 1 st,

SELinux 2006 Ganapathy/Jaeger/Jha: Toward Automated Authorization Policy Enforcement 23

Key Insight: Fingerprints

• How to find fingerprints?

• How to use fingerprints to place hooks?

Page 24: Toward Automated Authorization Policy Enforcement Vinod Ganapathy vg@cs.wisc.edu Trent Jaeger tjaeger@cse.psu.edu Somesh Jha jha@cs.wisc.edu March 1 st,

SELinux 2006 Ganapathy/Jaeger/Jha: Toward Automated Authorization Policy Enforcement 24

Using Fingerprints: An Example

• X server function MapSubWindows

MapSubWindows(Window *pParent, Client *pClient) { xEvent event; Window *pWin; … pWin = pParent->firstChild; … for (;pWin != 0; pWin=pWin->nextSib) {

pWin->mapped = TRUE; …event.type = MapNotify;

}}

Page 25: Toward Automated Authorization Policy Enforcement Vinod Ganapathy vg@cs.wisc.edu Trent Jaeger tjaeger@cse.psu.edu Somesh Jha jha@cs.wisc.edu March 1 st,

SELinux 2006 Ganapathy/Jaeger/Jha: Toward Automated Authorization Policy Enforcement 25

Examples of Fingerprints

• Access vectors for the X server• WINDOW_MAP:-

– Set WindowPtr->mapped TO TRUE &– Set xEvent->type TO MapNotify

• WINDOW_ENUMERATE:-– Read WindowPtr->firstChild &– Read WindowPtr->nextSib &– Compare WindowPtr ≠ 0

Page 26: Toward Automated Authorization Policy Enforcement Vinod Ganapathy vg@cs.wisc.edu Trent Jaeger tjaeger@cse.psu.edu Somesh Jha jha@cs.wisc.edu March 1 st,

SELinux 2006 Ganapathy/Jaeger/Jha: Toward Automated Authorization Policy Enforcement 26

Using Fingerprints: An Example

• X server function MapSubWindows

MapSubWindows(Window *pParent, Client *pClient) { xEvent event; Window *pWin; … pWin = pParent->firstChild; … for (;pWin != 0; pWin=pWin->nextSib) {

pWin->mapped = TRUE; …event.type = MapNotify;

}}

Performs Window_Map

Page 27: Toward Automated Authorization Policy Enforcement Vinod Ganapathy vg@cs.wisc.edu Trent Jaeger tjaeger@cse.psu.edu Somesh Jha jha@cs.wisc.edu March 1 st,

SELinux 2006 Ganapathy/Jaeger/Jha: Toward Automated Authorization Policy Enforcement 27

Examples of Fingerprints

• Access vectors for the X server• WINDOW_MAP:-

– Set WindowPtr->mapped TO TRUE &– Set xEvent->type TO MapNotify

• WINDOW_ENUMERATE:-– Read WindowPtr->firstChild &– Read WindowPtr->nextSib &– Compare WindowPtr ≠ 0

Page 28: Toward Automated Authorization Policy Enforcement Vinod Ganapathy vg@cs.wisc.edu Trent Jaeger tjaeger@cse.psu.edu Somesh Jha jha@cs.wisc.edu March 1 st,

SELinux 2006 Ganapathy/Jaeger/Jha: Toward Automated Authorization Policy Enforcement 28

Using Fingerprints: An Example

• X server function MapSubWindows

MapSubWindows(Window *pParent, Client *pClient) { xEvent event; Window *pWin; … pWin = pParent->firstChild; … for (;pWin != 0; pWin=pWin->nextSib) { // Code to map window on screen

pWin->mapped = TRUE; …event.type = MapNotify;

}}

Performs Window_Enumerate

Page 29: Toward Automated Authorization Policy Enforcement Vinod Ganapathy vg@cs.wisc.edu Trent Jaeger tjaeger@cse.psu.edu Somesh Jha jha@cs.wisc.edu March 1 st,

SELinux 2006 Ganapathy/Jaeger/Jha: Toward Automated Authorization Policy Enforcement 29

Using Fingerprints

• Fingerprints located using static analysis

• Key advantage: statically find all locations where fingerprints occur

• Can add hooks to all these locations

Page 30: Toward Automated Authorization Policy Enforcement Vinod Ganapathy vg@cs.wisc.edu Trent Jaeger tjaeger@cse.psu.edu Somesh Jha jha@cs.wisc.edu March 1 st,

SELinux 2006 Ganapathy/Jaeger/Jha: Toward Automated Authorization Policy Enforcement 30

Adding Hooks: An Example

• X server function MapSubWindows

MapSubWindows(Window *pParent, Client *pClient) { xEvent event; Window *pWin; // Code to enumerate child windows avc_has_perm(pClient, pParent, WINDOW_ENUMERATE); pWin = pParent->firstChild; … for (;pWin != 0; pWin=pWin->nextSib) { // Code to map window on screen

avc_has_perm(pClient, pWin, WINDOW_MAP);pWin->mapped = TRUE; …event.type = MapNotify;

}}

Page 31: Toward Automated Authorization Policy Enforcement Vinod Ganapathy vg@cs.wisc.edu Trent Jaeger tjaeger@cse.psu.edu Somesh Jha jha@cs.wisc.edu March 1 st,

SELinux 2006 Ganapathy/Jaeger/Jha: Toward Automated Authorization Policy Enforcement 31

Key Insight: Fingerprints

• How to find fingerprints?

• How to use fingerprints to place hooks?

Page 32: Toward Automated Authorization Policy Enforcement Vinod Ganapathy vg@cs.wisc.edu Trent Jaeger tjaeger@cse.psu.edu Somesh Jha jha@cs.wisc.edu March 1 st,

SELinux 2006 Ganapathy/Jaeger/Jha: Toward Automated Authorization Policy Enforcement 32

Finding Fingerprints

• Using analysis of runtime traces

• Key Insight: – If server does a security-sensitive operation

its fingerprint must be in the trace

• Example:– Get X server to perform WINDOW_MAP

Set WindowPtr->mapped TO TRUE

Set xEvent->type

TO MapNotify

Page 33: Toward Automated Authorization Policy Enforcement Vinod Ganapathy vg@cs.wisc.edu Trent Jaeger tjaeger@cse.psu.edu Somesh Jha jha@cs.wisc.edu March 1 st,

SELinux 2006 Ganapathy/Jaeger/Jha: Toward Automated Authorization Policy Enforcement 33

Finding Fingerprints

• Main challenge: – Locating fingerprints in the runtime trace

• Key insight:– Compare several runtime traces

Set WindowPtr->mapped TO TRUE

Set xEvent->type

TO MapNotify“DIFF”

Trace 1: Server does not perform WINDOW_MAP

Page 34: Toward Automated Authorization Policy Enforcement Vinod Ganapathy vg@cs.wisc.edu Trent Jaeger tjaeger@cse.psu.edu Somesh Jha jha@cs.wisc.edu March 1 st,

SELinux 2006 Ganapathy/Jaeger/Jha: Toward Automated Authorization Policy Enforcement 34

Finding Fingerprints

• Main challenge: – Locating fingerprints in the runtime trace

• Key insight:– Compare several runtime traces

Set WindowPtr->mapped TO TRUE

Set xEvent->type

TO MapNotify“DIFF”

Trace 2: Server does not perform WINDOW_MAP

Page 35: Toward Automated Authorization Policy Enforcement Vinod Ganapathy vg@cs.wisc.edu Trent Jaeger tjaeger@cse.psu.edu Somesh Jha jha@cs.wisc.edu March 1 st,

SELinux 2006 Ganapathy/Jaeger/Jha: Toward Automated Authorization Policy Enforcement 35

Key Insight: Fingerprints

• How to find fingerprints?

• How to use fingerprints to place hooks?

Page 36: Toward Automated Authorization Policy Enforcement Vinod Ganapathy vg@cs.wisc.edu Trent Jaeger tjaeger@cse.psu.edu Somesh Jha jha@cs.wisc.edu March 1 st,

SELinux 2006 Ganapathy/Jaeger/Jha: Toward Automated Authorization Policy Enforcement 36

Results

• Retrofitted version of X server

• Fingerprint-finding technique is effective:– Fewer than 10 functions to be examined to

write fingerprints– In comparison, each trace exercises several

hundred distinct X server functions

• Details in upcoming IEEE S&P 2006 paper

Page 37: Toward Automated Authorization Policy Enforcement Vinod Ganapathy vg@cs.wisc.edu Trent Jaeger tjaeger@cse.psu.edu Somesh Jha jha@cs.wisc.edu March 1 st,

SELinux 2006 Ganapathy/Jaeger/Jha: Toward Automated Authorization Policy Enforcement 37

Examples of fingerprintsOperation Fingerprint

WINDOW_CREATE Call CreateWindowWINDOW_DESTROY Call DeleteWindow

WINDOW_UNMAP Set xEvent->type

TO UnmapNotifyWINDOW_CHSTACK Call MoveWindowInStack

WINDOW_INPUTEVENT Call ProcessPointerEvent,

Call ProcessKeybdEvent

Page 38: Toward Automated Authorization Policy Enforcement Vinod Ganapathy vg@cs.wisc.edu Trent Jaeger tjaeger@cse.psu.edu Somesh Jha jha@cs.wisc.edu March 1 st,

SELinux 2006 Ganapathy/Jaeger/Jha: Toward Automated Authorization Policy Enforcement 38

Slide to take home• Goal: Placing authorization hooks in servers• Key insight: Security-sensitive operations have

fingerprints

• Finding fingerprints: Using “diff” of runtime traces• Placing hooks: By statically locating fingerprints

Page 39: Toward Automated Authorization Policy Enforcement Vinod Ganapathy vg@cs.wisc.edu Trent Jaeger tjaeger@cse.psu.edu Somesh Jha jha@cs.wisc.edu March 1 st,

Vinod [email protected]

Trent [email protected]

Somesh [email protected]

Questions?

Toward Automated Authorization Policy Enforcement

http://www.cs.wisc.edu/~vghttp://www.cse.psu.edu/~tjaegerhttp://www.cs.wisc.edu/~jha