No.050 Software Contracts for Communication, Monitoring, and Security

Icon

NII Shonan Meeting Seminar 050

Philip Wadler: Blame Concisely

An introduction to the blame calculus and summary of contributions, covering the following.

Well-typed programs can’t be blamed, Wadler and Findler, ESOP 2009.

Threesomes, with and without blame, Siek and Wadler, POPL 2010.

Blame for all, Ahmed, Findler, Siek, and Wadler, POPL 2011.

Blame, threesomes, and coercions, precisely, Siek, Thiemann, and Wadler, submitted.

Symmetric blame, Wadler, in preparation.

Simon Gay: Session Types and Typestate for Object-Oriented Programming

Session types describe the sequence and format of messages on point-to-point communication channels. They allow communication protocols to be specified type-theoretically so that their implementations can be verified by static type-checking. Session types were introduced in the setting of process calculus, and later formulated for imperative, functional and object-oriented languages. The quest for a clean integration of session types and objects leads to the idea of embedding session types in a more general setting of typestate, in which the operations available for a given object are state-dependent. We are exploring this idea with a typestate system in which typestate specifications are inspired by session types, and developing an experimental implementation as an extension of Java.

Joint work with Vasco Vasconcelos, Antonio Ravara, Nils Gesbert, Ornela Dardha, Dimitrios Kouzapas

Steven Chong: Secure shell scripting

Reasoning about the security of shell scripts is notoriously hard. This is in large part because it is difficult for programmers to deduce the effects of shell scripts on the underlying operating system. First, resource references, such as file paths, are typically resolved lazily and subject to race conditions.? Second, shell scripts are typically run with the same privileges as the invoking user, making it hard to determine or enforce that a script has all (and only) permissions to execute successfully. Third, shell scripts invoke other programs, often arbitrary binaries.

In this talk, I present the preliminary design and implementation of Shill, a secure shell scripting language that uses fine-grained capabilities to restrict access to resources. Capabilities bind resources at the time of their creation, and avoid vulnerabilities arising from lazy name resolution. Shill scripts come with contracts that specify and restrict what capabilities the script may use. A Shill script can invoke an arbitrary binary in a sandbox that limits the privileges of the binary based on a set of capabilities. Capabilities together with contracts and sandboxing enable the caller of a script to reason precisely about which resources a script (and the binaries it calls) may access, and thus, Shill helps reason safely and effectively about the use and composition of scripts. We have implemented Shill on top of FreeBSD, using Racket and the FreeBSD Trusted MAC framework.

Christos Dimoulas: Complete contract monitors and their applications

Contracts are a popular mechanism for enhancing the interface of components. In the world of first-order functions, programmers embrace contracts because they write them in a familiar language and easily? understand them as a pair of a pre-condition and a post-condition. In a? higher-order world, contracts offer the same expressiveness to? programmers but their meaning subtly differs from the familiar first-order notion. For instance, it is unclear what the behavior of? dependent contracts for higher-order functions or of contracts for mutable data should be. As a consequence, it is difficult to design? monitoring systems for such higher-order worlds.

In response to this problem, we investigate complete monitors, a formal? framework for deciding if a contract system is correct. The intuition behind the framework is that a correct contract system should:
— mediate the exchange of values between contracted components
— and blame correctly in case of contract violations.
The framework reveals flaws in the semantics for dependent contracts? from the literature and suggests a natural fix. In addition, we demonstrate the usefulness of the framework for language design with a? language with contracts for mutable data and a language that mixes typed and untyped imperative programs. The final contribution is the provably correct design of a novel form of contracts, dubbed options contracts, that mix contract checking with random and probabilistic checking.

Nokuko Yoshida: Multiparty session types and their applications to a large distributed system

We give a summary of our recent research developments on multiparty session types for verifying distributed and concurrent programs, and our collaborations with industry partners and a major, long-term, NSF-funded project (Ocean Observatories Initiatives) to provide an ultra large-scale cyberinfrustracture (OOI CI) for 25-30 years of sustained ocean measurements to study climate variability, ocean circulation and ecosystem dynamics.
We shall first talk how Robin Milner, Kohei Honda and Yoshida started collaborations with industry to develop a web service protocol description language called Scribble and discovered the theory of multiparty session types through the collaborations. ?We then talk about the recent developments in Scribble and the runtime session monitoring framework currently used in the OOI CI.

Vasco T. Vasconcelos: Deductive Verification of Communication Contracts

Communication contracts describe the global interactive behaviour of
concurrent and distributed systems. The challenge is to verify whether
a given program (or collection of programs) adheres a contract. If
that turns out to be the case, properties such as absence of 'message
not understood', undesired races and deadlocks are automatically
guaranteed. We show one such system for Message Passing Interface
programs.

Ilaria Castellani: Secure information flow for synchronous reactive programs

We consider the security property of noninterference in a core synchronous reactive language that we call CRL. In the synchronous reactive paradigm, threads communicate by means of broadcast events, and their parallel execution is regulated by a notion of instant. Threads get suspended while waiting for an absent event or when deliberately releasing the control for the current instant. An instant is a period of time during which all threads compute up to termination or suspension. A program interacts with its environment only at the start and the end of instants.
?
We define two bisimulation equivalences on CRL programs, corresponding respectively to a fine-grained and to a coarse-grained observation of programs. Based on these bisimulations, two properties of Reactive Noninterference (RNI) are introduced, formalising secure information flow. Both RNI properties are clock-sensitive (events are observed with their clock-stamp, i.e. the instant in which they are produced) and termination-insensitive.?Coarse-grained RNI is more abstract than fine-grained RNI in that it ignores the order of generation of events and repeated emissions of the same event within an instant.
?
We present a type system guaranteeing both security properties. Thanks to some design choices of CRL and to specific typing rules for conditionals, this type system allows for a precise treatment of termination leaks, which are an issue in parallel languages.
?
Finally, we try to draw some analogies between the behaviour of synchronous programs within instants and that of pi-calculus processes within sessions.

Martin Sulzmann: Constructive Trace Validation with Regular Program Properties

We consider the problem of verifying if a program trace is valid with
respect to a regular program specification, e.g. expressed in terms of
regular expressions or linear temporal logic formulas. Existing
methods only provide yes/no answers. Such answers are unsatisfactory
and not helpful to precisely track down the source of a failure. We
introduce a constructive method which provides detailed explanations about the
outcome of trace validation in a form comprehensible for the user. For
example, we obtain information which parts of the specification have
been exercised in case of success and which parts have been violated
in case of failure. The approach has been fully implemented and is
applied in some real-world projects for testing of synchronously
executed software components.

Luca Padovani: Types and Effects for Deadlock-Free Higher-Order Concurrent Programs

Deadlock freedom is for concurrent programs what progress is for sequential ones: it indicates the absence of stable (i.e., irreducible) states in which some pending operations cannot be completed. In the particular case of communicating processes, operations are inputs and outputs on channels and deadlocks may be caused by mutual dependencies between communications. In this talk we see how to define an effect system ensuring deadlock freedom of higher-order programs and discuss some of its properties.

Naoki Kobayashi: From Behavioral Types to Higher-Order Model Checking

The talk covers three topics related (in my opinion) to 
the seminar: behavioral types, resource usage verification (or typestate
checking), and higher-order model checking, and discuss their relationship.
First, I review our earlier work on behavioral types, and
explain how they can be used for analysis of concurrent programs 
and resource usage verification (or, typestate checking) of functional programs.
I will then explain how that line of work has evolved to our more
recent work on resource usage verification based on higher-order 
model checking.