CS162 Week 8 Kyle Dewey. Overview Example online going over fail03.not (from the test suite) in depth A type system for secure information flow Implementing.

Slides:



Advertisements
Similar presentations
NP-Hard Nattee Niparnan.
Advertisements

School of EECS, Peking University “Advanced Compiler Techniques” (Fall 2011) SSA Guo, Yao.
Partial Order Reduction: Main Idea
Chapter 9 Code optimization Section 0 overview 1.Position of code optimizer 2.Purpose of code optimizer to get better efficiency –Run faster –Take less.
Control-Flow Graphs & Dataflow Analysis CS153: Compilers Greg Morrisett.
Iterative Deepening A* & Constraint Satisfaction Problems Lecture Module 6.
CS412/413 Introduction to Compilers Radu Rugina Lecture 37: DU Chains and SSA Form 29 Apr 02.
Lecture 24 Coping with NPC and Unsolvable problems. When a problem is unsolvable, that's generally very bad news: it means there is no general algorithm.
Approximation, Chance and Networks Lecture Notes BISS 2005, Bertinoro March Alessandro Panconesi University La Sapienza of Rome.
CS162 Week 9 Kyle Dewey. Overview What needs to be done Quirks with GC on miniJS Implementing GC on miniJS.
Algorithms + L. Grewe.
Label Placement and graph drawing Imo Lieberwerth.
1 The Limits of Computation Intractable and Non-computable functions.
CS 267: Automated Verification Lecture 10: Nested Depth First Search, Counter- Example Generation Revisited, Bit-State Hashing, On-The-Fly Model Checking.
Parallel Inclusion-based Points-to Analysis Mario Méndez-Lojo Augustine Mathew Keshav Pingali The University of Texas at Austin (USA) 1.
Best-First Search: Agendas
Type Checking.
Train DEPOT PROBLEM USING PERMUTATION GRAPHS
CPSC 322, Lecture 19Slide 1 Propositional Logic Intro, Syntax Computer Science cpsc322, Lecture 19 (Textbook Chpt ) February, 23, 2009.
1 Introduction to Computability Theory Lecture12: Decidable Languages Prof. Amos Israeli.
1 Introduction to Computability Theory Lecture12: Reductions Prof. Amos Israeli.
CPSC 322, Lecture 12Slide 1 CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12 (Textbook Chpt ) January, 29, 2010.
Approximation Algorithms
Verifiable Security Goals
CS 330 Programming Languages 09 / 18 / 2007 Instructor: Michael Eckmann.
4/25/08Prof. Hilfinger CS164 Lecture 371 Global Optimization Lecture 37 (From notes by R. Bodik & G. Necula)
Register Allocation (via graph coloring)
Data Flow Analysis Compiler Design October 5, 2004 These slides live on the Web. I obtained them from Jeff Foster and he said that he obtained.
(Page 554 – 564) Ping Perez CS 147 Summer 2001 Alternative Parallel Architectures  Dataflow  Systolic arrays  Neural networks.
Data Flow Analysis Compiler Design Nov. 8, 2005.
Cs164 Prof. Bodik, Fall Symbol Tables and Static Checks Lecture 14.
Sequential circuit design
CSE341: Programming Languages Lecture 11 Type Inference Dan Grossman Winter 2013.
CP Summer School Modelling for Constraint Programming Barbara Smith 1.Definitions, Viewpoints, Constraints 2.Implied Constraints, Optimization,
Nattee Niparnan. Easy & Hard Problem What is “difficulty” of problem? Difficult for computer scientist to derive algorithm for the problem? Difficult.
4 4.2 © 2012 Pearson Education, Inc. Vector Spaces NULL SPACES, COLUMN SPACES, AND LINEAR TRANSFORMATIONS.
CS162 Week 8 Kyle Dewey. Overview Example online going over fail03.not (from the test suite) in depth A type system for secure information flow Implementing.
Advanced Digital Circuits ECET 146 Week 5 Professor Iskandar Hack ET 221G, Me as I typed this slides.
Computer Programming TCP1224 Chapter 3 Completing the Problem-Solving Process and Getting Started with C++
Lecture 1 Computation and Languages CS311 Fall 2012.
Verification and Validation in the Context of Domain-Specific Modelling Janne Merilinna.
Type Systems CS Definitions Program analysis Discovering facts about programs. Dynamic analysis Program analysis by using program executions.
Computer Science CPSC 322 Lecture 13 Arc Consistency (4.5, 4.6 ) Slide 1.
SECURE WEB APPLICATIONS VIA AUTOMATIC PARTITIONING S. Chong, J. Liu, A. C. Myers, X. Qi, K. Vikram, L. Zheng, X. Zheng Cornell University.
Current Assignments Homework 2 is available and is due in three days (June 19th). Project 1 due in 6 days (June 23 rd ) Write a binomial root solver using.
NP-COMPLETE PROBLEMS. Admin  Two more assignments…  No office hours on tomorrow.
Software Security II Karl Lieberherr. What is Security Enforcing a policy that describes rules for accessing resources. Policy may be explicit or implicit.
June 10, 2002© Howard Huang1 Number systems To get started, we’ll discuss one of the fundamental concepts underlying digital computer design:
A System to Generate Test Data and Symbolically Execute Programs Lori A. Clarke Presented by: Xia Cheng.
Problem Reduction So far we have considered search strategies for OR graph. In OR graph, several arcs indicate a variety of ways in which the original.
Maximum Density Still Life Symmetries and Lazy Clause Generation Geoffrey Chu, Maria Garcia de la Banda, Chris Mears, Peter J. Stuckey.
Arc Consistency CPSC 322 – CSP 3 Textbook § 4.5 February 2, 2011.
Programming Fundamentals. Topics to be covered Today Recursion Inline Functions Scope and Storage Class A simple class Constructor Destructor.
CS162 Week 4 Kyle Dewey. Overview Reactive imperative programming in a nutshell Reactive imperative programming implementation details.
CSE 311 Foundations of Computing I Lecture 28 Computability: Other Undecidable Problems Autumn 2011 CSE 3111.
Lecture 8CSE Intro to Cognitive Science1 Interpreting Line Drawings II.
MA10209 – Week 3 Tutorial B3/B4, Andrew Kennedy. people.bath.ac.uk/aik22/ma10209 How to go about a proof  Step 1: Identify what you need to show  Sometimes.
CS162 Week 3 Kyle Dewey. Overview Grades posted for assignment 1 Secure information flow key implementation issues Reactive imperative programming.
Iterative Improvement for Domain-Specific Problems Lecturer: Jing Liu Homepage:
Week 6 MondayTuesdayWednesdayThursdayFriday Testing III Reading due Group meetings Testing IVSection ZFR due ZFR demos Progress report due Readings out.
Wolfgang Runte Slide University of Osnabrueck, Software Engineering Research Group Wolfgang Runte Software Engineering Research Group Institute.
Lecture 7: Constrained Conditional Models
Verifiable Security Goals
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
Paper Reading Group:. Language-Based Information-Flow Security. A
Lectures on Network Flows
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
Data Flow Analysis Compiler Design
An information flow model FM is defined by
Presentation transcript:

CS162 Week 8 Kyle Dewey

Overview Example online going over fail03.not (from the test suite) in depth A type system for secure information flow Implementing said type system

Flashback: Assignment 2 Implemented dynamically enforced secure information flow via label tracking Each Storable is labeled with a tag describing its security level Security levels interact in well-defined ways

Security Levels Secr et Publi c AliceBob Most Secure Least Secure ⊑ ⊑ ⊑ ⊑

Basic Idea Specify which channel we output to (public, secure, etc.) Only output values of equal or lesser security than the specified value (i.e. do not output something secure on a public channel) When values interact to produce new values, the new values take the security level of the most secure thing they touched

Example var x, y inoutput secret "enter secret number: ";x := input secret num;y := x;output public y

Issues This system works, but there are two major issues with it (well, 1.5 major issues) What’s problematic?

#1: Termination Leaks Whether or not a program halts can leak a bit to an attacker In a dynamic system, certain kinds of leaks are transformed into termination leaks I.e. instead of outputting a secret value to public, throw an exception and terminate instead

#2: Dynamic var x, y in x := input secret num; y := input public num; if (y = 42) { output public x }

A Solution A static type system and type checker, specifically for secure information flow If a program typechecks, then it is guaranteed that it is secure Type systems being type systems, if it does not typecheck, it still might be secure

Assignment 5 Implement a type checker for secure information flow for miniJS Slightly more complex lattice Implicitly typed The type system, along with all the necessary rules, is provided Overall very similar to the type system coverage in the lecture

Major Difference from Lecture Lecture is using equivalence constraints Solved using the union-find data structure This assignment will use subset constraints These slides cover how to solve these

Three Core Challenges 1. Understanding the math 2. Implementing the math 3. Solving the constraints

#1 Understanding The Math Basics needed to understand it covered extensively in lecture Biggest difference from lecture: L is used as a type variable instead of T, since L is a security level

#2 Implementing Math General rule: implement as close to the math as possible The more it deviates, the more difficult it is to reason about whether or not they are equivalent...and the more difficult it becomes to track down bugs

Implementing Math

#3: Solving the Constraints

Constraint Generation Very similar to how constraints were generated in lecture Based on subsets instead of equality

Constraint Generation Once all the rules have completed, we end up with a bunch of constraints like these: Public ⊑ L ₁ Public ⊑ L ₂ Public ⊑ SecretPublic ⊑ L ₃ L ₃ ⊑ L ₁ L ₂ ⊑ L ₄ Secret ⊑ L ₄...where L ₁, L ₂, and L ₃ are type variables

Constraint Meaning These constraints show what the syntax of the program says about the security lattice We already know what the security lattice looks like If the two are consistent, the program typechecks If there are inconsistencies, the program fails to typecheck

Finding Inconsistencies If any constraints violate this partial order, it means the program is not well-typed Secret ⊑ Public Secret ⊑ Bob Secret ⊑ Alice Bob ⊑ Public Alice ⊑ Public Bob ⊑ Alice Alice ⊑ Bob Secr et Publi c AliceBob ⊑ ⊑ ⊑ ⊑

Not that Easy What about type variables? Need a way to map these back to concrete types Public ⊑ L ₁ Public ⊑ L ₂ Public ⊑ SecretPublic ⊑ L ₃ L ₃ ⊑ L ₁ L ₂ ⊑ L ₄ Secret ⊑ L ₄

Coalescing Constraints Public ⊑ L ₁ Public ⊑ L ₂ Public ⊑ SecretPublic ⊑ L ₃ L ₃ ⊑ L ₁ L ₂ ⊑ L ₄ Secret ⊑ L ₄ Publi c Secr et L₁L₁L₁L₁ L₂L₂L₂L₂ L₃L₃L₃L₃ L₄L₄L₄L₄ Edges denote ⊑

Getting the Full ⊑ Publi c Secr et L₁L₁L₁L₁ L₂L₂L₂L₂ L₃L₃L₃L₃ L₄L₄L₄L₄ If node n 1 can reach node n 2, then n 1 ⊑ n 2 Public ⊑ : {L ₁, L ₂, L ₃, L ₄, Secret} Secret ⊑ : {L ₄ }

Cycles The graph can contain cycles This should not break anything Publi c Secr et L₁L₁L₁L₁ L₂L₂L₂L₂ Public ⊑ : {L ₁, L ₂ } Secret ⊑ : {L ₁, L ₂ }

Final Step Verify the full sets are consistent Only need to consider concrete security levels (public, secure, etc.) Secret ⊑ Public Secret ⊑ Bob Secret ⊑ Alice Bob ⊑ Public Alice ⊑ Public Bob ⊑ Alice Alice ⊑ Bob Secret cannot reach Public Secret cannot reach Bob Secret cannot reach Alice Bob cannot reach Public Alice cannot reach Public Bob cannot reach Alice Alice cannot reach Bob

Constraint Solver Implementation Free to use mutability It is not necessary to make an explicit graph, but you are free to do so if you wish It is likely easier to avoid it if possible For each constraint, add an edge and possibly nodes to this graph A global counter will be needed for generating unique type variables

Removed for Simplicity Each node should have an edge pointing to itself Since the definition of ⊑ includes equality, for all levels l, l ⊑ l Hint: this can be exploited in implementations that do not have an explicit graph

Security Lattice The security lattice we use for this assignment is more complex than the Public, Secret, Alice, and Bob lattice used in Assignment 2

Security Lattice ⊑ ⊑ ⊑ ⊑ ⊑ ⊑ ⊑ ⊑ ⊑ ⊑

Things to Avoid For full credit, you MUST implement the subset constraint solving outlined here Maximum score for any other method: C+ Do not try to hack assignment 2 until it is a type checker Like hacking on a compiler until it’s a text editor Historically, starting from scratch is simpler

The Math in Depth

fail03.not Example