a secure jailing system for confining untrusted applications

23
A SECURE JAILING SYSTEM FOR CONFINING UNTRUSTED APPLICATIONS Guido Noordende, ´Ad´am Balogh, Rutger Hofman, Frances M. T. Brazier , and Andrew S. Tanenbaum Presented by Khalid Alharthi 1

Upload: illana-michael

Post on 01-Jan-2016

24 views

Category:

Documents


0 download

DESCRIPTION

A SECURE JAILING SYSTEM FOR CONFINING UNTRUSTED APPLICATIONS Guido Noordende, ´Ad´am Balogh, Rutger Hofman , Frances M. T. Brazier , and Andrew S. Tanenbaum. Presented by Khalid Alharthi. Outline. Introduction. Goals. Terminology. - PowerPoint PPT Presentation

TRANSCRIPT

A SECURE JAILING SYSTEM FOR CONFINING

UNTRUSTEDAPPLICATIONS

Guido Noordende, ´Ad´am Balogh, Rutger Hofman, Frances M. T. Brazier , and Andrew S. Tanenbaum

Presented by

Khalid Alharthi1

2

Introduction. Goals. Terminology. General positioning of an existing call interception system. Threats. TOCTOU. Insufficient Solutions. The jailing mode. Jailer architecture. Conclusion. References.

Outline

3

Introduction I

Operating systems currently do not provide sufficiently protection mechanisms against the programs that someone executes.

The UNIX protection model is based on a discretionary access control model.

To safely execute untrusted programs on UNIX systems, system-call interception based jailing systems can be used to protect the system and the user’s resources.

System-call interception based jailing systems are based on a kernel-level tracing mechanism (e.g., ptrace).

4

Introduction II

A number of jailing systems require modifications to the operating system to function securely.

Existing systems suffer from several race conditions, which allowan attacker to bypass the jailer’s control mechanisms

5

Goals:

This paper gives an overview of the most importantthreats to jailing systems.

presents mechanisms for implementing jailing securely systems on standard UNIX.

It provides solutions to race condition problems.

The jailing system presented in this paper provides sufficient control to allow for effective confinement of untrusted programs .

6

Terminology:

The jailer is a trusted process that monitors an untrusted application and enforces a policy on the user’s behalf.

A prisoner is an untrusted application that is being monitored by a jailer and is forced to adhere to a predefined jailing policy.

The tracer is the interface offered by the operating system for debugging / tracing an application.

7

General positioning of an existing call interception system I

figure is showing a jailer and a traced prisoner.

When a prisoner makes a system call (step 1), the OS suspends the invoking thread and reflects the system call to the jailer (step 2).

The jailer inspects the system call’s arguments and decides if it allows the system call or not.

8

General positioning of a existing call interception system II

It informs the operating system of its decision (step 3), which results in the system call being continued or an error.

9

Threats

We used the ptrace() system call tracing interface to implement jailing system.

Figure illustrates a problem in all system call interception that support multithreaded applications or processes that use shared memory.

In (step 2), the jailer has to make a decision on whether to allow the system call based on its arguments.

These arguments often contain a pointer to a string (e.g., a filename) in the prisoner’s address Space.

10

Threats

Between the time that an invocation was made(step 1/2) and the decision has been passed back to the operating system (step 3), a different thread of the prisoner could have modified the argument in the original thread’s address space.

In this case, the system call would end up using the modified system call argument rather than the argument checked by the jailer. This race condition is called a Time of Check to Time of Use (TOCTOU) race.

11

TOCTOU

Time-of-check, time-of-use race conditions occur when between the time in which a given resource is checked, and the time that resource is used, a change occurs in the resource to invalidate the results of the check.

Consequences: Access control: access to unauthorized resources.

Integrity: changed in undesirable ways.

Non-repudiation: possible to delete files by a malicious user 

12

Insufficient Solutions I

The most secure among current approaches is to let the kernel create a safe copy of the arguments before reflecting that to a user-level policy enforcement module.

Also, based on relocating a system call’s argument to a random location on the caller’s stack before checking it.

Other jailing systems simply completely disallow thread creation, or suspend all threads of a jailed process while a system call is being evaluated.

13

Insufficient Solutions II

Both approaches limit the applicability of such systems for executing modern thread-based applications.

Race conditions are again caused by a lack of atomicity of argument checking and system call invocation.

A weakness of most existing jailing systems is that they either always allow or deny them altogether.

Another solution is to make a callback to the user.

14

The jailing model I

They provide a clear jailing model, which distinguish an application’s allowed actions within a jail from actions that influence the world outside the jail.

A jail always starts with a single program, but this program may fork or execve other programs or create new threads4. Child processes run under the same policy as their parent (fig.).

15

The jailing model II

16

The jailing model III

A jail’s process hierarchy. The jailer starts the first jailed process in its own jail, and controls this jail by enforcing the jailing model and the jail’s policy.

A jailed process can create child processes (using fork and execve).These processes are now in the same jail as their parent and execute under the same policy as their parent.

17

The jailing model IV

All processes within a jail can communicate with Each other using UNIX IPC primitives or signals, or by writing files in their jailing directory.

Communication with processes outside the jail is controlled by the jailer’s policy.

18

Jailer architecture I

The architectural design of our jailer separates generic functionality (i.e., policy enforcement) from platform-specific functionality.

The jailer is split into two layers. The lowest layer is called the interception layer. This layer interfaces with the underlying system

call tracing interface.

The upper layer is the policy layer, which enforces the jailingpolicy. Both layers can access a shared memory managermodule, which manages the ShRO memory region (fig).

19

Jailer architecture II

20

Conclusion

This paper provides an effective jailing model that allows users to run untrusted programs securely.

The solution presents an effective and secure solution for alleviating shared memory and file system race conditions.

This solution is portable to any (POSIX compliant) UNIX system.

By differentiating between resources created inside and outside the jail, the jailing system has a clear model for deciding which system calls to accept or deny.

21

References I

Jain, K. and Sekar, R. (2000). User-level infrastructurefor system call interposition: A platform for intrusiondetection and confinement. ISOC Network and DistributedSystem Security Symposium (NDSS). pp. 19-34. Kamp, P. and Watson, R. (2000). Jails: Confining the omnipotentroot. Proc. 2nd Intl. SANE Conference. Liang, Z., Venkatakrishnan, V., and Sekar, R. (2003). Isolatedprogram execution: An application transparent approach for executing untrusted programs. 19th Annual Computer Security Applications Conference (ACSAC), Las Vegas, Nevada.

22

References II

Alexandrov, A., Kmiec, P., and Schauser, K. (1999). Consh:Confined execution environment for internet computations.http://www.cs.ucsb.edu/˜berto/papers/99-usenix-consh.ps.

23