23
Maude Implementation of MSR Demo Mark-Oliver Stehr Stefan Reich University of Illinois, Urbana-Champaign (Iliano Cervesato) ITT Industries @ NRL http://theory.stanford.edu/~iliano/ Protocol eXchange - UMBC September 21, 2004 Customer Analyst Programmer Cast

Maude Implementation of MSR Demo Mark-Oliver Stehr Stefan Reich University of Illinois, Urbana-Champaign (Iliano Cervesato) ITT Industries @ NRL iliano

  • View
    222

  • Download
    1

Embed Size (px)

Citation preview

Page 1: Maude Implementation of MSR Demo Mark-Oliver Stehr Stefan Reich University of Illinois, Urbana-Champaign (Iliano Cervesato) ITT Industries @ NRL iliano

Maude Implementation of MSR

Demo

Mark-Oliver StehrStefan ReichUniversity of Illinois,Urbana-Champaign

(Iliano Cervesato)ITT Industries @ NRLhttp://theory.stanford.edu/~iliano/

Protocol eXchange - UMBC September 21, 2004

Customer

Analyst

Programmer

Cast

Page 2: Maude Implementation of MSR Demo Mark-Oliver Stehr Stefan Reich University of Illinois, Urbana-Champaign (Iliano Cervesato) ITT Industries @ NRL iliano

MSR in Maude 2/22

What thecustomerexplained

What theproject

managerunderstood

What theanalyst

designed

What theprogrammer

delivered

What theconsultant

defined

What wasdocumented

What wasinstalled

What theclient wascharged

How it wasmaintained

What theclient

needed

From http://muetze.net/links/fun/kundenprojekte-e.html

Page 3: Maude Implementation of MSR Demo Mark-Oliver Stehr Stefan Reich University of Illinois, Urbana-Champaign (Iliano Cervesato) ITT Industries @ NRL iliano

MSR in Maude 3/22

Big Picture

MSR Protocol specification

language Multiset rewriting Dependent types Existentials

Maude Flexible specification

framework Rewriting logic Equational reasoning Reflection

MSR MaudeProtocol specs.

Security goals

Page 4: Maude Implementation of MSR Demo Mark-Oliver Stehr Stefan Reich University of Illinois, Urbana-Champaign (Iliano Cervesato) ITT Industries @ NRL iliano

MSR in Maude 4/22

Implemented Architecture

MSR

MaudeMSR-

OCC

RWLDT

OCC

prototypeThis

work

SecurityGoal

Simulation - Execution

Analysis - Search engine - Model checker - Theorem provers

Parsing

Type checking

DAS?

Analysis

Page 5: Maude Implementation of MSR Demo Mark-Oliver Stehr Stefan Reich University of Illinois, Urbana-Champaign (Iliano Cervesato) ITT Industries @ NRL iliano

MSR in Maude 5/22

Bestiary

MSR- MSR (2) with some restrictions

RWLDTRewriting Logic with Dependent TypesTyped version of Maude

OCCOpen Calculus of ConstructionsMark-Oliver’s thesis (589 pages)Prototype implemented in Maude

Page 6: Maude Implementation of MSR Demo Mark-Oliver Stehr Stefan Reich University of Illinois, Urbana-Champaign (Iliano Cervesato) ITT Industries @ NRL iliano

MSR in Maude 6/22

Advantages over MSR Maude

Separation of concernsMSR -> RWLDT

Preserves terms and types Maps operations

RWLDT: takes care of type checkingMaude: untyped execution

AbstractionMSR and RWLDT have similar types and termsEmulate MSR execution in RWLDTShallow encoding

ReasoningExpress verification tasks in OCC [future work]

Page 7: Maude Implementation of MSR Demo Mark-Oliver Stehr Stefan Reich University of Illinois, Urbana-Champaign (Iliano Cervesato) ITT Industries @ NRL iliano

MSR in Maude 7/22

MSR MSR-

Small changes to simplify encoding

Work-aroundsSubtyping

Coercions

OmissionsData Access Specification

AdditionsEquations

Emulated viapre-processing

Future work

Beta version

Page 8: Maude Implementation of MSR Demo Mark-Oliver Stehr Stefan Reich University of Illinois, Urbana-Champaign (Iliano Cervesato) ITT Industries @ NRL iliano

MSR in Maude 8/22

Supported Operations

Parsing for MSR-Minor limitations (currently worked on)

Type reconstructionRule-level missing (currently worked on)

Type checking Simulation

Indirect via OCC (currently worked on)search [n] (goal)rew [n] (goal)choose n

Page 9: Maude Implementation of MSR Demo Mark-Oliver Stehr Stefan Reich University of Illinois, Urbana-Champaign (Iliano Cervesato) ITT Industries @ NRL iliano

MSR in Maude 9/22

Example: Otway-Rees Protocol

A, B, C, … have keys to S A and B want to talk Use S to get common key

Key distributionAuthentication

1. A -> B: n A B {nA n A B}KAS

2. B -> S: n A B {nA n A B}KAS {nB n A B}KBS

3. S -> B: n {nA kAB}KAS {nB kAB}KBS

4. B -> A: n {nA kAB}KAS

A B

C

S

Page 10: Maude Implementation of MSR Demo Mark-Oliver Stehr Stefan Reich University of Illinois, Urbana-Champaign (Iliano Cervesato) ITT Industries @ NRL iliano

MSR in Maude 10/22

TypesSubsorting

Constructors

Predicates Roles for

SA, B

Principalsand keys

msg, princ, nonce: type.

shK, stK, ltK: princ -> princ -> type.

princ, nonce, stK A B <: msg.

stK A B, ltK A B <: shK A B.

_ _: msg -> msg -> msg.

{_}_: msg -> shK A B -> msg.S : princ.

N: msg -> state.

...

Next slide

1. A -> B: n A B {nA n A B}KAS

2. B -> S: n A B {nA n A B}KAS {nB n A B}KBS

3. S -> B: n {nA kAB}KAS {nB kAB}KBS

4. B -> A: n {nA kAB}KAS

MSR Spec.

Page 11: Maude Implementation of MSR Demo Mark-Oliver Stehr Stefan Reich University of Illinois, Urbana-Champaign (Iliano Cervesato) ITT Industries @ NRL iliano

MSR in Maude 11/22

B:princ.L:B:princ. nonce * nonce * ltK B S -> state.

1. A -> B: n A B X

2. B -> S: n A B X {nB n A B}KBS

3. S -> B: n Y {nB kAB}KBS

4. B -> A: n Y

A:princ. n:nonce. kBS:ltK B S. X:msg.

N(n A B X) nB:nonce.N(n A B X {nb n A

B}kBS),L(A, B, n, nB, kBS)A:princ. n, nB:nonce. kBS:ltK B S.

Y:msg. kAB:stK A B.

N (n Y {nB kAB}kBS),L(A, B, n, nB, kBS) N (n Y)

B’s Role

Page 12: Maude Implementation of MSR Demo Mark-Oliver Stehr Stefan Reich University of Illinois, Urbana-Champaign (Iliano Cervesato) ITT Industries @ NRL iliano

MSR in Maude 12/22

Main Features of MSR

Open signatures Multiset rewriting

Msets of F.O. formulas Rules

(LHS n:. RHS) Existentials

RolesA. L:. r

Types Possibly dependent Subsorting Type reconstruction

More Constraints Modules Equations

Static checks Type checking Data access spec.

Execution

Black = implementedBrown = work-aroundRed = future work

Page 13: Maude Implementation of MSR Demo Mark-Oliver Stehr Stefan Reich University of Illinois, Urbana-Champaign (Iliano Cervesato) ITT Industries @ NRL iliano

MSR in Maude 13/22

Rewriting Logic with Dep. Types

Combination of methodologies Conditional rewriting modulo equations

x:S. A = B if C (generalizes equational logic) x:S. A => B if C (generalizes rewriting logic)

Dependent type theory x:S. M : x:S T(generalizes simple types)

Fragment of Open Calculus of Constructions

Features Open computation system Proposition-as-types interpretation

x:S. P(x) interpreted as x:S. P(x)– Expressive higher-order logic

Model-theoretic semantics

Page 14: Maude Implementation of MSR Demo Mark-Oliver Stehr Stefan Reich University of Illinois, Urbana-Champaign (Iliano Cervesato) ITT Industries @ NRL iliano

MSR in Maude 14/22

Example: Commutative Monoid

state: Type.

empty: state.

union: state -> state -> state.

state_comm: || {s1,s2 : state}(union s1 s2) = (union s2 s1).

state_assoc: || {s1,s2,s3 : state}(union s1 (union s2 s3)) = (union s1 (union s2 s3)).

state_id: || {s : state}(union s empty) = s.

This implements MSR’s state

s:state. …

Structuralequality

Page 15: Maude Implementation of MSR Demo Mark-Oliver Stehr Stefan Reich University of Illinois, Urbana-Champaign (Iliano Cervesato) ITT Industries @ NRL iliano

MSR in Maude 15/22

Encoding Strategy

Types and terms Homomorphic mapping

Subsorting via coercions

States RWLDT terms

Roles Add 1 RWLDT rewrite axiom for role instantiation Simulate using counters

Rules Mapped to RWLDT rewrite axioms

Simulate using counters

Optimizations [not implemented] Reduce non-determinism

Page 16: Maude Implementation of MSR Demo Mark-Oliver Stehr Stefan Reich University of Illinois, Urbana-Champaign (Iliano Cervesato) ITT Industries @ NRL iliano

MSR in Maude 16/22

Representing Fresh Objects

In rules

nonce : nat -> nonce is an injection In roles

Li : nat -> i -> state are injections

L1,L2. (... (…, L1 t ..., L2 t’), ...)

nextL(c) ..., Tj(t. L1 c t, t. L2 (c+1) t), ..., nextL(c+2)

Tj(L1,L2), ..., L1 t ..., L2 t’ ...

(…) n,n’:nonce. (... n ... n’ …)

(…), next(c) (... nonce(c) ... nonce(c+1) …), next(c+2)

Rule j

(don

e u

sing

con

ditio

nal re

writin

g)

Page 17: Maude Implementation of MSR Demo Mark-Oliver Stehr Stefan Reich University of Illinois, Urbana-Champaign (Iliano Cervesato) ITT Industries @ NRL iliano

MSR in Maude 17/22

Representing Roles

Enhancement Force rule application upon activation

princ(A), nextL(c), lhsi T1(A,Ls), ..., rhsi ..., Tn(A,Ls), princ(A), nextL(c’)

Ti(A,Ls), lhsi rhsi

A:princ. Ls. (lhs1rhs1, …, lhsnrhsn)

princ(A), nextL(c) T1(A,Ls), ..., Tn(A,Ls), princ(A), nextL(c’)

T1(A,Ls), lhs1 rhs1

...

Tn(A,Ls), lhsn rhsn

Page 18: Maude Implementation of MSR Demo Mark-Oliver Stehr Stefan Reich University of Illinois, Urbana-Champaign (Iliano Cervesato) ITT Industries @ NRL iliano

MSR in Maude 18/22

Representing Rules

Handles x’s occurring only in rhsAllows encoding to untyped rewrite systemsTypes must be finite and enumerated in

state

EnhancementLimit to x’s occurring only on rhs

x:. lhs rhs

(x), ..., …, lhs (x), ..., rhs

Page 19: Maude Implementation of MSR Demo Mark-Oliver Stehr Stefan Reich University of Illinois, Urbana-Champaign (Iliano Cervesato) ITT Industries @ NRL iliano

MSR in Maude 19/22

Optimizations [not implemented]

Use single counterA. L. (lhs n. rhs)

Minimal control-flow analysisTrace uses of L’sDo not generate unreachable rules

T’s often duplicates L’s

Substantial code reductionCould be further improved

Page 20: Maude Implementation of MSR Demo Mark-Oliver Stehr Stefan Reich University of Illinois, Urbana-Champaign (Iliano Cervesato) ITT Industries @ NRL iliano

MSR in Maude 20/22

Trivia Versions

Alpha (this) Partial reconstruction Non-integrated search (exit MSR; call OCC) No equations Not-so-pretty-printing

Beta (mid-October – already working, mostly) Space and Time

3,700 lines of Maude (1,300 for testing) 6 months designing, 3 months coding

Examples Otway-Rees Needham-Schroeder PK Kerberos (abstract, full, cross-realm – soon) … more soon …

Page 21: Maude Implementation of MSR Demo Mark-Oliver Stehr Stefan Reich University of Illinois, Urbana-Champaign (Iliano Cervesato) ITT Industries @ NRL iliano

MSR in Maude 21/22

Wanna Play?

DownloadCurrently alpha-releaseSoon beta-release

Papers News

http://formal.cs.uiuc.edu/stehr/msr.html

http://theory.stanford.edu/~iliano/MSR/

Page 22: Maude Implementation of MSR Demo Mark-Oliver Stehr Stefan Reich University of Illinois, Urbana-Champaign (Iliano Cervesato) ITT Industries @ NRL iliano

MSR in Maude 22/22

Future Work

Short-termComplete beta-releasedGet degree (Stefan)

Medium term – languageLibrary of protocolsData Access SpecificationMSR 3

Embedded rules and more

Medium/long-term – Verification Implement various methodologiesMSR as verification middleware

Page 23: Maude Implementation of MSR Demo Mark-Oliver Stehr Stefan Reich University of Illinois, Urbana-Champaign (Iliano Cervesato) ITT Industries @ NRL iliano

MSR in Maude 23/22

Demo Time!!!