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
Introduction to Compilation of Functional Languages Wanhe Zhang Computing and Software Department McMaster University 16 th, March, 2004.
Advertisements

NP-Hard Nattee Niparnan.
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.
Context-Sensitive Interprocedural Points-to Analysis in the Presence of Function Pointers Presentation by Patrick Kaleem Justin.
Control-Flow Graphs & Dataflow Analysis CS153: Compilers Greg Morrisett.
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.
Annoucements  Next labs 9 and 10 are paired for everyone. So don’t miss the lab.  There is a review session for the quiz on Monday, November 4, at 8:00.
CS 267: Automated Verification Lecture 10: Nested Depth First Search, Counter- Example Generation Revisited, Bit-State Hashing, On-The-Fly Model Checking.
Both finite sets, A and B, are relations. A= { (0,2), (1,3), (2,4) }
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
Train DEPOT PROBLEM USING PERMUTATION GRAPHS
1.2 Row Reduction and Echelon Forms
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.
Common Sub-expression Elim Want to compute when an expression is available in a var Domain:
61 Nondeterminism and Nodeterministic Automata. 62 The computational machine models that we learned in the class are deterministic in the sense that the.
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
4/25/08Prof. Hilfinger CS164 Lecture 371 Global Optimization Lecture 37 (From notes by R. Bodik & G. Necula)
(Page 554 – 564) Ping Perez CS 147 Summer 2001 Alternative Parallel Architectures  Dataflow  Systolic arrays  Neural networks.
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 22 Instructor: Paul Beame.
CSC 395 – Software Engineering Lecture 21: Overview of the Term & What Goes in a Data Dictionary.
Direction of analysis Although constraints are not directional, flow functions are All flow functions we have seen so far are in the forward direction.
Cs164 Prof. Bodik, Fall Symbol Tables and Static Checks Lecture 14.
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,
 Let A and B be any sets A binary relation R from A to B is a subset of AxB Given an ordered pair (x, y), x is related to y by R iff (x, y) is in R. This.
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.
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.
C++ Programming Language Lecture 2 Problem Analysis and Solution Representation By Ghada Al-Mashaqbeh The Hashemite University Computer Engineering Department.
Password Mistyping in Two-Factor Authenticated Key Exchange Vladimir KolesnikovCharles Rackoff Bell LabsU. Toronto ICALP 2008.
SECURE WEB APPLICATIONS VIA AUTOMATIC PARTITIONING S. Chong, J. Liu, A. C. Myers, X. Qi, K. Vikram, L. Zheng, X. Zheng Cornell University.
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.
ICS 253: Discrete Structures I Induction and Recursion King Fahd University of Petroleum & Minerals Information & Computer Science Department.
NP-Complete problems.
A System to Generate Test Data and Symbolically Execute Programs Lori A. Clarke Presented by: Xia Cheng.
CS 103 Discrete Structures Lecture 13 Induction and Recursion (1)
NP-Completeness (Nondeterministic Polynomial Completeness) Sushanth Sivaram Vallath & Z. Joseph.
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.
Intro to Planning Or, how to represent the planning problem in logic.
Arc Consistency CPSC 322 – CSP 3 Textbook § 4.5 February 2, 2011.
CS162 Week 4 Kyle Dewey. Overview Reactive imperative programming in a nutshell Reactive imperative programming implementation details.
Lecture 8CSE Intro to Cognitive Science1 Interpreting Line Drawings II.
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.
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.
1 1.2 Linear Equations in Linear Algebra Row Reduction and Echelon Forms © 2016 Pearson Education, Ltd.
Abstraction and Abstract Interpretation. Abstraction (a simplified view) Abstraction is an effective tool in verification Given a transition system, we.
Discrete Optimization MA2827 Fondements de l’optimisation discrète Material from P. Van Hentenryck’s course.
P & NP.
Lecture 7: Constrained Conditional Models
Verifiable Security Goals
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
CompSci 230 Software Construction
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
Paper Reading Group:. Language-Based Information-Flow Security. A
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
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 Publi c Secr et AliceBob Most Secure Least Secure ⊑ ⊑ ⊑ ⊑ Most Precise Least Precise

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 Same syntax from assignment 2 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 Publi c Secr et AliceBob ⊑ ⊑ ⊑ ⊑ 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

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

The Math in Depth

fail03.not Example