Principles for secure design Some of the slides and content are - - PowerPoint PPT Presentation

principles for secure design
SMART_READER_LITE
LIVE PREVIEW

Principles for secure design Some of the slides and content are - - PowerPoint PPT Presentation

Principles for secure design Some of the slides and content are from Mike Hicks Coursera course Making secure software Making secure software Flawed approach : Design and build software, and ignore security at first Add security once


slide-1
SLIDE 1

Principles for secure design

Some of the slides and content are from Mike Hicks’ Coursera course

slide-2
SLIDE 2

Making secure software

slide-3
SLIDE 3

Making secure software

  • Flawed approach: Design and build software, and

ignore security at first

  • Add security once the functional requirements are

satisfied

slide-4
SLIDE 4

Making secure software

  • Flawed approach: Design and build software, and

ignore security at first

  • Add security once the functional requirements are

satisfied

  • Better approach: Build security in from the start
  • Incorporate security-minded thinking into all phases of

the development process

slide-5
SLIDE 5

Development process

  • Many development processes; four common phases:
  • Requirements
  • Design
  • Implementation
  • Testing/assurance
  • Where does security engineering fit in?
  • All phases!
slide-6
SLIDE 6

Security engineering

  • Requirements
  • Design
  • Implementation
  • Testing/assurance

Phases

Note that different SD processes have different phases and artifacts, but all involve the basics above. We’ll keep it simple and refer to these.

slide-7
SLIDE 7

Security engineering

  • Requirements
  • Design
  • Implementation
  • Testing/assurance

Phases Activities

Note that different SD processes have different phases and artifacts, but all involve the basics above. We’ll keep it simple and refer to these.

slide-8
SLIDE 8

Security engineering

  • Requirements
  • Design
  • Implementation
  • Testing/assurance

Security Requirements

Phases Activities

Note that different SD processes have different phases and artifacts, but all involve the basics above. We’ll keep it simple and refer to these.

slide-9
SLIDE 9

Security engineering

  • Requirements
  • Design
  • Implementation
  • Testing/assurance

Security Requirements Abuse Cases

Phases Activities

Note that different SD processes have different phases and artifacts, but all involve the basics above. We’ll keep it simple and refer to these.

slide-10
SLIDE 10

Security engineering

  • Requirements
  • Design
  • Implementation
  • Testing/assurance

Security Requirements Abuse Cases Architectural Risk Analysis

Phases Activities

Note that different SD processes have different phases and artifacts, but all involve the basics above. We’ll keep it simple and refer to these.

slide-11
SLIDE 11

Security engineering

  • Requirements
  • Design
  • Implementation
  • Testing/assurance

Security Requirements Abuse Cases Security-oriented Design Architectural Risk Analysis

Phases Activities

Note that different SD processes have different phases and artifacts, but all involve the basics above. We’ll keep it simple and refer to these.

slide-12
SLIDE 12

Security engineering

  • Requirements
  • Design
  • Implementation
  • Testing/assurance

Security Requirements Abuse Cases Code Review (with tools) Security-oriented Design Architectural Risk Analysis

Phases Activities

Note that different SD processes have different phases and artifacts, but all involve the basics above. We’ll keep it simple and refer to these.

slide-13
SLIDE 13

Security engineering

  • Requirements
  • Design
  • Implementation
  • Testing/assurance

Security Requirements Abuse Cases Code Review (with tools) Security-oriented Design Risk-based Security Tests Architectural Risk Analysis

Phases Activities

Note that different SD processes have different phases and artifacts, but all involve the basics above. We’ll keep it simple and refer to these.

slide-14
SLIDE 14

Security engineering

  • Requirements
  • Design
  • Implementation
  • Testing/assurance

Security Requirements Abuse Cases Code Review (with tools) Penetration Testing Security-oriented Design Risk-based Security Tests Architectural Risk Analysis

Phases Activities

Note that different SD processes have different phases and artifacts, but all involve the basics above. We’ll keep it simple and refer to these.

slide-15
SLIDE 15

Designing secure systems

  • Model your threats
  • Define your security requirements
  • What distinguishes a security requirement from a

typical “software feature”?

  • Apply good security design principles
slide-16
SLIDE 16

Threat Modeling

slide-17
SLIDE 17

Threat Model

slide-18
SLIDE 18

Threat Model

  • The threat model makes explicit the adversary’s

assumed powers

  • Consequence: The threat model must match reality,
  • therwise the risk analysis of the system will be wrong
slide-19
SLIDE 19

Threat Model

  • The threat model makes explicit the adversary’s

assumed powers

  • Consequence: The threat model must match reality,
  • therwise the risk analysis of the system will be wrong
  • The threat model is critically important
  • If you are not explicit about what the attacker can do,

how can you assess whether your design will repel that attacker?

slide-20
SLIDE 20

A few different network threat models

Malicious user

slide-21
SLIDE 21

A few different network threat models

Malicious user Co-located user

slide-22
SLIDE 22

A few different network threat models

Malicious user Co-located user Compromised server

slide-23
SLIDE 23

A few different network threat models

Malicious user Snooping Co-located user Compromised server

slide-24
SLIDE 24

Threat-driven Design

slide-25
SLIDE 25

Threat-driven Design

  • Different threat models will elicit different responses
slide-26
SLIDE 26

Threat-driven Design

  • Different threat models will elicit different responses
  • Only malicious users: implies message traffic is safe
  • No need to encrypt communications
  • This is what telnet remote login software assumed
slide-27
SLIDE 27

Threat-driven Design

  • Different threat models will elicit different responses
  • Only malicious users: implies message traffic is safe
  • No need to encrypt communications
  • This is what telnet remote login software assumed
  • Snooping attackers: means message traffic is visible
  • So use encrypted wifi (link layer), encrypted network layer

(IPsec), or encrypted application layer (SSL)

  • Which is most appropriate for your system?
slide-28
SLIDE 28

Threat-driven Design

  • Different threat models will elicit different responses
  • Only malicious users: implies message traffic is safe
  • No need to encrypt communications
  • This is what telnet remote login software assumed
  • Snooping attackers: means message traffic is visible
  • So use encrypted wifi (link layer), encrypted network layer

(IPsec), or encrypted application layer (SSL)

  • Which is most appropriate for your system?
  • Co-located attacker: can access local files, memory
  • Cannot store unencrypted secrets, like passwords
  • Likewise with a compromised server
slide-29
SLIDE 29

Bad Model = Bad Security

  • Any assumptions you make in your model are

potential holes that the adversary can exploit

slide-30
SLIDE 30

Bad Model = Bad Security

  • Any assumptions you make in your model are

potential holes that the adversary can exploit

  • E.g.: Assuming no snooping users no longer valid
  • Prevalence of wi-fi networks in most deployments
slide-31
SLIDE 31

Bad Model = Bad Security

  • Any assumptions you make in your model are

potential holes that the adversary can exploit

  • E.g.: Assuming no snooping users no longer valid
  • Prevalence of wi-fi networks in most deployments
  • Other mistaken assumptions
  • Assumption: Encrypted traffic carries no information
  • Not true! By analyzing the size and distribution of messages, you

can infer application state

slide-32
SLIDE 32

Bad Model = Bad Security

  • Any assumptions you make in your model are

potential holes that the adversary can exploit

  • E.g.: Assuming no snooping users no longer valid
  • Prevalence of wi-fi networks in most deployments
  • Other mistaken assumptions
  • Assumption: Encrypted traffic carries no information
  • Not true! By analyzing the size and distribution of messages, you

can infer application state

  • Assumption: Timing channels carry little information
  • Not true! Timing measurements of previous RSA implementations

could be used eventually reveal a remote SSL secret key

slide-33
SLIDE 33

Finding a good model

slide-34
SLIDE 34

Finding a good model

  • Compare against similar systems
  • What attacks does their design contend with?
slide-35
SLIDE 35

Finding a good model

  • Compare against similar systems
  • What attacks does their design contend with?
  • Understand past attacks and attack patterns
  • How do they apply to your system?
slide-36
SLIDE 36

Finding a good model

  • Compare against similar systems
  • What attacks does their design contend with?
  • Understand past attacks and attack patterns
  • How do they apply to your system?
  • Challenge assumptions in your design
  • What happens if an assumption is untrue?
  • What would a breach potentially cost you?
  • How hard would it be to get rid of an assumption,

allowing for a stronger adversary?

  • What would that development cost?
slide-37
SLIDE 37

Security Requirements

slide-38
SLIDE 38

Security Requirements

slide-39
SLIDE 39

Security Requirements

  • Software requirements typically about what the

software should do

slide-40
SLIDE 40

Security Requirements

  • Software requirements typically about what the

software should do

  • We also want to have security requirements
slide-41
SLIDE 41

Security Requirements

  • Software requirements typically about what the

software should do

  • We also want to have security requirements
  • Security-related goals (or policies)
  • Example: One user’s bank account balance should not be learned

by, or modified by, another user, unless authorized

slide-42
SLIDE 42

Security Requirements

  • Software requirements typically about what the

software should do

  • We also want to have security requirements
  • Security-related goals (or policies)
  • Example: One user’s bank account balance should not be learned

by, or modified by, another user, unless authorized

  • Required mechanisms for enforcing them
slide-43
SLIDE 43

Security Requirements

  • Software requirements typically about what the

software should do

  • We also want to have security requirements
  • Security-related goals (or policies)
  • Example: One user’s bank account balance should not be learned

by, or modified by, another user, unless authorized

  • Required mechanisms for enforcing them
  • Example:

1.Users identify themselves using passwords,

slide-44
SLIDE 44

Security Requirements

  • Software requirements typically about what the

software should do

  • We also want to have security requirements
  • Security-related goals (or policies)
  • Example: One user’s bank account balance should not be learned

by, or modified by, another user, unless authorized

  • Required mechanisms for enforcing them
  • Example:

1.Users identify themselves using passwords, 2.Passwords must be “strong,” and

slide-45
SLIDE 45

Security Requirements

  • Software requirements typically about what the

software should do

  • We also want to have security requirements
  • Security-related goals (or policies)
  • Example: One user’s bank account balance should not be learned

by, or modified by, another user, unless authorized

  • Required mechanisms for enforcing them
  • Example:

1.Users identify themselves using passwords, 2.Passwords must be “strong,” and 3.The password database is only accessible to login program.

slide-46
SLIDE 46

Typical Kinds of Requirements

slide-47
SLIDE 47

Typical Kinds of Requirements

  • Policies
  • Confidentiality (and Privacy and Anonymity)
  • Integrity
  • Availability
slide-48
SLIDE 48

Typical Kinds of Requirements

  • Policies
  • Confidentiality (and Privacy and Anonymity)
  • Integrity
  • Availability
  • Supporting mechanisms
  • Authentication
  • Authorization
  • Audit-ability
slide-49
SLIDE 49

Supporting mechanisms

These relate identities (“principals”) to actions Authentication Authorization Audit-ability

slide-50
SLIDE 50

Supporting mechanisms

These relate identities (“principals”) to actions Authentication Authorization Audit-ability How can a system
 tell who a user is

slide-51
SLIDE 51

Supporting mechanisms

These relate identities (“principals”) to actions Authentication Authorization Audit-ability How can a system
 tell who a user is What we know What we have
 What we are >1 of the above =
 Mult-factor authentication

slide-52
SLIDE 52

Supporting mechanisms

These relate identities (“principals”) to actions Authentication Authorization Audit-ability How can a system
 tell who a user is How can a system
 tell what a user is
 allowed to do What we know What we have
 What we are >1 of the above =
 Mult-factor authentication

slide-53
SLIDE 53

Supporting mechanisms

These relate identities (“principals”) to actions Authentication Authorization Audit-ability How can a system
 tell who a user is How can a system
 tell what a user is
 allowed to do What we know What we have
 What we are >1 of the above =
 Mult-factor authentication Access control policies (defines)
 + Mediator (checks)

slide-54
SLIDE 54

Supporting mechanisms

These relate identities (“principals”) to actions Authentication Authorization Audit-ability How can a system
 tell who a user is How can a system
 tell what a user is
 allowed to do How can a system
 tell what a user did What we know What we have
 What we are >1 of the above =
 Mult-factor authentication Access control policies (defines)
 + Mediator (checks)

slide-55
SLIDE 55

Supporting mechanisms

These relate identities (“principals”) to actions Authentication Authorization Audit-ability How can a system
 tell who a user is How can a system
 tell what a user is
 allowed to do How can a system
 tell what a user did What we know What we have
 What we are >1 of the above =
 Mult-factor authentication Access control policies (defines)
 + Mediator (checks) Retain enough info
 to determine the circumstances of a
 breach

slide-56
SLIDE 56

Defining Security Requirements

  • Many processes for deciding security requirements
slide-57
SLIDE 57

Defining Security Requirements

  • Many processes for deciding security requirements
  • Example: General policy concerns
slide-58
SLIDE 58

Defining Security Requirements

  • Many processes for deciding security requirements
  • Example: General policy concerns
  • Due to regulations/standards (HIPAA, SOX, etc.)
slide-59
SLIDE 59

Defining Security Requirements

  • Many processes for deciding security requirements
  • Example: General policy concerns
  • Due to regulations/standards (HIPAA, SOX, etc.)
  • Due organizational values (e.g., valuing privacy)
slide-60
SLIDE 60

Defining Security Requirements

  • Many processes for deciding security requirements
  • Example: General policy concerns
  • Due to regulations/standards (HIPAA, SOX, etc.)
  • Due organizational values (e.g., valuing privacy)
  • Example: Policy arising from threat modeling
slide-61
SLIDE 61

Defining Security Requirements

  • Many processes for deciding security requirements
  • Example: General policy concerns
  • Due to regulations/standards (HIPAA, SOX, etc.)
  • Due organizational values (e.g., valuing privacy)
  • Example: Policy arising from threat modeling
  • Which attacks cause the greatest concern?
  • Who are the likely adversaries and what are their goals and

methods?

slide-62
SLIDE 62

Defining Security Requirements

  • Many processes for deciding security requirements
  • Example: General policy concerns
  • Due to regulations/standards (HIPAA, SOX, etc.)
  • Due organizational values (e.g., valuing privacy)
  • Example: Policy arising from threat modeling
  • Which attacks cause the greatest concern?
  • Who are the likely adversaries and what are their goals and

methods?

  • Which attacks have already occurred?
  • Within the organization, or elsewhere on related systems?
slide-63
SLIDE 63

Abuse Cases

slide-64
SLIDE 64

Abuse Cases

  • Abuse cases illustrate security requirements
slide-65
SLIDE 65

Abuse Cases

  • Abuse cases illustrate security requirements
  • Where use cases describe what a system should

do, abuse cases describe what it should not do

slide-66
SLIDE 66

Abuse Cases

  • Abuse cases illustrate security requirements
  • Where use cases describe what a system should

do, abuse cases describe what it should not do

  • Example use case: The system allows bank

managers to modify an account’s interest rate

slide-67
SLIDE 67

Abuse Cases

  • Abuse cases illustrate security requirements
  • Where use cases describe what a system should

do, abuse cases describe what it should not do

  • Example use case: The system allows bank

managers to modify an account’s interest rate

  • Example abuse case: A user is able to spoof being

a manager and thereby change the interest rate on an account

slide-68
SLIDE 68

Defining Abuse Cases

slide-69
SLIDE 69

Defining Abuse Cases

  • Using attack patterns and likely scenarios, construct

cases in which an adversary’s exercise of power could violate a security requirement

slide-70
SLIDE 70

Defining Abuse Cases

  • Using attack patterns and likely scenarios, construct

cases in which an adversary’s exercise of power could violate a security requirement

  • Based on the threat model
slide-71
SLIDE 71

Defining Abuse Cases

  • Using attack patterns and likely scenarios, construct

cases in which an adversary’s exercise of power could violate a security requirement

  • Based on the threat model
  • What might occur if a security measure was removed?
slide-72
SLIDE 72

Defining Abuse Cases

  • Using attack patterns and likely scenarios, construct

cases in which an adversary’s exercise of power could violate a security requirement

  • Based on the threat model
  • What might occur if a security measure was removed?
  • Example: Co-located attacker steals password file

and learns all user passwords

slide-73
SLIDE 73

Defining Abuse Cases

  • Using attack patterns and likely scenarios, construct

cases in which an adversary’s exercise of power could violate a security requirement

  • Based on the threat model
  • What might occur if a security measure was removed?
  • Example: Co-located attacker steals password file

and learns all user passwords

  • Possible if password file is not encrypted
slide-74
SLIDE 74

Defining Abuse Cases

  • Using attack patterns and likely scenarios, construct

cases in which an adversary’s exercise of power could violate a security requirement

  • Based on the threat model
  • What might occur if a security measure was removed?
  • Example: Co-located attacker steals password file

and learns all user passwords

  • Possible if password file is not encrypted
  • Example: Snooping attacker replays a captured

message, effecting a bank withdrawal

slide-75
SLIDE 75

Defining Abuse Cases

  • Using attack patterns and likely scenarios, construct

cases in which an adversary’s exercise of power could violate a security requirement

  • Based on the threat model
  • What might occur if a security measure was removed?
  • Example: Co-located attacker steals password file

and learns all user passwords

  • Possible if password file is not encrypted
  • Example: Snooping attacker replays a captured

message, effecting a bank withdrawal

  • Possible if messages are have no nonce
slide-76
SLIDE 76

Security design principles

slide-77
SLIDE 77

Design Defects = Flaws

  • Recall that software defects consist of both flaws

and bugs

  • Flaws are problems in the design
  • Bugs are problems in the implementation
  • We avoid flaws during the design phase
  • According to Gary McGraw,

50% of security problems are flaws

  • So this phase is very important
slide-78
SLIDE 78

Categories of Principles

slide-79
SLIDE 79

Categories of Principles

  • Prevention
slide-80
SLIDE 80

Categories of Principles

  • Prevention
  • Goal: Eliminate software defects entirely
slide-81
SLIDE 81

Categories of Principles

  • Prevention
  • Goal: Eliminate software defects entirely
  • Example: Heartbleed bug would have been prevented by

using a type-safe language, like Java

slide-82
SLIDE 82

Categories of Principles

  • Prevention
  • Goal: Eliminate software defects entirely
  • Example: Heartbleed bug would have been prevented by

using a type-safe language, like Java

  • Mitigation
slide-83
SLIDE 83

Categories of Principles

  • Prevention
  • Goal: Eliminate software defects entirely
  • Example: Heartbleed bug would have been prevented by

using a type-safe language, like Java

  • Mitigation
  • Goal: Reduce the harm from exploitation of unknown defects
slide-84
SLIDE 84

Categories of Principles

  • Prevention
  • Goal: Eliminate software defects entirely
  • Example: Heartbleed bug would have been prevented by

using a type-safe language, like Java

  • Mitigation
  • Goal: Reduce the harm from exploitation of unknown defects
  • Example: Run each browser tab in a separate process, so

exploitation of one tab does not yield access to data in another

slide-85
SLIDE 85

Categories of Principles

  • Prevention
  • Goal: Eliminate software defects entirely
  • Example: Heartbleed bug would have been prevented by

using a type-safe language, like Java

  • Mitigation
  • Goal: Reduce the harm from exploitation of unknown defects
  • Example: Run each browser tab in a separate process, so

exploitation of one tab does not yield access to data in another

  • Detection (and Recovery)
slide-86
SLIDE 86

Categories of Principles

  • Prevention
  • Goal: Eliminate software defects entirely
  • Example: Heartbleed bug would have been prevented by

using a type-safe language, like Java

  • Mitigation
  • Goal: Reduce the harm from exploitation of unknown defects
  • Example: Run each browser tab in a separate process, so

exploitation of one tab does not yield access to data in another

  • Detection (and Recovery)
  • Goal: Identify and understand an attack (and undo damage)
slide-87
SLIDE 87

Categories of Principles

  • Prevention
  • Goal: Eliminate software defects entirely
  • Example: Heartbleed bug would have been prevented by

using a type-safe language, like Java

  • Mitigation
  • Goal: Reduce the harm from exploitation of unknown defects
  • Example: Run each browser tab in a separate process, so

exploitation of one tab does not yield access to data in another

  • Detection (and Recovery)
  • Goal: Identify and understand an attack (and undo damage)
  • Example: Monitoring (e.g., expected invariants),

snapshotting

slide-88
SLIDE 88

Principles for building secure systems

  • Security is economics
  • Principle of least privilege
  • Use fail-safe defaults
  • Use separation of responsibility
  • Defend in depth
  • Take human factors into account
  • Ensure complete mediation
  • Accept that threat models change
  • If you can’t prevent, detect
  • Kerkhoff’s principle (no security

through obscurity)

  • Design security from the ground up
  • Prefer conservative designs
  • Proactively study attacks
slide-89
SLIDE 89
slide-90
SLIDE 90

Ensure complete mediation

slide-91
SLIDE 91
slide-92
SLIDE 92

Use separation of responsibility

slide-93
SLIDE 93
slide-94
SLIDE 94

Defense in depth

slide-95
SLIDE 95
slide-96
SLIDE 96

Account for human factors (“psychological acceptability”)
 (a) Users must buy into the security (b) The system must be usable

slide-97
SLIDE 97

Account for human factors

slide-98
SLIDE 98

Account for human factors

slide-99
SLIDE 99

Account for human factors

slide-100
SLIDE 100

Account for human factors

slide-101
SLIDE 101
slide-102
SLIDE 102
slide-103
SLIDE 103

Kerkhoff’s principle

slide-104
SLIDE 104
slide-105
SLIDE 105
slide-106
SLIDE 106
slide-107
SLIDE 107
slide-108
SLIDE 108
slide-109
SLIDE 109