Analyzing Security Architectures Marwan Abi-Antoun Jeffrey M. - - PowerPoint PPT Presentation

analyzing security architectures
SMART_READER_LITE
LIVE PREVIEW

Analyzing Security Architectures Marwan Abi-Antoun Jeffrey M. - - PowerPoint PPT Presentation

Analyzing Security Architectures Marwan Abi-Antoun Jeffrey M. Barnes Dept. of Computer Science Inst. for Software Research Wayne State University Carnegie Mellon University mabiantoun@wayne.edu jmbarnes@cs.cmu.edu Acknowledgements: David


slide-1
SLIDE 1

1

Analyzing Security Architectures

Marwan Abi-Antoun

  • Dept. of Computer Science

Wayne State University mabiantoun@wayne.edu Jeffrey M. Barnes

  • Inst. for Software Research

Carnegie Mellon University jmbarnes@cs.cmu.edu

Acknowledgements: David Garlan, Kirti Garg and Bradley Schmerl at Carnegie Mellon University. Raed Almomani at Wayne State University.

slide-2
SLIDE 2

Problem background

  • Engineers use tools like data flow

diagrams (DFDs) to analyze security properties of software systems

  • Often these are constructed from

developers’ recollection of how a system works, with little automated support

  • This architectural representation may fail

to capture all communication present in the system

2

  • Problem ● Approach ● Extract ● Abstract ● Analyze ● Enforce ● Conclusion
slide-3
SLIDE 3

Architecture conformance

  • In essence, this is a problem of

architecture conformance

  • Want to reason at an architectural level

but relate it to code at the same time

3

Architecture Code

Constraint: Untrusted components cannot access protected data Constraint: Untrusted components cannot access protected data

Provider Engine

class Provider { ... } class Engine { ... }

Consumer

class Consumer { ... }

  • Problem ● Approach ● Extract ● Abstract ● Analyze ● Enforce ● Conclusion
slide-4
SLIDE 4

Security architectures as runtime architectures

  • A security architecture is an example of

a runtime architecture

  • Shows runtime components such as
  • bjects and data stores
  • Shows runtime connectors such as

communication links and points-to relations

  • May have many instances of a single

component type

  • Contrast with static code views such as

class diagrams

4

  • Problem ● Approach ● Extract ● Abstract ● Analyze ● Enforce ● Conclusion
slide-5
SLIDE 5

The challenge of analyzing security architectures

  • Tools for analyzing conformance of

runtime architectures are immature compared to those for code architectures

  • A security analysis must consider the

worst case, not the typical case, of possible component communication

  • Demands static analysis
  • Dynamic analysis can tell us about only a

limited number of runs

5

  • Problem ● Approach ● Extract ● Abstract ● Analyze ● Enforce ● Conclusion
slide-6
SLIDE 6

Our contribution

  • An architecture-centric approach,

SECORIA, that enables reasoning at the level of a security runtime architecture, and relating it to code at the same time

  • Can enforce both code-level and global

architectural constraints

6

  • Problem ● Approach ● Extract ● Abstract ● Analyze ● Enforce ● Conclusion
slide-7
SLIDE 7

Evaluation

  • Validated SECORIA on CryptoDB, a

secure database system designed by a security expert

  • Database architecture that

provides cryptographic protections against unauthorized access

  • Includes 3,000-line

sample implementation in Java

7

  • Problem ● Approach ● Extract ● Abstract ● Analyze ● Enforce ● Conclusion
slide-8
SLIDE 8

8

Approach

  • Problem ● Approach ● Extract ● Abstract ● Analyze ● Enforce ● Conclusion
slide-9
SLIDE 9

Overview of SECORIA

  • Specialization of SCHOLIA [Abi-Antoun & Aldrich,

OOPSLA’09], which analyzes conformance

between object-oriented code and a hierarchical, target runtime architecture

  • SECORIA is an iterative process with two

main stages: conformance and enforcement

9

  • Problem ● Approach ● Extract ● Abstract ● Analyze ● Enforce ● Conclusion
slide-10
SLIDE 10

Conformance stage Enforcement stage

Overview of SECORIA

10

Code

class LocalKeyStore {…}

Designed Architecture Conformance View

?

Compare Enriched Architecture

with types, properties, & constraints

Enrich Trace Discrepancies Trace Violations Code-Level Constraints

expressed with domain links

Annotate

  • Problem ● Approach ● Extract ● Abstract ● Analyze ● Enforce ● Conclusion

Object Graph Extract Built Architecture Abstract Ownership Annotations

@Domains({"OWNED", …}) class LocalKeyStore {…}

Annotate

slide-11
SLIDE 11

11

Conformance stage: annotate; extract object graph

  • Problem ● Approach ● Extract ● Abstract ● Analyze ● Enforce ● Conclusion

Code

class LocalKeyStore {…}

Object Graph Extract Built Architecture Abstract Designed Architecture Conformance View

?

Compare Enriched Architecture

with types, properties, & constraints

Enrich Trace Discrepancies Trace Violations Code-Level Constraints

expressed with domain links

Annotate Ownership Annotations

@Domains({"OWNED", …}) class LocalKeyStore {…}

Annotate

slide-12
SLIDE 12

12

Object relation Object

At runtime, an object-oriented system appears as a Runtime Object Graph (ROG)

  • A node represents a runtime object
  • An edge represents a points-to relation
  • Problem ● Approach ● Extract ● Abstract ● Analyze ● Enforce ● Conclusion
slide-13
SLIDE 13

13

Component Object relation Object

Abstract objects into “components”

  • Problem ● Approach ● Extract ● Abstract ● Analyze ● Enforce ● Conclusion
slide-14
SLIDE 14

14

Component Connector Object relation Object

Abstract relations between components

  • Problem ● Approach ● Extract ● Abstract ● Analyze ● Enforce ● Conclusion
slide-15
SLIDE 15

15

Component Connector Object relation Object

Organize components into groups/tiers

Group/Tier

  • Problem ● Approach ● Extract ● Abstract ● Analyze ● Enforce ● Conclusion
slide-16
SLIDE 16

16

Component Connector Object relation Object

Make some components part of others

  • Problem ● Approach ● Extract ● Abstract ● Analyze ● Enforce ● Conclusion
slide-17
SLIDE 17

17

Component Connector Object relation Object

Make some components part of others

  • Problem ● Approach ● Extract ● Abstract ● Analyze ● Enforce ● Conclusion
slide-18
SLIDE 18

18

Component Connector Object relation Object

Make some components part of others

  • Problem ● Approach ● Extract ● Abstract ● Analyze ● Enforce ● Conclusion
slide-19
SLIDE 19

19

Component Hierarchy Connector Object relation Object

Make some components part of others

  • Problem ● Approach ● Extract ● Abstract ● Analyze ● Enforce ● Conclusion
slide-20
SLIDE 20

Annotate code and extract object graph

  • Problem: Architectural hierarchy not

readily observable in arbitrary code

  • To solve this, we use annotations to

capture architectural intent

  • Developer picks top-level entry point
  • Use annotations to impose an
  • wnership hierarchy on objects
  • Annotations are minimally invasive,

modular, and statically typecheckable

20

  • Problem ● Approach ● Extract ● Abstract ● Analyze ● Enforce ● Conclusion
slide-21
SLIDE 21

21

Ownership domains are groups of objects

[Aldrich and Chambers, ECOOP’04] [Krishnaswami and Aldrich, PLDI’05]

@Domains({“OWNED”, “KEYS”}) class LocalKeyStore { @Domain(“OWNED”) List<LocalKey> keys; @Domain(“KEYS”) LocalKey key; ... }

LocalKey OWNED Declarations are simplified KEYS

keys: List<LocalKey> key: LocalKey

  • Ownership domain = conceptual group of objects
  • Each object in exactly one domain
  • bject:

Type

Object Type Type

  • Problem ● Approach ● Extract ● Abstract ● Analyze ● Enforce ● Conclusion
slide-22
SLIDE 22

Annotations define two kinds of

  • bject hierarchy
  • A public domain provides logical

containment: an object is conceptually “part of” another

  • Having access to an object also gives

access to objects inside its public domains

  • A private domain provides strict

encapsulation

  • E.g., a public method cannot return an

alias to an object in a private domain, even though Java allows returning an alias to a private field

22

  • Problem ● Approach ● Extract ● Abstract ● Analyze ● Enforce ● Conclusion
slide-23
SLIDE 23

Examples of object hierarchy

  • LocalKeyStore has a public domain to

hold LocalKey objects

  • LocalKeyStore stores the ArrayList of

LocalKey objects in a private domain

23

KEYS OWNED keyStore: LocalKeyStore keys(+): ArrayList<LocalKey> localKey: LocalKey kekSpec(+): SecretKeySpec

  • Problem ● Approach ● Extract ● Abstract ● Analyze ● Enforce ● Conclusion
slide-24
SLIDE 24

24

Conformance stage: Abstract object graph

  • Problem ● Approach ● Extract ● Abstract ● Analyze ● Enforce ● Conclusion

Code

class LocalKeyStore {…}

Object Graph Extract Built Architecture Abstract Designed Architecture Conformance View

?

Compare Enriched Architecture

with types, properties, & constraints

Enrich Trace Discrepancies Trace Violations Code-Level Constraints

expressed with domain links

Annotate Ownership Annotations

@Domains({"OWNED", …}) class LocalKeyStore {…}

Annotate

slide-25
SLIDE 25

25

Object graph vs. target architecture

CryptoDB object graph CryptoDB target architecture

  • Problem ● Approach ● Extract ● Abstract ● Analyze ● Enforce ● Conclusion
  • Often, object graph not isomorphic to

architect’s intended architecture

  • So abstract and represent in

component-and-connector view

KEYS OWNED keyStore: LocalKeyStore keys(+): ArrayList<LocalKey> localKey: LocalKey kekSpec(+): SecretKeySpec

slide-26
SLIDE 26

26

Represent abstracted object graph as component-and-connector (C&C) view

  • bject graph ↔ C&C view

top-level object ↔ system

  • bject

↔ component

domain

↔ group

interface

↔ provide port

field reference ↔ use port

  • bject relation

↔ connector

substructure

↔ representation

CryptoDB

KEYMANAGEMENT KEYSTORAGE

keyTool keyStore

  • Problem ● Approach ● Extract ● Abstract ● Analyze ● Enforce ● Conclusion

keyAlias

slide-27
SLIDE 27

27

Conformance stage: Document target architecture; check conformance

  • Problem ● Approach ● Extract ● Abstract ● Analyze ● Enforce ● Conclusion

Code

class LocalKeyStore {…}

Object Graph Extract Built Architecture Abstract Designed Architecture Conformance View

?

Compare Enriched Architecture

with types, properties, & constraints

Enrich Trace Discrepancies Trace Violations Code-Level Constraints

expressed with domain links

Annotate Ownership Annotations

@Domains({"OWNED", …}) class LocalKeyStore {…}

Annotate

slide-28
SLIDE 28

28

CryptoDB: Document designed architecture

  • Problem ● Approach ● Extract ● Abstract ● Analyze ● Enforce ● Conclusion

CryptoDB: Level-1 DFD

[Kenan, Fig. 3.2]

slide-29
SLIDE 29

29

Analyzing conformance of system to target architecture

  • Conformance analysis based on

communication integrity

[Luckham and Vera, TSE’95]

  • Identifies following differences:
  • Convergence: node or edge in both

built and in designed view

  • Divergence: node or edge in built view,

but not in designed view

  • Absence: node or edge in designed view,

but not in built view

  • Problem ● Approach ● Extract ● Abstract ● Analyze ● Enforce ● Conclusion
slide-30
SLIDE 30

30

Developer investigates reported differences

Convergence Divergence Absence

  • Study findings
  • Trace to code
  • Problem ● Approach ● Extract ● Abstract ● Analyze ● Enforce ● Conclusion
slide-31
SLIDE 31

Enforcement stage

31

  • Problem ● Approach ● Extract ● Abstract ● Analyze ● Enforce ● Conclusion

Code

class LocalKeyStore {…}

Object Graph Extract Built Architecture Abstract Designed Architecture Conformance View

?

Compare Enriched Architecture

with types, properties, & constraints

Enrich Trace Discrepancies Trace Violations Code-Level Constraints

expressed with domain links

Annotate Ownership Annotations

@Domains({"OWNED", …}) class LocalKeyStore {…}

Annotate

slide-32
SLIDE 32

Architectural types

  • Target architecture described in an

architecture description language such as Acme

  • Architectures described using

components, connectors, and other elements

  • These elements participate in a type

system

  • E.g., many component instances may

belong to a single component type

32

  • Problem ● Approach ● Extract ● Abstract ● Analyze ● Enforce ● Conclusion
slide-33
SLIDE 33

Architectural families

  • Element types are used to build up

families

  • Encapsulate types applicable to a broad

class of software architectures

  • We have a reusable DFD family
  • Component types like Process, DataStore,

etc.

  • A family can also define architectural

properties

  • trustLevel, howFound, etc.

33

  • Problem ● Approach ● Extract ● Abstract ● Analyze ● Enforce ● Conclusion
slide-34
SLIDE 34

Architectural constraints

  • Security constraints
  • Automatically applied when the security

family is imported and types and properties are set

  • Application-specific constraints
  • Can be introduced as constraints in the

target architecture

  • Based on the specific security requirements
  • f the system under study

34

  • Problem ● Approach ● Extract ● Abstract ● Analyze ● Enforce ● Conclusion
slide-35
SLIDE 35

Security constraints

  • Common constraints defined by the DFD

family

  • Well-formedness constraints
  • E.g., two DataStores cannot be connected

directly

  • Information flow constraints
  • Based on STRIDE principles

[Howard & LeBlanc, Writing Secure Code]

  • Spoofing, Tampering, Repudiation, Information

Disclosure, Denial of Service, Elevation of Privilege

  • E.g., information disclosure: The trustLevel of

a DataFlow’s source should not be higher than its destination

35

  • Problem ● Approach ● Extract ● Abstract ● Analyze ● Enforce ● Conclusion
slide-36
SLIDE 36

Application-specific constraints

  • Documentation of the target architecture:
  • “Access to the key vault […] should be granted

to only security officers and the cryptographic engine” [Kenan, p. 71]

  • Our interpretation:
  • Only KeyManager and EngineWrapper should

have access to KeyVault

  • Our formalization:
  • forall c : SyncCompT in self.COMPONENTS |

pointsTo(c, KeyVault)

  • > c.label = "KeyManager"
  • r c.label = "EngineWrapper"

36

  • Problem ● Approach ● Extract ● Abstract ● Analyze ● Enforce ● Conclusion
slide-37
SLIDE 37

37

Validation results; related work

  • Problem ● Approach ● Extract ● Abstract ● Analyze ● Enforce ● Conclusion
slide-38
SLIDE 38

CryptoDB: Summary of findings

  • We successfully related the security

architecture and implementation

  • Renames: The structural comparison

allowed us to analyze conformance despite naming discrepancies (e.g., KeyManager versus KeyTool)

  • Conformance findings: Top-level

components in the target architecture and implementation were mostly consistent

38

  • Problem ● Approach ● Extract ● Abstract ● Analyze ● Enforce ● Conclusion
slide-39
SLIDE 39

Defect prevention

  • Manually injected manufactured

architecture violation into code

  • Coupled Provider and LocalKeyStore
  • Conformance view showed new

divergence between provider and keyVault

  • Predicate raised warning about violation

39

  • Problem ● Approach ● Extract ● Abstract ● Analyze ● Enforce ● Conclusion
slide-40
SLIDE 40

Related work

  • Architecture extraction &

conformance

  • Most work focuses on static extraction of a

code architecture [Murphy et al., TSE’01]

  • Approaches based on dynamic

analysis or testing

  • Cannot check all runs
  • Threat modeling tools

[Swiderski & Snyder, Threat Modeling]

  • Provide architectural analysis of security,

but do not relate architecture to code

40

slide-41
SLIDE 41

41

Summary

  • First approach, SECORIA, to analyze, entirely

statically, a security runtime architecture for some information flow vulnerabilities and for conformance to an object-oriented implementation

  • Evaluation shows we can detect code

changes that introduce architectural violations

  • Architecture-based analysis matches the

way experts reason about security during threat modeling

  • Problem ● Approach ● Extract ● Abstract ● Analyze ● Enforce ● Conclusion
slide-42
SLIDE 42

Supplementary material

Download Acme specifications, our DFD security family, and other related material at: http://www.cs.wayne.edu/~mabianto/cryptodb/

42