Model Driven Security: Foundations, Tools, and Practice

Similar documents
Formal Reasoning about Fine-Grained Access Control Policies

Appendix... B. The Object Constraint

Home Assignment 4 OCL

Model-Driven Development of Security-Aware GUIs for Data-Centric Applications

A Model-Driven Methodology for Developing Secure Data-Management Applications

Rigorous Software Engineering Hoare Logic and Design by Contracts

Analyzing First-order Role Based Access Control

Design by Contract beyond class modelling

TECHNICAL UNIVERSITY OF CRETE DATA STRUCTURES FILE STRUCTURES

Validation of a security metamodel for development of cloud applications

Scalable Automated Symbolic Analysis of Administrative Role-Based Access Control Policies by SMT solving

Regression Verification: Status Report

Case studies: Outline. Requirement Engineering. Case Study: Automated Banking System. UML and Case Studies ITNP090 - Object Oriented Software Design

Jairson Vitorino. PhD Thesis, CIn-UFPE February Supervisor: Prof. Jacques Robin. Ontologies Reasoning Components Agents Simulations

Rigorous Software Development CSCI-GA

Execution of A Requirement Model in Software Development

Rigorous Software Development CSCI-GA

Software Specification and Testing

Introduction to Programming (in C++) Loops. Jordi Cortadella, Ricard Gavaldà, Fernando Orejas Dept. of Computer Science, UPC

Example. Introduction to Programming (in C++) Loops. The while statement. Write the numbers 1 N. Assume the following specification:

Model-Based Formal Reasoning about Data-Management Applications

Automated Program Behavior Analysis

Etudes de cas en OCL avec l outil USE 2

Model Checking: An Introduction

Practice Questions. CS161 Computer Security, Fall 2008

Software Engineering Techniques

Analyzing and Managing Role-Based Access Control Policies

Language-Independent Model Transformation Verification K. Lano, S. Kolahdouz-Rahimi, T. Clark King s College London; University of Middlesex

Cassandra. References:

UML TUTORIALS THE USE CASE MODEL

Moving from CS 61A Scheme to CS 61B Java

Lecture Notes on Linear Search

Introducing Formal Methods. Software Engineering and Formal Methods

Verifying Dynamic Aspects of UML Models

Deseo Meeting Scheduler: Towards Automated Verification of Database Integrity Constraints

Introduction to formal semantics -

Towards a Common Metamodel for the Development of Web Applications

Optimizing Database-Backed Applications with Query Synthesis

On translating UML models into graph transformation systems $

Software Component Specification Using Design by Contract

Meta Model Based Integration of Role-Based and Discretionary Access Control Using Path Expressions

Software Testing Modeling Tools

HECTOR a software model checker with cooperating analysis plugins. Nathaniel Charlton and Michael Huth Imperial College London

Formally speaking: How to apply OCL

Chair of Software Engineering. Software Verification. Assertion Inference. Carlo A. Furia

Instant SQL Programming

From Object Oriented Conceptual Modeling to Automated Programming in Java

A UML 2 Profile for Business Process Modelling *

On the Modeling and Verification of Security-Aware and Process-Aware Information Systems

How To Write A Test Engine For A Microsoft Microsoft Web Browser (Php) For A Web Browser For A Non-Procedural Reason)

The Relational Model. Ramakrishnan&Gehrke, Chapter 3 CS4320 1

From Access Control Policies to an Aspect-based Infrastructure: A Metamodel-based Approach

Monitoring Metric First-order Temporal Properties

Structure of Presentation. Stages in Teaching Formal Methods. Motivation (1) Motivation (2) The Scope of Formal Methods (1)

µz An Efficient Engine for Fixed points with Constraints

The CLIPS environment. The CLIPS programming language. CLIPS production rules language - facts. Notes

SQL Server 2008 Core Skills. Gary Young 2011

A Comparison of Database Query Languages: SQL, SPARQL, CQL, DMX

BUSINESS RULES MANIPULATION MODEL 1

Sources: On the Web: Slides will be available on:

Specification and Analysis of Contracts Lecture 1 Introduction

In This Lecture. Security and Integrity. Database Security. DBMS Security Support. Privileges in SQL. Permissions and Privilege.

Simple Loop Patterns and Rich Loop Invariants

WESTMORELAND COUNTY PUBLIC SCHOOLS Integrated Instructional Pacing Guide and Checklist Computer Math

1 A New Look at Formal Methods for Software Construction

Constructing Contracts: Making Discrete Mathematics Relevant to Beginning Programmers

SDMX technical standards Data validation and other major enhancements

Towards Automatic Discovery of Deviations in Binary Implementations with Applications to Error Detection and Fingerprint Generation

MDA and Analysis of Web Applications

The Clean programming language. Group 25, Jingui Li, Daren Tuzi

DEFINING CONTRACTS WITH DIFFERENT TOOLS IN SOFTWARE DEVELOPMENT

CIS 544 Advanced Software Design and Development. Project Management System. Oreoluwa Alebiosu

Data Modeling. Database Systems: The Complete Book Ch ,

Informatica e Sistemi in Tempo Reale

An Integrated Data Model Verifier with Property Templates

SQL - QUICK GUIDE. Allows users to access data in relational database management systems.

Department of Computer Science, Institute for Software and Multimedia Technology OCL. by Example

Semester Review. CSC 301, Fall 2015

CSC 742 Database Management Systems

The design recipe. Programs as communication. Some goals for software design. Readings: HtDP, sections 1-5

Relational Databases

Algorithms are the threads that tie together most of the subfields of computer science.

Monitoring Database Access Constraints with an RBAC Metamodel: a Feasibility Study

Schema Mappings and Data Exchange

Runtime Verification of Computer Programs and its Application in Programming Education

Introduction to IR Systems: Supporting Boolean Text Search. Information Retrieval. IR vs. DBMS. Chapter 27, Part A

Incremental Analysis of Evolving Administrative Role Based Access Control Policies

Software Testing. Quality & Testing. Software Testing

Institut für Parallele und Verteilte Systeme. Abteilung Anwendersoftware. Universität Stuttgart Universitätsstraße 38 D Stuttgart

Organization of DSLE part. Overview of DSLE. Model driven software engineering. Engineering. Tooling. Topics:

Automatic Composition of Web Services

ENTRA. Common Assertion Language

A Classification of Model Checking-based Verification Approaches for Software Models

StaRVOOrS: A Tool for Combined Static and Runtime Verification of Java

Design by Contract for Web Services: Architecture, Guidelines, and Mappings

Mapping between Levels in the Metamodel Architecture

Ontologies for Enterprise Integration

Chapter 4: Design Principles I: Correctness and Robustness

Thomas Jefferson High School for Science and Technology Program of Studies Foundations of Computer Science. Unit of Study / Textbook Correlation

Foundations of Query Languages

Transcription:

Model Driven Security: Foundations, Tools, and Practice David Basin, Manuel Clavel, and ETH Zurich, IMDEA Software Institute Thursday 1st, 2011

Outline I 1 Models Analysis. Types. 2 The Object Constraint Language (OCL) 3 Metamodel-Based Analysis From concrete to abstract syntax Type I: Questions about your security policy per se Semantic correspondence Type II: Questions about your security policy applied to a concrete scenario Type III: Questions about your security policy applied to scenarios in general 4 Mapping OCL expressions to FOL 5 Type III. Exercise.

Questions that you may want to ask about your security-design models Questions about your security policy 1 per se : e.g., are supervisors allowed to delete meetings? under which general conditions (i.e., authorization constraints)? 2 but applied to a concrete snapshot of the system: e.g., can Bob delete the kick-off meeting of the NESSoS project? 3 but applied to scenarios in general: e.g., can a scenario exist in which a supervisor is allowed to delete a meeting that he/she does not own?

Questions that you may want to ask about your security-design models applied to scenarios in general Your question is whether there exists a scenario in which the authorization constraints for the given role to perform the given action (e.g., the caller being the owner of the meeting to be deleted) hold AND the invariants of your system hold AND your additional contraints (e.g.., the caller not being the owner of the meeting to be deleted) also hold. And many other questions, of course. But, for the type of the above questions, we have a way of getting the answers.

Method for getting the answers to questions about your security-design models of Type I. Type I. Questions about your security policy per se : e.g., are supervisors allowed to delete meetings? Step 1 Formalize your question as an OCL query, using the language provided by the SecureUML+ComponentUML metamodel. This step is manual, but you can use our library of predefined queries in OCL about security-design models. Step 2 Evaluate your OCL query on the instance of the SecureUML+ComponentUML metamodel corresponding to your security-design model. This step is automatic.

Method for getting the answers to questions about your security-design models of Type II. Type II. Questions about your security policy, but applied to a concrete scenario: e.g., can Bob delete the kick-off meeting of the NESSoS project? Step 1 For each of the roles assigned to the given user in the given scenario, query your security policy about the conditions for users in that role to be allowed to perform the given action. This step is manual, and follows the same metamodel-based technique explained before. Step 2 Evaluate the conditions obtained on the given scenario. This step is automatic.

Method for getting the answers to questions about your security-design models of Type III. Type III. Questions about your security policy, but applied to scenarios in general: e.g., can a scenario exist in which a supervisor is allowed to delete a meeting that he/she does not own? Step 1 Query your security policy about the conditions for users in the given role to be allowed to perform the given action. This step is manual, and follows the same metamodel-based technique explained before. Step 2 Formalize in OCL your additional contraints. Step 3 Translate into first-order logic the obtained conditions, your additional constraints, and the invariants of your system. This step is automatic. Step 4 Use standard first-order theorem-prover techniques to solve the problem; SMT solvers may give you the solution automatically.

Outline I 1 Models Analysis. Types. 2 The Object Constraint Language (OCL) 3 Metamodel-Based Analysis From concrete to abstract syntax Type I: Questions about your security policy per se Semantic correspondence Type II: Questions about your security policy applied to a concrete scenario Type III: Questions about your security policy applied to scenarios in general 4 Mapping OCL expressions to FOL 5 Type III. Exercise.

The Object Constraint Language (OCL) OCL was used to specify constraints on OO systems models. Used to specify class invariants, pre- and post-conditions for methods, as a navigation language, as a query language, etc.. Textual modeling language. Adds precision to imprecise models. Used as a query language for model analysis. Standardized. Supported by IBM, Microsoft, Oracle, etc..

OCL OCL is a formal specification language that is implementable. Supports object concepts and has an intuitive syntax. Not a programming language: no control flow, no-side effects. Useful at the software design and analysis stages, for the V&V of systems. Tool support: evaluators (MDT-OCL, EOS, Borland), compilers (MySQL4OCL), interactive provers (HOL-OCL), SMT solvers (OCLSat4Yices), etc..

OCL Examples 1 Employee.allInstances()->size() 2 context Employee inv: self.supervisor->size() <= 1 3 Employee.allInstances().name->includes( John ) 4 Employee.allInstances().name->asSequence()->indexOf( John ) 5 Employee().allInstances()->forAll(e e.salary > 800)

OCL Type system OCL is a strongly typed language. Basic types: String, Integer, Boolean, and Real. Class types: Employee etc.. Collection types: Bag(Integer) = Bag{1,2,4,2,3,4,4}, Bag(Employee) = Bag{e1,e2,e2,e4}, Sequence(Integer) = Sequence{1,2,4,2,3,4,4}.

Types of OCL operations Operations on basic types: concat, substring, not, implies, +, -, abs(), floor(),... Class operations: Employee.allInstances() Collection operations: Bag{1,2,4,2,3,4,4}->count(2), Sequence{1,2,4,2,3,4,4}->at(3) Iterator operations: Employee.allInstances()->select(e e.salary > 1000), Employee.allInstances()->forall(e, e e<>e implies e.bankaccount <> e.bankaccount)

Frequently used collection operations Collection operations: <src-exp>->nameop(<exp>) boolean operations: excludesall/includesall, isempty/notempty, excludes/includes, =, <>,... numeric operations: count, size, sum,... operations over collections: including, excluding, union,... Iterator operations: <src-exp>->nameiterop(v <body>) boolean body: any, exists, forall, reject/select any type body: collect

Outline I 1 Models Analysis. Types. 2 The Object Constraint Language (OCL) 3 Metamodel-Based Analysis From concrete to abstract syntax Type I: Questions about your security policy per se Semantic correspondence Type II: Questions about your security policy applied to a concrete scenario Type III: Questions about your security policy applied to scenarios in general 4 Mapping OCL expressions to FOL 5 Type III. Exercise.

Outline I 1 Models Analysis. Types. 2 The Object Constraint Language (OCL) 3 Metamodel-Based Analysis From concrete to abstract syntax Type I: Questions about your security policy per se Semantic correspondence Type II: Questions about your security policy applied to a concrete scenario Type III: Questions about your security policy applied to scenarios in general 4 Mapping OCL expressions to FOL 5 Type III. Exercise.

Metamodel. Conformance. A metamodel is a model composed of metadata whose elements formalize concepts and relations that define a modeling language. A model has conformance to a metamodel when it is written using the concepts and relations provided by the metamodel and it fulfill metamodel s constraints (if any). E.g. Meeting is a model that has conformance to the ComponentUML metamodel. E.g. SecureMeeting is a model that has conformance to the SecureUML+ComponentUML metamodel.

Example: Security Policy on the entity Meeting (CS) caller = self.owner.name «Role» SystemUser «Role» Supervisor «Role» SystemAdministrator «Permission» OwnerMeeting «entityaction» Meeting:update «entityaction» Meeting:delete «Permission» UserMeeting «entityaction» Meeting:create «entityaction» Meeting:read «Permission» SupervisorCancel «methodaction» Meeting.cancel: execute «methodaction» Meeting.notify: execute «Permission» ReadMeeting «entityaction» Meeting: read «Entity» Meeting start: Date duration: Time notify() cancel() * * +participants 2..* 1 +owner «Entity» Person name: String «Permission» UserManagement «entityaction» Person:fullaccess

SecureUML+ComponentUML metamodel

Meeting: Concrete to Abstract Syntax A model defined in concrete syntax can be map to abstract syntax as an instance of its metamodel.

Example: SecureMeeting Abstract Syntax

Example: Meeting-Scheduler security policy caller = self.owner.name «Role» SystemUser «Role» Supervisor «Role» SystemAdministrator «Permission» OwnerMeeting «entityaction» Meeting:update «entityaction» Meeting:delete «Permission» UserMeeting «entityaction» Meeting:create «entityaction» Meeting:read «Permission» SupervisorCancel «methodaction» Meeting.cancel: execute «methodaction» Meeting.notify: execute «Permission» ReadMeeting «entityaction» Meeting: read «Entity» Meeting start: Date duration: Time notify() cancel() * * +participants 2..* 1 +owner «Entity» Person name: String «Permission» UserManagement «entityaction» Person:fullaccess

Outline I 1 Models Analysis. Types. 2 The Object Constraint Language (OCL) 3 Metamodel-Based Analysis From concrete to abstract syntax Type I: Questions about your security policy per se Semantic correspondence Type II: Questions about your security policy applied to a concrete scenario Type III: Questions about your security policy applied to scenarios in general 4 Mapping OCL expressions to FOL 5 Type III. Exercise.

Type I: Questions about your security policy per se Are there a role SystemAdministrator? Has the role Supervisor the permission UserMeeting associated? Which are the actions associated to the permission UserMeeting? Is there a permission granting access to delete meetings? Can Users edit meeting information?

Method for getting the answers to questions about your security-design models of Type I. Type I. Questions about your security policy per se : e.g., are supervisors allowed to delete meetings? Step 1 Formalize your question as an OCL query, upon the SecureUML+ComponentUML metamodel (step manual, predefined library). Step 2 Evaluate your OCL query on the instance of the SecureUML+ComponentUML metamodel corresponding to your security-design model (automatic).

OCL queries to analyze security design models Which are the superroles of the System Administrator?, and of the Supervisor? It is not enough to run the query Supervisor.superrole to obtain the roles above a given role? context Role::superrolePlus():Set(Role) body: self.superroleplusonset(self.superrole) context Role::superrolePlusOnSet(rs:Set(Role)):Set(Role) body: if rs.superrole)->exists(r rs->excludes(r)) then self.superroleplusonset(rs ->union(rs.superrole)->asset()) else rs->including(self) endif

OCL queries to analyze security design models Which are the permissions of the role Supervisor? It is not sufficient to run the query Supervisor.hasPermission since permissions are inherited along the role hierarchy. Supervisor.hasPermission > {SupervisorCancel} context Role::allPermissions():Set(Permission) body: self.superroleplus().haspermission->asset() Supervisor.allPermissions() > {SupervisorCancel, UserMeeting, OwnerMeeting}

OCL queries to analyze security design models subactionplus() returns the collection of actions (directly or indirectly) subordinated to an action. context Action::subactionPlus():Set(Action) body: if self.ocliskindof(atomicaction) then Set{self} else self.oclastype(compositeaction).subordinatedactions.subactionplus() endif context Permission::allActions():Set(Action) body: self.accesses.subactionplus()->asset() context User::allAllowedActions():Set(Action) body: self.hasrole.allpermissions().allactions()->asset()

OCL queries to analyze security design models Supervisor.hasPermission.accesses > {Meeting:cancel:execute, Meeting:notify:execute} Supervisor.allPermissions().accesses > {Meeting:create, Meeting:delete, Meeting:read, Meeting:update, Meeting:cancel:execute, Meeting:notify:execute }

Queries to analyze the security policy Do two permissions overlap? SystemUser, SystemAdministrator and Supervisor can read meeting information. They have overlapping permissions. context Permission::overlapsWith(p:Permission):Boolean body: self.allactions()->intersection(p.allactions())->notempty() Are there overlapping permissions for different roles? SystemAdministrator and Supervisor, SystemUser and SystemAdministrator. context Permission::existOverlapping():Boolean body: Permission.allInstances()->exists(p1,p2 p1 <> p2 and p1.overlapswith(p2) and not(p1.allroles()->includesall(p2.allroles())))

Outline I 1 Models Analysis. Types. 2 The Object Constraint Language (OCL) 3 Metamodel-Based Analysis From concrete to abstract syntax Type I: Questions about your security policy per se Semantic correspondence Type II: Questions about your security policy applied to a concrete scenario Type III: Questions about your security policy applied to scenarios in general 4 Mapping OCL expressions to FOL 5 Type III. Exercise.

Semantic correspondence Let I RBAC be the Σ RBAC structure defined by a model M. u Users, p Permissions, and a Actions is satisfied in I RBAC UA(u, r) PA(r, p) AA(p, a) evaluates to true over M u.hasrole->includes(r) r.haspermission->includes(p) p.accesses->includes(a)

Semantic correspondence is satisfied in I RBAC evaluates to true in M r 1 Roles r 2 r 2.superrolePlus()->includes(r 1 ) r 1.subrolePlus()->includes(r 2 ) r 2 Roles. r 1.allPermissions()->includes(p) r 2 Roles r 1 PA(r 2, p) p.allroles()->includes(r 1 ) a 1 Actions a 2 a 1.subactionPlus()->includes(a 2 ) a 2.compactionPlus()->includes(a 1 ) a 2 Actions. p.allactions->includes(a 1 ) a 2 Actions a 1 AA(p, a 2 ) a 1.allAssignedPermisssions() ->includes(p) φ RBAC (u, a) u.allallowedactions()->includes(a)

Semantic correspondence φ RBAC (u, a): has the user u a permission to perform the action a? φ RBAC (u, a) = r 1, r 2 Roles. p Permissions. a Actions. UA(u, r 1 ) r 1 Roles r 2 PA(r 2, p) AA(p, a ) a Actions a.

Example: Queries on Meeting-Scheduler security policy Are there any users with the role Administrator? User.allInstances()->exists(u u.hasrole.superroleplus()->include( Administrator )) Has the role Supervisor granted the permission UserMeeting? Supervisor.allPermissions()->includes(UserMeeting) Is the permission UserMeeting granting access to execute the action Meeting:Create? UserMeeting.allActions()->includes(Meeting:Create) Is there a permission granting access to delete meetings? Permission.allInstances().accesses->includes(Meeting:Delete)

Outline I 1 Models Analysis. Types. 2 The Object Constraint Language (OCL) 3 Metamodel-Based Analysis From concrete to abstract syntax Type I: Questions about your security policy per se Semantic correspondence Type II: Questions about your security policy applied to a concrete scenario Type III: Questions about your security policy applied to scenarios in general 4 Mapping OCL expressions to FOL 5 Type III. Exercise.

Method for getting the answers to questions about your security-design models of Type II. Type II. Questions about your security policy, but applied to a concrete scenario: e.g., can Bob delete the kick-off meeting of the NESSoS project? Step 1 For each of the roles assigned to the given user in the scenario, query your security policy about the conditions for users in that role to be allowed to perform the ( abstract version of) given action. (manual, and follows the same technique explained before). Step 2 Evaluate the conditions obtained on the given scenario (automatic).

Example: Meeting-Scheduler security policy scenario «Role» SystemUser «Role» Supervisor Bob: Person name = Bob Alice: Person name = Alice participant owner participant Kick-Off: Meeting start =... duration =...

Queries to get the conditions Which is the collection of actions that are permitted for a given user? context User::allAllowedActions():Set(Action) body: self.hasrole.allpermissions().allactions()->asset() Given a user and an action, which authorization constraints must be satisfied for the user to perform this action? context User::allAuthConstUser(a:Action):Set(AuthConstraint) body: self.hasrole.superroleplus().allauthconstrole(a) context Role::allAuthConstRole(a:Action):Set(AuthConstraint) body: self.permissionplus(a).isconstraintby

Queries to analyze the security policy scenario Can Bob cancel a meeting? Bob.allAllowedActions()->includes(Meeting:cancel:execute) > false. Can Alice cancel a meeting? Alice.allAllowedActions()->includes(Meeting:cancel:execute) > true. Can Bob update a meeting? Under which constraints? Bob.allAllowedActions()->includes(Meeting:update:execute) > true. Bob.hasRole.allAuthConstRole(Meeting:update:execute) > caller = self.owner Are there a users in the system allowed to create new meetings? Users.allInstances()->exists(u u.allallowedactions()->includes(meeting:create)) > true

Queries to analyze the security policy scenario Can Bob cancel a meeting? Bob.allAllowedActions()->includes(Meeting:cancel:execute) > false. Can Alice cancel a meeting? Alice.allAllowedActions()->includes(Meeting:cancel:execute) > true. Can Bob update a meeting? Under which constraints? Bob.allAllowedActions()->includes(Meeting:update:execute) > true. Bob.hasRole.allAuthConstRole(Meeting:update:execute) > caller = self.owner Are there a users in the system allowed to create new meetings? Users.allInstances()->exists(u u.allallowedactions()->includes(meeting:create)) > true

Queries to analyze the security policy scenario Can Bob cancel a meeting? Bob.allAllowedActions()->includes(Meeting:cancel:execute) > false. Can Alice cancel a meeting? Alice.allAllowedActions()->includes(Meeting:cancel:execute) > true. Can Bob update a meeting? Under which constraints? Bob.allAllowedActions()->includes(Meeting:update:execute) > true. Bob.hasRole.allAuthConstRole(Meeting:update:execute) > caller = self.owner Are there a users in the system allowed to create new meetings? Users.allInstances()->exists(u u.allallowedactions()->includes(meeting:create)) > true

Queries to analyze the security policy scenario Can Bob cancel a meeting? Bob.allAllowedActions()->includes(Meeting:cancel:execute) > false. Can Alice cancel a meeting? Alice.allAllowedActions()->includes(Meeting:cancel:execute) > true. Can Bob update a meeting? Under which constraints? Bob.allAllowedActions()->includes(Meeting:update:execute) > true. Bob.hasRole.allAuthConstRole(Meeting:update:execute) > caller = self.owner Are there a users in the system allowed to create new meetings? Users.allInstances()->exists(u u.allallowedactions()->includes(meeting:create)) > true

Queries to analyze the security policy scenario Can Bob cancel a meeting? Bob.allAllowedActions()->includes(Meeting:cancel:execute) > false. Can Alice cancel a meeting? Alice.allAllowedActions()->includes(Meeting:cancel:execute) > true. Can Bob update a meeting? Under which constraints? Bob.allAllowedActions()->includes(Meeting:update:execute) > true. Bob.hasRole.allAuthConstRole(Meeting:update:execute) > caller = self.owner Are there a users in the system allowed to create new meetings? Users.allInstances()->exists(u u.allallowedactions()->includes(meeting:create)) > true

Queries to analyze the security policy scenario Can Bob cancel a meeting? Bob.allAllowedActions()->includes(Meeting:cancel:execute) > false. Can Alice cancel a meeting? Alice.allAllowedActions()->includes(Meeting:cancel:execute) > true. Can Bob update a meeting? Under which constraints? Bob.allAllowedActions()->includes(Meeting:update:execute) > true. Bob.hasRole.allAuthConstRole(Meeting:update:execute) > caller = self.owner Are there a users in the system allowed to create new meetings? Users.allInstances()->exists(u u.allallowedactions()->includes(meeting:create)) > true

Outline I 1 Models Analysis. Types. 2 The Object Constraint Language (OCL) 3 Metamodel-Based Analysis From concrete to abstract syntax Type I: Questions about your security policy per se Semantic correspondence Type II: Questions about your security policy applied to a concrete scenario Type III: Questions about your security policy applied to scenarios in general 4 Mapping OCL expressions to FOL 5 Type III. Exercise.

Method for getting the answers to questions about your security-design models of Type III.... applied to scenarios in general: e.g., can a scenario exist in which a supervisor is allowed to delete a meeting that he/she does not own? Your question is whether there exists a scenario in which the authorization constraints for the given role to perform the given action (e.g., the caller being the owner of the meeting to be deleted) hold AND the invariants of your system hold AND your additional contraints (e.g.., the caller not being the owner of the meeting to be deleted) also hold.

Method for getting the answers to questions about your security-design models of Type III. Type III. Questions about your security policy, but applied to scenarios in general: e.g., can a scenario exist in which a supervisor is allowed to delete a meeting that he/she does not own? Step 1 Query your security policy about the conditions for users in the given role to be allowed to perform the given action. (manual, same technique explained before). Step 2 Formalize in OCL your additional contraints. Step 3 Translate into first-order logic the obtained conditions, your additional constraints, and the invariants of your system. This step is automatic. Step 4 Use standard first-order theorem-prover techniques to solve the problem; SMT solvers may give you the solution automatically.

Method for getting the answers to questions about your security-design models of Type III. Can a scenario exist in which a supervisor is allowed to delete a meeting that he/she does not own? Step 1 Conditions: Supervisor.allAuthConstRole(Meeting:delete) > caller = self.owner Step 2 Additional constraints: that he/she does not own? caller <> self.owner Step 3 Translate conditions, additional constraints and invariants to FOL. Condition: (caller), (self )(Supervisor(caller) and Meeting(self ) and (caller = owner(self )) Constraint: (caller owner(self )) Invariants:

Outline I 1 Models Analysis. Types. 2 The Object Constraint Language (OCL) 3 Metamodel-Based Analysis From concrete to abstract syntax Type I: Questions about your security policy per se Semantic correspondence Type II: Questions about your security policy applied to a concrete scenario Type III: Questions about your security policy applied to scenarios in general 4 Mapping OCL expressions to FOL 5 Type III. Exercise.

Benefits. Limitation. Check the unsatisfiability of (sets of) OCL expressions can be a powerful and practical tool in the hands of modelers: e.g., it will allows them to Verify class invariants, by checking that they logically imply the expected constraints/properties; Verify method preconditions, by checking that the class invariants do not logically imply their negations; and Verify method postconditions, by checking that they do not logically imply the negation of (any of) the class invariants. Since OCL in full is undecidable, one can only expect to have an automated unsatisfiability checker for a large class of OCL expressions.

Unsatisfiability Definition Given a model (class diagram) M, and a set of OCL constraints Φ, we say that Φ is M-unsatisfiable if and only if there does not exist an M-instance (object diagram) O on which every constraint in Φ evaluates to true 1 1 We do not assume that instances always have a finite number of elements

Our mapping in a nutshell Defined recursively over the structure of OCL expressions: Boolean-expressions are translated by formulas, which mirror their logical structure; Integer-expressions are basically copied; Collection-expressions are translated by predicates, whose meaning is defined by formulas also generated by the mapping; Association-ends are translated by predicates, also defined by formulas generated by the mapping; Attributes are translated by uninterpreted functions.

Association Ends Given an association between two classes Class 1 and Class 2, with association-ends AssocEnd Class 1 and AssocEnd Class 2, the function map() generates the following sentences: E.g. (x, y)(assocend Class 1 (x, y) Class 1 (y)). (x, y)(assocend Class 2 (x, y) Class 2 (y)). (x, y)(assocend Class 1 (x, y) AssocEnd Class 2 (y, x)). (x, y)(owner(x, y) Person(y)) (x, y)(ownedby(x, y) Meeting(y)) (x, y)(owner(x, y) ownedby(y, x))

Some simple Mapping Rules The function map() returns FOL sentences that mirror the logical structure of the original OCL. map(boolexpr implies BoolExpr ) = {make_conj(map(boolexpr)) make_conj(map(boolexpr ))}. map(setexpr->isempty()) = { (x )( (in_coll(name(setexpr), x )))} map(setexpr). map(setexpr->includes(objexpr)) = {in_coll(name(setexpr), name(objexpr))} map(setexpr).

Examples map(meeting.allinstances()->isempty()) = { (x)( Meeting(x))}. map(meeting.allinstances()->forall(x x.owner->isempty())) = { (x)(meeting(x) (y)( (owner(x, y)}. map(meeting.allinstances()->exists(a a.owner->notempty())) = { (a)(meeting(a) (x)(owner(a, x)))}.

More sophisticated Mapping Rules map(setexpr->exists(x BoolExpr)) = { (x )(in_coll(name(setexpr), x ) make_conj(map(boolexpr[x x ])))} map(setexpr). map(setexpr->forall(x BoolExpr)) = { (x )(in_coll(name(setexpr), x ) make_conj(map(boolexpr[x x ])))} map(setexpr). map(setexpr->select(x BoolExpr)) = { (y )(in_coll(name(setexpr->select(x BoolExpr[x y ])), y ) (in_coll(name(setexpr), y ) make_conj(map(boolexpr[x y ]))))}.

Examples map(meeting.allinstances()->exists(x Meeting.allInstances()->excluding(x) ->includes(x))) = { (x)(meeting(x) excluding1(x) ( (y)((meeting(y) y x) excluding1(y))))}. map(meeting.allinstances()->collect(x x.owner)->asset() ->exists(y y.ownedby->isempty())) = { (y)(collect1(y) (x)( (owner(y, x))), (z)(collect1(z) (w)(meeting(w) ownedby(w, z))))}.

Recall Method for Type III. Type III. Questions about your security policy, but applied to scenarios in general: e.g., can a scenario exist in which a supervisor is allowed to delete a meeting that he/she does not own? Step 1 Query your security policy about the conditions for users in the given role to be allowed to perform the given action. (manual, same technique explained before). Step 2 Formalize in OCL your additional contraints. Step 3 Translate into first-order logic the obtained conditions, your additional constraints, and the invariants of your system. This step is automatic. Step 4 Use standard first-order theorem-prover techniques to solve the problem; SMT solvers may give you the solution automatically.

Outline I 1 Models Analysis. Types. 2 The Object Constraint Language (OCL) 3 Metamodel-Based Analysis From concrete to abstract syntax Type I: Questions about your security policy per se Semantic correspondence Type II: Questions about your security policy applied to a concrete scenario Type III: Questions about your security policy applied to scenarios in general 4 Mapping OCL expressions to FOL 5 Type III. Exercise.

ComponentUML example: Employee Here we use ComponentUML to model the data associated with a company s employees. An employee has a name, a surname, a salary, and a bank account. An employee may possibly have a supervisor and may in turn supervise other employees.

Employee model invariants We can further specify this model by adding constraints to it. For example, we can specify that: 1 There is exactly one employee who has no supervisor. Employee.allInstances()->one(e e.supervisedby->isempty()) 2 Nobody is his (or her) own supervisor. Employee.allInstances()->forAll(e e.supervisedby->excludes(e))

Employee model invariants We can further specify this model by adding constraints to it. For example, we can specify that: 1 There is exactly one employee who has no supervisor. Employee.allInstances()->one(e e.supervisedby->isempty()) 2 Nobody is his (or her) own supervisor. Employee.allInstances()->forAll(e e.supervisedby->excludes(e))

Employee model invariants We can further specify this model by adding constraints to it. For example, we can specify that: 1 There is exactly one employee who has no supervisor. Employee.allInstances()->one(e e.supervisedby->isempty()) 2 Nobody is his (or her) own supervisor. Employee.allInstances()->forAll(e e.supervisedby->excludes(e))

Employee model invariants We can further specify this model by adding constraints to it. For example, we can specify that: 1 There is exactly one employee who has no supervisor. Employee.allInstances()->one(e e.supervisedby->isempty()) 2 Nobody is his (or her) own supervisor. Employee.allInstances()->forAll(e e.supervisedby->excludes(e))

Employee model invariants We can further specify this model by adding constraints to it. For example, we can specify that: 1 There is exactly one employee who has no supervisor. Employee.allInstances()->one(e e.supervisedby->isempty()) 2 Nobody is his (or her) own supervisor. Employee.allInstances()->forAll(e e.supervisedby->excludes(e))

Security-design model for Employees

SecureUML+ComponentUML example Question: Do our models allow an scenario in which a supervisor can change his/her own salary?

Model based analysis: OCLSat4Yices (define Employee::(-> int bool)) (define supervisedby::(-> int int bool)) ; Cond: Employee.allInstances()->exists(self self.supervisedby->includes(caller)) ;Ad.Cons: caller=self (assert (exists (self::int) (exists (caller::int) (and (Employee self) (and (Employee caller) (and (supervisedby self caller) (= self caller))))))) ; Inv: Employee.allInstances()->forAll(e e.supervisedby->excludes(e)) (assert (forall (x::int) (=> (Employee x) (not (supervisedby x x))))) (check) -> unsat

Model based analysis: OCLSat4Yices (define Employee::(-> int bool)) (define supervisedby::(-> int int bool)) ; Cond: Employee.allInstances()->exists(self self.supervisedby->includes(caller)) ;Ad.Cons: caller=self (assert (exists (self::int) (exists (caller::int) (and (Employee self) (and (Employee caller) (and (supervisedby self caller) (= self caller))))))) ; Inv: Employee.allInstances()->forAll(e e.supervisedby->excludes(e)) (assert (forall (x::int) (=> (Employee x) (not (supervisedby x x))))) (check) -> unsat

Model based analysis: OCLSat4Yices (define Employee::(-> int bool)) (define supervisedby::(-> int int bool)) ; Cond: Employee.allInstances()->exists(self self.supervisedby->includes(caller)) ;Ad.Cons: caller=self (assert (exists (self::int) (exists (caller::int) (and (Employee self) (and (Employee caller) (and (supervisedby self caller) (= self caller))))))) ; Inv: Employee.allInstances()->forAll(e e.supervisedby->excludes(e)) (assert (forall (x::int) (=> (Employee x) (not (supervisedby x x))))) (check) -> unsat

Model based analysis: OCLSat4Yices (define Employee::(-> int bool)) (define supervisedby::(-> int int bool)) ; Cond: Employee.allInstances()->exists(self self.supervisedby->includes(caller)) ;Ad.Cons: caller=self (assert (exists (self::int) (exists (caller::int) (and (Employee self) (and (Employee caller) (and (supervisedby self caller) (= self caller))))))) ; Inv: Employee.allInstances()->forAll(e e.supervisedby->excludes(e)) (assert (forall (x::int) (=> (Employee x) (not (supervisedby x x))))) (check) -> unsat

Model based analysis: OCLSat4Yices (define Employee::(-> int bool)) (define supervisedby::(-> int int bool)) ; Cond: Employee.allInstances()->exists(self self.supervisedby->includes(caller)) ;Ad.Cons: caller=self (assert (exists (self::int) (exists (caller::int) (and (Employee self) (and (Employee caller) (and (supervisedby self caller) (= self caller))))))) ; Inv: Employee.allInstances()->forAll(e e.supervisedby->excludes(e)) (assert (forall (x::int) (=> (Employee x) (not (supervisedby x x))))) (check) -> unsat

Model based analysis: OCLSat4Yices (define Employee::(-> int bool)) (define supervisedby::(-> int int bool)) ; Cond: Employee.allInstances()->exists(self self.supervisedby->includes(caller)) ;Ad.Cons: caller=self (assert (exists (self::int) (exists (caller::int) (and (Employee self) (and (Employee caller) (and (supervisedby self caller) (= self caller))))))) ; Inv: Employee.allInstances()->forAll(e e.supervisedby->excludes(e)) (assert (forall (x::int) (=> (Employee x) (not (supervisedby x x))))) (check) -> unsat

THANKS FOR YOUR ATTENTION. QUESTIONS?