SAFKASI: A Security Mechanism for Language-based Systems Dan S. Wallach Rice University Andrew W. Appel and Edward W. Felten Princeton University Excerpt.

Slides:



Advertisements
Similar presentations
Operating Systems Components of OS
Advertisements

Towards Remote Policy Enforcement for Runtime Protection of Mobile Code Using Trusted Computing Xinwen Zhang Francesco Parisi-Presicce Ravi Sandhu
Completeness and Expressiveness
Mobile Code Security Yurii Kuzmin. What is Mobile Code? Term used to describe general-purpose executables that run in remote locations. Web browsers come.
Threads, SMP, and Microkernels
Operating System Security
C O N T E X T - F R E E LANGUAGES ( use a grammar to describe a language) 1.
Java security (in a nutshell)
Mobile Code Security Aviel D. Rubin, Daniel E. Geer, Jr. MOBILE CODE SECURITY, IEEE Internet Computing, 1998 Minkyu Lee
MC697 Object-Oriented Programming Using Java. In this class, we will cover: How the class will be structured Difference between object-oriented programming.
CORBA - Common Object Request Broker Architecture.
Component Patterns – Architecture and Applications with EJB copyright © 2001, MATHEMA AG Component Patterns Architecture and Applications with EJB JavaForum.
1 Extensible Security Architectures for Java Authors: Dan S.Wallch, Dirk Balfanz Presented by Moonjoo Kim.
Lecture 2: Do you speak Java?. From Problem to Program Last Lecture we looked at modeling with objects! Steps to solving a business problem –Investigate.
Constraint Logic Programming Ryan Kinworthy. Overview Introduction Logic Programming LP as a constraint programming language Constraint Logic Programming.
© 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.1 Computer Networks and Internets with Internet Applications, 4e By Douglas.
Communication in Distributed Systems –Part 2
1 Run time vs. Compile time The compiler must generate code to handle issues that arise at run time Representation of various data types Procedure linkage.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 2: Operating-System Structures Modified from the text book.
3-1 3 Compilers and interpreters  Compilers and other translators  Interpreters  Tombstone diagrams  Real vs virtual machines  Interpretive compilers.
Session-02. Objective In this session you will learn : What is Class Loader ? What is Byte Code Verifier? JIT & JAVA API Features of Java Java Environment.
Proxy Design Pattern Source: Design Patterns – Elements of Reusable Object- Oriented Software; Gamma, et. al.
Java Security Updated May Topics Intro to the Java Sandbox Language Level Security Run Time Security Evolution of Security Sandbox Models The Security.
JAVA v.s. C++ Programming Language Comparison By LI LU SAMMY CHU By LI LU SAMMY CHU.
The Impact of Programming Language Theory on Computer Security Drew Dean Computer Science Laboratory SRI International.
Java Security. Topics Intro to the Java Sandbox Language Level Security Run Time Security Evolution of Security Sandbox Models The Security Manager.
MT311 Java Application Development and Programming Languages Li Tak Sing( 李德成 )
High level & Low level language High level programming languages are more structured, are closer to spoken language and are more intuitive than low level.
Gary MarsdenSlide 1University of Cape Town Principles of programming language design Gary Marsden Semester 2 – 2001.
Programming in Java Unit 2. Class and variable declaration A class is best thought of as a template from which objects are created. You can create many.
Java Security Pingping Ma Nov 2 nd, Overview Platform Security Cryptography Authentication and Access Control Public Key Infrastructure (PKI)
1 Module Objective & Outline Module Objective: After completing this Module, you will be able to, appreciate java as a programming language, write java.
Proof Carrying Code Zhiwei Lin. Outline Proof-Carrying Code The Design and Implementation of a Certifying Compiler A Proof – Carrying Code Architecture.
1 Comp 104: Operating Systems Concepts Java Development and Run-Time Store Organisation.
CSSE501 Object-Oriented Development. Chapter 12: Implications of Substitution  In this chapter we will investigate some of the implications of the principle.
Java 2 security model Valentina Casola. Components of Java the development environment –development lifecycle –Java language features –class files and.
SE: CHAPTER 7 Writing The Program
CE Operating Systems Lecture 3 Overview of OS functions and structure.
Secure Active Network Prototypes Sandra Murphy TIS Labs at Network Associates March 16,1999.
CE Operating Systems Lecture 14 Memory management.
SECURE WEB APPLICATIONS VIA AUTOMATIC PARTITIONING S. Chong, J. Liu, A. C. Myers, X. Qi, K. Vikram, L. Zheng, X. Zheng Cornell University.
By Teacher Asma Aleisa Year 1433 H.   Goals of memory management  To provide a convenient abstraction for programming.  To allocate scarce memory.
The Software Development Process
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University IWPSE 2003 Program.
 Objects versus Class  Three main concepts of OOP ◦ Encapsulation ◦ Inheritance ◦ Polymorphism  Method ◦ Parameterized ◦ Value-Returning.
Object Oriented Programming
1Computer Sciences Department. Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER Reference 3Computer Sciences Department.
By Mr. Muhammad Pervez Akhtar
Introduction to OOP CPS235: Introduction.
Procedures and Functions Procedures and Functions – subprograms – are named fragments of program they can be called from numerous places  within a main.
Silberschatz, Galvin and Gagne ©2011 Operating System Concepts Essentials – 8 th Edition Chapter 2: The Linux System Part 2.
1 Asstt. Prof Navjot Kaur Computer Dept PRESENTED BY.
 Description of Inheritance  Base Class Object  Subclass, Subtype, and Substitutability  Forms of Inheritance  Modifiers and Inheritance  The Benefits.
LECTURE 19 Subroutines and Parameter Passing. ABSTRACTION Recall: Abstraction is the process by which we can hide larger or more complex code fragments.
RealTimeSystems Lab Jong-Koo, Lim
Some of the utilities associated with the development of programs. These program development tools allow users to write and construct programs that the.
1 Chapter 2: Operating-System Structures Services Interface provided to users & programmers –System calls (programmer access) –User level access to system.
Sung-Dong Kim, Dept. of Computer Engineering, Hansung University Java - Introduction.
A Single Intermediate Language That Supports Multiple Implemtntation of Exceptions Delvin Defoe Washington University in Saint Louis Department of Computer.
Object Oriented Programming in
Visit for more Learning Resources
Java Primer 1: Types, Classes and Operators
Java security (in a nutshell)
Topic: Java Security Models
Chapter 2: The Linux System Part 2
Chapter 2: Operating-System Structures
Outline Chapter 2 (cont) OS Design OS structure
Chapter 2: Operating-System Structures
Authorization in Oracle Part 2 Ji-Won Mahesh
Presentation transcript:

SAFKASI: A Security Mechanism for Language-based Systems Dan S. Wallach Rice University Andrew W. Appel and Edward W. Felten Princeton University Excerpt By: Raghuram Vijapurapu

Contents ● What is this all about? ● What is SAFKASI? ● What is Stack Inspection? ● How Stack Inspection Works? ● Limitations of Stack Inspection ● Improvements from SAFKASI ● Access Control Logic (ABLP) ● Improved Implementation ● Security Passing Style and its Implementations.

What is this all about? Security in Java is considered one of the toughest when compared to many other languages. This is with respect to the execution of an unsafe operation by a client, that is in File System interaction and in execution of “dangerous routines”. This security in Java is provided by a feature in JVM called Stack Inspection. In actual implementation of Stack Inspection there exists an “unclear relationship to the actual achievement of security, over constrained the implementation of a Java system”.

What is SAFKASI? Its Pronounced as : saff-KAH-zee [D. Wallach; a new approach to mobile code security] Security Architecture Formerly Known As Stack Inspection SAFKASI is an improved implementation of Stack Inspection using the “calculus of Security- Passing Style”. It is a model by which Stack Inspection can be improved.

What is Stack Inspection? Stack inspection is an algorithm for preventing untrusted code from using sensitive system resources. Before a dangerous operation proceeds, a call is made to the security manager, which implements a reference monitor. The security manager will consider, in sequence, the principals* that own each stack frame. If a stack frame's principal is found to be unprivileged for the operation in question, permission is denied and the operation fails. *Principal is either the Web site from which the code was loaded or a signer who applied a digital signature to the code.

How is it Implemented in Java? Two Basic Operations of Stack Inspection are: BeginPrivilege( ): Enables Privileges CheckPrivilege(T): Check whether privileges for a given target T are enabled. Check-Privilege is implemented by searching stack frames from the current one. A Demo on how Stack Inspection Works:

Stack Inspection Demo DeleteFile(xyz) <=CheckPrivilege AliceFrame

Stack Inspection Demo DeleteFile( ) QuickSort( ) <=CheckPrivilege AliceFrame

Stack Inspection Demo DeleteFile( ) SubRoutine( ) <=CheckPrivilege LoadURL( ) BeginPrivilege AliceFrame

Limitations of Stack Inspection ● It is not clear whether the mechanism achieves real security, or how to reason about the security that it might achieve. ● The operational definition of stack-inspection over constraints its implementation. ● The high cost of the CheckPrivilege operation discourages its usage.

Improvements from SAFKASI ● Describing Stack Inspection using ABLP* Logic ● Applying new semantics for Stack Inspection called “Security Passing Style” and providing the flexibility to express all the security operations in plain Java. Not only does this avoid interference with program analysis and optimizations, but standard dataflow-based compiler optimizations now help optimize security operations for free. ● Each of the operations in our new implementation can be performed in O(1) time. * Abadi, Burrows, Lampson and Plotkin [Abadi et al. 1993]

Access Control Logic The Authors decided to adopt an access control logic described in Taos Operating Systems, where the Operating System maintains all the records of access control whether it is Network or Resource. The logic needs relatively simple propositional or modal logic with no negation of statements (and with certain restrictions on the form of statements), allows the theorem prover to run fast enough to not dramatically impact system performance. This kind of access logic provided by ABLP Logic was used to model Stack Inspection.

ABLP Logic ABLP is based on some simple Concepts: ● Principle ● Target ● Statement ● Conjunction of Principles ● Quotation ● Authority

Mapping Java to ABLP Principles: Code is Signed using a PKI. Targets: The resource we wish to protect. For every target we create a dummy principle whose name is identical to the target. This Dummy target do not make any statements themselves, but various principles speak for them. Setting Policy: Standard access matrix is implemented with with hash-tables to keep track of which principals have permission to access which targets.

Mapping Java to ABLP Stacks: When a Java program is executing, we treat each stack frame as a principal. Starting a Program: When a program starts, we need to set the security context of the initial stack frame Enabling Privileges: If a stack frame F calls BeginPrivilege(T) for some target T, it is really saying it authorizes access to the target. Calling a Procedure: When a stack frame F makes a procedure call, this creates a new stack frame G.

Mapping Java to ABLP Checking Privileges: Before making a system call or otherwise invoking a dangerous operation, the Java virtual machine calls CheckPrivilege() to make sure that the requested operation is authorized. ● THEOREM 1: Termination. The check decision procedure always terminates. ● THEOREM 2: Soundness. If the check decision procedure returns true when invoked in stack frame F, then there exists a proof in ABLP logic that E F Ok(T). ● THEOREM 3: (Equivalence to Stack Inspection). The check decision procedure is equivalent to the Java stack inspection algorithm.

Mapping Java to ABLP Extensions to the Model: There are a number of cases in which Java implementations differ from the model we have described. These are minor differences with no effect on the strength of the model. Groups. Threads. Enabling a Privilege. Disabling a Privilege. Frame Credentials. Java implementations do not treat stack frames or their code as separate principals.

Improved Implementation The model can improve the performance in two ways. By showing the evolution of security contexts can be represented by a deterministic pushdown automaton; this opens up a variety of efficient implementation techniques. Security-passing style, an efficient and convenient integration of the pushdown automaton with the state of the program.

Security Passing Style In security passing style the security state is tracked using JVM. (In other implementations an additional security subsystem looks into the implementation.) In Security passing style an implicit argument is added to every procedure. The argument is a pointer to the finite space of the automation. This eliminates the need to have a separate push down stack for security contexts or maintain stack annotations on the existing run-time stack. ● The main advantage of security-passing style is that once a program has been rewritten into SPS, it no longer needs any special security functionality from the JVM. ● Security-passing style allows us to express the stack inspection model within the existing semantics of the Java language

Implementing Security Passing Style Rewriting Java Bytecodes Stack inspection was originally implemented by adding support for it in the runtime system. These extensions required changing the stack frame representation, which in turn affected the garbage collector and JIT compiler. With SPS conversion, we can express the stack- inspection security architecture in vanilla Java bytecodes (or source). Every method has an extra parameter for passing the security context, but this parameter and its representation are just Java.

Issues in Implementation of SPS Native Methods: Java programs can call native methods (functions not written in Java) that might then call back to Java methods. We cannot apply SPS conversion within the native methods. Instead, when calling from Java to native, we store the security context s into a per-thread global variable; when calling from native back to Java we fetch as the security context for the Java code. Reflection: Ideally, the security-passing transformation should not be visible in any way to an application. The Java reflection API allows a program to learn how many parameters each of its methods takes; since SPS conversion introduces extra arguments. Thus needs reconstruction of reflection api and is still not supported by SAFKASI.

Issues in Implementation of SPS Bootstrapping: This code is written in Java therefore proved to be a problem for running with SPS therefore Bootstrapping code is written in 3 stages: Classes involved in the very beginning of bootstrapping the runtime were identified by hand and added to a list of classes that are not modified by the SPS converter. SPS-converted classes begin execution but the SPS runtime itself is not yet initialized. A dummy security context, later sub-classed to implement the real security context, is created. Finally, when real security contexts are available, the application s main routine can be invoked with a proper security context and execution continues normally.

Issues in Implementation of SPS ● Consistency and Inheritance: To run the SPS converted code in various environments requires assessing which classes need to be handled specially. To solve this problem of inconsistency a rule has been made that if a class is SPS converted then all classes that implement that interface also need to be SPS converted. ● Portability: Running SPS-converted code in a different Java environment would require assessing which classes need to be handled specially. But on the whole porting this code on any machine is possible with minimum changes. ● Production vs. prototype implementations: Our prototype implementation makes a number of simplifying assumptions that would not be acceptable in a production system.

Question? ● Is there any way a Program can implement security to disable access to a client / resource without using the facilities of Java?