08/03/071/41 Polymer: A Language and System for Specifying Complex, Modular Run-time Policies Jay Ligatti, University of South Florida Joint work with:

Slides:



Advertisements
Similar presentations
Towards Remote Policy Enforcement for Runtime Protection of Mobile Code Using Trusted Computing Xinwen Zhang Francesco Parisi-Presicce Ravi Sandhu
Advertisements

1 Composing Security Policies with Polymer Jay Ligatti (Princeton); joint work with: Lujo Bauer (CMU), David Walker (Princeton)
New Security Issues Raised by Open Cards Pierre GirardJean-Louis Lanet GERMPLUS R&D.
Mobile Agents Mouse House Creative Technologies Mike OBrien.
Mobile Code Security Yurii Kuzmin. What is Mobile Code? Term used to describe general-purpose executables that run in remote locations. Web browsers come.
Comparing Semantic and Syntactic Methods in Mechanized Proof Frameworks C.J. Bell, Robert Dockins, Aquinas Hobor, Andrew W. Appel, David Walker 1.
Current Techniques in Language-based Security David Walker COS 597B With slides stolen from: Steve Zdancewic University of Pennsylvania.
Architecture Representation
Portability and Safety Mahdi Milani Fard Dec, 2006 Java.
Jay Ligatti and Srikar Reddy University of South Florida.
Mobile Code Security Aviel D. Rubin, Daniel E. Geer, Jr. MOBILE CODE SECURITY, IEEE Internet Computing, 1998 Minkyu Lee
CSI 3125, Preliminaries, page 1 Programming languages and the process of programming –Programming means more than coding. –Why study programming languages?
Extensibility, Safety and Performance in the SPIN Operating System Presented by Allen Kerr.
Presented by: Thabet Kacem Spring Outline Contributions Introduction Proposed Approach Related Work Reconception of ADLs XTEAM Tool Chain Discussion.
J2ME 25 July Overview  What is J2ME?  The CLDC and CDC configurations  MIDP and MIDlets  Development Tools  Demonstrations.
Modular Program Monitors David Walker Princeton University (joint work with Lujo Bauer and Jay Ligatti)
LAB#2 JAVA SECURITY OVERVIEW Prepared by: I.Raniah Alghamdi.
1 Extensible Security Architectures for Java Authors: Dan S.Wallch, Dirk Balfanz Presented by Moonjoo Kim.
Software Security Monitors: Theory & Practice David Walker Princeton University (joint work with Lujo Bauer and Jay Ligatti)
1 Enforcing Confidentiality in Low-level Programs Andrew Myers Cornell University.
Programmability with Proof-Carrying Code George C. Necula University of California Berkeley Peter Lee Carnegie Mellon University.
More Enforceable Security Policies Lujo Bauer, Jay Ligatti and David Walker Princeton University (graciously presented by Iliano Cervesato)
A Type System for Expressive Security Policies David Walker Cornell University.
Harmless Advice Daniel S Dantas Princeton University with Prof. David Walker.
AspectJ2EE/Clasa Israel Institute of Technology The Computer Science department Itay Maman.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 2: Operating-System Structures Modified from the text book.
Poly stop a hacker David Walker Princeton University (joint work with Lujo Bauer and Jay Ligatti)
1 The Problem o Fluid software cannot be trusted to behave as advertised unknown origin (must be assumed to be malicious) known origin (can be erroneous.
Cormac Flanagan University of California, Santa Cruz Hybrid Type Checking.
1 An introduction to design patterns Based on material produced by John Vlissides and Douglas C. Schmidt.
Taming the Wildcards: Combining Definition- and Use-Site Variance – Altidor John Altidor Taming the Wildcards: Combining Definition- and Use-Site Variance.
12/03/071/51 Monitoring Software to Enforce Run-time Policies Jay Ligatti, University of South Florida.
Page 1 Sandboxing & Signed Software Paul Krzyzanowski Distributed Systems Except as otherwise noted, the content of this presentation.
Java Security Updated May Topics Intro to the Java Sandbox Language Level Security Run Time Security Evolution of Security Sandbox Models The Security.
Java Security. Topics Intro to the Java Sandbox Language Level Security Run Time Security Evolution of Security Sandbox Models The Security Manager.
Modern Concurrency Abstractions for C# by Nick Benton, Luca Cardelli & C´EDRIC FOURNET Microsoft Research.
Katanosh Morovat.   This concept is a formal approach for identifying the rules that encapsulate the structure, constraint, and control of the operation.
Jaeki Song ISQS6337 JAVA Lecture 16 Other Issues in Java.
Security in Java Sunesh Kumra S
Chapter 1 Introduction Dr. Frank Lee. 1.1 Why Study Compiler? To write more efficient code in a high-level language To provide solid foundation in parsing.
Eric Keller, Evan Green Princeton University PRESTO /22/08 Virtualizing the Data Plane Through Source Code Merging.
Aspect Oriented Programming Scott Nykl CSSE 411 Senior Seminar.
1 22 August 2001 The Security Architecture of the M&M Mobile Agent Framework P. Marques, N. Santos, L. Silva, J. Silva CISUC, University of Coimbra, Portugal.
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.
Java Security Nathan Moore CS 665. Overview Survey of Java Inherent Security Properties Java Runtime Environment Java Virtual Machine Java Security Model.
Class 5 Architecture-Based Self-Healing Systems David Garlan Carnegie Mellon University.
CE Operating Systems Lecture 3 Overview of OS functions and structure.
1 Enforcing Security Policies with Run-time Program Monitors Jay Ligatti Princeton University.
Java Security Session 19. Java Security / 2 of 23 Objectives Discuss Java cryptography Explain the Java Security Model Discuss each of the components.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
A Flexible Access Control Service for Java Mobile Code HPCC lab 문 정 아.
Java – in context Main Features From Sun Microsystems ‘White Paper’
08/06/071/58 Runtime Software Monitoring Jay Ligatti, University of South Florida Joint work with: Lujo Bauer, CMU CyLab David Walker, Princeton University.
On Implementing High Level Concurrency in Java G Stewart von Itzstein Mark Jasiunas University of South Australia.
SAFE KERNEL EXTENSIONS WITHOUT RUN-TIME CHECKING George C. Necula Peter Lee Carnegie Mellon U.
Exceptions Lecture 11 COMP 401, Fall /25/2014.
ALLOY: A Formal Methods Tool Glenn Gordon Indiana University of Pennsylvania COSC 481- Formal Methods Dr. W. Oblitey 26 April 2005.
27/09/071/65 Coping with Runtime-Policy Complexity Jay Ligatti, University of South Florida Joint work with: Lujo Bauer, Carnegie Mellon University CyLab.
ASHRAY PATEL Protection Mechanisms. Roadmap Access Control Four access control processes Managing access control Firewalls Scanning and Analysis tools.
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.
1 Jay Ligatti (Princeton University); joint work with: Lujo Bauer (Carnegie Mellon University), David Walker (Princeton University) Enforcing Non-safety.
Policy Enforcement via Program Monitoring
Enforcing Security Policies with Run-time Program Monitors
Enforcing Non-safety Security Policies with Program Monitors
New Research in Software Security
Computer Science 340 Software Design & Testing
Abstract Types Defined as Classes of Variables
Presentation transcript:

08/03/071/41 Polymer: A Language and System for Specifying Complex, Modular Run-time Policies Jay Ligatti, University of South Florida Joint work with: Lujo Bauer, Carnegie Mellon University David Walker, Princeton University

08/03/072/41 Security Policy Enforcement News flash: Software sometimes does bad stuff News flash: Software sometimes does bad stuff –Bugs –Malicious design One protection mechanism: Run-time program monitoring One protection mechanism: Run-time program monitoring –Monitoring software interposes whenever an untrusted application is about to execute a security-relevant action

08/03/073/41 Program Monitoring Monitors ensure that software dynamically adheres to constraints specified by a security policy Monitors ensure that software dynamically adheres to constraints specified by a security policy Practical examples Practical examples –Stack inspection, firewalls, network auditors, sandboxing, intrusion detection systems, … Untrusted Target Program Monitor Executing System Open(f,“w”) is OK Open(f,“w”)

08/03/074/41 Security Policies Become More Complex… 1. As software becomes more sophisticated (i.e., enters new domains) –Multi-user and networked systems –Electronic commerce –Medical databases (HIPAA, EU Data Protection Law)

08/03/075/41 Security Policies Become More Complex… 1. As software becomes more sophisticated (i.e., enters new domains) –Multi-user and networked systems –Electronic commerce –Medical databases (HIPAA, EU Data Protection Law) 2. As we tighten overly relaxed policies –Insecure default configurations disallowed –Downloading.doc files requires warning

08/03/076/41 Security Policies Become More Complex… 1. As software becomes more sophisticated (i.e., enters new domains) –Multi-user and networked systems –Electronic commerce –Medical databases (HIPAA, EU Data Protection Law) 2. As we tighten overly relaxed policies –Insecure default configurations disallowed –Downloading.doc files requires warning 3. As we relax overly tight policies –All applets sandboxed (JDK 1.0) vs. only unsigned applets sandboxed (JDK 1.1)

08/03/077/41 Managing Complexity via Centralization Application with policy scattered throughout Scattered policy is hard to find and reason about Application with centralized policy Centralized policy is easier to find and reason about Policy contains: - Security code - When to run the security code

08/03/078/41 Related Work: Managing Policy Complexity via Centralization General monitoring systems General monitoring systems –Java-MaC [Lee, Kannan, Kim, Sokolsky, Viswanathan ‘99] –Naccio [Evans, Twyman ’99] –Policy Enforcement Toolkit [Erlingsson, Schneider ’00] –Aspect-oriented software systems [Kiczales, Hilsdale, Hugunin, Kersten, Palm, Griswold ’01; …] –… Language theory Language theory –Semantics for AOPLs [Tucker, Krishnamurthi ’03; Walker, Zdancewic, Ligatti ’03; Wand, Kiczales, Dutchyn ’04; …] Automata theory Automata theory –Security automata [Schneider ’00; Ligatti, Bauer, Walker ’05]

08/03/079/41 Beyond Centralization: Composition Policy centralization is not enough Policy centralization is not enough –Need methodology for organizing a complex centralized policy All of the cited efforts lack a flexible methodology for decomposing complex policies into simpler modules All of the cited efforts lack a flexible methodology for decomposing complex policies into simpler modules

08/03/0710/41 Polymer Contributions Polymer Polymer –Is a fully implemented language (with formal semantics) for specifying run-time policies on Java code –Provides a methodology for conveniently specifying and generating complex monitors from simpler modules Strategy Strategy –Make all policies first-class and composeable –So higher-order policies (superpolicies) can compose simpler policies (subpolicies)

08/03/0711/41 Outline Motivation and goal Motivation and goal –Ease specification of run-time policies Polymer system Polymer system Polymer language Polymer language –First-class actions, suggestions, policies –Policy examples Case study Case study Formal Polymer language Formal Polymer language Conclusion Conclusion

08/03/0712/41 Polymer System Tools Policy compiler Policy compiler –Converts monitor policies written in the Polymer language into Java source code –Then runs javac to compile the Java source Bytecode instrumenter Bytecode instrumenter –Inserts calls to the monitor at the right places in:  The core Java libraries  The untrusted (target) application

08/03/0713/41 Securing Targets in Polymer TargetLibraries…… Original application Instrumented target Instrumented libraries Compiled policy …… Secured application

08/03/0714/41 Securing Targets in Polymer 1. Create a listing of all security-relevant methods (trigger actions) 2. Instrument trigger actions in core Java libraries 3. Write and compile security policy 4. Run target using instrumented libraries, instrumenting target classes as they load (with a custom class loader)

08/03/0715/41 Outline Motivation and goal Motivation and goal –Ease specification of run-time policies Polymer system Polymer system Polymer language Polymer language –First-class actions, suggestions, policies –Policy examples Case study Case study Formal Polymer language Formal Polymer language Conclusion Conclusion

08/03/0716/41 Polymer Language Overview Syntactically almost identical to Java source Syntactically almost identical to Java source Primary additions to Java Primary additions to Java –Key abstractions for first-class actions, suggestions, and policies –Programming discipline –Composeable policy organization

08/03/0717/41 First-class Actions Action objects contain information about a method invocation Action objects contain information about a method invocation –Static method signature –Dynamic calling object –Dynamic parameters Policies can analyze trigger actions Policies can analyze trigger actions Policies can synthesize actions to insert Policies can synthesize actions to insert

08/03/0718/41 Action Patterns For convenient analysis, action objects can be matched to patterns in aswitch statements For convenient analysis, action objects can be matched to patterns in aswitch statements Wildcards can appear in action patterns Wildcards can appear in action patterns aswitch(a) { case : E; … } (int i, …)>

08/03/0719/41 First-class Suggestions Policies return Suggestion objects to indicate how to handle trigger actions Policies return Suggestion objects to indicate how to handle trigger actions –IrrSug: action is irrelevant –OKSug: action is relevant but safe –InsSug: defer judgment until after running and evaluating some auxiliary code –ReplSug: replace action (which computes a return value) with another return value –ExnSug: raise an exception to notify target that it is not allowed to execute this action –HaltSug: disallow action and halt execution

08/03/0720/41 First-class Policies Policies include state and several methods: Policies include state and several methods: –query() suggests how to deal with trigger actions –accept() performs bookkeeping before a suggestion is followed –result() performs bookkeeping after an OK’d or inserted action returns a result public abstract class Policy { public abstract Sug query(Action a); public void accept(Sug s) { }; public void result(Sug s, Object result, boolean wasExnThn) { }; }

08/03/0721/41 Compositional Policy Design query() methods should be effect-free query() methods should be effect-free –Superpolicies test reactions of subpolicies by calling their query() methods –Superpolicies combine reactions in meaningful ways –Policies cannot assume suggestions will be followed Effects postponed for accept() and result() Effects postponed for accept() and result()

08/03/0722/41 A Simple Policy That Forbids Runtime.exec(..) methods public class DisSysCalls extends Policy { public Sug query(Action a) { aswitch(a) { case : return new HaltSug(this, a); } return new IrrSug(this); } public void accept(Sug s) { if(s.isHalt()) { System.err.println(“Illegal method called”); System.err.println(“About to halt target.”); }

08/03/0723/41 Policy Combinators Polymer provides library of generic superpolicies (combinators) Polymer provides library of generic superpolicies (combinators) Policy writers are free to create new combinators Policy writers are free to create new combinators Standard form: Standard form: public class Conjunction extends Policy { private Policy p1, p2; public Conjunction(Policy p1, Policy p2) { this.p1 = p1; this.p2 = p2; } public Sug query(Action a) { Sug s1 = p1.query(a), s2 = p2.query(a); //return the conjunction of s1 and s2 …

08/03/0724/41 Conjunctive Combinator Apply several policies at once, first making any insertions suggested by subpolicies Apply several policies at once, first making any insertions suggested by subpolicies When no subpolicy suggests an insertion, obey most restrictive subpolicy suggestion When no subpolicy suggests an insertion, obey most restrictive subpolicy suggestion Irrelevant OK Replace(v1) Replace(v2) … Replace(v3) ExceptionHalt Least restrictiveMost restrictive Policy netPoly = new Conjunction(new FirewallPoly(), new LogSocketsPoly(), new WarnB4DownloadPoly());

08/03/0725/41 Selector Combinators Make some initial choice about which subpolicy to enforce and forget about the other subpolicies Make some initial choice about which subpolicy to enforce and forget about the other subpolicies IsClientSigned: Enforce first subpolicy if and only if target is cryptographically signed IsClientSigned: Enforce first subpolicy if and only if target is cryptographically signed Policy sandboxUnsigned = new IsClientSigned( new TrivialPolicy(), new SandboxPolicy());

08/03/0726/41 Unary Combinators Perform some extra operations while enforcing a single subpolicy Perform some extra operations while enforcing a single subpolicy AutoUpdate: Obey sole subpolicy but also intermittently check for subpolicy updates AutoUpdate: Obey sole subpolicy but also intermittently check for subpolicy updates

08/03/0727/41 Outline Motivation and goal Motivation and goal –Ease specification of run-time policies Polymer system Polymer system Polymer language Polymer language –First-class actions, suggestions, policies –Policy examples Case study Case study Formal Polymer language Formal Polymer language Conclusion Conclusion

08/03/0728/41 Case Study Polymer policy for clients that use the JavaMail API Polymer policy for clients that use the JavaMail API –Approx lines of Polymer code, available at Tested on Pooka [ Tested on Pooka [ –Approx. 50K lines of Java code + libraries (Java standard libraries, JavaMail, JavaBeans Activation Framework, JavaHelp, The Knife mbox provider, Kunststoff Look and Feel, and ICE JNI library) (Java standard libraries, JavaMail, JavaBeans Activation Framework, JavaHelp, The Knife mbox provider, Kunststoff Look and Feel, and ICE JNI library)

08/03/0729/41 Policy Hierarchy Related policy concerns are modularized => 1) Easier to create the policy - Modules are reusable - Modules can be written in isolation - Modules can be written in isolation 2) Easier to understand the policy 3) Easier to update the policy

08/03/0730/41 Outline Motivation and goal Motivation and goal –Ease specification of run-time policies Polymer system Polymer system Polymer language Polymer language –First-class actions, suggestions, policies –Policy examples Case study Case study Formal Polymer language Formal Polymer language Conclusion Conclusion

08/03/0731/41 Formal Semantics Motivation Motivation –Unambiguously communicate central workings of language and highlight their simplicity Style Style –Lambda calculus, rather than class-based calculus (again, for simplicity)

08/03/0732/41 Syntax

08/03/0733/41 Static Semantics

08/03/0734/41 Dynamic Semantics I

08/03/0735/41 Dynamic Semantics II

08/03/0736/41 Type Safety Particularly important for monitor-based policy-specification languages Particularly important for monitor-based policy-specification languages –Application expressions in well-typed programs cannot:  circumvent monitor checks (complete mediation)  tamper with monitor code or state Straightforward proof Straightforward proof –Context weakening, Typing inversion, Canonical Forms, Substitution, Preservation, Progress

08/03/0737/41 Outline Motivation and goal Motivation and goal –Ease specification of run-time policies Polymer system Polymer system Polymer language Polymer language –First-class actions, suggestions, policies –Policy examples Case study Case study Formal Polymer language Formal Polymer language Conclusion Conclusion

08/03/0738/41 Summary An approach to managing policy complexity: An approach to managing policy complexity: –Design policies for composition –Complex policies can be decomposed into simpler subpolicies Enabling the approach Enabling the approach –First-class actions, suggestions, and policies –Policy organization (effectless query methods and effectful bookkeeping methods) Implemented end-to-end system Implemented end-to-end system –Library of useful combinators –Case study policy hierarchy

08/03/0739/41 Current Work: Improving Specification Convenience Effectful query methods Effectful query methods –Writing effectless query methods is tedious –Algorithm seems to exist for compiling an effectful- query policy into an effectless-query policy Polymer GUI Polymer GUI –Policies written at too low of level for many users –GUI would allow safe policy specification, visualization, and update by selection from a library of prepackaged policies

08/03/0740/41 More Information Source code and example policies: Source code and example policies: Papers: Papers: –Composing security policies with Polymer (PLDI 2005) –Composing expressive run-time security policies (journal article in submission)

08/03/0741/41 End Thanks / Questions?

08/03/0742/41 Implementation Numbers Polymer size Polymer size –30 core classes (approx lines of Java) + JavaCC + Apache BCEL (Unoptimized) Performance (Unoptimized) Performance –Instrument all Java core libraries = 107s = 3.7 ms per method –Typical class loading time = 12 ms (vs. 6 ms with default class loader) –Monitored method call = 0.6 ms overhead –Policy code’s performance typically dominates cost

08/03/0743/41 Another Example (logs incoming and prepends “SPAM:” to subject lines on messages flagged by a spam filter)