security patterns and model driven architecture

76
The Beginning

Upload: bdemchak

Post on 13-Apr-2017

358 views

Category:

Software


0 download

TRANSCRIPT

Page 1: Security patterns and model driven architecture

The Beginning

Page 2: Security patterns and model driven architecture

The Beginning

Page 3: Security patterns and model driven architecture

Security Patterns and

Model Driven Architecture

UC San DiegoCSE 294

Fall Quarter 2006Barry Demchak

Page 4: Security patterns and model driven architecture

Papers to Review

Using Security Patterns to Model and Analyze Security Requirements (Betty Cheng et al, Michigan State University) [~2000]

A Study of Security Architecture Patterns (Rosado et al, University of Castilla-La Mancha) [2006]

Integration of Security Patterns in Software Models based on Semantic Descriptions (Diego Ray, University of Malaga) [2003]

Page 5: Security patterns and model driven architecture

The Big Problem

Security requirements and solutions “The application should do blah-blah, blah-blah,

and blah-blah. It should do them like this: blah-blah-blah.”

And it should be fast, reliable, and secure. Security is a value, not an engineering goal Security is a non-functional requirement Irregular and haphazard application of

security measures leads to insecure systems

Page 6: Security patterns and model driven architecture

Evidence of the Problem “Thousands of Brits fall victim to data theft”

-- October 10, 2006 New York Times “Medicare and Medicaid Security Gaps Are

Found”-- October 8, 2006 New York Times

“U.S. and Europe Agree on Passenger Data”-- October 6, 2006 New York Times

Is AJAX secure?-- October, 2006 SQL Magazine

Page 7: Security patterns and model driven architecture

The Context

Secure Servers

Firewall

EncryptionStrong

PasswordsTheoremProvers

Internet Explorer FederatedSignons

DataViruses andSpyware

Page 8: Security patterns and model driven architecture

Preview – the Players and their Parts

Cheng – Pattern definition Rosado – Pattern enumeration and

evaluation Ray – Future directions

Page 9: Security patterns and model driven architecture

Patterns Patterns are a tool for managing complexity

Describe technical solutions in context of business problems

Patterns are prescriptive – tell you what to do Each pattern represents a decision that must be made

and considerations that go into that decision Patterns facilitate communication

Form common vocabulary among experts and non-experts

Patterns are a tool to capture expertise Patterns can increase the degree of corporate

knowledge capture and transfer

Page 10: Security patterns and model driven architecture

What is a Pattern?

A pattern for software architecture describes a particular recurring design problem that arises in specific design contexts, and

presents a well-proven generic scheme for its solution. The solution scheme is specified by describing its constituent components, their responsibilities and relationships, and the

ways in which they collaborate.[POSA96]

Page 11: Security patterns and model driven architecture

MVC

Context & Problem Application data needs to be maintained and

presented via the user interface Multiple different output formats need to be supported Multiple different forms of input need to be supported How to establish consistency?

Page 12: Security patterns and model driven architecture

MVC

Solution: Introduce separate components for storing and

processing of data (model), data presentation (view), and for handling input (controller)

The model represents the functional core; it registers dependent components (views and controllers) and notifies them about data changes

The view retrieves data from the model and displays it The controller translates user input into events for the

model; it may also change the UI to mirror data changes

Page 13: Security patterns and model driven architecture

MVC: Example

02040

6080

100

120140160180200

a b c

Series1abc

a b c

60 30 10

50 30 20

80 10 10

a = 63%b = 23%c = 14%

Model

View

Controller

adapted from [M05]

Page 14: Security patterns and model driven architecture

MVC Structure:

Model

AbstractSourceAttach(Observer

)Detach(Observe

r)Notify()

GetState()SetState()service()

state

AbstractObserver

Update()

View

Update()Display()Initialize()

observers*

model

1 Controller

Update()HandleInput(

)Initialize()

Page 15: Security patterns and model driven architecture

Behavior:

MVC

:View:Model:Controller

Service()

Update()

HandleInput()Notify()

GetState()Display()

Update()GetState()

Page 16: Security patterns and model driven architecture

Consequences:

Decoupling of application data from

presentation and input mechanism

Consistency of user interface and underlying

data model

Increase of structural and dynamic complexity

Potential loss of performance

MVC

Page 17: Security patterns and model driven architecture

Pattern Information

Analysis patterns [Fowler: Analysis Patterns] Design patterns [Gamma et al: Design

Patterns] Specification patterns [Dwyer et al: 2nd

Workshop on Formal Methods in Software Engineering (1998)]

Page 18: Security patterns and model driven architecture

Cheng’s Approach – The Problem

Security patterns lack comprehensive structure that conveys essential information essential to security engineering

Security cannot be verified

Page 19: Security patterns and model driven architecture

The Solution

Investigate alternate templates for security patterns

Enable verification of requirements by adding formal constraints to patterns

Page 20: Security patterns and model driven architecture

Security Patterns

Capture and convey information to facilitate “security engineering”

“Security” is subjective and environment-dependent

Extending normal patterns to security comes up short: behavior, security constraints, etc

Check essential security properties

Page 21: Security patterns and model driven architecture

Objectives

Communication of security-specific knowledge in context of concrete application

Verification using UML formalization framework (Hydra) -> Promela (SPIN) -> Minerva

Page 22: Security patterns and model driven architecture

Design Patterns – a launching point

Pattern Name and Classification Intent Also Known As Motivation Applicability – altered Consequences - altered Structure Participants Collaborations

Page 23: Security patterns and model driven architecture

Changed Fields

Applicability – added application-level, host-level, or network-level security

Consequences – added set of consequences: accountability, confidentiality, integrity, availability, performance, cost, manageability, usability

Page 24: Security patterns and model driven architecture

New Fields

Behavior – illustrate behavior and interaction using UML state and sequence diagrams

Constraints – global conditions that have to apply

Related Security Patterns – how it relates to other security patterns

Supported Security Principles – how it relates to each of the ten principles identified by Viega and McGraw

Page 25: Security patterns and model driven architecture

Viega and McGraw Principles (aside)

1. Secure weakest link2. Practice defense in depth3. Fail securely4. Principle of least privilege5. Compartmentalize6. Keep it simple7. Promote privacy8. Hiding secrets is hard9. Be reluctant to trust10. Use community resources

Page 26: Security patterns and model driven architecture

Patterns, Classifications & Principles

Page 27: Security patterns and model driven architecture

Process for Using Security Patterns

Page 28: Security patterns and model driven architecture

Example – Faulty UML State Diagram

Page 29: Security patterns and model driven architecture

Example - eBiz

Requirement: Unauthorized access to system should not be possible, and it triggers a counter-measure

Page 30: Security patterns and model driven architecture

Example - eBiz

Page 31: Security patterns and model driven architecture

Example – eBiz

Page 32: Security patterns and model driven architecture

Analysis of Security Properties

Checked Authorization, Check Point, and Single Access Point

Instantiated constraints using LTL -> SPIN Iteratively verified/improved – errors

visualized using Minerva as UML showing counterexamples

Page 33: Security patterns and model driven architecture

Checkpoint Properties CHK1 – unauthorized access leads to counter-

measure: □(p(◊q)) (CP.grantaccess == 2)(CM.triggered == 1)

CHK2 – integrity or confidentiality are uncompromised after denial: □(p(qUr)) (CP.grantaccess == 2) ((ERG.success == 0) U

(ERG.waiting == 0) CHK3 – granted access leads to notify: □(p(◊q)Ur)

(CP.grantaccess == 1) ((ERG.success == 1) U (ERG.waiting == 0)

Page 34: Security patterns and model driven architecture

UML for Check Point Pattern

Page 35: Security patterns and model driven architecture

Cheng Summary

Proposed revised template for security Combine previous UML formalizations with

security patterns to produce rigorous analysis Result: Reduction of error-prone post-design

security modifications

Page 36: Security patterns and model driven architecture

Cheng Futures

Incorporate security beliefs into templates Investigate how application domain affects

security patterns Use of timing information in specifying

security patterns

Page 37: Security patterns and model driven architecture

Rosado’s Approach -- The Problem

Unsecure systems are everywhere, and are especially acute with connected systems

Security should be considered at all stages of system design and at all architectural levels

There is no comprehensive methodology for designing security-sensitive systems Requirements difficult to model Secure development expertise is rare

Page 38: Security patterns and model driven architecture

The Solution

Security patterns encapsulate accumulated knowledge of secure systems design

Can be understood and used by non-security professionals

Degree of security in a pattern can be measured

Page 39: Security patterns and model driven architecture

The Security Pattern Template

Intent Context Problem Description Solution Consequences Known Uses Related Patterns

Page 40: Security patterns and model driven architecture

The Security Pattern Template(vs Cheng et al)

Intent Context Problem Description Solution Consequences Known Uses Related Patterns

Also known as Structure Participants Collaborations Supported security

principles

Page 41: Security patterns and model driven architecture

Patterns Presented Authorization Role-Based Access Control Multi-level Security Reference Monitor Virtual Address Space Access Control Execution Domain Single Access Point Check Point Session

Page 42: Security patterns and model driven architecture

Patterns Presented

AuthorizationRole-Based Access ControlMulti-level Security

Reference Monitor Virtual Address Space Access Control Execution Domain

Single Access PointCheck PointSession Limited View

Full View with Errors

Page 43: Security patterns and model driven architecture

Authorization Pattern

Intent: Who is authorized to access resource Context: Active entities request resources

whose access must be controlled Problem: Access to secure objects needs to

be explicitly protected

Page 44: Security patterns and model driven architecture

Authorization Pattern – cont’d

Description: distinguish between active entities (subjects) and passive resources (protection objects)

Solution: Subject class, Object class, Rights class, and the relationship between them

Page 45: Security patterns and model driven architecture

Authorization Pattern – cont’d

Consequences Solution is independent of resources to be protected Subjects: processes, users, roles, groups Objects: transactions, memory, devices, files … Access: reading, writing, execution, methods

Page 46: Security patterns and model driven architecture

Authorization Pattern – cont’d

Known uses: access control in Unix, Windows, Oracle

Related patterns: RBAC is a specialization

Page 47: Security patterns and model driven architecture

Role-Based Access Control Pattern

Intent: Control access based on role Context: Access based on job or task Solution: Extends Authorization so users are

assigned roles, and roles have rights

Page 48: Security patterns and model driven architecture

Multilevel Security Pattern

Intent: Access under multiple levels of security class Solution: Each subject some class, each resource some

class, instances used to add levels of security Consequences: Facilitates admin work for classification,

maintenance of classification can be costly

Page 49: Security patterns and model driven architecture

Reference Monitor Pattern

Intent: All authorizations are fulfilled when process needs resource

Context: Multiprocess environment petitioning resources Consequences: If all petitions are intercepted, rules can be

observed. Implementation depends on resource, and performance suffers

Page 50: Security patterns and model driven architecture

Virtual Address Space Access Control Pattern

Intent: Control access by processes to specific memory using predefined access types

Context: Processes must share memory in controlled way; each process executes in own address space

Solution: Divide memory into segments, assign descriptors and allowed access types

Page 51: Security patterns and model driven architecture

Execution Domain Pattern

Intent: Define process environment indicating accessible resources the resource access privileges

Problem: Restrict process to use specific resources to prevent destruction that could interfere with other processes

Consequences: Resource mapped into address space, domain implementation not restricted, complex and needs hardware

Page 52: Security patterns and model driven architecture

Session Pattern

Intent: Provide environment where user rights can be restricted and controlled

Description: Repository for global information access Consequences: Session has privileges necessary to perform

task, but insufficient to cause collateral damage

Page 53: Security patterns and model driven architecture

Single Access Point Pattern

Intent: Simple interface for communications with external entities

Solution: Single point of control (mediator) can coordinate policy implementation through Check Point pattern

Consequences: Can capture information, carry out authorization, and prevent undesirable data modification

Page 54: Security patterns and model driven architecture

Check Point Pattern

Intent: Check requests and take countermeasures Solution: Analyze requests and messages, combines with

Single Access Point pattern, applies current security policy Consequences: Benefits confidentiality if operating properly

and attacks can be detected. Complex checking slows system.

Page 55: Security patterns and model driven architecture

Comparing Security Criteria

Page 56: Security patterns and model driven architecture

Comparing Performance

Page 57: Security patterns and model driven architecture

Comparing Cost and Security

Page 58: Security patterns and model driven architecture

Rosado’s Futures

Define method to specify flexible security architectures that can be easily adapted to systems with different security requirements

Guarantee security using security patterns

Page 59: Security patterns and model driven architecture

Ray’s Approach – The Problem

Security and reliability not considered during initial stages of software development

Not part of standard procedures in development or maintenance of software

Page 60: Security patterns and model driven architecture

The Solution

Create framework for semantic description and management of security properties and patterns

Given security requirements, define mechanisms to automate analysis of security-enhanced models

Define mechanism to guarantee that subsequent changes preserve security properties and patterns

Page 61: Security patterns and model driven architecture

Security Awareness

25 Years Ago: What is Security?? 15 Years Ago: Security is a value-added

service Lately: Security must be built in

Page 62: Security patterns and model driven architecture

Development Processes Security requirements are often identified

independently for each system component Interdependencies are poorly understood Big trouble

Pervasive computing Ambient intelligence Mobile services

Deploy isolated countermeasures (PKI, IDS, firewalls, symmetric encryption, etc)

No development process identifies security requirements apriori

Page 63: Security patterns and model driven architecture

The Causes

Security is a non-functional requirement Security is both technical and social Developers often lack background or interest

in security No consistent way of representing security at

different levels of software description

Page 64: Security patterns and model driven architecture

Add-on Security

Usually a point solution Different implementations of the add-on

security cannot be compared (as to security properties)

Security mechanisms not congruent with system security requirements

Page 65: Security patterns and model driven architecture

Where Are We Now?

UML-based Business process engineering SecureUML integrates role-based access

control policies into model-driven software development process

UMLsec proposes extending UML for security modeling, but addresses only a few security issues

Integrate UML into Tropos (ERP) methodology

Page 66: Security patterns and model driven architecture

More UML … Use cases can describe special scenarios, but abuse

cases are more instructive UML Precise Group (PUML) investigating improving

semantics SEMPER (Secure Electronic Marketplace in Europe)

studying e-commerce frameworks COPS (Commercial Protocols and Services) studying

infrastructure for market transactions CASENET design and analysis of security protocols

studying requirements specification during application development

Page 67: Security patterns and model driven architecture

Where Next?

Use of formal methods in software engineering process

Develop formally proven solutions Assist software engineers regarding gathering

security requirements, integrating proven solutions, and validating against requirements

Page 68: Security patterns and model driven architecture

Where Next?

Page 69: Security patterns and model driven architecture

Basic Boehm Spiral Model

Page 70: Security patterns and model driven architecture

Integrated Security Engineering

Security solution Adaptation to

context

Analysis of consequences

Coherence

Page 71: Security patterns and model driven architecture

Semantic Modeling Security protocol as a series of semantic properties

to be fulfilled Level of security: confidential Authentication is needed … etc

Enables Semantic categorization of patterns and libraries Fitting patterns and libraries to context Ferret out unhealthy interactions Validate correctness of new patterns

Page 72: Security patterns and model driven architecture

Automated Tools Support

Page 73: Security patterns and model driven architecture

Comparison of Approaches Cheng et al

Improvement of attribute classifications of security patterns

UML + security patterns = rigorous analysis Rosado

Exposing security patterns for common use Classifying characteristics of security patterns

Ray Semantic description of security patterns Full development cycle supported by automation Guarantee that protocols are maintained across

development cycle

Page 74: Security patterns and model driven architecture

Other Threads

Dr. Dobbs Journal Scott Ambler on difficulty of marrying agile

with security Microsoft Systems Journal

November edition has 6 major stories Threat modeling Extending SDL – Documenting and Evaluating

the Security Guarantees of Your Apps

Page 75: Security patterns and model driven architecture

Bottom Line

Are today’s security patterns sufficient to guarantee secure systems?

Is security a cross-cutting issue? How do we create secure-by-architecture

designs?

“For interesting research, head towards chaos” – Ingolf Krueger, 2005

Page 76: Security patterns and model driven architecture

The Beginning