how to make threat modeling work for you...threat libraries (capec, owasp top 10, sans top 25)...

22
1/13/2016 1 How To Make Threat Modeling Work For You Tech Valley .NET User Group (TVUG) Latham, NY • January 12, 2016 Robert Hurlbut RobertHurlbut.com @RobertHurlbut Robert Hurlbut Independent Software Security Consultant and Trainer Owner / President of Robert Hurlbut Consulting Services Microsoft MVP – Security Developer 2005-2009, 2015 (ISC)2 CSSLP 2014-2017 Group Leader – Boston .NET Arch Group, Amherst Sec Group Speaker at user groups, conferences, and other training events Contacts Web Site: https:// roberthurlbut.com LinkedIn: https:// www.linkedin.com/in/roberthurlbut Twitter: @RobertHurlbut Email: robert at roberthurlbut.com Slides Location: https://roberthurlbut.com/training/presentations © 2016 Robert Hurlbut Consulting Services 2

Upload: others

Post on 26-Aug-2020

13 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: How To Make Threat Modeling Work For You...Threat Libraries (CAPEC, OWASP Top 10, SANS Top 25) Checklists (ex: OWASP Application Security Verification Standard (ASVS), OWASP Proactive

1/13/2016

1

How To Make Threat Modeling Work For You

Tech Valley .NET User Group (TVUG)

Latham, NY • January 12, 2016

Robert HurlbutRobertHurlbut.com • @RobertHurlbut

Robert Hurlbut

• Independent Software Security Consultant and Trainer• Owner / President of Robert Hurlbut Consulting Services

• Microsoft MVP – Security Developer 2005-2009, 2015

• (ISC)2 CSSLP 2014-2017

• Group Leader – Boston .NET Arch Group, Amherst Sec Group

• Speaker at user groups, conferences, and other training events

• Contacts• Web Site: https://roberthurlbut.com

• LinkedIn: https://www.linkedin.com/in/roberthurlbut

• Twitter: @RobertHurlbut

• Email: robert at roberthurlbut.com

• Slides Location:

https://roberthurlbut.com/training/presentations

© 2016 Robert Hurlbut Consulting Services 2

Page 2: How To Make Threat Modeling Work For You...Threat Libraries (CAPEC, OWASP Top 10, SANS Top 25) Checklists (ex: OWASP Application Security Verification Standard (ASVS), OWASP Proactive

1/13/2016

2

3

What is threat modeling?

Something we all do in our personal lives …

... when we lock our doors to our house

... when we lock the windows

... when we lock the doors to our car

We threat model by thinking ahead of what could go wrong and acting accordingly

© 2016 Robert Hurlbut Consulting Services

4

What is threat modeling?

Threat modeling is the process of understanding your system and potential threats against your system.

A threat model helps you assess the probability, potential harm, and priority of threats.

Based on the model you can try to minimize or eradicate the threats.

© 2016 Robert Hurlbut Consulting Services

Page 3: How To Make Threat Modeling Work For You...Threat Libraries (CAPEC, OWASP Top 10, SANS Top 25) Checklists (ex: OWASP Application Security Verification Standard (ASVS), OWASP Proactive

1/13/2016

3

5

Michael Howard @michael_howard Jan 7, 2015

A dev team with an awesome, complete and accurate threat model gets my admiration and not much of my time because they don’t need it!

© 2016 Robert Hurlbut Consulting Services

6

Brook Schoenfield @BrkSchoenfield June 29, 2015

As I practice it, threat modeling cannot be the province of a tech elite. It is best owned by all of a development team.

© 2016 Robert Hurlbut Consulting Services

Page 4: How To Make Threat Modeling Work For You...Threat Libraries (CAPEC, OWASP Top 10, SANS Top 25) Checklists (ex: OWASP Application Security Verification Standard (ASVS), OWASP Proactive

1/13/2016

4

7

Threat modeling helps you …

Identify threats your system faces

Challenge assumptions

Prioritize other security efforts (pen test, review, fuzzing)

Document what you have learned

© 2016 Robert Hurlbut Consulting Services

8

Definitions

Threat Agent

Someone (or a process) who could do harm to a system (also adversary or attacker)

© 2016 Robert Hurlbut Consulting Services

Page 5: How To Make Threat Modeling Work For You...Threat Libraries (CAPEC, OWASP Top 10, SANS Top 25) Checklists (ex: OWASP Application Security Verification Standard (ASVS), OWASP Proactive

1/13/2016

5

9

Definitions

Threat

An adversary’s goal

© 2016 Robert Hurlbut Consulting Services

10

Definitions

Vulnerability

A flaw in the system that could help a threat agent realize a threat

© 2016 Robert Hurlbut Consulting Services

Page 6: How To Make Threat Modeling Work For You...Threat Libraries (CAPEC, OWASP Top 10, SANS Top 25) Checklists (ex: OWASP Application Security Verification Standard (ASVS), OWASP Proactive

1/13/2016

6

11

Definitions

Attack

When a motivated and sufficiently skilled threat agent takes advantage of a vulnerability

© 2016 Robert Hurlbut Consulting Services

12

Definitions

AssetSomething of value to valid users and adversaries alike

© 2016 Robert Hurlbut Consulting Services

Page 7: How To Make Threat Modeling Work For You...Threat Libraries (CAPEC, OWASP Top 10, SANS Top 25) Checklists (ex: OWASP Application Security Verification Standard (ASVS), OWASP Proactive

1/13/2016

7

13

When?

Make threat modeling part of your secure software and architecture design

What if I didn’t? It’s not too late to start threat modeling, but it will be more difficult to change major design decisions

© 2016 Robert Hurlbut Consulting Services

14

Getting started

Gather documentation (requirements, high-level design, detailed design, etc.)

Gather your team (don’t make this one person’s job only!)Developers, QA, Architects, Project Managers, Business Stakeholders

Understand business goals

Understand technical goals

Agree on meeting date(s) and time(s)

Plan on 1-2 hours at a time spread over a week or weeks – keep sessions focused

Important: Be honest, leave ego at the door, no blaming!

© 2016 Robert Hurlbut Consulting Services

Page 8: How To Make Threat Modeling Work For You...Threat Libraries (CAPEC, OWASP Top 10, SANS Top 25) Checklists (ex: OWASP Application Security Verification Standard (ASVS), OWASP Proactive

1/13/2016

8

15

Threat Modeling Process – Making it work

1. Draw your picture - model the system

2. List the elements – entities, processes, data, data flows

3. Identity the threats - Ask questions

4. Determine mitigations and risks

5. Follow through

© 2016 Robert Hurlbut Consulting Services

Draw your picture

© 2016 Robert Hurlbut Consulting Services

Page 9: How To Make Threat Modeling Work For You...Threat Libraries (CAPEC, OWASP Top 10, SANS Top 25) Checklists (ex: OWASP Application Security Verification Standard (ASVS), OWASP Proactive

1/13/2016

9

17

Model the system

• DFD – Data Flow Diagrams (from Microsoft SDL)

External

Entity

Process Multi-Process

Data Store Dataflow Privilege

Boundary

18

Model the System

ServerUsers Admin

Request

Response

Admin

Settings

Logging

Data

© 2016 Robert Hurlbut Consulting Services

(Trust boundary)

Page 10: How To Make Threat Modeling Work For You...Threat Libraries (CAPEC, OWASP Top 10, SANS Top 25) Checklists (ex: OWASP Application Security Verification Standard (ASVS), OWASP Proactive

1/13/2016

10

19

Model the system

User

Admin

Authn

Engine

Audit

Engine

Service

Mnmgt

ToolCredentials

Data Files

Audit DataRequest

Set/Get

Creds

Requested

File(s)

Audit

Requests

Audit

Info

Audit

Read

Audit

Write

Get

Creds

1

2

3

4

5

6

7

8

9

(Trust boundary)

(Tru

st

Boundary

)

20

Your threat model now consists of …

1. Diagram / visual model of your system

© 2016 Robert Hurlbut Consulting Services

Page 11: How To Make Threat Modeling Work For You...Threat Libraries (CAPEC, OWASP Top 10, SANS Top 25) Checklists (ex: OWASP Application Security Verification Standard (ASVS), OWASP Proactive

1/13/2016

11

21

Identity the elements

User

Admin

Authn

Engine

Audit

Engine

Service

Mnmgt

ToolCredentials

Data Files

Audit DataRequest

Set/Get

Creds

Requested

File(s)

Audit

Requests

Audit

Info

Audit

Read

Audit

Write

Get

Creds

1

2

3

4

5

6

7

8

9

(Trust boundary)

External Entities:

Users, Admin

Processes:

Service, Authn Engine,

Audit Engine, Mnmgt Tool

Data Store(s):

Data Files, Credentials

Data Flows:

Users <-> Service

Admin <-> Audit Engine

(Tru

st

Boundary

)

22

Your threat model now consists of …

1. Diagram / visual model of your system

2. Elements of your system and the interactions

© 2016 Robert Hurlbut Consulting Services

Page 12: How To Make Threat Modeling Work For You...Threat Libraries (CAPEC, OWASP Top 10, SANS Top 25) Checklists (ex: OWASP Application Security Verification Standard (ASVS), OWASP Proactive

1/13/2016

12

Identify threats

Attack Trees (Bruce Schneier - Slide deck)Threat Libraries (CAPEC, OWASP Top 10, SANS Top 25)Checklists (ex: OWASP Application Security Verification Standard (ASVS), OWASP Proactive Controls 2016))Use Cases / Misuse CasesGames: Elevation of Privilege (EoP), OWASP CornucopiaSTRIDEP.A.S.T.A. – Process for Attack Simulation and Threat Analysis (combining STRIDE + Attacks + Risk Analyses)

© 2016 Robert Hurlbut Consulting Services 23

24

OWASP Cornucopia

Suits:Data validation and encoding

Authentication

Session Management

Authorization

Cryptography

Cornucopia

13 cards per suit, 2 JokersPlay a round, highest value wins

© 2016 Robert Hurlbut Consulting Services

Page 13: How To Make Threat Modeling Work For You...Threat Libraries (CAPEC, OWASP Top 10, SANS Top 25) Checklists (ex: OWASP Application Security Verification Standard (ASVS), OWASP Proactive

1/13/2016

13

STRIDE Framework* for finding threats

Threat Property we want

Spoofing Authentication

Tampering Integrity

Repudiation Non-repudiation

Information Disclosure Confidentiality

Denial of Service Availability

Elevation of Privilege Authorization

* Framework, not classification scheme. STRIDE is a good framework, bad taxonomy© 2016 Robert Hurlbut Consulting Services

26

Identify Threats

Input and data validation

Authentication

Authorization

Configuration management

Sensitive data

Session management

Cryptography

Parameter manipulation

Exception management

Auditing and logging

© 2016 Robert Hurlbut Consulting Services

Page 14: How To Make Threat Modeling Work For You...Threat Libraries (CAPEC, OWASP Top 10, SANS Top 25) Checklists (ex: OWASP Application Security Verification Standard (ASVS), OWASP Proactive

1/13/2016

14

27

Ask questions

How is authentication handled?

What about authorization?

Are we sending data in the open?

Are we using cryptography properly?

Is there logging? What is stored?

Etc.

© 2016 Robert Hurlbut Consulting Services

28

One of the best questions …

Is there anything that keeps you up at night worrying about this system?

© 2016 Robert Hurlbut Consulting Services

Page 15: How To Make Threat Modeling Work For You...Threat Libraries (CAPEC, OWASP Top 10, SANS Top 25) Checklists (ex: OWASP Application Security Verification Standard (ASVS), OWASP Proactive

1/13/2016

15

29

Your threat model now consists of …

1. Diagram / visual model of your system

2. Elements of your system and the interactions

3. Threats identified through answers to questions

© 2016 Robert Hurlbut Consulting Services

30

•Mitigation Options:• Leave as-is

• Remove from product

• Remedy with technology countermeasure

• Warn user

•What is the risk associated with the vulnerability?

Determine mitigations and risks

© 2016 Robert Hurlbut Consulting Services

Page 16: How To Make Threat Modeling Work For You...Threat Libraries (CAPEC, OWASP Top 10, SANS Top 25) Checklists (ex: OWASP Application Security Verification Standard (ASVS), OWASP Proactive

1/13/2016

16

Determine mitigations and risks

Risk ManagementBug Bar (Critical / Important / Moderate / Low)

FAIR (Factor Analysis of Information Risk) – Jack Jones

Risk Rating (High, Medium, Low)

© 2016 Robert Hurlbut Consulting Services 31

Risk Rating

Overall risk of the threat expressed in High, Medium, or Low.

Risk is product of two factors:

Ease of exploitation

Business impact

© 2016 Robert Hurlbut Consulting Services 32

Page 17: How To Make Threat Modeling Work For You...Threat Libraries (CAPEC, OWASP Top 10, SANS Top 25) Checklists (ex: OWASP Application Security Verification Standard (ASVS), OWASP Proactive

1/13/2016

17

Risk Rating – Ease of Exploitation

© 2016 Robert Hurlbut Consulting Services 33

Risk Rating Description

High • Tools and exploits are readily available on the Internet or other locations

• Exploitation requires no specialized knowledge of the system and little or no

programming skills

• Anonymous users can exploit the issue

Medium • Tools and exploits are available but need to be modified to work successfully

• Exploitation requires basic knowledge of the system and may require some

programming skills

• User-level access may be a pre-condition

Low • Working tools or exploits are not readily available

• Exploitation requires in-depth knowledge of the system and/or may require strong

programming skills

• User-level (or perhaps higher privilege) access may be one of a number of pre-

conditions

Risk Rating – Business Impact

© 2016 Robert Hurlbut Consulting Services 34

Risk Rating Description

High • Administrator-level access (for arbitrary code execution through privilege

escalation for instance) or disclosure of sensitive information

• Depending on the criticality of the system, some denial-of-service issues are

considered high impact

• All or significant number of users affected

• Impact to brand or reputation

Medium • User-level access with no disclosure of sensitive information

• Depending on the criticality of the system, some denial-of-service issues are

considered medium impact

Low • Disclosure of non-sensitive information, such as configuration details that may

assist an attacker

• Failure to adhere to recommended best practices (which does not result in an

immediately visible exploit) also falls into this bracket

• Low number of user affected

Page 18: How To Make Threat Modeling Work For You...Threat Libraries (CAPEC, OWASP Top 10, SANS Top 25) Checklists (ex: OWASP Application Security Verification Standard (ASVS), OWASP Proactive

1/13/2016

18

Example – Medium Risk Threat

© 2016 Robert Hurlbut Consulting Services 35

ID - Risk RT-3

Threat Lack of CSRF protection allows attackers to submit

commands on behalf of users

Description/Impact Client applications could be subject to a CSRF attack

where the attacker embeds commands in the client

applications and uses it to submit commands to the

server on behalf of the users

Countermeasures Per transaction codes (nonce), thresholds, event

visibility

Components

Affected

CO-3

36

Your threat model now consists of …

1. Diagram / visual model of your system

2. Elements of your system and the interactions

3. Threats identified through answers to questions

4. Mitigations and risks identified to deal with the threats

© 2016 Robert Hurlbut Consulting Services

Page 19: How To Make Threat Modeling Work For You...Threat Libraries (CAPEC, OWASP Top 10, SANS Top 25) Checklists (ex: OWASP Application Security Verification Standard (ASVS), OWASP Proactive

1/13/2016

19

37

Follow through

Document what you found and decisions you make

File bugs or new requirements

Verify bugs fixed and new requirements implemented

Did we miss anything? Review again

Anything new? Review again

© 2016 Robert Hurlbut Consulting Services

38

Your threat model now consists of …

1. Diagram / visual model of your system

2. Elements of your system and the interactions

3. Threats identified through answers to questions

4. Mitigations and risks identified to deal with the threats

5. Follow through

A living threat model!

© 2016 Robert Hurlbut Consulting Services

Page 20: How To Make Threat Modeling Work For You...Threat Libraries (CAPEC, OWASP Top 10, SANS Top 25) Checklists (ex: OWASP Application Security Verification Standard (ASVS), OWASP Proactive

1/13/2016

20

39

Your challenge

Add threat modeling to your toolkit

Consider threat modeling first (secure design, before new features, etc.)

Many ways … just do it!

© 2016 Robert Hurlbut Consulting Services

Resources - Books

Threat Modeling: Designing for Security

Adam Shostack

Securing Systems: Applied Architecture and Threat Models

Brook S.E. Schoenfield

Risk Centric Threat Modeling: Process for Attack Simulation and Threat Analysis

Marco Morana and Tony UcedaVelez

Measuring and Managing Information Risk: A FAIR Approach

Jack Jones and Jack Freund

© 2016 Robert Hurlbut Consulting Services 40

Page 21: How To Make Threat Modeling Work For You...Threat Libraries (CAPEC, OWASP Top 10, SANS Top 25) Checklists (ex: OWASP Application Security Verification Standard (ASVS), OWASP Proactive

1/13/2016

21

Resources - Tools

Whiteboard

Visio (or equivalent) for diagraming

Word (or equivalent) or Excel (or equivalent) for documenting

© 2016 Robert Hurlbut Consulting Services

Resources - Tools

Attack Trees – Bruce Schneier on Securityhttps://www.schneier.com/attacktrees.pdf

Microsoft Threat Modeling Tool 2016http://www.microsoft.com/en-us/download/details.aspx?id=49168

Threat Modeler Tool 3.0http://myappsecurity.com

© 2016 Robert Hurlbut Consulting Services 42

Page 22: How To Make Threat Modeling Work For You...Threat Libraries (CAPEC, OWASP Top 10, SANS Top 25) Checklists (ex: OWASP Application Security Verification Standard (ASVS), OWASP Proactive

1/13/2016

22

Resources - Tools

Elevation of Privilege (EoP) Gamehttp://www.microsoft.com/en-us/download/details.aspx?id=20303

OWASP Cornucopiahttps://www.owasp.org/index.php/OWASP_Cornucopia

OWASP Application Security Verification Standard (ASVS)https://www.owasp.org/index.php/Category:OWASP_Application_Security_Verification_Standard_Project

OWASP Proactive Controls (especially current 2016 work)https://www.owasp.org/index.php/OWASP_Proactive_Controls

© 2016 Robert Hurlbut Consulting Services 43

Questions?

• Contacts

• Web Site: https://roberthurlbut.com

• LinkedIn: https://www.linkedin.com/in/roberthurlbut

• Twitter: @RobertHurlbut

• Email: robert at roberthurlbut.com

• Slides Location:

https://roberthurlbut.com/training/presentations

© 2016 Robert Hurlbut Consulting Services 44